public void QuitRunButton() { go.GeneralGameState.GetComponent <MonitorRamUsage>().ClearRam(true); if (go.GeneralGameState.training && !go.GeneralGameState.UserInfo.LeaderboardUnlocked) { for (int i = 0; i < go.PlayerShip.Count; i++) { if (go.PlayerScore.GetScore(i) > GeneralGameState.unlockLeaderboardpoints) { go.GeneralGameState.UserInfo.LeaderboardUnlocked = true; go.GeneralGameState.SaveUserInformation(false); } } } if (GeneralGameState.useShadow == null && go.PlayerScore.isPersonalBest && !go.GeneralGameState.training && SeedAPI.VrifySeed(long.Parse(go.GeneralGameState.seed.ToString()), false, null) == long.Parse(go.GeneralGameState.seed.ToString())) { for (int j = 0; j < go.PlayerShip.Count; j++) { go.PlayerShip[j].GetComponent <ShadowRecording>().SaveRecording(); } } Time.timeScale = 1f; go.GeneralGameState.seed = 0L; go.GeneralGameState.training = false; PubSubHub.PostMessage <RestartLevel>(new RestartLevel(false, null)); }
public ServerThread(Socket serverSocket, ConnectionSettings settings, int maxConnections, ConnectionEventListener.NewASdu newASduEvent, PubSubHub pubSubHub) { _maxConnections = maxConnections; _serverSocket = serverSocket; _settings = settings; _newAsduEvent = newASduEvent; _pubSubHub = pubSubHub; }
public ConnectionHandler(Socket socket, ConnectionSettings settings, ConnectionEventListener.NewASdu newASduEvent, PubSubHub pubSubHub) { _socket = socket; _settings = settings; _newAsduEvent = newASduEvent; _pubSubHub = pubSubHub; _pubSubHub.Subscribe <ASdu>(this, "send", asdu => { try { _connection.Send(asdu); } catch (Exception e) { _pubSubHub.Publish(this, "error", e); } }); }