add catch code for previous commit :(

This commit is contained in:
NotAlwaysTrue
2025-12-22 22:54:33 +08:00
parent dadd6c598f
commit 1def7b7b8d
3 changed files with 10 additions and 2 deletions
@@ -1233,9 +1233,9 @@ namespace Barotrauma.Networking
} }
} }
} }
finally catch
{ {
errorLines.Add("Catch event snapshot failed."); errorLines.Add("Failed to write EntitySpawner events.");
} }
errorLines.Add(""); errorLines.Add("");
@@ -293,6 +293,10 @@ namespace Barotrauma
GameMain.Server.EntityEventManager.Events.RemoveAll(ev => ev.Entity == item); GameMain.Server.EntityEventManager.Events.RemoveAll(ev => ev.Entity == item);
} }
} }
catch
{
GameServer.Log("Try making UniqueEvents snapshot failed", ServerLog.MessageType.Warning);
}
finally finally
{ {
Entity.Spawner.CreateNetworkEvent(new EntitySpawner.SpawnEntity(item)); Entity.Spawner.CreateNetworkEvent(new EntitySpawner.SpawnEntity(item));
@@ -181,6 +181,10 @@ namespace Barotrauma
GameMain.Server.EntityEventManager.Events.RemoveAll(ev => ev.Entity == item); GameMain.Server.EntityEventManager.Events.RemoveAll(ev => ev.Entity == item);
} }
} }
catch
{
GameServer.Log("Try making UniqueEvents snapshot failed", ServerLog.MessageType.Warning);
}
finally finally
{ {
Entity.Spawner.CreateNetworkEvent(new EntitySpawner.SpawnEntity(item)); Entity.Spawner.CreateNetworkEvent(new EntitySpawner.SpawnEntity(item));