context: // Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48.  DO NOT EDIT!
  #pragma warning disable 1591
  #region Designer generated code
  
  using pb = global::Google.ProtocolBuffers;
  using pbc = global::Google.ProtocolBuffers.Collections;
  using pbd = global::Google.ProtocolBuffers.Descriptors;
  using scg = global::System.Collections.Generic;
  namespace bnet.protocol.presence {
    
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
    public static partial class Presence {
    
      #region Extension registration
      public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
      }
      #endregion
      #region Static variables
      internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor;
      internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.SubscribeRequest, global::bnet.protocol.presence.SubscribeRequest.Builder> internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable;
      internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor;
      internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.UnsubscribeRequest, global::bnet.protocol.presence.UnsubscribeRequest.Builder> internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable;
      internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_UpdateRequest__Descriptor;
      internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.UpdateRequest, global::bnet.protocol.presence.UpdateRequest.Builder> internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable;
      internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_QueryRequest__Descriptor;
      internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.QueryRequest, global::bnet.protocol.presence.QueryRequest.Builder> internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable;
      internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_QueryResponse__Descriptor;
      internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.QueryResponse, global::bnet.protocol.presence.QueryResponse.Builder> internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable;
      #endregion
      #region Descriptor
      public static pbd::FileDescriptor Descriptor {
        get { return descriptor; }
      }
      private static pbd::FileDescriptor descriptor;
      
      static Presence() {
        byte[] descriptorData = global::System.Convert.FromBase64String(
            "Ch9zZXJ2aWNlL3ByZXNlbmNlL3ByZXNlbmNlLnByb3RvEhZibmV0LnByb3Rv" + 
            "Y29sLnByZXNlbmNlGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3RvGhls" + 
            "aWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGhFsaWIvcnBjL3JwYy5wcm90bxol" + 
            "c2VydmljZS9wcmVzZW5jZS9wcmVzZW5jZV90eXBlcy5wcm90byJ8ChBTdWJz" + 
            "Y3JpYmVSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2Nv" + 
            "bC5FbnRpdHlJZBIqCgllbnRpdHlfaWQYAiACKAsyFy5ibmV0LnByb3RvY29s" + 
            "LkVudGl0eUlkEhEKCW9iamVjdF9pZBgDIAIoBCJrChJVbnN1YnNjcmliZVJl" + 
            "cXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0" + 
            "eUlkEioKCWVudGl0eV9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + 
            "SWQifAoNVXBkYXRlUmVxdWVzdBIqCgllbnRpdHlfaWQYASACKAsyFy5ibmV0" + 
            "LnByb3RvY29sLkVudGl0eUlkEj8KD2ZpZWxkX29wZXJhdGlvbhgCIAMoCzIm" + 
            "LmJuZXQucHJvdG9jb2wucHJlc2VuY2UuRmllbGRPcGVyYXRpb24iaQoMUXVl" + 
            "cnlSZXF1ZXN0EioKCWVudGl0eV9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wu" + 
            "RW50aXR5SWQSLQoDa2V5GAIgAygLMiAuYm5ldC5wcm90b2NvbC5wcmVzZW5j" + 
            "ZS5GaWVsZEtleSI9Cg1RdWVyeVJlc3BvbnNlEiwKBWZpZWxkGAIgAygLMh0u" + 
            "Ym5ldC5wcm90b2NvbC5wcmVzZW5jZS5GaWVsZDLnAgoPUHJlc2VuY2VTZXJ2" + 
            "aWNlElIKCVN1YnNjcmliZRIoLmJuZXQucHJvdG9jb2wucHJlc2VuY2UuU3Vi" + 
            "c2NyaWJlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgBElYK" + 
            "C1Vuc3Vic2NyaWJlEiouYm5ldC5wcm90b2NvbC5wcmVzZW5jZS5VbnN1YnNj" + 
            "cmliZVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAhJMCgZV" + 
            "cGRhdGUSJS5ibmV0LnByb3RvY29sLnByZXNlbmNlLlVwZGF0ZVJlcXVlc3Qa" + 
            "FS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAxJaCgVRdWVyeRIkLmJuZXQu" + 
            "cHJvdG9jb2wucHJlc2VuY2UuUXVlcnlSZXF1ZXN0GiUuYm5ldC5wcm90b2Nv" + 
            "bC5wcmVzZW5jZS5RdWVyeVJlc3BvbnNlIgSAtRgEQgOAAQA=");
        pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
          descriptor = root;
          internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor = Descriptor.MessageTypes[0];
          internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable = 
              new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.SubscribeRequest, global::bnet.protocol.presence.SubscribeRequest.Builder>(internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor,
                  new string[] { "AgentId", "EntityId", "ObjectId", });
          internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor = Descriptor.MessageTypes[1];
          internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable = 
              new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.UnsubscribeRequest, global::bnet.protocol.presence.UnsubscribeRequest.Builder>(internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor,
                  new string[] { "AgentId", "EntityId", });
          internal__static_bnet_protocol_presence_UpdateRequest__Descriptor = Descriptor.MessageTypes[2];
          internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable = 
              new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.UpdateRequest, global::bnet.protocol.presence.UpdateRequest.Builder>(internal__static_bnet_protocol_presence_UpdateRequest__Descriptor,
                  new string[] { "EntityId", "FieldOperation", });
          internal__static_bnet_protocol_presence_QueryRequest__Descriptor = Descriptor.MessageTypes[3];
          internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable = 
              new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.QueryRequest, global::bnet.protocol.presence.QueryRequest.Builder>(internal__static_bnet_protocol_presence_QueryRequest__Descriptor,
                  new string[] { "EntityId", "Key", });
          internal__static_bnet_protocol_presence_QueryResponse__Descriptor = Descriptor.MessageTypes[4];
          internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable = 
              new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.presence.QueryResponse, global::bnet.protocol.presence.QueryResponse.Builder>(internal__static_bnet_protocol_presence_QueryResponse__Descriptor,
                  new string[] { "Field", });
          pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
          RegisterAllExtensions(registry);
          global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry);
          global::bnet.protocol.Entity.RegisterAllExtensions(registry);
          global::bnet.protocol.Rpc.RegisterAllExtensions(registry);
          global::bnet.protocol.presence.PresenceTypes.RegisterAllExtensions(registry);
          return registry;
        };
        pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
            new pbd::FileDescriptor[] {
            global::bnet.protocol.attribute.Proto.Attribute.Descriptor, 
            global::bnet.protocol.Entity.Descriptor, 
            global::bnet.protocol.Rpc.Descriptor, 
            global::bnet.protocol.presence.PresenceTypes.Descriptor, 
            }, assigner);
      }
      #endregion
      
    }
    #region Messages
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
    public sealed partial class SubscribeRequest : pb::GeneratedMessage<SubscribeRequest, SubscribeRequest.Builder> {
      private static readonly SubscribeRequest defaultInstance = new Builder().BuildPartial();
      private static readonly string[] _subscribeRequestFieldNames = new string[] { "agent_id", "entity_id", "object_id" };
      private static readonly uint[] _subscribeRequestFieldTags = new uint[] { 10, 18, 24 };
      public static SubscribeRequest DefaultInstance {
        get { return defaultInstance; }
      }
      
      public override SubscribeRequest DefaultInstanceForType {
        get { return defaultInstance; }
      }
      
      protected override SubscribeRequest ThisMessage {
        get { return this; }
      }
      
      public static pbd::MessageDescriptor Descriptor {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor; }
      }
      
      protected override pb::FieldAccess.FieldAccessorTable<SubscribeRequest, SubscribeRequest.Builder> InternalFieldAccessors {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable; }
      }
      
      public const int AgentIdFieldNumber = 1;
      private bool hasAgentId;
      private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance;
      public bool HasAgentId {
        get { return hasAgentId; }
      }
      public global::bnet.protocol.EntityId AgentId {
        get { return agentId_; }
      }
      
      public const int EntityIdFieldNumber = 2;
      private bool hasEntityId;
      private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
      public bool HasEntityId {
        get { return hasEntityId; }
      }
      public global::bnet.protocol.EntityId EntityId {
        get { return entityId_; }
      }
      
      public const int ObjectIdFieldNumber = 3;
      private bool hasObjectId;
      private ulong objectId_;
      public bool HasObjectId {
        get { return hasObjectId; }
      }
      public ulong ObjectId {
        get { return objectId_; }
      }
      
      public override bool IsInitialized {
        get {
          if (!hasEntityId) return false;
          if (!hasObjectId) return false;
          if (HasAgentId) {
            if (!AgentId.IsInitialized) return false;
          }
          if (!EntityId.IsInitialized) return false;
          return true;
        }
      }
      
      public override void WriteTo(pb::ICodedOutputStream output) {
        int size = SerializedSize;
        string[] field_names = _subscribeRequestFieldNames;
        if (hasAgentId) {
          output.WriteMessage(1, field_names[0], AgentId);
        }
        if (hasEntityId) {
          output.WriteMessage(2, field_names[1], EntityId);
        }
        if (hasObjectId) {
          output.WriteUInt64(3, field_names[2], ObjectId);
        }
        UnknownFields.WriteTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public override int SerializedSize {
        get {
          int size = memoizedSerializedSize;
          if (size != -1) return size;
          
          size = 0;
          if (hasAgentId) {
            size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId);
          }
          if (hasEntityId) {
            size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId);
          }
          if (hasObjectId) {
            size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId);
          }
          size += UnknownFields.SerializedSize;
          memoizedSerializedSize = size;
          return size;
        }
      }
      
      public static SubscribeRequest ParseFrom(pb::ByteString data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static SubscribeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static SubscribeRequest ParseFrom(byte[] data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static SubscribeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static SubscribeRequest ParseFrom(global::System.IO.Stream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static SubscribeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input) {
        return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
      }
      public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
      }
      public static SubscribeRequest ParseFrom(pb::ICodedInputStream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static SubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static Builder CreateBuilder() { return new Builder(); }
      public override Builder ToBuilder() { return CreateBuilder(this); }
      public override Builder CreateBuilderForType() { return new Builder(); }
      public static Builder CreateBuilder(SubscribeRequest prototype) {
        return (Builder) new Builder().MergeFrom(prototype);
      }
      
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
      [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
      public sealed partial class Builder : pb::GeneratedBuilder<SubscribeRequest, Builder> {
        protected override Builder ThisBuilder {
          get { return this; }
        }
        public Builder() {}
        
        SubscribeRequest result = new SubscribeRequest();
        
        protected override SubscribeRequest MessageBeingBuilt {
          get { return result; }
        }
        
        public override Builder Clear() {
          result = new SubscribeRequest();
          return this;
        }
        
        public override Builder Clone() {
          return new Builder().MergeFrom(result);
        }
        
        public override pbd::MessageDescriptor DescriptorForType {
          get { return global::bnet.protocol.presence.SubscribeRequest.Descriptor; }
        }
        
        public override SubscribeRequest DefaultInstanceForType {
          get { return global::bnet.protocol.presence.SubscribeRequest.DefaultInstance; }
        }
        
        public override SubscribeRequest BuildPartial() {
          if (result == null) {
            throw new global::System.InvalidOperationException("build() has already been called on this Builder");
          }
          SubscribeRequest returnMe = result;
          result = null;
          return returnMe;
        }
        
        public override Builder MergeFrom(pb::IMessage other) {
          if (other is SubscribeRequest) {
            return MergeFrom((SubscribeRequest) other);
          } else {
            base.MergeFrom(other);
            return this;
          }
        }
        
        public override Builder MergeFrom(SubscribeRequest other) {
          if (other == global::bnet.protocol.presence.SubscribeRequest.DefaultInstance) return this;
          if (other.HasAgentId) {
            MergeAgentId(other.AgentId);
          }
          if (other.HasEntityId) {
            MergeEntityId(other.EntityId);
          }
          if (other.HasObjectId) {
            ObjectId = other.ObjectId;
          }
          this.MergeUnknownFields(other.UnknownFields);
          return this;
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input) {
          return MergeFrom(input, pb::ExtensionRegistry.Empty);
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
          pb::UnknownFieldSet.Builder unknownFields = null;
          uint tag;
          string field_name;
          while (input.ReadTag(out tag, out field_name)) {
            if(tag == 0 && field_name != null) {
              int field_ordinal = global::System.Array.BinarySearch(_subscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal);
              if(field_ordinal >= 0)
                tag = _subscribeRequestFieldTags[field_ordinal];
              else {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                continue;
              }
            }
            switch (tag) {
              case 0: {
                throw pb::InvalidProtocolBufferException.InvalidTag();
              }
              default: {
                if (pb::WireFormat.IsEndGroupTag(tag)) {
                  if (unknownFields != null) {
                    this.UnknownFields = unknownFields.Build();
                  }
                  return this;
                }
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                break;
              }
              case 10: {
                global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder();
                if (result.hasAgentId) {
                  subBuilder.MergeFrom(AgentId);
                }
                input.ReadMessage(subBuilder, extensionRegistry);
                AgentId = subBuilder.BuildPartial();
                break;
              }
              case 18: {
                global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder();
                if (result.hasEntityId) {
                  subBuilder.MergeFrom(EntityId);
                }
                input.ReadMessage(subBuilder, extensionRegistry);
                EntityId = subBuilder.BuildPartial();
                break;
              }
              case 24: {
                result.hasObjectId = input.ReadUInt64(ref result.objectId_);
                break;
              }
            }
          }
          
          if (unknownFields != null) {
            this.UnknownFields = unknownFields.Build();
          }
          return this;
        }
        
        
        public bool HasAgentId {
         get { return result.hasAgentId; }
        }
        public global::bnet.protocol.EntityId AgentId {
          get { return result.AgentId; }
          set { SetAgentId(value); }
        }
        public Builder SetAgentId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.hasAgentId = true;
          result.agentId_ = value;
          return this;
        }
        public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.hasAgentId = true;
          result.agentId_ = builderForValue.Build();
          return this;
        }
        public Builder MergeAgentId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          if (result.hasAgentId &&
              result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) {
              result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial();
          } else {
            result.agentId_ = value;
          }
          result.hasAgentId = true;
          return this;
        }
        public Builder ClearAgentId() {
          result.hasAgentId = false;
          result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance;
          return this;
        }
        
        public bool HasEntityId {
         get { return result.hasEntityId; }
        }
        public global::bnet.protocol.EntityId EntityId {
          get { return result.EntityId; }
          set { SetEntityId(value); }
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.hasEntityId = true;
          result.entityId_ = value;
          return this;
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.hasEntityId = true;
          result.entityId_ = builderForValue.Build();
          return this;
        }
        public Builder MergeEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          if (result.hasEntityId &&
              result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) {
              result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial();
          } else {
            result.entityId_ = value;
          }
          result.hasEntityId = true;
          return this;
        }
        public Builder ClearEntityId() {
          result.hasEntityId = false;
          result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
          return this;
        }
        
        public bool HasObjectId {
          get { return result.hasObjectId; }
        }
        public ulong ObjectId {
          get { return result.ObjectId; }
          set { SetObjectId(value); }
        }
        public Builder SetObjectId(ulong value) {
          result.hasObjectId = true;
          result.objectId_ = value;
          return this;
        }
        public Builder ClearObjectId() {
          result.hasObjectId = false;
          result.objectId_ = 0UL;
          return this;
        }
      }
      static SubscribeRequest() {
        object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null);
      }
    }
    
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
    public sealed partial class UnsubscribeRequest : pb::GeneratedMessage<UnsubscribeRequest, UnsubscribeRequest.Builder> {
      private static readonly UnsubscribeRequest defaultInstance = new Builder().BuildPartial();
      private static readonly string[] _unsubscribeRequestFieldNames = new string[] { "agent_id", "entity_id" };
      private static readonly uint[] _unsubscribeRequestFieldTags = new uint[] { 10, 18 };
      public static UnsubscribeRequest DefaultInstance {
        get { return defaultInstance; }
      }
      
      public override UnsubscribeRequest DefaultInstanceForType {
        get { return defaultInstance; }
      }
      
      protected override UnsubscribeRequest ThisMessage {
        get { return this; }
      }
      
      public static pbd::MessageDescriptor Descriptor {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor; }
      }
      
      protected override pb::FieldAccess.FieldAccessorTable<UnsubscribeRequest, UnsubscribeRequest.Builder> InternalFieldAccessors {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable; }
      }
      
      public const int AgentIdFieldNumber = 1;
      private bool hasAgentId;
      private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance;
      public bool HasAgentId {
        get { return hasAgentId; }
      }
      public global::bnet.protocol.EntityId AgentId {
        get { return agentId_; }
      }
      
      public const int EntityIdFieldNumber = 2;
      private bool hasEntityId;
      private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
      public bool HasEntityId {
        get { return hasEntityId; }
      }
      public global::bnet.protocol.EntityId EntityId {
        get { return entityId_; }
      }
      
      public override bool IsInitialized {
        get {
          if (!hasEntityId) return false;
          if (HasAgentId) {
            if (!AgentId.IsInitialized) return false;
          }
          if (!EntityId.IsInitialized) return false;
          return true;
        }
      }
      
      public override void WriteTo(pb::ICodedOutputStream output) {
        int size = SerializedSize;
        string[] field_names = _unsubscribeRequestFieldNames;
        if (hasAgentId) {
          output.WriteMessage(1, field_names[0], AgentId);
        }
        if (hasEntityId) {
          output.WriteMessage(2, field_names[1], EntityId);
        }
        UnknownFields.WriteTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public override int SerializedSize {
        get {
          int size = memoizedSerializedSize;
          if (size != -1) return size;
          
          size = 0;
          if (hasAgentId) {
            size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId);
          }
          if (hasEntityId) {
            size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId);
          }
          size += UnknownFields.SerializedSize;
          memoizedSerializedSize = size;
          return size;
        }
      }
      
      public static UnsubscribeRequest ParseFrom(pb::ByteString data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static UnsubscribeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static UnsubscribeRequest ParseFrom(byte[] data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static UnsubscribeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static UnsubscribeRequest ParseFrom(global::System.IO.Stream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static UnsubscribeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input) {
        return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
      }
      public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
      }
      public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static Builder CreateBuilder() { return new Builder(); }
      public override Builder ToBuilder() { return CreateBuilder(this); }
      public override Builder CreateBuilderForType() { return new Builder(); }
      public static Builder CreateBuilder(UnsubscribeRequest prototype) {
        return (Builder) new Builder().MergeFrom(prototype);
      }
      
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
      [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
      public sealed partial class Builder : pb::GeneratedBuilder<UnsubscribeRequest, Builder> {
        protected override Builder ThisBuilder {
          get { return this; }
        }
        public Builder() {}
        
        UnsubscribeRequest result = new UnsubscribeRequest();
        
        protected override UnsubscribeRequest MessageBeingBuilt {
          get { return result; }
        }
        
        public override Builder Clear() {
          result = new UnsubscribeRequest();
          return this;
        }
        
        public override Builder Clone() {
          return new Builder().MergeFrom(result);
        }
        
        public override pbd::MessageDescriptor DescriptorForType {
          get { return global::bnet.protocol.presence.UnsubscribeRequest.Descriptor; }
        }
        
        public override UnsubscribeRequest DefaultInstanceForType {
          get { return global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance; }
        }
        
        public override UnsubscribeRequest BuildPartial() {
          if (result == null) {
            throw new global::System.InvalidOperationException("build() has already been called on this Builder");
          }
          UnsubscribeRequest returnMe = result;
          result = null;
          return returnMe;
        }
        
        public override Builder MergeFrom(pb::IMessage other) {
          if (other is UnsubscribeRequest) {
            return MergeFrom((UnsubscribeRequest) other);
          } else {
            base.MergeFrom(other);
            return this;
          }
        }
        
        public override Builder MergeFrom(UnsubscribeRequest other) {
          if (other == global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance) return this;
          if (other.HasAgentId) {
            MergeAgentId(other.AgentId);
          }
          if (other.HasEntityId) {
            MergeEntityId(other.EntityId);
          }
          this.MergeUnknownFields(other.UnknownFields);
          return this;
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input) {
          return MergeFrom(input, pb::ExtensionRegistry.Empty);
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
          pb::UnknownFieldSet.Builder unknownFields = null;
          uint tag;
          string field_name;
          while (input.ReadTag(out tag, out field_name)) {
            if(tag == 0 && field_name != null) {
              int field_ordinal = global::System.Array.BinarySearch(_unsubscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal);
              if(field_ordinal >= 0)
                tag = _unsubscribeRequestFieldTags[field_ordinal];
              else {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                continue;
              }
            }
            switch (tag) {
              case 0: {
                throw pb::InvalidProtocolBufferException.InvalidTag();
              }
              default: {
                if (pb::WireFormat.IsEndGroupTag(tag)) {
                  if (unknownFields != null) {
                    this.UnknownFields = unknownFields.Build();
                  }
                  return this;
                }
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                break;
              }
              case 10: {
                global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder();
                if (result.hasAgentId) {
                  subBuilder.MergeFrom(AgentId);
                }
                input.ReadMessage(subBuilder, extensionRegistry);
                AgentId = subBuilder.BuildPartial();
                break;
              }
              case 18: {
                global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder();
                if (result.hasEntityId) {
                  subBuilder.MergeFrom(EntityId);
                }
                input.ReadMessage(subBuilder, extensionRegistry);
                EntityId = subBuilder.BuildPartial();
                break;
              }
            }
          }
          
          if (unknownFields != null) {
            this.UnknownFields = unknownFields.Build();
          }
          return this;
        }
        
        
        public bool HasAgentId {
         get { return result.hasAgentId; }
        }
        public global::bnet.protocol.EntityId AgentId {
          get { return result.AgentId; }
          set { SetAgentId(value); }
        }
        public Builder SetAgentId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.hasAgentId = true;
          result.agentId_ = value;
          return this;
        }
        public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.hasAgentId = true;
          result.agentId_ = builderForValue.Build();
          return this;
        }
        public Builder MergeAgentId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          if (result.hasAgentId &&
              result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) {
              result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial();
          } else {
            result.agentId_ = value;
          }
          result.hasAgentId = true;
          return this;
        }
        public Builder ClearAgentId() {
          result.hasAgentId = false;
          result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance;
          return this;
        }
        
        public bool HasEntityId {
         get { return result.hasEntityId; }
        }
        public global::bnet.protocol.EntityId EntityId {
          get { return result.EntityId; }
          set { SetEntityId(value); }
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.hasEntityId = true;
          result.entityId_ = value;
          return this;
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.hasEntityId = true;
          result.entityId_ = builderForValue.Build();
          return this;
        }
        public Builder MergeEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          if (result.hasEntityId &&
              result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) {
              result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial();
          } else {
            result.entityId_ = value;
          }
          result.hasEntityId = true;
          return this;
        }
        public Builder ClearEntityId() {
          result.hasEntityId = false;
          result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
          return this;
        }
      }
      static UnsubscribeRequest() {
        object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null);
      }
    }
    
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
    public sealed partial class UpdateRequest : pb::GeneratedMessage<UpdateRequest, UpdateRequest.Builder> {
      private static readonly UpdateRequest defaultInstance = new Builder().BuildPartial();
      private static readonly string[] _updateRequestFieldNames = new string[] { "entity_id", "field_operation" };
      private static readonly uint[] _updateRequestFieldTags = new uint[] { 10, 18 };
      public static UpdateRequest DefaultInstance {
        get { return defaultInstance; }
      }
      
      public override UpdateRequest DefaultInstanceForType {
        get { return defaultInstance; }
      }
      
      protected override UpdateRequest ThisMessage {
        get { return this; }
      }
      
      public static pbd::MessageDescriptor Descriptor {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UpdateRequest__Descriptor; }
      }
      
      protected override pb::FieldAccess.FieldAccessorTable<UpdateRequest, UpdateRequest.Builder> InternalFieldAccessors {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable; }
      }
      
      public const int EntityIdFieldNumber = 1;
      private bool hasEntityId;
      private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
      public bool HasEntityId {
        get { return hasEntityId; }
      }
      public global::bnet.protocol.EntityId EntityId {
        get { return entityId_; }
      }
      
      public const int FieldOperationFieldNumber = 2;
      private pbc::PopsicleList<global::bnet.protocol.presence.FieldOperation> fieldOperation_ = new pbc::PopsicleList<global::bnet.protocol.presence.FieldOperation>();
      public scg::IList<global::bnet.protocol.presence.FieldOperation> FieldOperationList {
        get { return fieldOperation_; }
      }
      public int FieldOperationCount {
        get { return fieldOperation_.Count; }
      }
      public global::bnet.protocol.presence.FieldOperation GetFieldOperation(int index) {
        return fieldOperation_[index];
      }
      
      public override bool IsInitialized {
        get {
          if (!hasEntityId) return false;
          if (!EntityId.IsInitialized) return false;
          foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) {
            if (!element.IsInitialized) return false;
          }
          return true;
        }
      }
      
      public override void WriteTo(pb::ICodedOutputStream output) {
        int size = SerializedSize;
        string[] field_names = _updateRequestFieldNames;
        if (hasEntityId) {
          output.WriteMessage(1, field_names[0], EntityId);
        }
        if (fieldOperation_.Count > 0) {
          output.WriteMessageArray(2, field_names[1], fieldOperation_);
        }
        UnknownFields.WriteTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public override int SerializedSize {
        get {
          int size = memoizedSerializedSize;
          if (size != -1) return size;
          
          size = 0;
          if (hasEntityId) {
            size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId);
          }
          foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) {
            size += pb::CodedOutputStream.ComputeMessageSize(2, element);
          }
          size += UnknownFields.SerializedSize;
          memoizedSerializedSize = size;
          return size;
        }
      }
      
      public static UpdateRequest ParseFrom(pb::ByteString data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static UpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static UpdateRequest ParseFrom(byte[] data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static UpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static UpdateRequest ParseFrom(global::System.IO.Stream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static UpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static UpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) {
        return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
      }
      public static UpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
      }
      public static UpdateRequest ParseFrom(pb::ICodedInputStream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static UpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static Builder CreateBuilder() { return new Builder(); }
      public override Builder ToBuilder() { return CreateBuilder(this); }
      public override Builder CreateBuilderForType() { return new Builder(); }
      public static Builder CreateBuilder(UpdateRequest prototype) {
        return (Builder) new Builder().MergeFrom(prototype);
      }
      
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
      [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
      public sealed partial class Builder : pb::GeneratedBuilder<UpdateRequest, Builder> {
        protected override Builder ThisBuilder {
          get { return this; }
        }
        public Builder() {}
        
        UpdateRequest result = new UpdateRequest();
        
        protected override UpdateRequest MessageBeingBuilt {
          get { return result; }
        }
        
        public override Builder Clear() {
          result = new UpdateRequest();
          return this;
        }
        
        public override Builder Clone() {
          return new Builder().MergeFrom(result);
        }
        
        public override pbd::MessageDescriptor DescriptorForType {
          get { return global::bnet.protocol.presence.UpdateRequest.Descriptor; }
        }
        
        public override UpdateRequest DefaultInstanceForType {
          get { return global::bnet.protocol.presence.UpdateRequest.DefaultInstance; }
        }
        
        public override UpdateRequest BuildPartial() {
          if (result == null) {
            throw new global::System.InvalidOperationException("build() has already been called on this Builder");
          }
          result.fieldOperation_.MakeReadOnly();
          UpdateRequest returnMe = result;
          result = null;
          return returnMe;
        }
        
        public override Builder MergeFrom(pb::IMessage other) {
          if (other is UpdateRequest) {
            return MergeFrom((UpdateRequest) other);
          } else {
            base.MergeFrom(other);
            return this;
          }
        }
        
        public override Builder MergeFrom(UpdateRequest other) {
          if (other == global::bnet.protocol.presence.UpdateRequest.DefaultInstance) return this;
          if (other.HasEntityId) {
            MergeEntityId(other.EntityId);
          }
          if (other.fieldOperation_.Count != 0) {
            base.AddRange(other.fieldOperation_, result.fieldOperation_);
          }
          this.MergeUnknownFields(other.UnknownFields);
          return this;
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input) {
          return MergeFrom(input, pb::ExtensionRegistry.Empty);
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
          pb::UnknownFieldSet.Builder unknownFields = null;
          uint tag;
          string field_name;
          while (input.ReadTag(out tag, out field_name)) {
            if(tag == 0 && field_name != null) {
              int field_ordinal = global::System.Array.BinarySearch(_updateRequestFieldNames, field_name, global::System.StringComparer.Ordinal);
              if(field_ordinal >= 0)
                tag = _updateRequestFieldTags[field_ordinal];
              else {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                continue;
              }
            }
            switch (tag) {
              case 0: {
                throw pb::InvalidProtocolBufferException.InvalidTag();
              }
              default: {
                if (pb::WireFormat.IsEndGroupTag(tag)) {
                  if (unknownFields != null) {
                    this.UnknownFields = unknownFields.Build();
                  }
                  return this;
                }
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                break;
              }
              case 10: {
                global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder();
                if (result.hasEntityId) {
                  subBuilder.MergeFrom(EntityId);
                }
                input.ReadMessage(subBuilder, extensionRegistry);
                EntityId = subBuilder.BuildPartial();
                break;
              }
              case 18: {
                input.ReadMessageArray(tag, field_name, result.fieldOperation_, global::bnet.protocol.presence.FieldOperation.DefaultInstance, extensionRegistry);
                break;
              }
            }
          }
          
          if (unknownFields != null) {
            this.UnknownFields = unknownFields.Build();
          }
          return this;
        }
        
        
        public bool HasEntityId {
         get { return result.hasEntityId; }
        }
        public global::bnet.protocol.EntityId EntityId {
          get { return result.EntityId; }
          set { SetEntityId(value); }
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.hasEntityId = true;
          result.entityId_ = value;
          return this;
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.hasEntityId = true;
          result.entityId_ = builderForValue.Build();
          return this;
        }
        public Builder MergeEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          if (result.hasEntityId &&
              result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) {
              result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial();
          } else {
            result.entityId_ = value;
          }
          result.hasEntityId = true;
          return this;
        }
        public Builder ClearEntityId() {
          result.hasEntityId = false;
          result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
          return this;
        }
        
        public pbc::IPopsicleList<global::bnet.protocol.presence.FieldOperation> FieldOperationList {
          get { return result.fieldOperation_; }
        }
        public int FieldOperationCount {
          get { return result.FieldOperationCount; }
        }
        public global::bnet.protocol.presence.FieldOperation GetFieldOperation(int index) {
          return result.GetFieldOperation(index);
        }
        public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.fieldOperation_[index] = value;
          return this;
        }
        public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.fieldOperation_[index] = builderForValue.Build();
          return this;
        }
        public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.fieldOperation_.Add(value);
          return this;
        }
        public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.fieldOperation_.Add(builderForValue.Build());
          return this;
        }
        public Builder AddRangeFieldOperation(scg::IEnumerable<global::bnet.protocol.presence.FieldOperation> values) {
          base.AddRange(values, result.fieldOperation_);
          return this;
        }
        public Builder ClearFieldOperation() {
          result.fieldOperation_.Clear();
          return this;
        }
      }
      static UpdateRequest() {
        object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null);
      }
    }
    
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
    public sealed partial class QueryRequest : pb::GeneratedMessage<QueryRequest, QueryRequest.Builder> {
      private static readonly QueryRequest defaultInstance = new Builder().BuildPartial();
      private static readonly string[] _queryRequestFieldNames = new string[] { "entity_id", "key" };
      private static readonly uint[] _queryRequestFieldTags = new uint[] { 10, 18 };
      public static QueryRequest DefaultInstance {
        get { return defaultInstance; }
      }
      
      public override QueryRequest DefaultInstanceForType {
        get { return defaultInstance; }
      }
      
      protected override QueryRequest ThisMessage {
        get { return this; }
      }
      
      public static pbd::MessageDescriptor Descriptor {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryRequest__Descriptor; }
      }
      
      protected override pb::FieldAccess.FieldAccessorTable<QueryRequest, QueryRequest.Builder> InternalFieldAccessors {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable; }
      }
      
      public const int EntityIdFieldNumber = 1;
      private bool hasEntityId;
      private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
      public bool HasEntityId {
        get { return hasEntityId; }
      }
      public global::bnet.protocol.EntityId EntityId {
        get { return entityId_; }
      }
      
      public const int KeyFieldNumber = 2;
      private pbc::PopsicleList<global::bnet.protocol.presence.FieldKey> key_ = new pbc::PopsicleList<global::bnet.protocol.presence.FieldKey>();
      public scg::IList<global::bnet.protocol.presence.FieldKey> KeyList {
        get { return key_; }
      }
      public int KeyCount {
        get { return key_.Count; }
      }
      public global::bnet.protocol.presence.FieldKey GetKey(int index) {
        return key_[index];
      }
      
      public override bool IsInitialized {
        get {
          if (!hasEntityId) return false;
          if (!EntityId.IsInitialized) return false;
          foreach (global::bnet.protocol.presence.FieldKey element in KeyList) {
            if (!element.IsInitialized) return false;
          }
          return true;
        }
      }
      
      public override void WriteTo(pb::ICodedOutputStream output) {
        int size = SerializedSize;
        string[] field_names = _queryRequestFieldNames;
        if (hasEntityId) {
          output.WriteMessage(1, field_names[0], EntityId);
        }
        if (key_.Count > 0) {
          output.WriteMessageArray(2, field_names[1], key_);
        }
        UnknownFields.WriteTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public override int SerializedSize {
        get {
          int size = memoizedSerializedSize;
          if (size != -1) return size;
          
          size = 0;
          if (hasEntityId) {
            size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId);
          }
          foreach (global::bnet.protocol.presence.FieldKey element in KeyList) {
            size += pb::CodedOutputStream.ComputeMessageSize(2, element);
          }
          size += UnknownFields.SerializedSize;
          memoizedSerializedSize = size;
          return size;
        }
      }
      
      public static QueryRequest ParseFrom(pb::ByteString data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static QueryRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static QueryRequest ParseFrom(byte[] data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static QueryRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static QueryRequest ParseFrom(global::System.IO.Stream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static QueryRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static QueryRequest ParseDelimitedFrom(global::System.IO.Stream input) {
        return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
      }
      public static QueryRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
      }
      public static QueryRequest ParseFrom(pb::ICodedInputStream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static QueryRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static Builder CreateBuilder() { return new Builder(); }
      public override Builder ToBuilder() { return CreateBuilder(this); }
      public override Builder CreateBuilderForType() { return new Builder(); }
      public static Builder CreateBuilder(QueryRequest prototype) {
        return (Builder) new Builder().MergeFrom(prototype);
      }
      
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
      [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
      public sealed partial class Builder : pb::GeneratedBuilder<QueryRequest, Builder> {
        protected override Builder ThisBuilder {
          get { return this; }
        }
        public Builder() {}
        
        QueryRequest result = new QueryRequest();
        
        protected override QueryRequest MessageBeingBuilt {
          get { return result; }
        }
        
        public override Builder Clear() {
          result = new QueryRequest();
          return this;
        }
        
        public override Builder Clone() {
          return new Builder().MergeFrom(result);
        }
        
        public override pbd::MessageDescriptor DescriptorForType {
          get { return global::bnet.protocol.presence.QueryRequest.Descriptor; }
        }
        
        public override QueryRequest DefaultInstanceForType {
          get { return global::bnet.protocol.presence.QueryRequest.DefaultInstance; }
        }
        
        public override QueryRequest BuildPartial() {
          if (result == null) {
            throw new global::System.InvalidOperationException("build() has already been called on this Builder");
          }
          result.key_.MakeReadOnly();
          QueryRequest returnMe = result;
          result = null;
          return returnMe;
        }
        
        public override Builder MergeFrom(pb::IMessage other) {
          if (other is QueryRequest) {
            return MergeFrom((QueryRequest) other);
          } else {
            base.MergeFrom(other);
            return this;
          }
        }
        
        public override Builder MergeFrom(QueryRequest other) {
          if (other == global::bnet.protocol.presence.QueryRequest.DefaultInstance) return this;
          if (other.HasEntityId) {
            MergeEntityId(other.EntityId);
          }
          if (other.key_.Count != 0) {
            base.AddRange(other.key_, result.key_);
          }
          this.MergeUnknownFields(other.UnknownFields);
          return this;
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input) {
          return MergeFrom(input, pb::ExtensionRegistry.Empty);
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
          pb::UnknownFieldSet.Builder unknownFields = null;
          uint tag;
          string field_name;
          while (input.ReadTag(out tag, out field_name)) {
            if(tag == 0 && field_name != null) {
              int field_ordinal = global::System.Array.BinarySearch(_queryRequestFieldNames, field_name, global::System.StringComparer.Ordinal);
              if(field_ordinal >= 0)
                tag = _queryRequestFieldTags[field_ordinal];
              else {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                continue;
              }
            }
            switch (tag) {
              case 0: {
                throw pb::InvalidProtocolBufferException.InvalidTag();
              }
              default: {
                if (pb::WireFormat.IsEndGroupTag(tag)) {
                  if (unknownFields != null) {
                    this.UnknownFields = unknownFields.Build();
                  }
                  return this;
                }
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                break;
              }
              case 10: {
                global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder();
                if (result.hasEntityId) {
                  subBuilder.MergeFrom(EntityId);
                }
                input.ReadMessage(subBuilder, extensionRegistry);
                EntityId = subBuilder.BuildPartial();
                break;
              }
              case 18: {
                input.ReadMessageArray(tag, field_name, result.key_, global::bnet.protocol.presence.FieldKey.DefaultInstance, extensionRegistry);
                break;
              }
            }
          }
          
          if (unknownFields != null) {
            this.UnknownFields = unknownFields.Build();
          }
          return this;
        }
        
        
        public bool HasEntityId {
         get { return result.hasEntityId; }
        }
        public global::bnet.protocol.EntityId EntityId {
          get { return result.EntityId; }
          set { SetEntityId(value); }
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.hasEntityId = true;
          result.entityId_ = value;
          return this;
        }
        public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.hasEntityId = true;
          result.entityId_ = builderForValue.Build();
          return this;
        }
        public Builder MergeEntityId(global::bnet.protocol.EntityId value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          if (result.hasEntityId &&
              result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) {
              result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial();
          } else {
            result.entityId_ = value;
          }
          result.hasEntityId = true;
          return this;
        }
        public Builder ClearEntityId() {
          result.hasEntityId = false;
          result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance;
          return this;
        }
        
        public pbc::IPopsicleList<global::bnet.protocol.presence.FieldKey> KeyList {
          get { return result.key_; }
        }
        public int KeyCount {
          get { return result.KeyCount; }
        }
        public global::bnet.protocol.presence.FieldKey GetKey(int index) {
          return result.GetKey(index);
        }
        public Builder SetKey(int index, global::bnet.protocol.presence.FieldKey value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.key_[index] = value;
          return this;
        }
        public Builder SetKey(int index, global::bnet.protocol.presence.FieldKey.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.key_[index] = builderForValue.Build();
          return this;
        }
        public Builder AddKey(global::bnet.protocol.presence.FieldKey value) {
          pb::ThrowHelper.ThrowIfNull(value, "value");
          result.key_.Add(value);
          return this;
        }
        public Builder AddKey(global::bnet.protocol.presence.FieldKey.Builder builderForValue) {
          pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
          result.key_.Add(builderForValue.Build());
          return this;
        }
        public Builder AddRangeKey(scg::IEnumerable<global::bnet.protocol.presence.FieldKey> values) {
          base.AddRange(values, result.key_);
          return this;
        }
        public Builder ClearKey() {
          result.key_.Clear();
          return this;
        }
      }
      static QueryRequest() {
        object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null);
      }
    }
    
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
    public sealed partial class QueryResponse : pb::GeneratedMessage<QueryResponse, QueryResponse.Builder> {
      private static readonly QueryResponse defaultInstance = new Builder().BuildPartial();
      private static readonly string[] _queryResponseFieldNames = new string[] { "field" };
      private static readonly uint[] _queryResponseFieldTags = new uint[] { 18 };
      public static QueryResponse DefaultInstance {
        get { return defaultInstance; }
      }
      
      public override QueryResponse DefaultInstanceForType {
        get { return defaultInstance; }
      }
      
      protected override QueryResponse ThisMessage {
        get { return this; }
      }
      
      public static pbd::MessageDescriptor Descriptor {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryResponse__Descriptor; }
      }
      
      protected override pb::FieldAccess.FieldAccessorTable<QueryResponse, QueryResponse.Builder> InternalFieldAccessors {
        get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable; }
      }
      
      public const int FieldFieldNumber = 2;
      private pbc::PopsicleList<global::bnet.protocol.presence.Field> field_ = new pbc::PopsicleList<global::bnet.protocol.presence.Field>();
      public scg::IList<global::bnet.protocol.presence.Field> FieldList {
        get { return field_; }
      }
      public int FieldCount {
        get { return field_.Count; }
      }
      public global::bnet.protocol.presence.Field GetField(int index) {
        return field_[index];
      }
      
      public override bool IsInitialized {
        get {
          foreach (global::bnet.protocol.presence.Field element in FieldList) {
            if (!element.IsInitialized) return false;
          }
          return true;
        }
      }
      
      public override void WriteTo(pb::ICodedOutputStream output) {
        int size = SerializedSize;
        string[] field_names = _queryResponseFieldNames;
        if (field_.Count > 0) {
          output.WriteMessageArray(2, field_names[0], field_);
        }
        UnknownFields.WriteTo(output);
      }
      
      private int memoizedSerializedSize = -1;
      public override int SerializedSize {
        get {
          int size = memoizedSerializedSize;
          if (size != -1) return size;
          
          size = 0;
          foreach (global::bnet.protocol.presence.Field element in FieldList) {
            size += pb::CodedOutputStream.ComputeMessageSize(2, element);
          }
          size += UnknownFields.SerializedSize;
          memoizedSerializedSize = size;
          return size;
        }
      }
      
      public static QueryResponse ParseFrom(pb::ByteString data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static QueryResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static QueryResponse ParseFrom(byte[] data) {
        return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
      }
      public static QueryResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
      }
      public static QueryResponse ParseFrom(global::System.IO.Stream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static QueryResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static QueryResponse ParseDelimitedFrom(global::System.IO.Stream input) {
        return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
      }
      public static QueryResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
        return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
      }
      public static QueryResponse ParseFrom(pb::ICodedInputStream input) {
        return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
      }
      public static QueryResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
      }
      public static Builder CreateBuilder() { return new Builder(); }
      public override Builder ToBuilder() { return CreateBuilder(this); }
      public override Builder CreateBuilderForType() { return new Builder(); }
      public static Builder CreateBuilder(QueryResponse prototype) {
        return (Builder) new Builder().MergeFrom(prototype);
      }
      
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
      [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
      public sealed partial class Builder : pb::GeneratedBuilder<QueryResponse, Builder> {
        protected override Builder ThisBuilder {
          get { return this; }
        }
        public Builder() {}
        
        QueryResponse result = new QueryResponse();
        
        protected override QueryResponse MessageBeingBuilt {
          get { return result; }
        }
        
        public override Builder Clear() {
          result = new QueryResponse();
          return this;
        }
        
        public override Builder Clone() {
          return new Builder().MergeFrom(result);
        }
        
        public override pbd::MessageDescriptor DescriptorForType {
          get { return global::bnet.protocol.presence.QueryResponse.Descriptor; }
        }
        
        public override QueryResponse DefaultInstanceForType {
          get { return global::bnet.protocol.presence.QueryResponse.DefaultInstance; }
        }
        
        public override QueryResponse BuildPartial() {
          if (result == null) {
            throw new global::System.InvalidOperationException("build() has already been called on this Builder");
          }
          result.field_.MakeReadOnly();
          QueryResponse returnMe = result;
          result = null;
          return returnMe;
        }
        
        public override Builder MergeFrom(pb::IMessage other) {
          if (other is QueryResponse) {
            return MergeFrom((QueryResponse) other);
          } else {
            base.MergeFrom(other);
            return this;
          }
        }
        
        public override Builder MergeFrom(QueryResponse other) {
          if (other == global::bnet.protocol.presence.QueryResponse.DefaultInstance) return this;
          if (other.field_.Count != 0) {
            base.AddRange(other.field_, result.field_);
          }
          this.MergeUnknownFields(other.UnknownFields);
          return this;
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input) {
          return MergeFrom(input, pb::ExtensionRegistry.Empty);
        }
        
        public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
          pb::UnknownFieldSet.Builder unknownFields = null;
          uint tag;
          string field_name;
          while (input.ReadTag(out tag, out field_name)) {
            if(tag == 0 && field_name != null) {
              int field_ordinal = global::System.Array.BinarySearch(_queryResponseFieldNames, field_name, global::System.StringComparer.Ordinal);
              if(field_ordinal >= 0)
                tag = _queryResponseFieldTags[field_ordinal];
              else {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                continue;
              }
            }
            switch (tag) {
              case 0: {
                throw pb::InvalidProtocolBufferException.InvalidTag();
              }
              default: {
                if (pb::WireFormat.IsEndGroupTag(tag)) {
                  if (unknownFields != null) {
                    this.UnknownFields = unknownFields.Build();
                  }
                  return this;
                }
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                break;
              }
              case 18: {
                input.ReadMessageArray(tag, field_name, result.field_, global::bnet.protocol.presence.Field.DefaultInstance, extensionRegistry);
                break;
              }
            }
          }
          
          if (unknownFields != null) {
            this.UnknownFields = unknownFields.Build();
          }
          return this;
        }
        
        
        public pbc::IPopsicleList<global::bnet.protocol.presence.Field> FieldList {
          get { return result.field_; }
        }
        public int FieldCount {
  
gt:         get { return result.FieldCount; }