From bbf85468672ca936e5e1c1558d6bfc239c2e3911 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 8 Apr 2023 08:20:59 +0200 Subject: [PATCH] MultiServer: Flag for saving on datastore, create_as_hint scout and client state change --- MultiServer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MultiServer.py b/MultiServer.py index ea055b66..95290ccf 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1742,6 +1742,8 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict): hints.extend(collect_hint_location_id(ctx, client.team, client.slot, location)) locs.append(NetworkItem(target_item, location, target_player, flags)) ctx.notify_hints(client.team, hints, only_new=create_as_hint == 2) + if locs and create_as_hint: + ctx.save() await ctx.send_msgs(client, [{'cmd': 'LocationInfo', 'locations': locs}]) elif cmd == 'StatusUpdate': @@ -1800,6 +1802,7 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict): targets.add(client) if targets: ctx.broadcast(targets, [args]) + ctx.save() elif cmd == "SetNotify": if "keys" not in args or type(args["keys"]) != list: @@ -1817,6 +1820,7 @@ def update_client_status(ctx: Context, client: Client, new_status: ClientStatus) ctx.on_goal_achieved(client) ctx.client_game_state[client.team, client.slot] = new_status + ctx.save() class ServerCommandProcessor(CommonCommandProcessor):