some fixes

This commit is contained in:
Mister_Nebula 2020-09-17 20:14:55 +01:00
parent efc1574a3a
commit 469f45b5ce
3 changed files with 20 additions and 1 deletions

View File

@ -2,6 +2,7 @@
using OWML.ModHelper.Events;
using QSB.Animation;
using QSB.DeathSync;
using QSB.ElevatorSync;
using QSB.Events;
using QSB.GeyserSync;
using QSB.OrbSync;
@ -151,6 +152,12 @@ namespace QSB
}
PlayerRegistry.PlayerList.ForEach(x => PlayerRegistry.PlayerList.Remove(x));
WorldRegistry.OrbSyncList.ForEach(x => Destroy(x));
WorldRegistry.RemoveObjects<QSBOrbSlot>();
WorldRegistry.RemoveObjects<QSBElevator>();
WorldRegistry.RemoveObjects<QSBGeyser>();
WorldRegistry.RemoveObjects<QSBSector>();
_lobby.CanEditName = true;
}
@ -172,6 +179,13 @@ namespace QSB
DebugLog.ToConsole("[S] Server stopped!", MessageType.Info);
PlayerRegistry.PlayerList.ForEach(player => player.HudMarker?.Remove());
NetworkServer.connections.ToList().ForEach(CleanupConnection);
WorldRegistry.OrbSyncList.ForEach(x => Destroy(x));
WorldRegistry.RemoveObjects<QSBOrbSlot>();
WorldRegistry.RemoveObjects<QSBElevator>();
WorldRegistry.RemoveObjects<QSBGeyser>();
WorldRegistry.RemoveObjects<QSBSector>();
base.OnStopServer();
}

View File

@ -32,6 +32,11 @@ namespace QSB.WorldSync
return GetObjects<T>().FirstOrDefault(x => x.ObjectId == id);
}
public static void RemoveObjects<T>() where T : WorldObject
{
WorldObjects.RemoveAll(x => x.GetType() == typeof(T));
}
public static void HandleSlotStateChange(NomaiInterfaceSlot slot, NomaiInterfaceOrb affectingOrb, bool state)
{
var qsbSlot = GetObjects<QSBOrbSlot>().First(x => x.InterfaceSlot == slot);

View File

@ -3,6 +3,6 @@
"settings": {
"defaultServerIP": "localhost",
"port": 7777,
"debugMode": true
"debugMode": false
}
}