public override void initPreGameLobby(Sprite gameSprite, PreGameRoomMsg roomInfo)
 {
     base.initPreGameLobby(gameSprite, roomInfo);
     handlers.Add(Msf.Connection.SetHandler((short)ServerCommProtocl.PreGameKick, handlePreGameKickMsg));
     initPlayerInfos();
     initP2Settings(roomInfo.specs.type);
 }
        public override void initPreGameLobby(Sprite gameSprite, PreGameRoomMsg roomInfo)
        {
            base.initPreGameLobby(gameSprite, roomInfo);

            p2Settings.ClearOptions();
            p2Settings.AddOptions(LocalTrainingBots.getBotModeNames(type));
            p2Settings.value  = LocalTrainingBots.getStandardSettings(type);
            hasStoredSettings = false;
        }
Example #3
0
 protected void updatePreGameLobby(IIncommingMessage rawMsg)
 {
     //Debug.LogError("Input msg Lenght: " + rawMsg.AsBytes().Length);
     try {
         PreGameRoomMsg msg = rawMsg.Deserialize <PreGameRoomMsg> ();
         currentPlayers = msg.players;
         setPlayerSlots(msg.players);
         setAdminStartButton();
     } catch {
         Debug.LogError("Could not deserialize msg");
         return;
     }
 }
        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);
        }
Example #5
0
        public virtual void initPreGameLobby(Sprite gameSprite, PreGameRoomMsg roomInfo)
        {
            gameObject.SetActive(true);
            gameCreator.setCurrentPreLobby(this);

            this.type             = roomInfo.specs.type;
            this.roomId           = roomInfo.specs.roomID;
            this.currentPlayers   = roomInfo.players;
            this.gameImage.sprite = gameSprite;
            this.gameTitle.SetText(roomInfo.specs.type.ToString());
            this.quitButton.SetActive(roomInfo.specs.isInTournament == false);
            isAdmin = roomInfo.specs.hostName == ClientUIOverlord.getCurrentAcountInfo().Username;

            setPlayerSlots(roomInfo.players);
            setAdminValues(isAdmin);
            extractLocalPlayerSlotId(roomInfo.players);
            loginTCPUI.startServerClicked(true);
            handlers.Add(Msf.Connection.SetHandler((short)ServerCommProtocl.UpdatePreGame, updatePreGameLobby));

            CurrentGame.setNewCurrentPreGame(roomInfo.specs);
        }
Example #6
0
        private void activateSinglePlayerLobby()
        {
            gameSelectionLobby.SetActive(false);
            singlePlayerLobby.SetActive(true);

            PreGameBaseLobby  lobby       = singlePlayerLobby.GetComponent <PreGameBaseLobby>();
            AccountInfoPacket currentUser = ClientUI.ClientUIOverlord.getCurrentAcountInfo();


            PlayerInfo playerInfo = new PlayerInfo()
            {
                iconNumber = int.Parse(currentUser.Properties[AlbotDictKeys.icon]), username = currentUser.Username
            };

            PreGameSlotInfo[] players = new PreGameSlotInfo[] {
                new PreGameSlotInfo()
                {
                    playerInfo = playerInfo, slotID = 0
                },
                new PreGameSlotInfo()
                {
                    playerInfo = playerInfo, slotID = 1, isReady = true
                }
            };

            PreGameSpecs specs = new PreGameSpecs()
            {
                type = gameMap.type, hostName = ClientUIOverlord.getCurrentAcountInfo().Username
            };
            PreGameRoomMsg roomInfo = new PreGameRoomMsg()
            {
                players = players, specs = specs
            };

            AnneHacks.startSinglePlayerLobby(lobby, gameMap);
            lobby.initPreGameLobby(gameMap.picture, roomInfo);
        }