Ejemplo n.º 1
0
        private void ProcessObjectPacket(byte[] payload)
        {
            NetworkObject networkObject = NetworkObject.UnPack(payload);

            ObjectOpcode opcode = (ObjectOpcode)NetworkObjectField.ReadIntField(networkObject.GetField(0));

            log.Trace($"Received object packet {opcode}(0x{opcode:X}).");

            if (opcode == ObjectOpcode.Authenticate)
            {
                PacketManager.InvokeObjectMessageHandler(this, opcode, networkObject);
            }
            else
            {
                PacketManager.InvokeObjectMessageHandler(this, opcode, networkObject.GetField(1).ReadObject());
            }
        }
Ejemplo n.º 2
0
 public override void FromNetworkObject(NetworkObject class63_0)
 {
     using (var stream = new MemoryStream(NetworkObjectField.smethod_1(class63_0.GetField(0))))
     {
         using (var reader = new BinaryReader(stream))
         {
             this.Read(reader);
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Enqueue <see cref="NetworkObject"/> to be sent to the client.
        /// </summary>
        public void EnqueueMessage(NetworkObject message)
        {
            var packet = new ServerPacket(message);

            outgoingPackets.Enqueue(packet);

            ObjectOpcode opcode = (ObjectOpcode)NetworkObjectField.ReadIntField(message.GetField(0));

            log.Trace($"Sent object packet {opcode}(0x{opcode:X}).");
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        private void ProcessObjectPacket(byte[] payload)
        {
            try
            {
                NetworkObject networkObject = NetworkObject.UnPack(payload);

                ObjectOpcode opcode = (ObjectOpcode)NetworkObjectField.ReadIntField(networkObject.GetField(0));
                if (opcode == ObjectOpcode.Authenticate)
                {
                    PacketManager.InvokeObjectPacketHandler(this, opcode, networkObject);
                }
                else
                {
                    PacketManager.InvokeObjectPacketHandler(this, opcode, networkObject.GetField(1).ReadObject());
                }
            }
            catch (OutOfMemoryException exception)
            {
                log.Fatal(exception);
                log.Fatal($"Payload Length: {payload.Length}");
                throw;
            }
        }