From da542df2cb3718c1fe4bfa1f832935244269dbf5 Mon Sep 17 00:00:00 2001 From: flowtron Date: Fri, 6 May 2022 20:47:17 +0200 Subject: [PATCH] avoid auth loop --- config/menus_auth.cfg | 13 +++++++++---- source/src/client.cpp | 2 ++ source/src/scoreboard.cpp | 2 +- source/src/serverbrowser.cpp | 6 ++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/config/menus_auth.cfg b/config/menus_auth.cfg index 2c0f92c8..3c91a254 100644 --- a/config/menus_auth.cfg +++ b/config/menus_auth.cfg @@ -1,6 +1,6 @@ newmenu [auth setup] -menuinit [ tempalias ___ppass "" ; tempalias ___pass ""; tempalias ___rememberpass 0; ] +menuinit [ menuselection (curmenu) 8; tempalias ___ppass "" ; tempalias ___pass ""; tempalias ___rememberpass 0; ] menuitem "To play online you need to create an account" -1 menuitem "which servers will use to identify you." -1 menuitem "This identity is stored as a public/private keypair." -1 @@ -17,8 +17,9 @@ menuitem "" -1 //menuitem "" -1 //ABOUT: the master password was advertised as 'password for account restoration' menuitem "\f0Set passwords \f4(recommended)" -1 -menuitemtextinput "Unlock password\t" "" [___pass = $arg1] [] 64 -menuitemtextinput "Master password\t" "" [___ppass = $arg1] [] 64 +menuitemtextinput "Unlock password\t" "" [___pass = $arg1] [] 64 1 +menuitemtextinput "Master password\t" "" [___ppass = $arg1] [] 64 1 +menuitem "\fHhold CTRL key to view password input in the clear" -1 menuitem "" -1 menuitemradio "Remember game account password: " 0 1 [ ] [ "No \f4(recommended)" "Yes"] [ ___rememberpass = (= $arg1 1)] menuitem "\f2\t\t\t [ OK ]" [ @@ -111,8 +112,12 @@ menuitem "\t\t\f0[Create game account]" [ closecurmenu; showmenu "auth setup"; ] menuitem "\t\t[Not now...]" closecurmenu +__passwordfirstitem = 0 newmenu "enter password" -menuitemtextinput "please enter the password for your game account\t" "" [ __loginpass = $arg1; closecurmenu; showmenu authentication ] [] 64 1 +menuinit [ menuselection (curmenu) $__passwordfirstitem ] +menuitemtextinput "please enter the password for your game account\t" "" [ __passwordfirstitem = 2; __loginpass = $arg1; closecurmenu; showmenu authentication ] [] 64 1 +menuitem "\fHhold CTRL key to view password input in the clear" -1 +menuitem "[Not now...]" [ closemenu "" ] newmenu "authentication" menuinit [ sleep 100 [ echo "checking..." ; authsetup passd $__loginpass authfinish; __loginpass = "" ] ] diff --git a/source/src/client.cpp b/source/src/client.cpp index 7de0e392..248d2b79 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -120,6 +120,8 @@ void connectserv(char *servername, int *serverport, char *password) formatstring(cpc)("%s%s%s", cp1, cp2, cp3); aaconnect = newstring(cpc); hudoutf("\f5.. \f2waiting \f4for \fUauth\f5entication .."); + extern gmenu *curmenu; + if(!curmenu) showmenu("enter password"); } } COMMANDN(connect, connectserv, "sis"); diff --git a/source/src/scoreboard.cpp b/source/src/scoreboard.cpp index b1cc6dd2..c2f64891 100644 --- a/source/src/scoreboard.cpp +++ b/source/src/scoreboard.cpp @@ -411,7 +411,7 @@ void renderscores(void *menu, bool init) // update server stats static int lastrefresh = 0; - if(!lastrefresh || lastrefresh+5000