From c1d80a32fa91351802c4f2622ba97af653d385b5 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 5 Jul 2022 17:16:30 -0400 Subject: [PATCH] Fix #17 Too much game info data sent thru plugin framework --- server.py | 4 ++-- src/python.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index fec3162..66556d3 100644 --- a/server.py +++ b/server.py @@ -133,8 +133,8 @@ async def start(version): http_server = Server(version) http_runner = web.AppRunner(http_server) await http_runner.setup() - site = web.TCPSite(http_runner, '127.0.0.1', 5030) - await site.start() + http_site = web.TCPSite(http_runner, '127.0.0.1', 5030) + await http_site.start() async def shutdown(): # never really called global http_runner, http_server, http_site diff --git a/src/python.ts b/src/python.ts index 9912f65..8fa277b 100644 --- a/src/python.ts +++ b/src/python.ts @@ -125,7 +125,8 @@ export function getCurrentGame(): Promise { } export function onGameStart(gameId: number, data: any): Promise { - return server!.callPluginMethod("on_game_start", {"game_id": gameId, "data":data}); + const data2 = {appid: data.appid, display_name: data.display_name, gameid: gameId}; // Issue #17 + return server!.callPluginMethod("on_game_start", {"game_id": gameId, "data":data2}); } export function onGameStop(gameId: number | null): Promise {