public void gameOver() { isGameOver = true; canSendServerMsg = false; UnetRoomConnector.shutdownCurrentConnection(); localGameUI.stopAllTimers(); ClientPlayersHandler.killBots(); }
public static void addHuman() { AccountInfoPacket playerInfo = ClientUI.ClientUIOverlord.getCurrentAcountInfo(); ClientPlayersHandler.addPlayer(false, true, new AlbotServer.PlayerInfo { username = "******", iconNumber = int.Parse(playerInfo.Properties [AlbotDictKeys.icon]) }); }
//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); }
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 }); }
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); } }
//For in editor void OnApplicationQuit() { ClientPlayersHandler.killBots(); }