Beispiel #1
0
        public static void SendPacketToServer(byte[] packet, int length)
        {
            lock ( _serverSendLock )
            {
                while (DateTime.Now < _nextPacketSendTime)
                {
                    Thread.Sleep(1);
                }

                InternalPacketSentEvent?.Invoke(packet, length);

                _sendToServer?.Invoke(ref packet, ref length);

                _nextPacketSendTime = DateTime.Now + PACKET_SEND_DELAY;
            }
        }
Beispiel #2
0
        public static void SendPacketToServer(byte[] packet, int length)
        {
            lock ( _serverSendLock )
            {
                while (DateTime.Now < _nextPacketSendTime)
                {
                    Thread.Sleep(1);
                }

                InternalPacketSentEvent?.Invoke(packet, length);

                PacketWaitEntries?.CheckWait(packet, PacketDirection.Outgoing, true);

                _sendToServer?.Invoke(ref packet, ref length);

                _nextPacketSendTime = DateTime.Now + PACKET_SEND_DELAY;
            }
        }
Beispiel #3
0
        public static void SendPacketToServer(byte[] packet, int length)
        {
            InternalPacketSentEvent?.Invoke(packet, length);

            _sendToServer?.Invoke(ref packet, ref length);
        }