Factorio: Add connection change filtering functionality (#4997)

This commit is contained in:
Andres
2025-11-20 20:30:11 -05:00
committed by GitHub
parent 3c819ec781
commit 32a021096b
5 changed files with 45 additions and 2 deletions

4
CommonClient.py Normal file → Executable file
View File

@@ -572,6 +572,10 @@ class CommonContext:
return print_json_packet.get("type", "") == "ItemSend" \
and not self.slot_concerns_self(print_json_packet["receiving"]) \
and not self.slot_concerns_self(print_json_packet["item"].player)
def is_connection_change(self, print_json_packet: dict) -> bool:
"""Helper function for filtering out connection changes."""
return print_json_packet.get("type", "") in ["Join","Part"]
def on_print(self, args: dict):
logger.info(args["text"])