Skip to content

Commit

Permalink
Black
Browse files Browse the repository at this point in the history
  • Loading branch information
olijeffers0n committed Jun 24, 2024
1 parent b4056eb commit f3b7465
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
3 changes: 2 additions & 1 deletion rustplus/remote/camera/camera_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
AppEmpty,
AppRequest,
AppCameraInfo,
AppCameraRays, AppCameraSubscribe,
AppCameraRays,
AppCameraSubscribe,
)
from ...structs import Vector
from .structures import CameraInfo, Entity, LimitedQueue
Expand Down
20 changes: 15 additions & 5 deletions rustplus/remote/websocket/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
from ..camera import CameraManager
from ..rustplus_proto import AppMessage, AppRequest
from ...commands import CommandOptions, ChatCommand, ChatCommandTime
from ...events import ProtobufEventPayload, EntityEventPayload, TeamEventPayload, ChatEventPayload
from ...events import (
ProtobufEventPayload,
EntityEventPayload,
TeamEventPayload,
ChatEventPayload,
)
from ...exceptions import ClientNotConnectedError, RequestError
from ...identification import ServerID, RegisteredListener
from ...structs import RustChatMessage, RustTeamInfo
Expand Down Expand Up @@ -189,7 +194,10 @@ async def handle_message(self, app_message: AppMessage) -> None:

# This means that the team of the current player has changed
handlers = TeamEventPayload.HANDLER_LIST.get_handlers(self.server_id)
team_event = TeamEventPayload(app_message.broadcast.team_changed.player_id, RustTeamInfo(app_message.broadcast.team_changed.team_info))
team_event = TeamEventPayload(
app_message.broadcast.team_changed.player_id,
RustTeamInfo(app_message.broadcast.team_changed.team_info),
)
for handler in handlers:
await handler.get_coro()(team_event)

Expand All @@ -200,7 +208,9 @@ async def handle_message(self, app_message: AppMessage) -> None:
self.logger.info(f"Running Chat Event: {app_message}")

handlers = ChatEventPayload.HANDLER_LIST.get_handlers(self.server_id)
chat_event = ChatEventPayload(RustChatMessage(app_message.broadcast.team_message.message))
chat_event = ChatEventPayload(
RustChatMessage(app_message.broadcast.team_message.message)
)
for handler in handlers:
await handler.get_coro()(chat_event)

Expand All @@ -225,8 +235,8 @@ def get_prefix(self, message: str) -> Optional[str]:

@staticmethod
async def run_proto_event(data: Union[str, bytes], server_id: ServerID) -> None:
handlers: Set[RegisteredListener] = ProtobufEventPayload.HANDLER_LIST.get_handlers(
server_id
handlers: Set[RegisteredListener] = (
ProtobufEventPayload.HANDLER_LIST.get_handlers(server_id)
)
for handler in handlers:
await handler.get_coro()(data)
Expand Down
3 changes: 2 additions & 1 deletion rustplus/rust_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
AppEmpty,
AppSendMessage,
AppSetEntityValue,
AppPromoteToLeader, AppCameraSubscribe,
AppPromoteToLeader,
AppCameraSubscribe,
)
from .remote.websocket import RustWebsocket
from .structs import (
Expand Down

0 comments on commit f3b7465

Please sign in to comment.