public void SendDatagram(DataPacket pk) { RakNetDataPacketSendEventArgs ev = new RakNetDataPacketSendEventArgs(this, pk); Server.Instance.Event.Network.OnRakNetDataPacketSend(this, ev); if (ev.IsCancel) { return; } pk = ev.Packet; pk.SeqNumber = this.LastSendSeqNumber++; this.SendedPacket.TryAdd(pk.SeqNumber, pk); this.SendPacket(pk.Clone()); }
public void OnRakNetDataPacketSend(object sender, RakNetDataPacketSendEventArgs e) { this.RakNetDataPacketSend?.Invoke(sender, e); }