Skip to content

Commit b2eac3f

Browse files
committed
Send all the player options upon receiving them
1 parent 8434c72 commit b2eac3f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lua/ui/lobby/autolobby/AutolobbyController.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,15 @@ AutolobbyCommunications = Class(MohoLobbyMethods, AutolobbyServerCommunicationsC
624624
-- put the player where it belongs
625625
self.PlayerOptions[playerOptions.StartSpot] = playerOptions
626626

627+
-- send all player options to the server, this is necessary to do immediately (for the host) so that the server knows who is (not) connected.
628+
for slot, playerOptions in self.PlayerOptions do
629+
local ownerId = playerOptions.OwnerID
630+
self:SendPlayerOptionToServer(ownerId, 'Team', playerOptions.Team)
631+
self:SendPlayerOptionToServer(ownerId, 'Army', playerOptions.StartSpot)
632+
self:SendPlayerOptionToServer(ownerId, 'StartSpot', playerOptions.StartSpot)
633+
self:SendPlayerOptionToServer(ownerId, 'Faction', playerOptions.Faction)
634+
end
635+
627636
-- sync game options with the connected peer
628637
self:SendData(data.SenderID, { Type = "UpdateGameOptions", GameOptions = self.GameOptions })
629638

0 commit comments

Comments
 (0)