Exemplo n.º 1
0
 public override void Deserialize(IoBuffer input, ISerializationContext context)
 {
     LotLocation_X = input.GetUInt16();
     LotLocation_Y = input.GetUInt16();
     Name          = input.GetPascalString();
     StartFresh    = input.GetBool();
 }
Exemplo n.º 2
0
 public void Deserialize(IoBuffer input, ISerializationContext context)
 {
     this.User         = input.GetString(112, Encoding.ASCII);
     this.AriesVersion = input.GetString(80, Encoding.ASCII);
     this.Email        = input.GetString(40, Encoding.ASCII);
     this.Authserv     = input.GetString(84, Encoding.ASCII);
     this.Product      = input.GetUInt16();
     this.Unknown      = input.Get();
     this.ServiceIdent = input.GetString(3, Encoding.ASCII);
     this.Unknown2     = input.GetUInt16();
     this.Password     = input.GetString(32, Encoding.ASCII);
 }
Exemplo n.º 3
0
 public override void Deserialize(IoBuffer input, ISerializationContext context)
 {
     this.MajorVersion     = input.GetUInt16();
     this.MinorVersion     = input.GetUInt16();
     this.PointVersion     = input.GetUInt16();
     this.ArtVersion       = input.GetUInt16();
     this.Timestamp        = input.GetUInt64();
     this.NumberOfAttempts = input.Get();
     this.LastExitCode     = input.Get();
     this.LastFailureType  = input.Get();
     this.FailureCount     = input.Get();
     this.IsRunning        = input.Get();
     this.IsReLogging      = input.Get();
 }
Exemplo n.º 4
0
        public override void Deserialize(IoBuffer input, ISerializationContext context)
        {
            var length = input.GetUInt16();

            PlayerIds = new List <uint>();

            for (var i = 0; i < length; i++)
            {
                PlayerIds.Add(input.GetUInt32());
            }
        }
Exemplo n.º 5
0
        private void DecodeVoltronStylePackets(IoBuffer buffer, ref uint payloadSize, IProtocolDecoderOutput output, Func <ushort, Type> typeResolver)
        {
            while (payloadSize > 0)
            {
                /** Voltron packet **/
                buffer.Order = ByteOrder.BigEndian;
                ushort type             = buffer.GetUInt16();
                uint   innerPayloadSize = buffer.GetUInt32() - 6;

                byte[] data = new byte[(int)innerPayloadSize];
                buffer.Get(data, 0, (int)innerPayloadSize);

                var packetClass = typeResolver(type);
                if (packetClass != null)
                {
                    IoBufferDeserializable packet = (IoBufferDeserializable)Activator.CreateInstance(packetClass);
                    packet.Deserialize(IoBuffer.Wrap(data), Context);
                    output.Write(packet);
                }

                payloadSize -= innerPayloadSize + 6;
            }
        }
Exemplo n.º 6
0
        private void TryParseAriesFrame(IoBuffer buffer, PacketDirection direction)
        {
            buffer.Rewind();

            if (buffer.Remaining < 12)
            {
                return;
            }

            buffer.Order = ByteOrder.LittleEndian;
            uint packetType  = buffer.GetUInt32();
            uint timestamp   = buffer.GetUInt32();
            uint payloadSize = buffer.GetUInt32();

            if (buffer.Remaining < payloadSize)
            {
                buffer.Skip(-12);
                return;
            }

            while (payloadSize > 0)
            {
                if (packetType == 0)
                {
                    /** Voltron packet **/
                    buffer.Order = ByteOrder.BigEndian;
                    ushort voltronType        = buffer.GetUInt16();
                    uint   voltronPayloadSize = buffer.GetUInt32() - 6;

                    byte[] data = new byte[(int)voltronPayloadSize];
                    buffer.Get(data, 0, (int)voltronPayloadSize);

                    PacketLogger.OnPacket(new Packet
                    {
                        Data      = data,
                        Type      = PacketType.VOLTRON,
                        SubType   = voltronType,
                        Direction = direction
                    });

                    payloadSize -= voltronPayloadSize + 6;
                }
                else
                {
                    byte[] data = new byte[(int)payloadSize];
                    buffer.Get(data, 0, (int)payloadSize);

                    PacketLogger.OnPacket(new Packet
                    {
                        Data      = data,
                        Type      = PacketType.ARIES,
                        SubType   = packetType,
                        Direction = direction
                    });

                    payloadSize = 0;
                }
            }


            buffer.Rewind();
        }
Exemplo n.º 7
0
 public static T GetEnum <T>(this IoBuffer buffer)
 {
     return((T)System.Enum.Parse(typeof(T), buffer.GetUInt16().ToString()));
 }
Exemplo n.º 8
0
 public override void Deserialize(IoBuffer input, ISerializationContext context)
 {
     HostReservedWords = input.GetUInt16();
     HostVersion       = input.GetUInt16();
     ClientBufSize     = input.GetUInt16();
 }
Exemplo n.º 9
0
 public object Deserialize(uint clsid, IoBuffer input, ISerializationContext serializer)
 {
     return(input.GetUInt16());
 }