|
|
@@ -37,6 +37,23 @@ local function isBan(uuid, channelId, account, appId)
|
|
|
return BanLogic.CheckBan(uuid, channelId, account, appId)
|
|
|
end
|
|
|
|
|
|
+-- 判断是否属于白名单IP
|
|
|
+local function isWhiteIp(ip)
|
|
|
+ if not ip then
|
|
|
+ return false
|
|
|
+ end
|
|
|
+
|
|
|
+ if not Config.WHITEIP_LIST or #Config.WHITEIP_LIST == 0 then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+
|
|
|
+ if table.find(Config.WHITEIP_LIST, ip) then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+
|
|
|
+ return false
|
|
|
+end
|
|
|
+
|
|
|
|
|
|
--在线玩家列表不再从 ObjHuman.onlineAccount 获取, 改为从 ObjHuman.onlineNewUniqueTag 获取
|
|
|
function CG_TEST_PROTO(fd,msg)
|
|
|
@@ -220,6 +237,10 @@ function CG_ASK_LOGIN(fd, msg)
|
|
|
return sendDisconnect(fd, CommonDefine.DISCONNECT_AUTH_FAIL)
|
|
|
end
|
|
|
|
|
|
+ if Config.IS_CHECK_IP == true and not isWhiteIp(msg.ip) then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
|
|
|
--如果在线人数大于最大可容纳在线人数时,断开链接
|
|
|
local onlineCnt = ObjHuman.getOnlineCnt()
|