コード例 #1
0
 public void gameOver()
 {
     isGameOver       = true;
     canSendServerMsg = false;
     UnetRoomConnector.shutdownCurrentConnection();
     localGameUI.stopAllTimers();
     ClientPlayersHandler.killBots();
 }
コード例 #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])
            });
        }
コード例 #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);
        }
コード例 #4
0
        public void initController(GameType currentType)
        {
            if (currentType != getGameType())
            {
                Destroy(this);
                return;
            }
            ClientPlayersHandler.init(this);

            base.OnStartAuthority();
            initHandlers();
            StartCoroutine(sendGameServerReadyMsg());
        }
コード例 #5
0
        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
            });
        }
コード例 #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);
            }
        }
コード例 #7
0
 //For in editor
 void OnApplicationQuit()
 {
     ClientPlayersHandler.killBots();
 }