Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
olijeffers0n committed Jan 28, 2024
1 parent 335fe7a commit 35004db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion rustplus/api/remote/rust_remote_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ async def send_message(self, request: AppRequest) -> None:
raise ClientNotConnectedError("No Current Websocket Connection")

if self.debug:
self.logger.info(f"[RustPlus.py] Sending Message with seq {request.seq}: {request}")
self.logger.info(
f"[RustPlus.py] Sending Message with seq {request.seq}: {request}"
)

self.pending_response_events[request.seq] = YieldingEvent()
await self.ws.send_message(request)
Expand Down
19 changes: 10 additions & 9 deletions rustplus/api/remote/rustws.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ async def connect(
break

except Exception as exception:

self.logger.info(f"[RustPlus.py] {exception}")

print_error = True
Expand Down Expand Up @@ -225,9 +224,10 @@ async def run(self) -> None:
)

async def handle_message(self, app_message: AppMessage) -> None:

if self.debug:
self.logger.info(f"[RustPlus.py] Received Message with seq {app_message.response.seq}: {app_message}")
self.logger.info(
f"[RustPlus.py] Received Message with seq {app_message.response.seq}: {app_message}"
)

if app_message.response.seq in self.remote.ignored_responses:
self.remote.ignored_responses.remove(app_message.response.seq)
Expand All @@ -241,7 +241,9 @@ async def handle_message(self, app_message: AppMessage) -> None:
# This means it is a command

if self.debug:
self.logger.info(f"[RustPlus.py] Attempting to run Command: {app_message}")
self.logger.info(
f"[RustPlus.py] Attempting to run Command: {app_message}"
)

message = RustChatMessage(app_message.broadcast.team_message.message)
await self.remote.command_handler.run_command(message, prefix)
Expand All @@ -259,7 +261,6 @@ async def handle_message(self, app_message: AppMessage) -> None:
)

elif self.is_camera_broadcast(app_message):

if self.debug:
self.logger.info(f"[RustPlus.py] Running Camera Event: {app_message}")

Expand All @@ -269,7 +270,6 @@ async def handle_message(self, app_message: AppMessage) -> None:
)

elif self.is_team_broadcast(app_message):

if self.debug:
self.logger.info(f"[RustPlus.py] Running Team Event: {app_message}")

Expand Down Expand Up @@ -317,12 +317,13 @@ async def handle_message(self, app_message: AppMessage) -> None:
else:
# This means that it wasn't sent by the server and is a message from the server in response to an action
event: YieldingEvent = self.remote.pending_response_events.get(
app_message.response.seq, None
app_message.response.seq, None
)
if event is not None:

if self.debug:
self.logger.info(f"[RustPlus.py] Running Response Event: {app_message}")
self.logger.info(
f"[RustPlus.py] Running Response Event: {app_message}"
)

event.set_with_value(app_message)

Expand Down

0 comments on commit 35004db

Please sign in to comment.