From 0be2d6f2947fe9f3573841aee07dde4b9f4211b9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 19 九月 2024 16:39:21 +0800
Subject: [PATCH] 10267 【越南】【英文】【砍树】优化GivePlayerItemOrMail,防范列表元素包含None报错;
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py
index 3de2fd9..12c07f6 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py
@@ -476,6 +476,17 @@
return mainServerID
return 0
+def CheckServerIDInList(serverID, serverIDList):
+ if serverIDList == None:
+ return False
+ if not serverIDList:
+ return True
+ for serverIDInfo in serverIDList:
+ if (isinstance(serverIDInfo, tuple) and serverIDInfo[0] <= serverID <= serverIDInfo[1]) \
+ or (isinstance(serverIDInfo, list) and serverIDInfo[0] <= serverID <= serverIDInfo[1]) \
+ or (isinstance(serverIDInfo, int) and serverIDInfo == serverID):
+ return True
+ return False
#===============================================================================
# 平台ID = appid
--
Gitblit v1.8.0