Beispiel #1
0
        public static void Serialize(Stream stream, AccountFieldTags instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAccountLevelInfoTag)
            {
                stream.WriteByte(21);
                binaryWriter.Write(instance.AccountLevelInfoTag);
            }
            if (instance.HasPrivacyInfoTag)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.PrivacyInfoTag);
            }
            if (instance.HasParentalControlInfoTag)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.ParentalControlInfoTag);
            }
            if (instance.GameLevelInfoTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator = instance.GameLevelInfoTags.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ProgramTag current = enumerator.get_Current();
                        stream.WriteByte(58);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        ProgramTag.Serialize(stream, current);
                    }
                }
            }
            if (instance.GameStatusTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator2 = instance.GameStatusTags.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        ProgramTag current2 = enumerator2.get_Current();
                        stream.WriteByte(74);
                        ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                        ProgramTag.Serialize(stream, current2);
                    }
                }
            }
            if (instance.GameAccountTags.get_Count() > 0)
            {
                using (List <RegionTag> .Enumerator enumerator3 = instance.GameAccountTags.GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        RegionTag current3 = enumerator3.get_Current();
                        stream.WriteByte(90);
                        ProtocolParser.WriteUInt32(stream, current3.GetSerializedSize());
                        RegionTag.Serialize(stream, current3);
                    }
                }
            }
        }
Beispiel #2
0
        public static void Serialize(Stream stream, AccountFieldTags instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAccountLevelInfoTag)
            {
                stream.WriteByte(21);
                binaryWriter.Write(instance.AccountLevelInfoTag);
            }
            if (instance.HasPrivacyInfoTag)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.PrivacyInfoTag);
            }
            if (instance.HasParentalControlInfoTag)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.ParentalControlInfoTag);
            }
            if (instance.GameLevelInfoTags.Count > 0)
            {
                foreach (ProgramTag programTag in instance.GameLevelInfoTags)
                {
                    stream.WriteByte(58);
                    ProtocolParser.WriteUInt32(stream, programTag.GetSerializedSize());
                    ProgramTag.Serialize(stream, programTag);
                }
            }
            if (instance.GameStatusTags.Count > 0)
            {
                foreach (ProgramTag programTag2 in instance.GameStatusTags)
                {
                    stream.WriteByte(74);
                    ProtocolParser.WriteUInt32(stream, programTag2.GetSerializedSize());
                    ProgramTag.Serialize(stream, programTag2);
                }
            }
            if (instance.GameAccountTags.Count > 0)
            {
                foreach (RegionTag regionTag in instance.GameAccountTags)
                {
                    stream.WriteByte(90);
                    ProtocolParser.WriteUInt32(stream, regionTag.GetSerializedSize());
                    RegionTag.Serialize(stream, regionTag);
                }
            }
        }
 public void Serialize(Stream stream)
 {
     RegionTag.Serialize(stream, this);
 }