using ObjectModel;
using ObjectModel.Config;
using Server.DB.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GameData;

namespace GameDAL.Backend
{
    public class DeskPlayerDal
    {
        /// <summary>
        /// 获取禁止同桌信息
        /// </summary>
        /// <returns></returns>
        public static string GetNoDeskPlayer() {
            return redisManager.GetBiSaidb(ConstClass.NoDeskMatesAllowedDBIdx).StringGet(ConstClass.NoDeskMatesAllowedKey);
        }

        /// <summary>
        /// 设置禁止同桌信息
        /// </summary>
        /// <param name="playerInfos"></param>
        public static void SetNoDeskPlayer(List<NoDeskPlayerInfo> playerInfos) {
            if (playerInfos == null) return;
            redisManager.GetBiSaidb(ConstClass.NoDeskMatesAllowedDBIdx).StringSet(ConstClass.NoDeskMatesAllowedKey, JsonPack.GetJson(playerInfos));
        }
    }
}
