Exemple #1
0
 public void OnPlayerJoined()
 {
     if (isServer)                                 //if this is the server:
     {
         if (LobbyMgr.FactionLobbyInfos.Count > 0) //if there are other clients other than the server here:
         //the server will share all the lobby setting sfor the new player
         {
             foreach (MFactionLobbyInfo LobbyPlayer in LobbyMgr.FactionLobbyInfos)
             {
                 if (LobbyPlayer != null)
                 {
                     LobbyPlayer.CmdServerUpdateMap();
                     LobbyPlayer.CmdUpdateFactionColor(LobbyPlayer.FactionColorID, LobbyMgr.AllowedColors [LobbyPlayer.FactionColorID]);
                     LobbyPlayer.CmdUpdateFactionName(LobbyPlayer.FactionNameInput.text);
                     LobbyPlayer.CmdUpdateFactionType(LobbyPlayer.FactionTypeMenu.value);
                     LobbyPlayer.CmdUpdateReadyStatus();
                 }
             }
         }
     }
 }