Add hook to detect consoles activity

This commit is contained in:
norohind 2022-12-05 18:15:41 +03:00
parent 752d6b74b1
commit cd049d5916
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

16
hooks/ConsolesDetect.py Normal file
View File

@ -0,0 +1,16 @@
from typing import TYPE_CHECKING
from Hook import Hook
if TYPE_CHECKING:
import HookSystem
class ConsolesDetect(Hook):
def update(self, action_id: int, diff: list[dict]) -> None:
for squad in diff:
if squad['platform'] != 'PC':
print(f'Detected non PC actions: {action_id}')
def setup(hs: 'HookSystem'):
hs.add_update_hook(ConsolesDetect())