using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    //这个实际只有踢出功能，退出功能放在另一个包实现

    [Message(MessageCode.ClubQuitRequest)]
    [MessagePackObject]
    public class ClubQuitRequest : MessageData
    {
        [Key(0)] public int ClubId;

        /// <summary>
        /// 谁要退出, 如果操作的是自己，那就是退出，如果操作的别人，那就是踢出
        /// </summary>
        [Key(1)] public int WhoUserId;

#if GameClient
        public static ClubQuitRequest Create(int clubId)
        {
            ClubQuitRequest request = ReferencePool.Acquire<ClubQuitRequest>();
            request.ClubId = clubId;
            return request;
        }

        public override void Clear()
        {
            WhoUserId = 0;
        }
#endif
    }

    [Message(MessageCode.ClubQuitResponse)]
    [MessagePackObject]
    public class ClubQuitResponse : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public int WhoUserId;

        [Key(2)] // 0 退出 1 踢出
        public int OperatorType;

        [Key(3)] public int ResultCode;
    }

    [Message(MessageCode.ClubNormalQuitRequest)]
    [MessagePackObject]
    public class ClubNormalQuitRequest : MessageData
    {
        [Key(0)] public int ClubId;

        #if GameClient
        public static ClubNormalQuitRequest Create(int clubId)
        {
            ClubNormalQuitRequest request = ReferencePool.Acquire<ClubNormalQuitRequest>();
            request.ClubId = clubId;
            return request;
        }
        #endif
    }

    [Message(MessageCode.ClubNormalQuitResponse)]
    [MessagePackObject]
    public class ClubNormalQuitResponse : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public int ResultCode;
    }
}