public override bool Equals(object obj)
        {
            CreateGameAccountRequest createGameAccountRequest = obj as CreateGameAccountRequest;

            if (createGameAccountRequest == null)
            {
                return(false);
            }
            if (this.HasAccount != createGameAccountRequest.HasAccount || this.HasAccount && !this.Account.Equals(createGameAccountRequest.Account))
            {
                return(false);
            }
            if (this.HasRegion != createGameAccountRequest.HasRegion || this.HasRegion && !this.Region.Equals(createGameAccountRequest.Region))
            {
                return(false);
            }
            if (this.HasProgram != createGameAccountRequest.HasProgram || this.HasProgram && !this.Program.Equals(createGameAccountRequest.Program))
            {
                return(false);
            }
            if (this.HasRealmPermissions == createGameAccountRequest.HasRealmPermissions && (!this.HasRealmPermissions || this.RealmPermissions.Equals(createGameAccountRequest.RealmPermissions)))
            {
                return(true);
            }
            return(false);
        }
        public static void Serialize(Stream stream, CreateGameAccountRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAccount)
            {
                stream.WriteByte(10);
                ProtocolParser.WriteUInt32(stream, instance.Account.GetSerializedSize());
                AccountId.Serialize(stream, instance.Account);
            }
            if (instance.HasRegion)
            {
                stream.WriteByte(16);
                ProtocolParser.WriteUInt32(stream, instance.Region);
            }
            if (instance.HasProgram)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.Program);
            }
            if (instance.HasRealmPermissions)
            {
                stream.WriteByte(32);
                ProtocolParser.WriteUInt32(stream, instance.RealmPermissions);
            }
        }
        public static CreateGameAccountRequest DeserializeLengthDelimited(Stream stream, CreateGameAccountRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(CreateGameAccountRequest.Deserialize(stream, instance, position));
        }
        public static CreateGameAccountRequest DeserializeLengthDelimited(Stream stream)
        {
            CreateGameAccountRequest createGameAccountRequest = new CreateGameAccountRequest();

            CreateGameAccountRequest.DeserializeLengthDelimited(stream, createGameAccountRequest);
            return(createGameAccountRequest);
        }
Пример #5
0
        public static CreateGameAccountRequest DeserializeLengthDelimited(Stream stream, CreateGameAccountRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(CreateGameAccountRequest.Deserialize(stream, instance, num));
        }
        public static CreateGameAccountRequest Deserialize(Stream stream, CreateGameAccountRequest instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            instance.RealmPermissions = 1;
            while (true)
            {
                if (limit < (long)0 || stream.Position < limit)
                {
                    int num = stream.ReadByte();
                    if (num != -1)
                    {
                        switch (num)
                        {
                        case 29:
                        {
                            instance.Program = binaryReader.ReadUInt32();
                            continue;
                        }

                        case 32:
                        {
                            instance.RealmPermissions = ProtocolParser.ReadUInt32(stream);
                            continue;
                        }

                        default:
                        {
                            if (num == 10)
                            {
                                if (instance.Account != null)
                                {
                                    AccountId.DeserializeLengthDelimited(stream, instance.Account);
                                }
                                else
                                {
                                    instance.Account = AccountId.DeserializeLengthDelimited(stream);
                                }
                                continue;
                            }
                            else if (num == 16)
                            {
                                instance.Region = ProtocolParser.ReadUInt32(stream);
                                continue;
                            }
                            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);
                                continue;
                            }
                        }
                        }
                    }
                    else
                    {
                        if (limit >= (long)0)
                        {
                            throw new EndOfStreamException();
                        }
                        break;
                    }
                }
                else
                {
                    if (stream.Position != limit)
                    {
                        throw new ProtocolBufferException("Read past max limit");
                    }
                    break;
                }
            }
            return(instance);
        }
 public static CreateGameAccountRequest Deserialize(Stream stream, CreateGameAccountRequest instance)
 {
     return(CreateGameAccountRequest.Deserialize(stream, instance, (long)-1));
 }
 public void Deserialize(Stream stream)
 {
     CreateGameAccountRequest.Deserialize(stream, this);
 }
Пример #9
0
        public override bool Equals(object obj)
        {
            CreateGameAccountRequest createGameAccountRequest = obj as CreateGameAccountRequest;

            return(createGameAccountRequest != null && this.HasAccount == createGameAccountRequest.HasAccount && (!this.HasAccount || this.Account.Equals(createGameAccountRequest.Account)) && this.HasRegion == createGameAccountRequest.HasRegion && (!this.HasRegion || this.Region.Equals(createGameAccountRequest.Region)) && this.HasProgram == createGameAccountRequest.HasProgram && (!this.HasProgram || this.Program.Equals(createGameAccountRequest.Program)) && this.HasRealmPermissions == createGameAccountRequest.HasRealmPermissions && (!this.HasRealmPermissions || this.RealmPermissions.Equals(createGameAccountRequest.RealmPermissions)));
        }
Пример #10
0
        public static CreateGameAccountRequest Deserialize(Stream stream, CreateGameAccountRequest instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            instance.RealmPermissions = 1u;
            while (limit < 0L || stream.get_Position() < limit)
            {
                int num = stream.ReadByte();
                if (num != -1)
                {
                    int num2 = num;
                    switch (num2)
                    {
                    case 29:
                        instance.Program = binaryReader.ReadUInt32();
                        continue;

                    case 30:
                    case 31:
                    {
IL_7A:
                        if (num2 == 10)
                        {
                            if (instance.Account == null)
                            {
                                instance.Account = AccountId.DeserializeLengthDelimited(stream);
                            }
                            else
                            {
                                AccountId.DeserializeLengthDelimited(stream, instance.Account);
                            }
                            continue;
                        }
                        if (num2 == 16)
                        {
                            instance.Region = ProtocolParser.ReadUInt32(stream);
                            continue;
                        }
                        Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                        uint field = key.Field;
                        if (field != 0u)
                        {
                            ProtocolParser.SkipKey(stream, key);
                            continue;
                        }
                        throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    }

                    case 32:
                        instance.RealmPermissions = ProtocolParser.ReadUInt32(stream);
                        continue;
                    }
                    goto IL_7A;
                }
                if (limit >= 0L)
                {
                    throw new EndOfStreamException();
                }
                return(instance);
            }
            if (stream.get_Position() == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }