From b35ad7303ce46653464c5bceb63295b80366bc27 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 12 Feb 2021 17:57:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E6=88=BF?= =?UTF-8?q?=E9=97=B4=E5=90=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.lua | 2 ++ parts/gametoolfunc.lua | 7 +++---- parts/globalTables.lua | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/main.lua b/main.lua index 50487ef7..4cd33f43 100644 --- a/main.lua +++ b/main.lua @@ -371,6 +371,8 @@ do NOGAME=true fs.remove("conf/key") end + USER.username=nil + if STAT.version~=VERSION_CODE then newVersionLaunch=true STAT.version=VERSION_CODE diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 221ce1ad..8dc4db91 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -950,7 +950,7 @@ do--function saveRecording() os.date("%Y/%m/%d_%A_%H:%M:%S\n").. GAME.curModeName.."\n".. VERSION_NAME.."\n".. - (USER.username or"Player") + (USER.name or"Player") local fileBody= GAME.seed.."\n".. json.encode(GAME.setting).."\n".. @@ -1051,13 +1051,12 @@ function TICK_httpREQ_getUserInfo(task) if response then local res=json.decode(response.body) if response.code==200 and res.message=="OK"then - -- LOG.print(text.accessSuccessed) - USER.username=res.username + USER.name=res.username USER.motto=res.motto USER.avatar=res.avatar FILE.save(USER,"conf/user") else - -- LOG.print(text.loginFailed..": "..text.httpCode..response.code.."-"..res.message,"warn") + LOG.print("Get user info failed: "..text.httpCode..response.code.."-"..res.message,"warn") end return elseif request_error then diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 0ed9e0a9..47703efc 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -243,7 +243,7 @@ GAME={--Global game data RANKS=FILE.load("conf/unlock")or{sprint_10l=0}--Ranks of modes USER=FILE.load("conf/user")or{--User infomation --Network infos - username=false, + name=false, id=false, email=false, motto=false,