void Lobby_OnNewPlayerJoinRoomEvent(SWJoinRoomEventData eventData)
Debug.Log("Player joined room");
// Store the new playerId and player name pair
playersDict[eventData.newPlayerId] = eventData.GetString();
if (NetworkClient.Lobby.IsOwner)
// Find the smaller team and assign the new player to it.
if(roomData.team1.players.Count < roomData.team2.players.Count)
roomData.team1.players.Add(eventData.newPlayerId);
roomData.team2.players.Add(eventData.newPlayerId);
// Update the room custom data
NetworkClient.Lobby.ChangeRoomCustomData(roomData, (bool successful, SWLobbyError error) =>
Debug.Log("ChangeRoomCustomData successful");
Debug.Log("ChangeRoomCustomData failed: " + error);