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); } } }
internal void OnSentPacketEvent(OutGoingPacket type, Action <D2gsPacket> handler) => PacketSentEventHandlers.AddOrUpdate(type, handler, (t, h) => h += handler);
internal void WritePacket(OutGoingPacket packet) { WritePacket(new byte[] { (byte)packet }); }
public void OnSentPacketEvent(OutGoingPacket type, Action <D2gsPacket> action) => D2gs.OnSentPacketEvent(type, action);