using MessagePack;
using Server.Core;

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

        [Key(1)]
        public long SessionId
        {
            get;
            set;
        }

        [Key(2)]
        public int UserId
        {
            get;
            set;
        }

        [Key(3)]
        public string Uuid
        {
            get;
            set;
        }

        [Key(4)]
        public int ClientVer
        {
            get;
            set;
        }

        [Key(5)]
        public int Plat
        {
            get;
            set;
        }

        [Key(6)]
        public bool Reset
        {
            get;
            set;
        }

        [Key(7)]
        public string DeviceInfo
        {
            get;
            set;
        }

        public static BindUserRequest Create()
        {
            BindUserRequest request = ReferencePool.Fetch<BindUserRequest>();
            return request;
        }
    }

    [Message(MessageOpcode.BindUserResponse)]
    [MessagePackObject]
    public class BindUserResponse : MessageObject, IResponse
    {
        [Key(0)]
        public uint RpcId
        {
            get;
            set;
        }
        
        [Key(1)]
        public int Error
        {
            get;
            set;
        }

        [Key(2)]
        public string Message
        {
            get;
            set;
        }
    }
}