using MessagePack;
using Server.Core;

namespace NetWorkMessage
{
    [Message(MessageOpcode.RpcTestRequest)]
    [ResponseType(typeof(RpcTestResponse))]
    [MessagePackObject]
    public class RpcTestRequest : MessageObject,IRequest
    {
        [Key(0)]
        public uint RpcId { get; set; }

        [Key(1)] public int Id { get; set; }
        
        public static RpcTestRequest Create(int id)
        {
            RpcTestRequest rpcTestRequest = ReferencePool.Fetch<RpcTestRequest>();
            rpcTestRequest.Id = id;
            return rpcTestRequest;
        }

        protected override void VDispose()
        {
            base.VDispose();
        }
    }
    
    [Message(MessageOpcode.RpcTestResponse)]
    [MessagePackObject]
    public class RpcTestResponse : MessageObject,IResponse
    {
        [Key(0)]
        public int Error { get; set; }
        [Key(1)]
        public string Message { get; set; }
        [Key(2)]
        public uint RpcId { get; set; }

        /// <summary>
        /// 回应值
        /// </summary>
        [Key(3)]
        public int Id { get; set; }

    }
}