Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/prelobby.js
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | case "connected": | ||||
Engine.ConfigDB_CreateValue("user", "playername.multiplayer", username); | Engine.ConfigDB_CreateValue("user", "playername.multiplayer", username); | ||||
Engine.ConfigDB_WriteValueToFile("user", "playername.multiplayer", username, "config/user.cfg"); | Engine.ConfigDB_WriteValueToFile("user", "playername.multiplayer", username, "config/user.cfg"); | ||||
Engine.ConfigDB_CreateValue("user", "lobby.login", username); | Engine.ConfigDB_CreateValue("user", "lobby.login", username); | ||||
Engine.ConfigDB_WriteValueToFile("user", "lobby.login", username, "config/user.cfg"); | Engine.ConfigDB_WriteValueToFile("user", "lobby.login", username, "config/user.cfg"); | ||||
// We only store the encrypted password, so make sure to re-encrypt it if changed before saving. | // We only store the encrypted password, so make sure to re-encrypt it if changed before saving. | ||||
if (password != g_EncryptedPassword.substring(0, 10)) | if (password != g_EncryptedPassword.substring(0, 10)) | ||||
g_EncryptedPassword = Engine.EncryptPassword(password, username); | g_EncryptedPassword = Engine.EncryptPassword(password, username); | ||||
Engine.ConfigDB_CreateValue("user", "lobby.password", g_EncryptedPassword); | Engine.ConfigDB_CreateValue("user", "lobby.password", g_EncryptedPassword); | ||||
if (Engine.ConfigDB_GetValue("user", "lobby.rememberpassword") != "true") | |||||
{ | |||||
Engine.ConfigDB_RemoveValue("user", "lobby.password"); | |||||
elexis: The implementation regulates how many reports for forgotton passwords I get, so I'd prefer a… | |||||
Engine.ConfigDB_WriteFile("user", "config/user.cfg"); | |||||
} | |||||
else | |||||
Engine.ConfigDB_WriteValueToFile("user", "lobby.password", g_EncryptedPassword, "config/user.cfg"); | Engine.ConfigDB_WriteValueToFile("user", "lobby.password", g_EncryptedPassword, "config/user.cfg"); | ||||
Not Done Inline Actions(Some prefer to have the most common case first, others prefer to avoid the double negation by checking for positives in if-else statements) elexis: (Some prefer to have the most common case first, others prefer to avoid the double negation by… | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
function switchPage(page) | function switchPage(page) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | function prelobbyCancel() | ||||
lobbyStop(); | lobbyStop(); | ||||
Engine.GetGUIObjectByName("feedback").caption = ""; | Engine.GetGUIObjectByName("feedback").caption = ""; | ||||
if (Engine.GetGUIObjectByName("pageWelcome").hidden) | if (Engine.GetGUIObjectByName("pageWelcome").hidden) | ||||
switchPage("welcome"); | switchPage("welcome"); | ||||
else | else | ||||
Engine.PopGuiPage(); | Engine.PopGuiPage(); | ||||
} | } | ||||
Not Done Inline ActionsI'm not sure about function names, I'm open to suggestions. vladislavbelov: I'm not sure about function names, I'm open to suggestions. | |||||
Not Done Inline ActionsName functions according to what they do. So maybe toggleRemeberPassword. elexis: Name functions according to what they do. So maybe `toggleRemeberPassword`. |
Wildfire Games · Phabricator
The implementation regulates how many reports for forgotton passwords I get, so I'd prefer a confirmation message box before deleting user passwords while not having a forgotton-pw function. (In fact I'd prefer three messsage boxes before deletion, maybe a 5 minute consideration timer xD)
Agree that a "delete-password" button isn't better, because people who dont want the PW saved, don't have their use case addressed.