public override void SendMessage(CommPacket packet) { if (packet.TargetID == -1) { foreach (int id in ClientList) { base.SendMessage(packet.Command, packet.Data, id); } } else { base.SendMessage(packet); } }
/// <summary> /// Triggers the MessageRxEvent for the provided packet /// </summary> /// <param name="packet">The comm packet that was received</param> protected virtual void OnMessageRxEvent(CommPacket packet) { MessageRxEvent?.Invoke(this, new MessageRxEventArgs(packet)); }
/// <summary> /// Sends a message to other modules /// </summary> /// <param name="packet">The comm packet to send</param> public virtual void SendMessage(CommPacket packet) { packet.AuthorID = ID; TxQueue.Enqueue(packet); }
public MessageRxEventArgs(CommPacket packet) { Packet = packet; }