public static void WriteDelete(BaseVobInstance instance) { var stream = GameServer.SetupStream(ServerMessages.VobInstanceDeleteMessage); stream.Write((ushort)instance.ID); GameClient.ForEach(c => c.Send(stream, NetPriority.Low, NetReliability.Reliable, '\0')); }
public static void ReadDelete(PacketReader stream) { if (BaseVobInstance.TryGet(stream.ReadUShort(), out BaseVobInstance inst)) { inst.ScriptObject.Delete(); } }
public static void WriteCreate(BaseVobInstance instance) { var stream = GameServer.SetupStream(ServerMessages.VobInstanceCreateMessage); stream.Write((byte)instance.ScriptObject.GetVobType()); instance.WriteStream(stream); GameClient.ForEach(c => c.Send(stream, NetPriority.Low, NetReliability.Reliable, '\0')); }
public static void ReadCreate(PacketReader stream) { byte type = stream.ReadByte(); BaseVobInstance inst = ScriptManager.Interface.CreateInstance(type); inst.ReadStream(stream); inst.ScriptObject.Create(); }
/// <summary> Gets any Instance with the given ID or null from the static Instance collection. </summary> public static bool TryGet(int id, out BaseVobInstance instance) { return(idColl.TryGet(id, out instance)); }