启动器新增游戏设置页(频道开关+活动开关),窗口标题改名
- 服务端新增活动开关运行时配置与 GM 接口(GET/POST /dnf/gm/activity-switches), 持久化到 Settings,接入月签到/周签到/PC房↔累计在线的实时下发 - 服务端新增频道开关 GM 接口(channel-switches),目录生成时过滤禁用频道 - channelcatalog/channelinfo 支持按禁用频道 ID 过滤目录与客户端脚本 - 启动器新增「游戏设置」页面:频道开关 Tab + 活动开关 Tab - native.py/server.py 新增对应转发 API - 窗口标题/页面 title/侧边栏「90轮回」统一改为「DNF90 灵狐小竹整合单机版」
This commit is contained in:
1 parent
977a4a1196
commit
0ced464168
15 files changed
+1022
-14
No files matched your search
+64
-1
@@ -578,6 +578,10 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self._api_character_black_diamond(qs)
|
||||
elif path == "/api/gameplay":
|
||||
self._api_gameplay(qs)
|
||||
elif path == "/api/game-settings/activity-switches":
|
||||
self._api_activity_switches()
|
||||
elif path == "/api/game-settings/channel-switches":
|
||||
self._api_channel_switches()
|
||||
elif path == "/api/quests":
|
||||
self._api_quests(qs)
|
||||
elif path == "/api/quests/search":
|
||||
@@ -638,6 +642,10 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self._api_gameplay_fatigue_mode(data)
|
||||
elif path == "/api/gameplay/burning":
|
||||
self._api_gameplay_burning(data)
|
||||
elif path == "/api/game-settings/activity-switch":
|
||||
self._api_activity_switch(data)
|
||||
elif path == "/api/game-settings/channel-switch":
|
||||
self._api_channel_switch(data)
|
||||
elif path == "/api/character/fatigue/refill":
|
||||
self._api_fatigue_refill(data)
|
||||
elif path == "/api/quests/action":
|
||||
@@ -1214,6 +1222,61 @@ class Handler(BaseHTTPRequestHandler):
|
||||
except Exception as e:
|
||||
self._json({"error": str(e)}, 500)
|
||||
|
||||
def _api_activity_switches(self):
|
||||
if not self._require_native():
|
||||
return
|
||||
try:
|
||||
res = NATIVE.get_activity_switches()
|
||||
self._json({"ok": True, "data": res})
|
||||
except NativeError as e:
|
||||
self._json({"error": str(e)}, 502)
|
||||
except Exception as e:
|
||||
self._json({"error": str(e)}, 500)
|
||||
|
||||
def _api_activity_switch(self, data):
|
||||
if not self._require_native():
|
||||
return
|
||||
key = data.get("key", "")
|
||||
enabled = bool(data.get("enabled", False))
|
||||
if not key:
|
||||
self._json({"error": "missing key"}, 400)
|
||||
return
|
||||
try:
|
||||
res = NATIVE.set_activity_switch(key, enabled)
|
||||
self._json({"ok": True, "data": res})
|
||||
except NativeError as e:
|
||||
self._json({"error": str(e)}, 502)
|
||||
except Exception as e:
|
||||
self._json({"error": str(e)}, 500)
|
||||
|
||||
def _api_channel_switches(self):
|
||||
if not self._require_native():
|
||||
return
|
||||
try:
|
||||
res = NATIVE.get_channel_switches()
|
||||
self._json({"ok": True, "data": res})
|
||||
except NativeError as e:
|
||||
self._json({"error": str(e)}, 502)
|
||||
except Exception as e:
|
||||
self._json({"error": str(e)}, 500)
|
||||
|
||||
def _api_channel_switch(self, data):
|
||||
if not self._require_native():
|
||||
return
|
||||
try:
|
||||
channel_id = int(data.get("channel_id"))
|
||||
except (TypeError, ValueError):
|
||||
self._json({"error": "missing or invalid channel_id"}, 400)
|
||||
return
|
||||
enabled = bool(data.get("enabled", False))
|
||||
try:
|
||||
res = NATIVE.set_channel_switch(channel_id, enabled)
|
||||
self._json({"ok": True, "data": res})
|
||||
except NativeError as e:
|
||||
self._json({"error": str(e)}, 502)
|
||||
except Exception as e:
|
||||
self._json({"error": str(e)}, 500)
|
||||
|
||||
def _api_dungeon_unlock(self, data):
|
||||
char_id = str(data.get("id", ""))
|
||||
kind = data.get("kind", "difficulties")
|
||||
@@ -2221,7 +2284,7 @@ def show_window(url):
|
||||
|
||||
# 主窗口:启动器(无边框,屏幕居中)
|
||||
window = webview.create_window(
|
||||
"90轮回",
|
||||
"DNF90 灵狐小竹整合单机版",
|
||||
url,
|
||||
width=1204,
|
||||
height=717,
|
||||
|
||||
Reference in new issue
Block a user