Ejemplo n.º 1
0
        public static void Serialize(Stream stream, AccountLevelInfo instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.Licenses.Count > 0)
            {
                foreach (AccountLicense accountLicense in instance.Licenses)
                {
                    stream.WriteByte(26);
                    ProtocolParser.WriteUInt32(stream, accountLicense.GetSerializedSize());
                    AccountLicense.Serialize(stream, accountLicense);
                }
            }
            if (instance.HasDefaultCurrency)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.DefaultCurrency);
            }
            if (instance.HasCountry)
            {
                stream.WriteByte(42);
                ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Country));
            }
            if (instance.HasPreferredRegion)
            {
                stream.WriteByte(48);
                ProtocolParser.WriteUInt32(stream, instance.PreferredRegion);
            }
        }
        public static void Serialize(Stream stream, AccountLevelInfo instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.Licenses.get_Count() > 0)
            {
                using (List <AccountLicense> .Enumerator enumerator = instance.Licenses.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AccountLicense current = enumerator.get_Current();
                        stream.WriteByte(26);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        AccountLicense.Serialize(stream, current);
                    }
                }
            }
            if (instance.HasDefaultCurrency)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.DefaultCurrency);
            }
            if (instance.HasCountry)
            {
                stream.WriteByte(42);
                ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.Country));
            }
            if (instance.HasPreferredRegion)
            {
                stream.WriteByte(48);
                ProtocolParser.WriteUInt32(stream, instance.PreferredRegion);
            }
        }
Ejemplo n.º 3
0
        public static void Serialize(Stream stream, GameLevelInfo instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasIsStarterEdition)
            {
                stream.WriteByte(24);
                ProtocolParser.WriteBool(stream, instance.IsStarterEdition);
            }
            if (instance.HasIsTrial)
            {
                stream.WriteByte(32);
                ProtocolParser.WriteBool(stream, instance.IsTrial);
            }
            if (instance.HasIsLifetime)
            {
                stream.WriteByte(40);
                ProtocolParser.WriteBool(stream, instance.IsLifetime);
            }
            if (instance.HasIsRestricted)
            {
                stream.WriteByte(48);
                ProtocolParser.WriteBool(stream, instance.IsRestricted);
            }
            if (instance.HasIsBeta)
            {
                stream.WriteByte(56);
                ProtocolParser.WriteBool(stream, instance.IsBeta);
            }
            if (instance.HasName)
            {
                stream.WriteByte(66);
                ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.Name));
            }
            if (instance.HasProgram)
            {
                stream.WriteByte(77);
                binaryWriter.Write(instance.Program);
            }
            if (instance.Licenses.get_Count() > 0)
            {
                using (List <AccountLicense> .Enumerator enumerator = instance.Licenses.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AccountLicense current = enumerator.get_Current();
                        stream.WriteByte(82);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        AccountLicense.Serialize(stream, current);
                    }
                }
            }
            if (instance.HasRealmPermissions)
            {
                stream.WriteByte(88);
                ProtocolParser.WriteUInt32(stream, instance.RealmPermissions);
            }
        }
Ejemplo n.º 4
0
        public static void Serialize(Stream stream, GameLevelInfo instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasIsStarterEdition)
            {
                stream.WriteByte(24);
                ProtocolParser.WriteBool(stream, instance.IsStarterEdition);
            }
            if (instance.HasIsTrial)
            {
                stream.WriteByte(32);
                ProtocolParser.WriteBool(stream, instance.IsTrial);
            }
            if (instance.HasIsLifetime)
            {
                stream.WriteByte(40);
                ProtocolParser.WriteBool(stream, instance.IsLifetime);
            }
            if (instance.HasIsRestricted)
            {
                stream.WriteByte(48);
                ProtocolParser.WriteBool(stream, instance.IsRestricted);
            }
            if (instance.HasIsBeta)
            {
                stream.WriteByte(56);
                ProtocolParser.WriteBool(stream, instance.IsBeta);
            }
            if (instance.HasName)
            {
                stream.WriteByte(66);
                ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Name));
            }
            if (instance.HasProgram)
            {
                stream.WriteByte(77);
                binaryWriter.Write(instance.Program);
            }
            if (instance.Licenses.Count > 0)
            {
                foreach (AccountLicense accountLicense in instance.Licenses)
                {
                    stream.WriteByte(82);
                    ProtocolParser.WriteUInt32(stream, accountLicense.GetSerializedSize());
                    AccountLicense.Serialize(stream, accountLicense);
                }
            }
            if (instance.HasRealmPermissions)
            {
                stream.WriteByte(88);
                ProtocolParser.WriteUInt32(stream, instance.RealmPermissions);
            }
        }
 public static void Serialize(Stream stream, GetLicensesResponse instance)
 {
     if (instance.Licenses.Count > 0)
     {
         foreach (AccountLicense accountLicense in instance.Licenses)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, accountLicense.GetSerializedSize());
             AccountLicense.Serialize(stream, accountLicense);
         }
     }
 }
 public static void Serialize(Stream stream, GetLicensesResponse instance)
 {
     if (instance.Licenses.get_Count() > 0)
     {
         using (List <AccountLicense> .Enumerator enumerator = instance.Licenses.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 AccountLicense current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 AccountLicense.Serialize(stream, current);
             }
         }
     }
 }
Ejemplo n.º 7
0
 public void Serialize(Stream stream)
 {
     AccountLicense.Serialize(stream, this);
 }
Ejemplo n.º 8
0
 public static void Serialize(Stream stream, GameAccountBlob instance)
 {
     if (instance.GameAccount == null)
     {
         throw new ArgumentNullException("GameAccount", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.GameAccount.GetSerializedSize());
     GameAccountHandle.Serialize(stream, instance.GameAccount);
     if (instance.HasName)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Name));
     }
     if (instance.HasRealmPermissions)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.RealmPermissions);
     }
     stream.WriteByte(32);
     ProtocolParser.WriteUInt32(stream, instance.Status);
     if (instance.HasFlags)
     {
         stream.WriteByte(40);
         ProtocolParser.WriteUInt64(stream, instance.Flags);
     }
     if (instance.HasBillingFlags)
     {
         stream.WriteByte(48);
         ProtocolParser.WriteUInt32(stream, instance.BillingFlags);
     }
     stream.WriteByte(56);
     ProtocolParser.WriteUInt64(stream, instance.CacheExpiration);
     if (instance.HasSubscriptionExpiration)
     {
         stream.WriteByte(80);
         ProtocolParser.WriteUInt64(stream, instance.SubscriptionExpiration);
     }
     if (instance.HasUnitsRemaining)
     {
         stream.WriteByte(88);
         ProtocolParser.WriteUInt32(stream, instance.UnitsRemaining);
     }
     if (instance.HasStatusExpiration)
     {
         stream.WriteByte(96);
         ProtocolParser.WriteUInt64(stream, instance.StatusExpiration);
     }
     if (instance.HasBoxLevel)
     {
         stream.WriteByte(104);
         ProtocolParser.WriteUInt32(stream, instance.BoxLevel);
     }
     if (instance.HasBoxLevelExpiration)
     {
         stream.WriteByte(112);
         ProtocolParser.WriteUInt64(stream, instance.BoxLevelExpiration);
     }
     if (instance.Licenses.Count > 0)
     {
         foreach (AccountLicense accountLicense in instance.Licenses)
         {
             stream.WriteByte(162);
             stream.WriteByte(1);
             ProtocolParser.WriteUInt32(stream, accountLicense.GetSerializedSize());
             AccountLicense.Serialize(stream, accountLicense);
         }
     }
 }
Ejemplo n.º 9
0
 public static void Serialize(Stream stream, GameAccountBlob instance)
 {
     if (instance.GameAccount == null)
     {
         throw new ArgumentNullException("GameAccount", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.GameAccount.GetSerializedSize());
     GameAccountHandle.Serialize(stream, instance.GameAccount);
     if (instance.HasName)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.Name));
     }
     if (instance.HasRealmPermissions)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.RealmPermissions);
     }
     stream.WriteByte(32);
     ProtocolParser.WriteUInt32(stream, instance.Status);
     if (instance.HasFlags)
     {
         stream.WriteByte(40);
         ProtocolParser.WriteUInt64(stream, instance.Flags);
     }
     if (instance.HasBillingFlags)
     {
         stream.WriteByte(48);
         ProtocolParser.WriteUInt32(stream, instance.BillingFlags);
     }
     stream.WriteByte(56);
     ProtocolParser.WriteUInt64(stream, instance.CacheExpiration);
     if (instance.HasSubscriptionExpiration)
     {
         stream.WriteByte(80);
         ProtocolParser.WriteUInt64(stream, instance.SubscriptionExpiration);
     }
     if (instance.HasUnitsRemaining)
     {
         stream.WriteByte(88);
         ProtocolParser.WriteUInt32(stream, instance.UnitsRemaining);
     }
     if (instance.HasStatusExpiration)
     {
         stream.WriteByte(96);
         ProtocolParser.WriteUInt64(stream, instance.StatusExpiration);
     }
     if (instance.HasBoxLevel)
     {
         stream.WriteByte(104);
         ProtocolParser.WriteUInt32(stream, instance.BoxLevel);
     }
     if (instance.HasBoxLevelExpiration)
     {
         stream.WriteByte(112);
         ProtocolParser.WriteUInt64(stream, instance.BoxLevelExpiration);
     }
     if (instance.Licenses.get_Count() > 0)
     {
         using (List <AccountLicense> .Enumerator enumerator = instance.Licenses.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 AccountLicense current = enumerator.get_Current();
                 stream.WriteByte(162);
                 stream.WriteByte(1);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 AccountLicense.Serialize(stream, current);
             }
         }
     }
 }
Ejemplo n.º 10
0
        public static void Serialize(Stream stream, AccountBlob instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            stream.WriteByte(21);
            binaryWriter.Write(instance.Id);
            stream.WriteByte(24);
            ProtocolParser.WriteUInt32(stream, instance.Region);
            if (instance.Email.Count > 0)
            {
                foreach (string email in instance.Email)
                {
                    stream.WriteByte(34);
                    ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(email));
                }
            }
            stream.WriteByte(40);
            ProtocolParser.WriteUInt64(stream, instance.Flags);
            if (instance.HasSecureRelease)
            {
                stream.WriteByte(48);
                ProtocolParser.WriteUInt64(stream, instance.SecureRelease);
            }
            if (instance.HasWhitelistStart)
            {
                stream.WriteByte(56);
                ProtocolParser.WriteUInt64(stream, instance.WhitelistStart);
            }
            if (instance.HasWhitelistEnd)
            {
                stream.WriteByte(64);
                ProtocolParser.WriteUInt64(stream, instance.WhitelistEnd);
            }
            if (instance.FullName == null)
            {
                throw new ArgumentNullException("FullName", "Required by proto specification.");
            }
            stream.WriteByte(82);
            ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.FullName));
            if (instance.Licenses.Count > 0)
            {
                foreach (AccountLicense license in instance.Licenses)
                {
                    stream.WriteByte(162);
                    stream.WriteByte(1);
                    ProtocolParser.WriteUInt32(stream, license.GetSerializedSize());
                    AccountLicense.Serialize(stream, license);
                }
            }
            if (instance.Credentials.Count > 0)
            {
                foreach (AccountCredential credential in instance.Credentials)
                {
                    stream.WriteByte(170);
                    stream.WriteByte(1);
                    ProtocolParser.WriteUInt32(stream, credential.GetSerializedSize());
                    AccountCredential.Serialize(stream, credential);
                }
            }
            if (instance.AccountLinks.Count > 0)
            {
                foreach (GameAccountLink accountLink in instance.AccountLinks)
                {
                    stream.WriteByte(178);
                    stream.WriteByte(1);
                    ProtocolParser.WriteUInt32(stream, accountLink.GetSerializedSize());
                    GameAccountLink.Serialize(stream, accountLink);
                }
            }
            if (instance.HasBattleTag)
            {
                stream.WriteByte(186);
                stream.WriteByte(1);
                ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.BattleTag));
            }
            if (instance.HasDefaultCurrency)
            {
                stream.WriteByte(205);
                stream.WriteByte(1);
                binaryWriter.Write(instance.DefaultCurrency);
            }
            if (instance.HasLegalRegion)
            {
                stream.WriteByte(208);
                stream.WriteByte(1);
                ProtocolParser.WriteUInt32(stream, instance.LegalRegion);
            }
            if (instance.HasLegalLocale)
            {
                stream.WriteByte(221);
                stream.WriteByte(1);
                binaryWriter.Write(instance.LegalLocale);
            }
            stream.WriteByte(240);
            stream.WriteByte(1);
            ProtocolParser.WriteUInt64(stream, instance.CacheExpiration);
            if (instance.HasParentalControlInfo)
            {
                stream.WriteByte(250);
                stream.WriteByte(1);
                ProtocolParser.WriteUInt32(stream, instance.ParentalControlInfo.GetSerializedSize());
                bnet.protocol.account.ParentalControlInfo.Serialize(stream, instance.ParentalControlInfo);
            }
            if (instance.HasCountry)
            {
                stream.WriteByte(130);
                stream.WriteByte(2);
                ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Country));
            }
            if (instance.HasPreferredRegion)
            {
                stream.WriteByte(136);
                stream.WriteByte(2);
                ProtocolParser.WriteUInt32(stream, instance.PreferredRegion);
            }
        }
Ejemplo n.º 11
0
        public static void Serialize(Stream stream, AccountBlob instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            stream.WriteByte(21);
            binaryWriter.Write(instance.Id);
            stream.WriteByte(24);
            ProtocolParser.WriteUInt32(stream, instance.Region);
            if (instance.Email.get_Count() > 0)
            {
                using (List <string> .Enumerator enumerator = instance.Email.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        string current = enumerator.get_Current();
                        stream.WriteByte(34);
                        ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(current));
                    }
                }
            }
            stream.WriteByte(40);
            ProtocolParser.WriteUInt64(stream, instance.Flags);
            if (instance.HasSecureRelease)
            {
                stream.WriteByte(48);
                ProtocolParser.WriteUInt64(stream, instance.SecureRelease);
            }
            if (instance.HasWhitelistStart)
            {
                stream.WriteByte(56);
                ProtocolParser.WriteUInt64(stream, instance.WhitelistStart);
            }
            if (instance.HasWhitelistEnd)
            {
                stream.WriteByte(64);
                ProtocolParser.WriteUInt64(stream, instance.WhitelistEnd);
            }
            if (instance.FullName == null)
            {
                throw new ArgumentNullException("FullName", "Required by proto specification.");
            }
            stream.WriteByte(82);
            ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.FullName));
            if (instance.Licenses.get_Count() > 0)
            {
                using (List <AccountLicense> .Enumerator enumerator2 = instance.Licenses.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        AccountLicense current2 = enumerator2.get_Current();
                        stream.WriteByte(162);
                        stream.WriteByte(1);
                        ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                        AccountLicense.Serialize(stream, current2);
                    }
                }
            }
            if (instance.Credentials.get_Count() > 0)
            {
                using (List <AccountCredential> .Enumerator enumerator3 = instance.Credentials.GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        AccountCredential current3 = enumerator3.get_Current();
                        stream.WriteByte(170);
                        stream.WriteByte(1);
                        ProtocolParser.WriteUInt32(stream, current3.GetSerializedSize());
                        AccountCredential.Serialize(stream, current3);
                    }
                }
            }
            if (instance.AccountLinks.get_Count() > 0)
            {
                using (List <GameAccountLink> .Enumerator enumerator4 = instance.AccountLinks.GetEnumerator())
                {
                    while (enumerator4.MoveNext())
                    {
                        GameAccountLink current4 = enumerator4.get_Current();
                        stream.WriteByte(178);
                        stream.WriteByte(1);
                        ProtocolParser.WriteUInt32(stream, current4.GetSerializedSize());
                        GameAccountLink.Serialize(stream, current4);
                    }
                }
            }
            if (instance.HasBattleTag)
            {
                stream.WriteByte(186);
                stream.WriteByte(1);
                ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.BattleTag));
            }
            if (instance.HasDefaultCurrency)
            {
                stream.WriteByte(205);
                stream.WriteByte(1);
                binaryWriter.Write(instance.DefaultCurrency);
            }
            if (instance.HasLegalRegion)
            {
                stream.WriteByte(208);
                stream.WriteByte(1);
                ProtocolParser.WriteUInt32(stream, instance.LegalRegion);
            }
            if (instance.HasLegalLocale)
            {
                stream.WriteByte(221);
                stream.WriteByte(1);
                binaryWriter.Write(instance.LegalLocale);
            }
            stream.WriteByte(240);
            stream.WriteByte(1);
            ProtocolParser.WriteUInt64(stream, instance.CacheExpiration);
            if (instance.HasParentalControlInfo)
            {
                stream.WriteByte(250);
                stream.WriteByte(1);
                ProtocolParser.WriteUInt32(stream, instance.ParentalControlInfo.GetSerializedSize());
                ParentalControlInfo.Serialize(stream, instance.ParentalControlInfo);
            }
            if (instance.HasCountry)
            {
                stream.WriteByte(130);
                stream.WriteByte(2);
                ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.Country));
            }
            if (instance.HasPreferredRegion)
            {
                stream.WriteByte(136);
                stream.WriteByte(2);
                ProtocolParser.WriteUInt32(stream, instance.PreferredRegion);
            }
        }