refactor: handlers dictionaries should be readonly

This commit is contained in:
Paul Pacheco 2019-08-18 15:49:46 -05:00
parent 9e3ecc1ced
commit d08dd0328e

View File

@ -52,8 +52,8 @@ public static class ClientScene
public static Dictionary<ulong, NetworkIdentity> spawnableObjects;
// spawn handlers
static Dictionary<Guid, SpawnDelegate> spawnHandlers = new Dictionary<Guid, SpawnDelegate>();
static Dictionary<Guid, UnSpawnDelegate> unspawnHandlers = new Dictionary<Guid, UnSpawnDelegate>();
static readonly Dictionary<Guid, SpawnDelegate> spawnHandlers = new Dictionary<Guid, SpawnDelegate>();
static readonly Dictionary<Guid, UnSpawnDelegate> unspawnHandlers = new Dictionary<Guid, UnSpawnDelegate>();
// this is never called, and if we do call it in NetworkClient.Shutdown
// then the client's player object won't be removed after disconnecting!