public void startButtonPressed()
        {
            int arraySize = int.Parse(arraySizeField.text);

            numbers = controller.startNewSession(arraySize, 0, 99);
            theAnimator.init(numbers);

            TCPLocalConnection.stopServer();
            TCPLocalConnection.startServer(4000);
            gameStarted = true;
        }
        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);
        }
Esempio n. 3
0
 public void stopServerClicked()
 {
     TCPLocalConnection.stopServer();
 }
Esempio n. 4
0
 public void restartPressed()
 {
     TCPLocalConnection.stopServer();
     TCPLocalConnection.startServer(4000);
     gameController.restartGame();
 }