Esempio n. 1
0
 public static void Serialize(Stream stream, AccountSettingsNotification instance)
 {
     if (instance.Licenses.Count > 0)
     {
         foreach (AccountLicense accountLicense in instance.Licenses)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, accountLicense.GetSerializedSize());
             AccountLicense.Serialize(stream, accountLicense);
         }
     }
     if (instance.HasIsUsingRid)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteBool(stream, instance.IsUsingRid);
     }
     if (instance.HasIsPlayingFromIgr)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteBool(stream, instance.IsPlayingFromIgr);
     }
     if (instance.HasCanReceiveVoice)
     {
         stream.WriteByte(32);
         ProtocolParser.WriteBool(stream, instance.CanReceiveVoice);
     }
     if (instance.HasCanSendVoice)
     {
         stream.WriteByte(40);
         ProtocolParser.WriteBool(stream, instance.CanSendVoice);
     }
 }
Esempio n. 2
0
 public static void Serialize(Stream stream, AccountSettingsNotification 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);
             }
         }
     }
     if (instance.HasIsUsingRid)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteBool(stream, instance.IsUsingRid);
     }
     if (instance.HasIsPlayingFromIgr)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteBool(stream, instance.IsPlayingFromIgr);
     }
     if (instance.HasCanReceiveVoice)
     {
         stream.WriteByte(32);
         ProtocolParser.WriteBool(stream, instance.CanReceiveVoice);
     }
     if (instance.HasCanSendVoice)
     {
         stream.WriteByte(40);
         ProtocolParser.WriteBool(stream, instance.CanSendVoice);
     }
 }