You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
983 B

1 month ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sog;
using ProtoCSStruct;
using Sog.IO;
namespace World
{
/// <summary>
/// 游戏是否需要排队列表
/// </summary>
public static class LimitGameIdList
{
private static FileIntIDList m_whiteList = null;
public static bool CheckGameIdNeedWait(long uid)
{
//是否开启了白名单
if (!WorldServerUtils.GetServerConfig().enableWhiteGameIDList)
{
return true;
}
if(uid <= 0)
{
return true;
}
//初始化
if(m_whiteList == null)
{
m_whiteList = new FileIntIDList("../cfg/sog/white_gameId.txt");
m_whiteList.ReadFromFile();
}
return false == m_whiteList.IDInList(uid);
}
public static void Clear()
{
m_whiteList = null;
}
}
}