Example #1
0
            public override objectSleepingAvatar.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
            {
                uint   num;
                string str;

                this.PrepareBuilder();
                UnknownFieldSet.Builder builder = null;
                while (input.ReadTag(out num, out str))
                {
                    if (num == 0 && str != null)
                    {
                        int num1 = Array.BinarySearch <string>(objectSleepingAvatar._objectSleepingAvatarFieldNames, str, StringComparer.Ordinal);
                        if (num1 < 0)
                        {
                            if (builder == null)
                            {
                                builder = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                            }
                            this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                            continue;
                        }
                        else
                        {
                            num = objectSleepingAvatar._objectSleepingAvatarFieldTags[num1];
                        }
                    }
                    uint num2 = num;
                    if (num2 == 0)
                    {
                        throw InvalidProtocolBufferException.InvalidTag();
                    }
                    if (num2 == 8)
                    {
                        this.result.hasFootArmor = input.ReadInt32(ref this.result.footArmor_);
                    }
                    else if (num2 == 16)
                    {
                        this.result.hasLegArmor = input.ReadInt32(ref this.result.legArmor_);
                    }
                    else if (num2 == 24)
                    {
                        this.result.hasTorsoArmor = input.ReadInt32(ref this.result.torsoArmor_);
                    }
                    else if (num2 == 32)
                    {
                        this.result.hasHeadArmor = input.ReadInt32(ref this.result.headArmor_);
                    }
                    else if (num2 == 40)
                    {
                        this.result.hasTimestamp = input.ReadInt32(ref this.result.timestamp_);
                    }
                    else if (num2 == 50)
                    {
                        RustProto.Vitals.Builder builder1 = RustProto.Vitals.CreateBuilder();
                        if (this.result.hasVitals)
                        {
                            builder1.MergeFrom(this.Vitals);
                        }
                        input.ReadMessage(builder1, extensionRegistry);
                        this.Vitals = builder1.BuildPartial();
                    }
                    else
                    {
                        if (WireFormat.IsEndGroupTag(num))
                        {
                            if (builder != null)
                            {
                                this.UnknownFields = builder.Build();
                            }
                            return(this);
                        }
                        if (builder == null)
                        {
                            builder = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                        }
                        this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                    }
                }
                if (builder != null)
                {
                    this.UnknownFields = builder.Build();
                }
                return(this);
            }
Example #2
0
            public override Avatar.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
            {
                uint   num;
                string str;

                this.PrepareBuilder();
                UnknownFieldSet.Builder builder = null;
                while (input.ReadTag(ref num, ref str))
                {
                    if ((num == 0) && (str != null))
                    {
                        int index = Array.BinarySearch <string>(Avatar._avatarFieldNames, str, StringComparer.Ordinal);
                        if (index >= 0)
                        {
                            num = Avatar._avatarFieldTags[index];
                        }
                        else
                        {
                            if (builder == null)
                            {
                                builder = UnknownFieldSet.CreateBuilder(this.get_UnknownFields());
                            }
                            this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                            continue;
                        }
                    }
                    switch (num)
                    {
                    case 0:
                        throw InvalidProtocolBufferException.InvalidTag();

                    case 10:
                    {
                        Vector.Builder builder2 = Vector.CreateBuilder();
                        if (this.result.hasPos)
                        {
                            builder2.MergeFrom(this.Pos);
                        }
                        input.ReadMessage(builder2, extensionRegistry);
                        this.Pos = builder2.BuildPartial();
                        continue;
                    }

                    case 0x12:
                    {
                        Quaternion.Builder builder3 = Quaternion.CreateBuilder();
                        if (this.result.hasAng)
                        {
                            builder3.MergeFrom(this.Ang);
                        }
                        input.ReadMessage(builder3, extensionRegistry);
                        this.Ang = builder3.BuildPartial();
                        continue;
                    }

                    case 0x1a:
                    {
                        RustProto.Vitals.Builder builder4 = RustProto.Vitals.CreateBuilder();
                        if (this.result.hasVitals)
                        {
                            builder4.MergeFrom(this.Vitals);
                        }
                        input.ReadMessage(builder4, extensionRegistry);
                        this.Vitals = builder4.BuildPartial();
                        continue;
                    }

                    case 0x22:
                    {
                        input.ReadMessageArray <Blueprint>(num, str, this.result.blueprints_, Blueprint.DefaultInstance, extensionRegistry);
                        continue;
                    }

                    case 0x2a:
                    {
                        input.ReadMessageArray <Item>(num, str, this.result.inventory_, Item.DefaultInstance, extensionRegistry);
                        continue;
                    }

                    case 50:
                    {
                        input.ReadMessageArray <Item>(num, str, this.result.wearable_, Item.DefaultInstance, extensionRegistry);
                        continue;
                    }

                    case 0x3a:
                    {
                        input.ReadMessageArray <Item>(num, str, this.result.belt_, Item.DefaultInstance, extensionRegistry);
                        continue;
                    }

                    case 0x42:
                    {
                        RustProto.AwayEvent.Builder builder5 = RustProto.AwayEvent.CreateBuilder();
                        if (this.result.hasAwayEvent)
                        {
                            builder5.MergeFrom(this.AwayEvent);
                        }
                        input.ReadMessage(builder5, extensionRegistry);
                        this.AwayEvent = builder5.BuildPartial();
                        continue;
                    }
                    }
                    if (WireFormat.IsEndGroupTag(num))
                    {
                        if (builder != null)
                        {
                            this.set_UnknownFields(builder.Build());
                        }
                        return(this);
                    }
                    if (builder == null)
                    {
                        builder = UnknownFieldSet.CreateBuilder(this.get_UnknownFields());
                    }
                    this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                }
                if (builder != null)
                {
                    this.set_UnknownFields(builder.Build());
                }
                return(this);
            }
Example #3
0
            public override RustProto.Avatar.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
            {
                uint   num;
                string str;

                this.PrepareBuilder();
                UnknownFieldSet.Builder builder = null;
                while (input.ReadTag(out num, out str))
                {
                    if (num == 0 && str != null)
                    {
                        int num1 = Array.BinarySearch <string>(RustProto.Avatar._avatarFieldNames, str, StringComparer.Ordinal);
                        if (num1 < 0)
                        {
                            if (builder == null)
                            {
                                builder = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                            }
                            this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                            continue;
                        }
                        else
                        {
                            num = RustProto.Avatar._avatarFieldTags[num1];
                        }
                    }
                    uint num2 = num;
                    if (num2 == 0)
                    {
                        throw InvalidProtocolBufferException.InvalidTag();
                    }
                    if (num2 == 10)
                    {
                        Vector.Builder builder1 = Vector.CreateBuilder();
                        if (this.result.hasPos)
                        {
                            builder1.MergeFrom(this.Pos);
                        }
                        input.ReadMessage(builder1, extensionRegistry);
                        this.Pos = builder1.BuildPartial();
                    }
                    else if (num2 == 18)
                    {
                        Quaternion.Builder builder2 = Quaternion.CreateBuilder();
                        if (this.result.hasAng)
                        {
                            builder2.MergeFrom(this.Ang);
                        }
                        input.ReadMessage(builder2, extensionRegistry);
                        this.Ang = builder2.BuildPartial();
                    }
                    else if (num2 == 26)
                    {
                        RustProto.Vitals.Builder builder3 = RustProto.Vitals.CreateBuilder();
                        if (this.result.hasVitals)
                        {
                            builder3.MergeFrom(this.Vitals);
                        }
                        input.ReadMessage(builder3, extensionRegistry);
                        this.Vitals = builder3.BuildPartial();
                    }
                    else if (num2 == 34)
                    {
                        input.ReadMessageArray <RustProto.Blueprint>(num, str, this.result.blueprints_, RustProto.Blueprint.DefaultInstance, extensionRegistry);
                    }
                    else if (num2 == 42)
                    {
                        input.ReadMessageArray <RustProto.Item>(num, str, this.result.inventory_, RustProto.Item.DefaultInstance, extensionRegistry);
                    }
                    else if (num2 == 50)
                    {
                        input.ReadMessageArray <RustProto.Item>(num, str, this.result.wearable_, RustProto.Item.DefaultInstance, extensionRegistry);
                    }
                    else if (num2 == 58)
                    {
                        input.ReadMessageArray <RustProto.Item>(num, str, this.result.belt_, RustProto.Item.DefaultInstance, extensionRegistry);
                    }
                    else if (num2 == 66)
                    {
                        RustProto.AwayEvent.Builder builder4 = RustProto.AwayEvent.CreateBuilder();
                        if (this.result.hasAwayEvent)
                        {
                            builder4.MergeFrom(this.AwayEvent);
                        }
                        input.ReadMessage(builder4, extensionRegistry);
                        this.AwayEvent = builder4.BuildPartial();
                    }
                    else
                    {
                        if (WireFormat.IsEndGroupTag(num))
                        {
                            if (builder != null)
                            {
                                this.UnknownFields = builder.Build();
                            }
                            return(this);
                        }
                        if (builder == null)
                        {
                            builder = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                        }
                        this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                    }
                }
                if (builder != null)
                {
                    this.UnknownFields = builder.Build();
                }
                return(this);
            }
Example #4
0
            public override objectSleepingAvatar.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
            {
                uint   num;
                string str;

                this.PrepareBuilder();
                UnknownFieldSet.Builder builder = null;
                while (input.ReadTag(ref num, ref str))
                {
                    if ((num == 0) && (str != null))
                    {
                        int index = Array.BinarySearch <string>(objectSleepingAvatar._objectSleepingAvatarFieldNames, str, StringComparer.Ordinal);
                        if (index >= 0)
                        {
                            num = objectSleepingAvatar._objectSleepingAvatarFieldTags[index];
                        }
                        else
                        {
                            if (builder == null)
                            {
                                builder = UnknownFieldSet.CreateBuilder(this.get_UnknownFields());
                            }
                            this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                            continue;
                        }
                    }
                    switch (num)
                    {
                    case 0:
                        throw InvalidProtocolBufferException.InvalidTag();

                    case 8:
                    {
                        this.result.hasFootArmor = input.ReadInt32(ref this.result.footArmor_);
                        continue;
                    }

                    case 0x10:
                    {
                        this.result.hasLegArmor = input.ReadInt32(ref this.result.legArmor_);
                        continue;
                    }

                    case 0x18:
                    {
                        this.result.hasTorsoArmor = input.ReadInt32(ref this.result.torsoArmor_);
                        continue;
                    }

                    case 0x20:
                    {
                        this.result.hasHeadArmor = input.ReadInt32(ref this.result.headArmor_);
                        continue;
                    }

                    case 40:
                    {
                        this.result.hasTimestamp = input.ReadInt32(ref this.result.timestamp_);
                        continue;
                    }

                    case 50:
                    {
                        RustProto.Vitals.Builder builder2 = RustProto.Vitals.CreateBuilder();
                        if (this.result.hasVitals)
                        {
                            builder2.MergeFrom(this.Vitals);
                        }
                        input.ReadMessage(builder2, extensionRegistry);
                        this.Vitals = builder2.BuildPartial();
                        continue;
                    }
                    }
                    if (WireFormat.IsEndGroupTag(num))
                    {
                        if (builder != null)
                        {
                            this.set_UnknownFields(builder.Build());
                        }
                        return(this);
                    }
                    if (builder == null)
                    {
                        builder = UnknownFieldSet.CreateBuilder(this.get_UnknownFields());
                    }
                    this.ParseUnknownField(input, builder, extensionRegistry, num, str);
                }
                if (builder != null)
                {
                    this.set_UnknownFields(builder.Build());
                }
                return(this);
            }