Because the global variable g_PlayerAssignments was not updated until after the handlers were called, and because the handler in GameRegisterStanza.js was referring to the global variable when generating the iq stanza to send to the gamelist, this was causing the gamelist to be updated with the previous player assignments instead of the correct values.
This will pass a playerAssignments argument to both OnClientLeave and OnClientJoin handlers(/gui/gamesetup/) and use the argument instead of g_PlayerAssignments in the handler registered by GameRegisterStanza.js.
Details
Details
Test that when joining and leaving a match, the lobby gamelist is updated with the correct players that are inside the match.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Comment Actions
Fix looks correct & seems to work. I think I might have the first joiner stay as "observer" incorrectly, but that changed quickly. In general probably not a problem.
ReadyControl also uses the leave handler with player assignments, but I think using the old ones there is functional.