Archived
change callback to filter by player instead of client
This commit is contained in:
@@ -6,7 +6,7 @@ from controller import GameControllerInterface, ClientControllerInterface
|
||||
|
||||
from netcode.models import Message, LoginMessage
|
||||
|
||||
from model import Player
|
||||
from model import Player, Team
|
||||
|
||||
|
||||
def vibe_check(t):
|
||||
@@ -69,9 +69,9 @@ class ClientController(ClientControllerInterface):
|
||||
self,
|
||||
notification_type: str,
|
||||
data: dict,
|
||||
client_filter: Callable[["ClientController"], Any] = lambda x: True,
|
||||
player_filter: Callable[[Player], Any] = lambda x: True,
|
||||
):
|
||||
if client_filter(self):
|
||||
if hasattr(self, "player") is False or player_filter(self.player):
|
||||
await self.send(
|
||||
Message(type=notification_type, data_type="object", data=data)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user