Skip to content

Commit

Permalink
Formatting Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
olijeffers0n committed May 22, 2024
1 parent d52d865 commit 741e299
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
7 changes: 4 additions & 3 deletions rustplus/api/remote/rustws.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,10 @@ async def run(self) -> None:

try:
# This creates an asyncio task rather than awaiting the coroutine directly.
# This fixes the bug where if you called a BaseRustSocket#get... from within a RegisteredListener or callback,
# It would hang the websocket. This is because the websocket event loop would be stuck on the callback rather than polling the socket.
# This way, we can schedule the execution of all logic for this message, but continue polling the WS
# This fixes the bug where if you called a BaseRustSocket#get... from within a RegisteredListener or
# callback, It would hang the websocket. This is because the websocket event loop would be stuck on the
# callback rather than polling the socket. This way, we can schedule the execution of all logic for this
# message, but continue polling the WS
await self.run_coroutine_non_blocking(self.handle_message(app_message))
except Exception:
self.logger.exception(
Expand Down
4 changes: 1 addition & 3 deletions rustplus/api/rust_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ async def get_map(

for marker in map_markers:
if add_events:
if (
marker.type in RustMarker.Events
):
if marker.type in RustMarker.Events:
icon = convert_marker(str(marker.type), marker.rotation)
if marker.type == 6:
x = marker.x
Expand Down
8 changes: 7 additions & 1 deletion rustplus/api/structures/rust_marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ class RustMarker(Serializable):
RadiusMarker = 7
PatrolHelicopterMarker = 8

Events = (ExplosionMarker, ChinookMarker, CargoShipMarker, CrateMarker, PatrolHelicopterMarker)
Events = (
ExplosionMarker,
ChinookMarker,
CargoShipMarker,
CrateMarker,
PatrolHelicopterMarker,
)

def __init__(self, data: AppMarker) -> None:
self._id: int = data.id
Expand Down
2 changes: 1 addition & 1 deletion rustplus/commands/command_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def register_command(self, data: CommandData) -> None:

async def run_command(self, message: RustChatMessage, prefix) -> None:
if prefix == self.command_options.prefix:
command = shlex.split(message.message)[0][len(prefix) :]
command = shlex.split(message.message)[0][len(prefix):]
else:
command = prefix

Expand Down

0 comments on commit 741e299

Please sign in to comment.