From fe43008e7edea69cdfd0baa5d471c3953edabf1f Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 20 三月 2024 11:44:31 +0800 Subject: [PATCH] 10138 内存分析(修复读取仙盟表等级权限数据错误导致GameServer报错,如加入仙盟、升级仙盟等) --- ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py index c6504ef..cc413cf 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py @@ -118,6 +118,14 @@ except ValueError: return defValue +def ToFloat(input, defValue = 0): + try: + result = float(input) + return result + + except ValueError: + return defValue + ## 判断2个对象是否同国籍 # @param srcObj 起点对象 # @param desObj 目标对象 @@ -1122,13 +1130,14 @@ return 0 -def DebugAnswer(curPlayer, text): +def DebugAnswer(curPlayer, text, isLog=True): '''转码后再发DebugAnswer''' #=========================================================================== # if not GetGameWorld().GetDebugLevel(): # return #=========================================================================== - DebugLog(text) + if isLog: + DebugLog(text) text = text.decode(ShareDefine.Def_Game_Character_Encoding).encode(GetCharacterEncoding()) curPlayer.DebugAnswer(text) return -- Gitblit v1.8.0