小助手内嵌 GM 页:网页重定向 + 物品分页 + 装备强化增幅发放
- 90CN.dll 新增 IE 控件接管,把腾讯小助手页面重定向到本地 GM 页 - gmweb:物品列表改分页(每页 10/20/50,列表固定 6 行高) - 发放走 grant-options,支持强化 0-31、增幅属性+等级、锻造 0-8、品质 - 服务端补齐 amplify_level:等级统一写入 ext_data0/packed_flag_byte/reinforce/upgrade_level - 增幅与强化互斥校验,避免写出客户端无法创建的装备
This commit is contained in:
1 parent
6e570fe820
commit
18e98ca7c9
13 files changed
+1206
-11
No files matched your search
@@ -101,6 +101,9 @@ CONTROL = os.path.join(SERVER_ROOT, "Server", "runtime", "bin", "DNF90Control.ex
|
||||
CLIENT_DIR = os.path.join(SERVER_ROOT, "Client")
|
||||
CLIENT_LAUNCHER = os.path.join(SERVER_ROOT, "Server", "runtime", "bin", "DNF90Launcher.exe")
|
||||
|
||||
# 游戏内嵌网页窗口(小助手)重定向到的本地 GM 页端口,与 gmweb/serve.py 默认值一致
|
||||
GM_WEB_PORT = 18112
|
||||
|
||||
# GM 配置目录(物品名称表 + pvfexport 工具,均放这里,PVF 更新后自动重导出)
|
||||
GM_CONFIG_DIR = os.path.join(SERVER_ROOT, "GM配置")
|
||||
PVF_PATH = os.path.join(CLIENT_DIR, "Script.pvf")
|
||||
@@ -155,6 +158,31 @@ def port_open(port, host="127.0.0.1"):
|
||||
s.close()
|
||||
|
||||
|
||||
def start_gmweb():
|
||||
"""拉起本地 GM 页服务(127.0.0.1:18112),供游戏内嵌网页窗口显示。
|
||||
|
||||
页面与代理脚本在 <90server>/gmweb/,它把 /api/* 转发到 admin 口并注入 token,
|
||||
这样 IE 内核不用处理跨域,页面里也不会出现明文 token。失败只提示,不阻断启动。
|
||||
"""
|
||||
script = os.path.join(SERVER_ROOT, "gmweb", "serve.py")
|
||||
if not os.path.exists(script):
|
||||
return
|
||||
if port_open(GM_WEB_PORT):
|
||||
print("GM 页服务已在运行:http://127.0.0.1:%d/" % GM_WEB_PORT)
|
||||
return
|
||||
try:
|
||||
kwargs = {"cwd": os.path.dirname(script),
|
||||
"stdout": subprocess.DEVNULL,
|
||||
"stderr": subprocess.DEVNULL}
|
||||
if os.name == "nt":
|
||||
# CREATE_NO_WINDOW:不要给用户弹一个黑框
|
||||
kwargs["creationflags"] = 0x08000000
|
||||
subprocess.Popen([sys.executable, script, "--port", str(GM_WEB_PORT)], **kwargs)
|
||||
print("GM 页服务:http://127.0.0.1:%d/" % GM_WEB_PORT)
|
||||
except Exception as exc: # noqa: BLE001 - 启动器不能因此退出
|
||||
print("[提示] GM 页服务启动失败:%s" % exc)
|
||||
|
||||
|
||||
def _read_json_file(path, default):
|
||||
try:
|
||||
if path and os.path.exists(path):
|
||||
@@ -2102,6 +2130,7 @@ def main():
|
||||
|
||||
threading.Thread(target=_serve, daemon=True).start()
|
||||
start_loadout_hotkeys()
|
||||
start_gmweb()
|
||||
|
||||
# 用内嵌窗口(pywebview)显示界面,替代打开浏览器
|
||||
show_window(url)
|
||||
|
||||
Reference in new issue
Block a user