From a075f7841fb2d0a3b32bf10c8bc2df5bf02d6acb Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期日, 14 十二月 2025 14:24:28 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(贾诩所有技能;5022效果支持配置buff额外属性计算方式;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/CommFunc.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/CommFunc.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/CommFunc.py
index 7f0f50b..78aa02d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/CommFunc.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/CommFunc.py
@@ -31,6 +31,7 @@
import traceback
import shutil
import zlib
+import json
#---------------------------------------------------------------------
#全局变量
@@ -59,6 +60,16 @@
returnStr += chr(string.atoi(hexStr[i:i+2],16))
return returnStr
+def B2Hex(buf, upper=True, space=True):
+ hex_str = binascii.b2a_hex(buf)
+ # 转换为大写
+ if upper:
+ hex_str = hex_str.upper()
+ # 每两个字符添加一个空格
+ if space:
+ hex_str = ' '.join(hex_str[i:i+2] for i in range(0, len(hex_str), 2))
+ return hex_str
+
#获取异常信息#(try:...except:..GetExceptionInfo())
##
# @param 参数
@@ -436,6 +447,9 @@
except ZeroDivisionError:
return "Division is Zero"
+def JsonDump(dumpObj):
+ return json.dumps(dumpObj, ensure_ascii=False)
+
##生成指定文件(如par:r'E:\开发版本\Data\logo\formName1.log')
#def MakeAppointFile(par):
# dir = os.path.dirname(par) # 获得文件目录
--
Gitblit v1.8.0