Exemple #1
0
        public uint GetSerializedSize()
        {
            uint num = 0u;

            if (this.RegionDelta.get_Count() > 0)
            {
                using (List <GameAccountList> .Enumerator enumerator = this.RegionDelta.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GameAccountList current = enumerator.get_Current();
                        num += 1u;
                        uint serializedSize = current.GetSerializedSize();
                        num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize);
                    }
                }
            }
            if (this.HasSubscriberId)
            {
                num += 1u;
                num += ProtocolParser.SizeOfUInt64(this.SubscriberId);
            }
            if (this.HasAccountTags)
            {
                num += 1u;
                uint serializedSize2 = this.AccountTags.GetSerializedSize();
                num += serializedSize2 + ProtocolParser.SizeOfUInt32(serializedSize2);
            }
            return(num);
        }
Exemple #2
0
 public static void Serialize(Stream stream, GameAccountNotification instance)
 {
     if (instance.RegionDelta.get_Count() > 0)
     {
         using (List <GameAccountList> .Enumerator enumerator = instance.RegionDelta.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 GameAccountList current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 GameAccountList.Serialize(stream, current);
             }
         }
     }
     if (instance.HasSubscriberId)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt64(stream, instance.SubscriberId);
     }
     if (instance.HasAccountTags)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.AccountTags);
     }
 }
 public static void Serialize(Stream stream, AccountState instance)
 {
     if (instance.HasAccountLevelInfo)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.AccountLevelInfo.GetSerializedSize());
         AccountLevelInfo.Serialize(stream, instance.AccountLevelInfo);
     }
     if (instance.HasPrivacyInfo)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.PrivacyInfo.GetSerializedSize());
         PrivacyInfo.Serialize(stream, instance.PrivacyInfo);
     }
     if (instance.HasParentalControlInfo)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.ParentalControlInfo.GetSerializedSize());
         ParentalControlInfo.Serialize(stream, instance.ParentalControlInfo);
     }
     if (instance.GameLevelInfo.get_Count() > 0)
     {
         using (List <GameLevelInfo> .Enumerator enumerator = instance.GameLevelInfo.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 GameLevelInfo current = enumerator.get_Current();
                 stream.WriteByte(42);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 bnet.protocol.account.GameLevelInfo.Serialize(stream, current);
             }
         }
     }
     if (instance.GameStatus.get_Count() > 0)
     {
         using (List <GameStatus> .Enumerator enumerator2 = instance.GameStatus.GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 GameStatus current2 = enumerator2.get_Current();
                 stream.WriteByte(50);
                 ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                 bnet.protocol.account.GameStatus.Serialize(stream, current2);
             }
         }
     }
     if (instance.GameAccounts.get_Count() > 0)
     {
         using (List <GameAccountList> .Enumerator enumerator3 = instance.GameAccounts.GetEnumerator())
         {
             while (enumerator3.MoveNext())
             {
                 GameAccountList current3 = enumerator3.get_Current();
                 stream.WriteByte(58);
                 ProtocolParser.WriteUInt32(stream, current3.GetSerializedSize());
                 GameAccountList.Serialize(stream, current3);
             }
         }
     }
 }
        public uint GetSerializedSize()
        {
            uint num = 0u;

            if (this.HasAccountLevelInfo)
            {
                num += 1u;
                uint serializedSize = this.AccountLevelInfo.GetSerializedSize();
                num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize);
            }
            if (this.HasPrivacyInfo)
            {
                num += 1u;
                uint serializedSize2 = this.PrivacyInfo.GetSerializedSize();
                num += serializedSize2 + ProtocolParser.SizeOfUInt32(serializedSize2);
            }
            if (this.HasParentalControlInfo)
            {
                num += 1u;
                uint serializedSize3 = this.ParentalControlInfo.GetSerializedSize();
                num += serializedSize3 + ProtocolParser.SizeOfUInt32(serializedSize3);
            }
            if (this.GameLevelInfo.get_Count() > 0)
            {
                using (List <GameLevelInfo> .Enumerator enumerator = this.GameLevelInfo.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GameLevelInfo current = enumerator.get_Current();
                        num += 1u;
                        uint serializedSize4 = current.GetSerializedSize();
                        num += serializedSize4 + ProtocolParser.SizeOfUInt32(serializedSize4);
                    }
                }
            }
            if (this.GameStatus.get_Count() > 0)
            {
                using (List <GameStatus> .Enumerator enumerator2 = this.GameStatus.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        GameStatus current2 = enumerator2.get_Current();
                        num += 1u;
                        uint serializedSize5 = current2.GetSerializedSize();
                        num += serializedSize5 + ProtocolParser.SizeOfUInt32(serializedSize5);
                    }
                }
            }
            if (this.GameAccounts.get_Count() > 0)
            {
                using (List <GameAccountList> .Enumerator enumerator3 = this.GameAccounts.GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        GameAccountList current3 = enumerator3.get_Current();
                        num += 1u;
                        uint serializedSize6 = current3.GetSerializedSize();
                        num += serializedSize6 + ProtocolParser.SizeOfUInt32(serializedSize6);
                    }
                }
            }
            return(num);
        }