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(); }
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); }
//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(); } }
public void init() { singleton = this; ClientUIOverlord.onUIStateChanged += onUIChanged; }