using GameMessage;
using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace UnityGame
{
    [Message(MessageCode.UserRegisterRequest)]
    [MessagePackObject()]
    public class UserRegisterRequest : MessageData
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Key(0)] public string UserName;

        /// <summary>
        /// 昵称
        /// </summary>
        [Key(1)] public string NickName;

        /// <summary>
        /// 密码
        /// </summary>
        [Key(2)] public string PassWord;

        /// <summary>
        /// 性别
        /// </summary>
        [Key(3)] public int Sex;

        /// <summary>
        /// 平台标识
        /// </summary>
        [Key(4)] public string PlatTag;

        /// <summary>
        /// 注册平台
        /// </summary>
        [Key(5)] public int Plat;

#if GameClient
        public static UserRegisterRequest Create()
        {
            return ReferencePool.Acquire<UserRegisterRequest>();
        }

        public override void Clear()
        {
            UserName = null;
            NickName = null;
            PassWord = null;
            Sex = 0;
            PlatTag = null;
            Plat = 0;
        }
#endif
    }

    [Message(MessageCode.UserRegisterResponse)]
    [MessagePackObject()]
    public class UserRegisterResponse : MessageData
    {
        /// <summary>
        /// 注册结果
        /// </summary>
        [Key(0)] public int ResultCode;
    }
}