Exemple #1
0
        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());
        }
Exemple #2
0
 public void OnRakNetDataPacketSend(object sender, RakNetDataPacketSendEventArgs e)
 {
     this.RakNetDataPacketSend?.Invoke(sender, e);
 }