private void ReadingPacket()
 {
     while (running)
     {
         if (memRead.ReadByte(GotPacketAdr.ToInt32()) == 1)
         {
             byte   packetLen = memRead.ReadByte(Addresses.MyAddresses.OutGoingPacketLen.Address);
             byte[] packet    = memRead.ReadBytes(Addresses.MyAddresses.OutGoingBuffer.Address + 8, (uint)packetLen);
             if (OutGoingPacket != null)
             {
                 OutGoingPacket.Invoke(packet);
             }
             memRead.WriteByte(GotPacketAdr.ToInt32(), 0);
         }
     }
 }
Beispiel #2
0
 internal void OnSentPacketEvent(OutGoingPacket type, Action <D2gsPacket> handler)
 => PacketSentEventHandlers.AddOrUpdate(type, handler, (t, h) => h += handler);
Beispiel #3
0
 internal void WritePacket(OutGoingPacket packet)
 {
     WritePacket(new byte[] { (byte)packet });
 }
Beispiel #4
0
 public void OnSentPacketEvent(OutGoingPacket type, Action <D2gsPacket> action)
 => D2gs.OnSentPacketEvent(type, action);