fix: 7 bug fixes + port config with auto-restart

- HTTPException import added (was causing 500 on missing dashboard)
- game_manager.remove_plugin() restored (was AttributeError)
- api.js checks HTTP status codes, fails fast on errors
- sidebar game highlight only matches selected gameId
- scene resize handler uses stored canvas dims (was NaN)
- forwarder socket properly closed on listener stop
- telemetry port: use_unified_port toggle, off = per-game port, auto-restart on switch
This commit is contained in:
2026-07-26 17:23:14 +08:00
parent 41da7c03d5
commit e28be26ab3
8 changed files with 51 additions and 31 deletions
+14
View File
@@ -130,6 +130,20 @@ class GamePluginManager:
self._discover()
self._parser_cache.clear()
def remove_plugin(self, plugin_id: str) -> bool:
self._discover()
gp = self._plugins.get(plugin_id)
if gp and gp.is_builtin:
logger.warning("Cannot remove builtin plugin: %s", plugin_id)
return False
dest_dir = USER_DIR / plugin_id
if dest_dir.exists():
shutil.rmtree(dest_dir)
self._discover()
logger.info("Plugin removed: %s", plugin_id)
return True
return False
def install_plugin_zip(self, zip_data: bytes) -> bool:
try:
with zipfile.ZipFile(io.BytesIO(zip_data), 'r') as zf:
+3
View File
@@ -115,6 +115,9 @@ class TelemetryListener:
if self._transport:
self._transport.close()
self._transport = None
if self.forwarder._sock:
self.forwarder._sock.close()
self.forwarder._sock = None
logger.info("Telemetry listener stopped")
def _get_parser(self, key: str) -> BaseParser: