Ejemplo n.º 1
0
        public static ObjectDef Read(Client psr, NReader rdr)
        {
            ObjectDef ret = new ObjectDef();

            ret.ObjectType = (ushort)rdr.ReadInt16();
            ret.Stats      = ObjectStats.Read(psr, rdr);
            return(ret);
        }
Ejemplo n.º 2
0
        public static ObjectDef Read(NReader rdr)
        {
            var ret = new ObjectDef();

            ret.ObjectType = rdr.ReadUInt16();
            ret.Stats      = ObjectStats.Read(rdr);
            return(ret);
        }
Ejemplo n.º 3
0
        public static ObjectStats Read(Client psr, NReader rdr)
        {
            ObjectStats ret = new ObjectStats();

            ret.Id       = rdr.ReadInt32();
            ret.Position = Position.Read(psr, rdr);
            ret.Stats    = new KeyValuePair <StatsType, object> [rdr.ReadInt16()];
            for (int i = 0; i < ret.Stats.Length; i++)
            {
                StatsType type = (StatsType)rdr.ReadByte();
                if (type == StatsType.Guild || type == StatsType.Name)
                {
                    ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadUTF());
                }
                else
                {
                    ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadInt32());
                }
            }
            return(ret);
        }
Ejemplo n.º 4
0
        public static ObjectStats Read(NReader rdr)
        {
            var ret = new ObjectStats();

            ret.Id       = rdr.ReadInt32();
            ret.Position = Position.Read(rdr);
            ret.Stats    = new KeyValuePair <StatsType, object> [rdr.ReadInt16()];
            for (int i = 0; i < ret.Stats.Length; i++)
            {
                var type = (StatsType)rdr.ReadByte();
                if (type == StatsType.Guild || type == StatsType.Name || (type >= StatsType.InvData0 && type <= StatsType.InvData11))
                {
                    ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadUTF());
                }
                else
                {
                    ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadInt32());
                }
            }

            return(ret);
        }
Ejemplo n.º 5
0
        public static ObjectStats Read(NReader rdr)
        {
            var ret = new ObjectStats
            {
                Id       = rdr.ReadInt32(),
                Position = Position.Read(rdr),
                Stats    = new KeyValuePair <StatsType, object> [rdr.ReadInt16()]
            };

            for (var i = 0; i < ret.Stats.Length; i++)
            {
                var type = (StatsType)rdr.ReadByte();
                if (type == StatsType.Guild || type == StatsType.Name)
                {
                    ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadUTF());
                }
                else
                {
                    ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadInt32());
                }
            }

            return(ret);
        }
Ejemplo n.º 6
0
        public static ObjectStats Read(NReader rdr)
        {
            ObjectStats ret = new ObjectStats();
            ret.Id = rdr.ReadInt32();
            ret.Position = Position.Read(rdr);
            ret.Stats = new KeyValuePair<StatsType, object>[rdr.ReadInt16()];
            for (var i = 0; i < ret.Stats.Length; i++)
            {
                StatsType type = (StatsType)rdr.ReadByte();
                if (type == StatsType.Guild || type == StatsType.Name)
                    ret.Stats[i] = new KeyValuePair<StatsType, object>(type, rdr.ReadUTF());
                else
                    ret.Stats[i] = new KeyValuePair<StatsType, object>(type, rdr.ReadInt32());
            }

            return ret;
        }