Exemplo n.º 1
0
 public void gameOver()
 {
     isGameOver       = true;
     canSendServerMsg = false;
     UnetRoomConnector.shutdownCurrentConnection();
     localGameUI.stopAllTimers();
     ClientPlayersHandler.killBots();
 }
Exemplo 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])
            });
        }
Exemplo 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);
        }
Exemplo 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
            });
        }
Exemplo 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);
            }
        }
Exemplo n.º 7
0
 //For in editor
 void OnApplicationQuit()
 {
     ClientPlayersHandler.killBots();
 }