Esempio n. 1
0
        public static MapInfoPacket Read(NBufferReader reader)
        {
            var ret = new MapInfoPacket();

            ret.Width         = reader.ReadUInt32();
            ret.Height        = reader.ReadUInt32();
            ret.Name          = reader.ReadUTF();
            ret.Name2         = reader.ReadUTF();
            ret.Seed          = reader.ReadUInt32();
            ret.Background    = reader.ReadUInt32();
            ret.Diffculty     = reader.ReadUInt32();
            ret.AllowTeleport = reader.ReadBoolean();
            ret.ShowDisplays  = reader.ReadBoolean();

            ret.ClientXML = new string[reader.ReadUInt16()];
            for (int i = 0; i < ret.ClientXML.Length; i++)
            {
                ret.ClientXML[i] = reader.Read32UTF();
            }

            ret.ExtraXML = new string[reader.ReadUInt16()];
            for (int i = 0; i < ret.ExtraXML.Length; i++)
            {
                ret.ExtraXML[i] = reader.Read32UTF();
            }

            return(ret);
        }
Esempio n. 2
0
        public static HelloPacket Read(NBufferReader reader)
        {
            var ret = new HelloPacket();

            ret.BuildVer = reader.ReadUTF();
            ret.GameId   = reader.ReadUInt32();
            ret.Guid     = reader.ReadUTF();
            ret.Rand1    = reader.ReadUInt32();
            ret.Password = reader.ReadUTF();
            ret.Rand2    = reader.ReadUInt32();
            ret.Secret   = reader.ReadUTF();
            ret.KeyTime  = reader.ReadUInt32();
            ret.Key      = reader.ReadBytes(reader.ReadUInt16());
            ret.MapInfo  = reader.Read32UTF();
            ret.X1       = reader.ReadUTF();
            ret.X2       = reader.ReadUTF();
            ret.X3       = reader.ReadUTF();
            ret.X4       = reader.ReadUTF();
            ret.X5       = reader.ReadUTF();
            return(ret);
        }