Ejemplo n.º 1
0
 // Use this for initialization
 protected virtual void Awake()
 {
     localSingleton = this;
     _items         = new GenericUIList <GameInfoPacket>(ItemPrefab.gameObject, LayoutGroup, ItemPrefab.transform.parent);
     ClientUIOverlord.onUIStateChanged += (ClientUIStates newState) => { if (newState == ClientUIStates.GameLobby)
                                                                         {
                                                                             resetSelection();
                                                                         }
     };
     Connection.SetHandler((short)ServerCommProtocl.LobbyGameStats, handleGameStatsUpdate);
 }
Ejemplo n.º 2
0
        private void handleJoinPreGameMsg(ResponseStatus status, IIncommingMessage rawMsg)
        {
            if (Msf.Helper.serverResponseSuccess(status, rawMsg) == false)
            {
                return;
            }

            PreGameRoomMsg msg = rawMsg.Deserialize <PreGameRoomMsg> ();

            currentMap = GameSelectionUI.getMatchingMapSelection(msg.specs.type);
            AccountInfoPacket playerInfo = ClientUIOverlord.getCurrentAcountInfo();
            bool isAdmin = playerInfo.Username == msg.players [0].playerInfo.username;

            ClientUIStateManager.requestGotoState(ClientUIStates.PreGame);

            //Kill old TCP Connection
            TCPLocalConnection.stopServer();

            preGameLobby.initPreGameLobby(currentMap.picture, msg);
        }