public void Serialize(Stream stream) { AccountState.Serialize(stream, this); }
public void SetAccountState(AccountState val) { this.AccountState = val; }
public static AccountState Deserialize(Stream stream, AccountState instance, long limit) { if (instance.GameLevelInfo == null) { instance.GameLevelInfo = new List <bnet.protocol.account.GameLevelInfo>(); } if (instance.GameStatus == null) { instance.GameStatus = new List <bnet.protocol.account.GameStatus>(); } if (instance.GameAccounts == null) { instance.GameAccounts = new List <GameAccountList>(); } while (true) { if (limit < (long)0 || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= (long)0) { throw new EndOfStreamException(); } break; } else if (num == 10) { if (instance.AccountLevelInfo != null) { bnet.protocol.account.AccountLevelInfo.DeserializeLengthDelimited(stream, instance.AccountLevelInfo); } else { instance.AccountLevelInfo = bnet.protocol.account.AccountLevelInfo.DeserializeLengthDelimited(stream); } } else if (num == 18) { if (instance.PrivacyInfo != null) { bnet.protocol.account.PrivacyInfo.DeserializeLengthDelimited(stream, instance.PrivacyInfo); } else { instance.PrivacyInfo = bnet.protocol.account.PrivacyInfo.DeserializeLengthDelimited(stream); } } else if (num == 26) { if (instance.ParentalControlInfo != null) { bnet.protocol.account.ParentalControlInfo.DeserializeLengthDelimited(stream, instance.ParentalControlInfo); } else { instance.ParentalControlInfo = bnet.protocol.account.ParentalControlInfo.DeserializeLengthDelimited(stream); } } else if (num == 42) { instance.GameLevelInfo.Add(bnet.protocol.account.GameLevelInfo.DeserializeLengthDelimited(stream)); } else if (num == 50) { instance.GameStatus.Add(bnet.protocol.account.GameStatus.DeserializeLengthDelimited(stream)); } else if (num == 58) { instance.GameAccounts.Add(GameAccountList.DeserializeLengthDelimited(stream)); } else { Key key = ProtocolParser.ReadKey((byte)num, stream); if (key.Field == 0) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static AccountState Deserialize(Stream stream, AccountState instance) { return(AccountState.Deserialize(stream, instance, (long)-1)); }
public static AccountStateNotification Deserialize(Stream stream, AccountStateNotification instance, long limit) { while (true) { if (limit < (long)0 || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= (long)0) { throw new EndOfStreamException(); } break; } else if (num == 10) { if (instance.State != null) { AccountState.DeserializeLengthDelimited(stream, instance.State); } else { instance.State = AccountState.DeserializeLengthDelimited(stream); } } else if (num == 16) { instance.SubscriberId = ProtocolParser.ReadUInt64(stream); } else if (num != 26) { if (num == 32) { instance.SubscriptionCompleted = ProtocolParser.ReadBool(stream); } else { Key key = ProtocolParser.ReadKey((byte)num, stream); if (key.Field == 0) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } } else if (instance.AccountTags != null) { AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags); } else { instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static AccountState Deserialize(Stream stream, AccountState instance, long limit) { if (instance.GameLevelInfo == null) { instance.GameLevelInfo = new List <GameLevelInfo>(); } if (instance.GameStatus == null) { instance.GameStatus = new List <GameStatus>(); } if (instance.GameAccounts == null) { instance.GameAccounts = new List <GameAccountList>(); } while (limit < 0L || stream.get_Position() < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else { int num2 = num; if (num2 != 10) { if (num2 != 18) { if (num2 != 26) { if (num2 != 42) { if (num2 != 50) { if (num2 != 58) { Key key = ProtocolParser.ReadKey((byte)num, stream); uint field = key.Field; if (field == 0u) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } else { instance.GameAccounts.Add(GameAccountList.DeserializeLengthDelimited(stream)); } } else { instance.GameStatus.Add(bnet.protocol.account.GameStatus.DeserializeLengthDelimited(stream)); } } else { instance.GameLevelInfo.Add(bnet.protocol.account.GameLevelInfo.DeserializeLengthDelimited(stream)); } } else if (instance.ParentalControlInfo == null) { instance.ParentalControlInfo = ParentalControlInfo.DeserializeLengthDelimited(stream); } else { ParentalControlInfo.DeserializeLengthDelimited(stream, instance.ParentalControlInfo); } } else if (instance.PrivacyInfo == null) { instance.PrivacyInfo = PrivacyInfo.DeserializeLengthDelimited(stream); } else { PrivacyInfo.DeserializeLengthDelimited(stream, instance.PrivacyInfo); } } else if (instance.AccountLevelInfo == null) { instance.AccountLevelInfo = AccountLevelInfo.DeserializeLengthDelimited(stream); } else { AccountLevelInfo.DeserializeLengthDelimited(stream, instance.AccountLevelInfo); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static AccountStateNotification Deserialize(Stream stream, AccountStateNotification instance, long limit) { while (limit < 0L || stream.get_Position() < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else { int num2 = num; if (num2 != 10) { if (num2 != 16) { if (num2 != 26) { if (num2 != 32) { Key key = ProtocolParser.ReadKey((byte)num, stream); uint field = key.Field; if (field == 0u) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } else { instance.SubscriptionCompleted = ProtocolParser.ReadBool(stream); } } else if (instance.AccountTags == null) { instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream); } else { AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags); } } else { instance.SubscriberId = ProtocolParser.ReadUInt64(stream); } } else if (instance.State == null) { instance.State = AccountState.DeserializeLengthDelimited(stream); } else { AccountState.DeserializeLengthDelimited(stream, instance.State); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }