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,