整理代码,准备缓存用户信息相关功能
This commit is contained in:
2
main.lua
2
main.lua
@@ -34,7 +34,7 @@ love.keyboard.setTextInput(false)
|
||||
love.mouse.setVisible(false)
|
||||
|
||||
--Create directories
|
||||
for _,v in next,{"conf","record","replay"}do
|
||||
for _,v in next,{"conf","record","replay","cache"}do
|
||||
local info=fs.getInfo(v)
|
||||
if not info then
|
||||
fs.createDirectory(v)
|
||||
|
||||
@@ -141,15 +141,13 @@ function NET.storeUserInfo(res)
|
||||
local user=USERS[res.uid]
|
||||
if not user then
|
||||
user={}
|
||||
user.email=res.email
|
||||
user.name=res.username
|
||||
USERS[res.uid]=user
|
||||
else
|
||||
user.email=res.email
|
||||
user.name=res.username
|
||||
if not user.motto then user.motto=res.motto end
|
||||
if not user.avatar then user.avatar=res.avatar end
|
||||
end
|
||||
user.uid=res.uid
|
||||
user.email=res.email
|
||||
user.username=res.username
|
||||
user.motto=res.motto
|
||||
user.avatar=res.avatar
|
||||
|
||||
--Get own name
|
||||
if res.uid==USER.uid then
|
||||
|
||||
Reference in New Issue
Block a user