public static void Serialize(Stream stream, SendInvitationRequest instance)
 {
     if (instance.HasAgentIdentity)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.AgentIdentity.GetSerializedSize());
         Identity.Serialize(stream, instance.AgentIdentity);
     }
     if (instance.TargetId == null)
     {
         throw new ArgumentNullException("TargetId", "Required by proto specification.");
     }
     stream.WriteByte(18);
     ProtocolParser.WriteUInt32(stream, instance.TargetId.GetSerializedSize());
     EntityId.Serialize(stream, instance.TargetId);
     if (instance.Params == null)
     {
         throw new ArgumentNullException("Params", "Required by proto specification.");
     }
     stream.WriteByte(26);
     ProtocolParser.WriteUInt32(stream, instance.Params.GetSerializedSize());
     InvitationParams.Serialize(stream, instance.Params);
     if (instance.HasAgentInfo)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.AgentInfo.GetSerializedSize());
         AccountInfo.Serialize(stream, instance.AgentInfo);
     }
     if (instance.HasTarget)
     {
         stream.WriteByte(42);
         ProtocolParser.WriteUInt32(stream, instance.Target.GetSerializedSize());
         InvitationTarget.Serialize(stream, instance.Target);
     }
 }
        public static SendInvitationRequest DeserializeLengthDelimited(Stream stream)
        {
            SendInvitationRequest sendInvitationRequest = new SendInvitationRequest();

            SendInvitationRequest.DeserializeLengthDelimited(stream, sendInvitationRequest);
            return(sendInvitationRequest);
        }
        public static SendInvitationRequest DeserializeLengthDelimited(Stream stream, SendInvitationRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(SendInvitationRequest.Deserialize(stream, instance, num));
        }
        public override bool Equals(object obj)
        {
            SendInvitationRequest sendInvitationRequest = obj as SendInvitationRequest;

            if (sendInvitationRequest == null)
            {
                return(false);
            }
            if (this.HasAgentIdentity != sendInvitationRequest.HasAgentIdentity || this.HasAgentIdentity && !this.AgentIdentity.Equals(sendInvitationRequest.AgentIdentity))
            {
                return(false);
            }
            if (!this.TargetId.Equals(sendInvitationRequest.TargetId))
            {
                return(false);
            }
            if (!this.Params.Equals(sendInvitationRequest.Params))
            {
                return(false);
            }
            if (this.HasAgentInfo != sendInvitationRequest.HasAgentInfo || this.HasAgentInfo && !this.AgentInfo.Equals(sendInvitationRequest.AgentInfo))
            {
                return(false);
            }
            if (this.HasTarget == sendInvitationRequest.HasTarget && (!this.HasTarget || this.Target.Equals(sendInvitationRequest.Target)))
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 5
0
 public override void SendInvitation(IRpcController controller, SendInvitationRequest request, Action<SendInvitationResponse> done)
 {
     ProtoOutputBuffer.Write(request.GetType(), request.ToString());
 }
 public void Serialize(Stream stream)
 {
     SendInvitationRequest.Serialize(stream, this);
 }
 public static SendInvitationRequest Deserialize(Stream stream, SendInvitationRequest instance, long limit)
 {
     while (limit < 0L || stream.Position < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else if (num != 10)
         {
             if (num != 18)
             {
                 if (num != 26)
                 {
                     if (num != 34)
                     {
                         if (num != 42)
                         {
                             Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                             uint field = key.Field;
                             if (field == 0u)
                             {
                                 throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                             }
                             ProtocolParser.SkipKey(stream, key);
                         }
                         else if (instance.Target == null)
                         {
                             instance.Target = InvitationTarget.DeserializeLengthDelimited(stream);
                         }
                         else
                         {
                             InvitationTarget.DeserializeLengthDelimited(stream, instance.Target);
                         }
                     }
                     else if (instance.AgentInfo == null)
                     {
                         instance.AgentInfo = AccountInfo.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         AccountInfo.DeserializeLengthDelimited(stream, instance.AgentInfo);
                     }
                 }
                 else if (instance.Params == null)
                 {
                     instance.Params = InvitationParams.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     InvitationParams.DeserializeLengthDelimited(stream, instance.Params);
                 }
             }
             else if (instance.TargetId == null)
             {
                 instance.TargetId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.TargetId);
             }
         }
         else if (instance.AgentIdentity == null)
         {
             instance.AgentIdentity = Identity.DeserializeLengthDelimited(stream);
         }
         else
         {
             Identity.DeserializeLengthDelimited(stream, instance.AgentIdentity);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static SendInvitationRequest Deserialize(Stream stream, SendInvitationRequest instance)
 {
     return(SendInvitationRequest.Deserialize(stream, instance, -1L));
 }
        public override bool Equals(object obj)
        {
            SendInvitationRequest sendInvitationRequest = obj as SendInvitationRequest;

            return(sendInvitationRequest != null && this.HasAgentIdentity == sendInvitationRequest.HasAgentIdentity && (!this.HasAgentIdentity || this.AgentIdentity.Equals(sendInvitationRequest.AgentIdentity)) && this.TargetId.Equals(sendInvitationRequest.TargetId) && this.Params.Equals(sendInvitationRequest.Params) && this.HasAgentInfo == sendInvitationRequest.HasAgentInfo && (!this.HasAgentInfo || this.AgentInfo.Equals(sendInvitationRequest.AgentInfo)) && this.HasTarget == sendInvitationRequest.HasTarget && (!this.HasTarget || this.Target.Equals(sendInvitationRequest.Target)));
        }
Exemplo n.º 10
0
 public override void SendInvitation(IRpcController controller, SendInvitationRequest request, Action<SendInvitationResponse> done)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
        public override void SendInvitation(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.invitation.SendInvitationRequest request, Action <bnet.protocol.invitation.SendInvitationResponse> done)
        {
            var response = SendInvitationResponse.CreateBuilder();

            done(response.Build());
        }
 public override void SendInvitation(IRpcController controller, SendInvitationRequest request, Action <SendInvitationResponse> done)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 13
0
 public override void SendInvitation(IRpcController controller, SendInvitationRequest request, Action <SendInvitationResponse> done)
 {
     ProtoOutputBuffer.Write(request.GetType(), request.ToString());
 }