public static void handleLogInit(RunningGameInfoMsg initMsg) { currentPlayers = initMsg.players; localRenderer = null; logQueue.Clear(); singleton.startInitQueue(); isSpectating = true; }
public void preGameStarted(PreGame game, RunningGameInfoMsg initMsg) { if (game.hasSpectators() == false) { return; } foreach (IPeer p in game.getSpectatorsClone()) { p.SendMessage((short)CustomMasterServerMSG.spectateGameStarted, initMsg); } }
public static void startSpectateGame(string roomID) { SpectatorSubscriptionsMsg outMsg = new SpectatorSubscriptionsMsg() { broadcastID = roomID }; Msf.Connection.SendMessage((short)CustomMasterServerMSG.startSpectate, outMsg, ((s, m) => { if (s == ResponseStatus.Success) { RunningGameInfoMsg infoMsg = m.Deserialize <RunningGameInfoMsg>(); if (infoMsg.status == PreGameState.Running) { singleton.startNewSpectateGame(infoMsg); } } else { Debug.Log("Error:" + m.AsString()); } })); }
public void startNewSpectateGame(RunningGameInfoMsg infoMsg) { currentRoomID = infoMsg.gameID; handleLogInit(infoMsg); AdminUIManager.requestGotoGame(infoMsg.gameType, onGameSceneLoaded); }