using Newtonsoft.Json;
using Server.DB.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MrWu.Debug;
using StackExchange.Redis;

namespace Server
{
    /// <summary>
    /// 竞技比赛同桌判断
    /// </summary>
    public static class ClubSeatmate
    {
        /*
         * 这个脚本应该是静态的，所有的数据都是从redis获取进行运算。
         * 
         * 按静态的修改好了
         * */
        #region 常量
        public const int dbIdx = 7;

        /// <summary>
        /// 限制组数量
        /// </summary>
        public const int ClubBankCount=50;

        /// <summary>
        /// 竞技比赛禁止同桌的的Reids Key
        /// </summary>
        public const string NoPlayerGroupKey = "NoPlayerGroup:{0}";
        /// <summary>
        /// 该竞技比赛的禁止同桌列表Redis Key
        /// </summary>
        public const string ClubNoPlayerGroupKey = "NoPlayerGroup_Club:{0}";

        /// <summary>
        /// 获取该玩家的禁止同桌列表Redis Key
        /// </summary>
        public const string UserNoPlayerKey = "NoPlayGroup_Player:{0}:{1}";
        /// <summary>
        /// 获取该用户的禁止同桌列表Redis Key
        /// </summary>
        public const string UserNoPlayerClubKey = "NoPlayGroup_Player:{0}";

        public static IDatabaseProxy db
        {
            get
            {
                return redisManager.Getdb(dbIdx);
            }
        }

        #endregion

        /// <summary>
        /// Redis 设置过期时间半年
        /// </summary>
        public static TimeSpan TimeOut = new TimeSpan(180, 0, 0, 0, 0);

        /// <summary>
        /// 检测是否可以同桌
        /// </summary>
        public static bool CheckSeatmate(List<int> limitList, int[] deskUsers)
        {
            return true;
        }
        
    }
}
