Send player info with product purchase data

This commit is contained in:
Eden Kirin
2023-03-31 11:51:05 +02:00
parent 210a6aff7c
commit 659ca82d74
9 changed files with 141 additions and 98 deletions

View File

@ -3,16 +3,15 @@ import datetime
import logging
import time
from threading import Thread
from typing import Optional
from hopper.interfaces import SendGameDumpInterface
from hopper.models.player import PlayerList
from hopper.ws_server import WSServer
from settings import settings
class InactivityWatchdog(Thread):
def __init__(
self, players: PlayerList, ws_server: Optional[SendGameDumpInterface] = None
self, players: PlayerList, ws_server: WSServer = None
) -> None:
self.players = players
self.ws_server = ws_server
@ -61,8 +60,6 @@ class InactivityWatchdog(Thread):
self.send_game_dump()
def send_game_dump(self):
if not self.ws_server:
return
logging.info("Sending WS game dump")
asyncio.run(self.ws_server.send_game_dump())