整理代码习惯,常量字符串改用单引号,可能有遗漏

This commit is contained in:
MrZ626
2021-04-30 01:00:22 +08:00
parent 7676f32cf2
commit eda6c0d746
213 changed files with 2503 additions and 2499 deletions

View File

@@ -37,7 +37,7 @@ local db=setmetatable({},{__index=function(self,uid)
local d=fs.getInfo(file)and JSON.decode(fs.read(file))or TABLE.copy(emptyUser)
rawset(self,uid,d)
db_img[uid]=
type(d.hash)=="string"and #d.hash>0 and fs.getInfo("cache/"..d.hash)and
type(d.hash)=='string'and #d.hash>0 and fs.getInfo("cache/"..d.hash)and
loadAvatar("cache/"..d.hash)or
defaultAvatar[(uid-26)%29+1]
return d
@@ -55,9 +55,9 @@ function USERS.updateUserData(data)
hash=data.hash or db[uid].hash,
})
if data.avatar then
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[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
end
end