예제 #1
0
 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);
     }
 }
예제 #2
0
 /// <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));
 }
예제 #3
0
 /// <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);
 }
예제 #4
0
 public MessageRxEventArgs(CommPacket packet)
 {
     Packet = packet;
 }