Exemple #1
0
 private void OnConnect(AegisClient ac, bool connected)
 {
     if (connected == true)
     {
         OnNetworkStatusChanged(NetworkStatus.Connected);
     }
     else
     {
         OnNetworkStatusChanged(NetworkStatus.ConnectionFailed);
     }
 }
Exemple #2
0
        private bool IsValidPacket(AegisClient ac, StreamBuffer buffer, out Int32 packetSize)
        {
            if (buffer.WrittenBytes < 8)
            {
                packetSize = 0;
                return(false);
            }

            packetSize = buffer.GetUInt16();
            return(packetSize > 0 && buffer.WrittenBytes >= packetSize);
        }
Exemple #3
0
        private void OnReceive(AegisClient ac, StreamBuffer buffer)
        {
            SecurePacket packet = new SecurePacket(buffer);

            packet.Decrypt(AESIV, AESKey);
            packet.SkipHeader();

            if (PacketPreprocessing != null &&
                PacketPreprocessing(packet) == false)
            {
                _callbackQueue.AddPacket(packet);
            }
        }
Exemple #4
0
 private void OnDisconnect(AegisClient ac)
 {
     _aegisClient.EnableSend = false;
     OnNetworkStatusChanged(NetworkStatus.Disconnected);
 }