修正从服务器获取用户信息消息格式错误
This commit is contained in:
@@ -141,7 +141,7 @@ function NET.getUserInfo(uid)
|
|||||||
WS.send("user",JSON.encode{
|
WS.send("user",JSON.encode{
|
||||||
action=1,
|
action=1,
|
||||||
data={
|
data={
|
||||||
id=uid,
|
uid=uid,
|
||||||
hash=hash,
|
hash=hash,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ local db=setmetatable({},{__index=function(self,k)
|
|||||||
{
|
{
|
||||||
username="[X]",
|
username="[X]",
|
||||||
motto="Techmino haowan",
|
motto="Techmino haowan",
|
||||||
hash="",
|
hash="_",
|
||||||
new=false,
|
new=false,
|
||||||
}
|
}
|
||||||
rawset(self,k,d)
|
rawset(self,k,d)
|
||||||
@@ -61,7 +61,6 @@ function USERS.updateUserData(data)
|
|||||||
fs.write("cache/"..data.hash,love.data.decode("string","base64",data.avatar:sub(data.avatar:find","+1)))
|
fs.write("cache/"..data.hash,love.data.decode("string","base64",data.avatar:sub(data.avatar:find","+1)))
|
||||||
db_img[uid]=loadAvatar("cache/"..data.hash)
|
db_img[uid]=loadAvatar("cache/"..data.hash)
|
||||||
db[uid].hash=type(data.hash)=="string"and #data.hash>0 and data.hash
|
db[uid].hash=type(data.hash)=="string"and #data.hash>0 and data.hash
|
||||||
db[uid].new=true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user