예제 #1
0
        public static void handleStartGame(IIncommingMessage rawMsg)
        {
            PreGameStartedMsg msg = rawMsg.Deserialize <PreGameStartedMsg>();

            if (matchingSpecs(msg.specs, gameSpecs) == false)
            {
                Debug.LogError("Got non-matching start msg to: " + msg.specs.roomID + " Type: " + msg.specs.type);
                return;
            }
            currentlyPlayingGame = true;
            setupLocalPlayers(msg.slots);
            gameConnector.onJoinStartedGame(msg);
            AlbotDialogBox.removeAllPopups();
        }
예제 #2
0
        public static void gameOver(string gameOverText, bool sendTCPGameOver = false)
        {
            string buttonText = CurrentTournament.isInTournament ? "To Tournament" : "Return to lobby";

            Action buttonAction;

            if (CurrentTournament.isInTournament)
            {
                buttonAction = () => { CurrentTournament.reOpenTournament(); }
            }
            ;
            else
            {
                buttonAction = () => { ClientUIStateManager.requestGotoState(ClientUIStates.GameLobby); }
            };

            AlbotDialogBox.setGameOver();
            AlbotDialogBox.activateButton(buttonAction, DialogBoxType.GameState, gameOverText, buttonText, 70, 25);
        }
예제 #3
0
        //Retreive information the server if we could login or not
        private void handleLoginCallback(bool couldLogin, string msg)
        {
            loadingScreen.closeLoadingScreen();
            if (waitingForLoginResponse == false)
            {
                return;
            }

            if (couldLogin == false)
            {
                AlbotDialogBox.activateButton(() => { }, DialogBoxType.BotConnectionError, msg, "Ok!", 30, 30);
                resetToNormalState();
                return;
            }

            //gameObject.SetActive(false);
            waitingForLoginResponse = false;
            if (LoggedIn != null)
            {
                LoggedIn.Invoke();
            }
        }
예제 #4
0
 public void init()
 {
     singleton = this;
     ClientUIOverlord.onUIStateChanged += onUIChanged;
 }