Skip to content

fix(auth): Stop polling the browser login when it is cancelled - #674

Open
Okladnoj wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
OKJID:okji/fix/cancelled-login-poll
Open

Okladnoj wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
OKJID:okji/fix/cancelled-login-poll

Conversation

@Okladnoj

Copy link
Copy Markdown

Cancelling the browser login left m_bWaitingLogin set, so CheckLogin kept polling. Five minutes later the login code expires and OnLoginComplete(Failed) pops the screen on top. In a LAN match that is the game options screen: the LAN lobby opens, deletes the running game, and the client crashes. Now OnLoginComplete() clears m_bWaitingLogin for every result.

Players report frequent crashes in LAN matches, five minutes after they opened Online.

Quick reproduction: move GeneralsOnlineData/credentials.json out of the user data folder, press Online, then Cancel in the "Please continue in your web browser" box. Start a LAN game with a bot and stay in the match: it crashes five minutes after Online was opened. With the fix, the match keeps running.

Stack trace (macOS, arm64)
FATAL: Caught signal 11
  +311s current game info deleted mid-match, callers:
  +311s   _ZN11LANGameInfoD0Ev + 12
  +311s   _ZN6LANAPI5resetEv + 140
  +311s   _Z16LanLobbyMenuInitP12WindowLayoutPv + 928
  +311s   _ZN5Shell16shutdownCompleteEP12WindowLayoutb + 256
  +311s   _ZL16shutdownCompleteP12WindowLayout + 228
  +311s   _ZN5Shell6updateEv + 176
  +311s   _ZN10GameClient6updateEv + 1576
CRASH FAULT ADDRESS: 0xc code 2
CRASH BACKTRACE:
0   GeneralsOnlineZH                    0x0000000102cb1670 _ZL18macosSignalHandleriP9__siginfoPv + 1176
1   libsystem_platform.dylib            0x00000001a140a144 _sigtramp + 56
2   GeneralsOnlineZH                    0x000000010300b9f4 _ZN9GameLogic6updateEv + 364
3   GeneralsOnlineZH                    0x0000000102ceebfc _ZN10GameEngine6updateEv + 588
4   GeneralsOnlineZH                    0x0000000102cc67ac _ZN15MacOSGameEngine6updateEv + 48
5   GeneralsOnlineZH                    0x0000000102ceecb4 _ZN10GameEngine7executeEv + 48
6   GeneralsOnlineZH                    0x0000000102cf1bac _Z8GameMainv + 200
7   GeneralsOnlineZH                    0x0000000102caf6d0 -[GeneralsAppDelegate runGame] + 520

- Cancel in the "Please continue in your web browser" box calls OnLoginComplete(UserCancelled) but left m_bWaitingLogin set, so Tick kept sending CheckLogin every second
- Five minutes later the login code expires, the server answers FAILED and OnLoginComplete(Failed) pops whatever screen is on top
- If the player went on to a LAN match meanwhile, that pops LanGameOptionsMenu mid-match, LanLobbyMenuInit resets TheLAN and deletes the running game, and the client crashes
- OnLoginComplete now clears m_bWaitingLogin for every result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant