using MessagePack;

#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 注册Session
    /// </summary>
    [Message(MessageCode.RegisterSessionRequest)]
    [MessagePackObject]
    public class RegisterSessionRequest : MessageData
    {
        /// <summary>
        /// 用户Userid
        /// </summary>
        [Key(0)] public int Userid;

        /// <summary>
        /// 会话SessionUUID
        /// </summary>
        [Key(1)] public string SessionUUID;

        /// <summary>
        /// 客户端版本
        /// </summary>
        [Key(2)] public int ClientVer;

        [Key(3)] public long SeqId;

        [Key(4)]
        public int Plat;

        /// <summary>
        /// 设备信息
        /// </summary>
        [Key(5)]
        public string DeviceInfo;

        /// <summary>
        /// 商店类型
        /// </summary>
        [Key(6)]
        public string StoreType;

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

        public override void Clear()
        {
            Userid = 0;
            SessionUUID = null;
            ClientVer = 0;
            SeqId = 0;
            Plat = 0;
            DeviceInfo = null;
        }
#endif
    }

    /// <summary>
    /// 注册Session 响应
    /// </summary>
    [Message(MessageCode.RegisterSessionResponse)]
    [MessagePackObject]
    public class RegisterSessionResponse : MessageData
    {
        /// <summary>
        /// 处理结果
        /// </summary>
        [Key(0)] public int ResultCode;

        [Key(1)] public long SeqId;
    }

    /// <summary>
    /// 更新Session过期时间
    /// </summary>
    [Message(MessageCode.UpdateSessionExpireTime)]
    [MessagePackObject]
    public class SessionUpdateExpireTime : MessageData
    {
#if GameClient
        public static SessionUpdateExpireTime Create()
        {
            return ReferencePool.Acquire<SessionUpdateExpireTime>();
        }
#endif
    }

    // /// <summary>
    // /// 链接成功
    // /// </summary>
    // [Message(MessageCode.ConnectSuccess)]
    // [MessagePackObject]
    // public class ConnectSuccessMsg : MessageData
    // {
    //     
    // }
}