protected override void OnUpdate() { Main.isDemo = false; RockWeather.TickWeather(); Persona.Update(); RandomLevelDownloader.Update(); if (!NetworkDebugger.enabled) { FireManager.Update(); } DamageManager.Update(); if (!Network.isActive) { NetRand.generator = Rando.generator; } if (this.joinedLobby || !Program.testServer || (Network.isActive || !Steam.lobbySearchComplete)) { return; } if (Steam.lobbySearchResult != null) { Network.JoinServer("", 0, Steam.lobbySearchResult.id.ToString()); this.joinedLobby = true; } else { User who = Steam.friends.Find((Predicate <User>)(x => x.name == "superjoebob")); if (who == null) { return; } Steam.SearchForLobby(who); } }
public static void ResetMatchStuff() { PurpleBlock.Reset(); Highlights.ClearHighlights(); Crowd.GoHome(); GameMode.lastWinners.Clear(); Deathmatch.levelsSinceRandom = 0; Deathmatch.levelsSinceCustom = 0; GameMode.numMatchesPlayed = 0; GameMode.showdown = false; RockWeather.Reset(); Music.Reset(); foreach (Team team in Teams.all) { team.prevScoreboardScore = team.score = 0; if (team.activeProfiles.Count > 0) { foreach (Profile activeProfile in team.activeProfiles) { activeProfile.stats.lastPlayed = activeProfile.stats.lastPlayed = DateTime.Now; activeProfile.RecordPreviousStats(); Profiles.Save(activeProfile); } } } if (Profiles.all != null) { foreach (Profile profile in Profiles.all) { profile?.RecordPreviousStats(); } } Global.Save(); Options.Save(); Crowd.InitializeCrowd(); }