Page MenuHomeWildfire Games

Fix lobby gamelist incorrectly updating the playerAssignments for a match when someone leaves or joins the match.
AbandonedPublic

Authored by user1 on Jan 17 2021, 12:58 AM.

Details

Reviewers
wraitii
Trac Tickets
#5929
Summary

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.

Test Plan

Test that when joining and leaving a match, the lobby gamelist is updated with the correct players that are inside the match.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

user1 requested review of this revision.Jan 17 2021, 12:58 AM
user1 created this revision.
user1 retitled this revision from Fix lobby gamelist incorrectly updating the playerAssignments for a match when someone leaves or joins. to Fix lobby gamelist incorrectly updating the playerAssignments for a match when someone leaves or joins the match..
wraitii accepted this revision.Jan 17 2021, 5:23 PM
wraitii added a subscriber: wraitii.

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.

This revision is now accepted and ready to land.Jan 17 2021, 5:23 PM
user1 abandoned this revision.Jan 18 2021, 6:09 PM

The issue is instead fixed in D3944.