Esempio n. 1
0
 public void gameOver()
 {
     isGameOver       = true;
     canSendServerMsg = false;
     UnetRoomConnector.shutdownCurrentConnection();
     localGameUI.stopAllTimers();
     ClientPlayersHandler.killBots();
 }
Esempio n. 2
0
        public static void addHuman()
        {
            AccountInfoPacket playerInfo = ClientUI.ClientUIOverlord.getCurrentAcountInfo();

            ClientPlayersHandler.addPlayer(false, true, new AlbotServer.PlayerInfo {
                username   = "******",
                iconNumber = int.Parse(playerInfo.Properties [AlbotDictKeys.icon])
            });
        }
Esempio n. 3
0
        //HotFix
        private IEnumerator sendGameServerReadyMsg()
        {
            yield return(new WaitForSeconds(UnityEngine.Random.Range(0.4f, 0.5f)));

            ClientReadyMsg msg = new ClientReadyMsg()
            {
                players = ClientPlayersHandler.generatePlayersInfoArray()
            };

            connectionToServer.Send((short)ServerCommProtocl.ClientReadyChannel, msg);
        }
Esempio n. 4
0
        public void initController(GameType currentType)
        {
            if (currentType != getGameType())
            {
                Destroy(this);
                return;
            }
            ClientPlayersHandler.init(this);

            base.OnStartAuthority();
            initHandlers();
            StartCoroutine(sendGameServerReadyMsg());
        }
        public static void addBot(GameType type, int selectedBotMode = -1)
        {
            ClientPlayersHandler.addPlayer(true, false, StandardTrainingBotInfo);

            TrainingBot targetBot = getMatchingBot(type);

            selectedBotMode = selectedBotMode < 0 ? targetBot.defaultSettings() : selectedBotMode;
            Dictionary <string, string> newSettings = targetBot.botSettings() [selectedBotMode];

            botSettings.Add(new BotSetting(StandardTrainingBotInfo.username)
            {
                settings = newSettings
            });
        }
Esempio n. 6
0
        protected virtual void readTCPMsg(ReceivedLocalMessage inMsg)
        {
            APIMsgConclusion outMsg = apiRouter.handleIncomingMsg(inMsg.message);

            if (outMsg.target == MsgTarget.Server)
            {
                onOutgoingLocalMsg(outMsg.msg, ClientPlayersHandler.sendFromCurrentPlayer());
                isListeningForTCP = false;
            }
            else if (outMsg.target == MsgTarget.Player)
            {
                ClientPlayersHandler.getCurrentPlayer().takeInput(outMsg.msg);
            }
        }
Esempio n. 7
0
 //For in editor
 void OnApplicationQuit()
 {
     ClientPlayersHandler.killBots();
 }