public static void Init(RPCObject obj) { if (obj.DynamicId != 0 && Objects.ContainsKey(obj.DynamicId)) throw new Exception("Given object was already initialized"); ulong id = Next(); obj.DynamicId = id; Objects.Add(id, obj); }
public static void Init(RPCObject obj) { if (obj.DynamicId != 0 && Objects.ContainsKey(obj.DynamicId)) { throw new Exception("Given object was already initialized"); } ulong id = Next(); obj.DynamicId = id; Objects.Add(id, obj); }
public static void Release(RPCObject obj) { Logger.Debug("Releasing object {0}", obj.DynamicId); /*if (obj.Initialized) { if (obj.DynamicId == 0 || !Objects.ContainsKey(obj.DynamicId)) throw new Exception("Given object was already released"); Objects.Remove(obj.DynamicId); } else { Logger.Debug("RPCObject with ID={0} tried to release twice", obj.DynamicId); }*/ }
public static void Release(RPCObject obj) { Logger.Debug("Releasing object {0}", obj.DynamicId); /*if (obj.Initialized) * { * if (obj.DynamicId == 0 || !Objects.ContainsKey(obj.DynamicId)) * throw new Exception("Given object was already released"); * Objects.Remove(obj.DynamicId); * } * else * { * Logger.Debug("RPCObject with ID={0} tried to release twice", obj.DynamicId); * }*/ }