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 override void DoUpdate() { this.lefpres = Mouse.left == InputState.Pressed; List <DCLine> dcLineList = (List <DCLine>)null; lock (DevConsole.debuggerLines) { dcLineList = DevConsole.debuggerLines; DevConsole.debuggerLines = new List <DCLine>(); } for (int index1 = 0; index1 < 4; ++index1) { if (index1 >= NetworkDebugger._instances.Count || !NetworkDebugger._instances[index1].active) { if (index1 <= NetworkDebugger._instances.Count) { int init = -1; InputProfile inputProfile1 = (InputProfile)null; foreach (InputProfile defaultProfile in InputProfile.defaultProfiles) { if (defaultProfile.Pressed("START")) { foreach (InputProfile inputProfile2 in NetworkDebugger.inputProfiles) { if (defaultProfile == inputProfile2) { break; } } for (int index2 = 0; index2 < 4; ++index2) { if (NetworkDebugger.inputProfiles[index2].name == "") { bool flag = false; foreach (NetDebugInterface netDebugInterface in NetworkDebugger._interfaces) { if (netDebugInterface.visible) { flag = true; break; } } if (!flag) { init = index1; inputProfile1 = defaultProfile; } NetworkDebugger.inputProfiles[index2] = defaultProfile; break; } } } } if (init != -1) { this.CreateInstance(init, false); NetworkDebugger._instances[index1].ipro = inputProfile1; } } } else { NetworkInstance instance = NetworkDebugger._instances[index1]; NetworkDebugger._networkDrawingIndex = index1; this.LockInstance(instance); float volume = SFX.volume; if (NetworkDebugger.Mute(NetworkDebugger._networkDrawingIndex)) { SFX.volume = 0.0f; } InputProfile.Update(); foreach (DCLine dcLine in dcLineList) { if (dcLine.threadIndex == index1) { DevConsole.core.lines.Enqueue(dcLine); } } DevConsole.Update(); Network.PreUpdate(); FireManager.Update(); Level.UpdateLevelChange(); Level.UpdateCurrentLevel(); MonoMain.UpdatePauseMenu(); int index2 = 0; foreach (NetDebugInterface netDebugInterface in NetworkDebugger._interfaces) { MonoMain.instance.IsMouseVisible = true; if (index2 == index1 && index2 < NetworkDebugger._instances.Count) { netDebugInterface.Update(NetworkDebugger._instances[index2].network); } ++index2; } Network.PostUpdate(); if (DuckNetwork.status == DuckNetStatus.Disconnected) { NetworkDebugger._instances[index1].active = false; foreach (Profile profile in NetworkDebugger._instances[index1].duckNetworkCore.profiles) { for (int index3 = 0; index3 < 4; ++index3) { if (NetworkDebugger.inputProfiles[index3] == profile.inputProfile || NetworkDebugger.inputProfiles[index3] == NetworkDebugger._instances[index1].ipro) { NetworkDebugger.inputProfiles[index3] = new InputProfile(); } } } } SFX.volume = volume; this.UnlockInstance(); } } if (!Keyboard.Pressed(Keys.F11)) { return; } foreach (NetworkInstance instance in NetworkDebugger._instances) { instance.network.core.ForcefulTermination(); } Network.activeNetwork.core.ForcefulTermination(); NetworkDebugger._instances.Clear(); NetworkDebugger.inputProfiles.Clear(); Level.current = (Level) new NetworkDebugger(); }