public void InitGameWidgetPart() { board = b; if (!isTest) { Server.TokenAndId tai = (Server.TokenAndId)DataPasser.Get().Get("tai"); Game game = (Game)DataPasser.Get().Get("game"); Boolean isObserver = (Boolean)DataPasser.Get().Get("is_observer"); SetGameWidgetPart(tai, game); } else { Server.TokenAndId tai = Server.Authorize("!!FB!!103018196855905", "uskjlrvkovscfzzwbtsr"); lw = new LobbyWidget(tai); LobbyBackendWidget backgroud = new LobbyBackendWidget(tai); backgroud.Controls.timer = new CrazyGoTimerControl(1000, lobbyTimer); lw.Controls.backgroud = backgroud; lw.Callbacks.goToGameAsPlayerCallback = delegate(Game g) { lw.Discard(); Debug.Log("Go to game as player"); SetGameWidgetPart(tai, g); }; lw.Go(); lw.Controls.backgroud.OpenForRandomChallenge("hidden-move-go", "board_size-19|komi-7.5|first_player-0|randomize-1|hm_count-7|time-b3600#60#5"); } }
void Set(Server.TokenAndId tai) { moi = this; lobbyWidget = new LobbyWidget(tai); LobbyBackendWidget backgroud = new LobbyBackendWidget(tai); backgroud.Controls.timer = new CrazyGoTimerControl(1000, timerScriptLobby); lobbyWidget.Controls.backgroud = backgroud; lobbyWidget.Callbacks.goToGameAsPlayerCallback = delegate(Game g) { lobbyWidget.Discard(); newGameSound.Play(); UnityEngine.Debug.Log("Go to game"); DataPasser.Get().Set("lobby", lobbyWidget); DataPasser.Get().Set("tai", tai); DataPasser.Get().Set("is_observer", false); DataPasser.Get().Set("game", g); CloseWidget(); Application.LoadLevel(3); }; lobbyWidget.Callbacks.repeatedCallback = delegate() { lobbyWidget.Discard(); UnityEngine.Debug.Log("Already connected"); CloseWidget(); DataPasser.Get().Set("repeat", "true"); Application.LoadLevel(0); }; SetUserInfo(); SetPlayBarPart(lobbyWidget); lobbyWidget.Go(); }