Skip to content

Commit

Permalink
Return switch_player_now and switch_player_on_death result as a bool …
Browse files Browse the repository at this point in the history
…and not str
  • Loading branch information
cemathey committed May 22, 2024
1 parent d1103b5 commit 847decc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions rcon/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,16 @@ def set_votekick_thresholds(self, threshold_pairs: str) -> str:
def reset_votekick_thresholds(self) -> bool:
return self._str_request(f"resetvotekickthreshold", log_info=True) == SUCCESS

def switch_player_on_death(self, player_name) -> str:
return self._str_request(f"switchteamondeath {player_name}", log_info=True)
def switch_player_on_death(self, player_name) -> bool:
return (
self._str_request(f"switchteamondeath {player_name}", log_info=True)
== SUCCESS
)

def switch_player_now(self, player_name) -> str:
return self._str_request(f"switchteamnow {player_name}", log_info=True)
def switch_player_now(self, player_name: str) -> bool:
return (
self._str_request(f"switchteamnow {player_name}", log_info=True) == SUCCESS
)

def add_map_to_rotation(
self,
Expand Down
4 changes: 2 additions & 2 deletions rcon/rcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,10 +1128,10 @@ def punish(self, player_name: str, reason: str, by: str) -> bool:
)
return res

def switch_player_now(self, player_name, by) -> str:
def switch_player_now(self, player_name: str) -> bool:
return super().switch_player_now(player_name)

def switch_player_on_death(self, player_name, by) -> str:
def switch_player_on_death(self, player_name, by) -> bool:
return super().switch_player_on_death(player_name)

def kick(self, player_name, reason, by, player_id: str | None = None) -> bool:
Expand Down

0 comments on commit 847decc

Please sign in to comment.