public uint GetSerializedSize() { uint num = 0u; if (this.Licenses.get_Count() > 0) { using (List <AccountLicense> .Enumerator enumerator = this.Licenses.GetEnumerator()) { while (enumerator.MoveNext()) { AccountLicense current = enumerator.get_Current(); num += 1u; uint serializedSize = current.GetSerializedSize(); num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize); } } } if (this.HasIsUsingRid) { num += 1u; num += 1u; } if (this.HasIsPlayingFromIgr) { num += 1u; num += 1u; } if (this.HasCanReceiveVoice) { num += 1u; num += 1u; } if (this.HasCanSendVoice) { num += 1u; num += 1u; } return(num); }
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); } }