using GameMessage;
using MessagePack;

#if GameClient
using GameFramework;
#endif

namespace UnityGame
{
    [Message(MessageCode.UpdateUserInfoRequest)]
    [MessagePackObject]
    public class UpdateUserInfoRequest : MessageData
    {
        [Key(0)] public string NickName;

        [Key(1)] public string AvatarUrl;

#if GameClient
        public static UpdateUserInfoRequest Create(string nickName, string avatarUrl)
        {
            UpdateUserInfoRequest request = ReferencePool.Acquire<UpdateUserInfoRequest>();
            request.NickName = nickName;
            request.AvatarUrl = avatarUrl;
            return request;
        }

        public override void Clear()
        {
            NickName = null;
            AvatarUrl = null;
        }
#endif
    }

    [Message(MessageCode.UpdateUserInfoResponse)]
    [MessagePackObject]
    public class UpdateUserInfoResponse : MessageData
    {
    }
}