using MessagePack;
#if GameClient
using GameFramework;
#endif

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

        /// <summary>
        /// 密码
        /// </summary>
        [Key(1)]
        public string Pwd;

#if GameClient
        public static EditorUserPwdRequest Create(string userName, string pwd)
        {
            EditorUserPwdRequest request = ReferencePool.Acquire<EditorUserPwdRequest>();
            request.UserName = userName;
            request.Pwd = pwd;
            return request;
        }

        public override void Clear()
        {
            UserName = null;
            Pwd = null;
        }
#endif
    }

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

        /// <summary>
        /// 用户名
        /// </summary>
        [Key(1)]
        public string UserName;
    }
}
