mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-11-07 17:36:08 +00:00
Update Management.py
This commit is contained in:
parent
3f46c867b6
commit
68349e3eea
1 changed files with 24 additions and 6 deletions
|
|
@ -374,6 +374,8 @@ def quit(arguments):
|
||||||
def mute(arguments, clientid):
|
def mute(arguments, clientid):
|
||||||
if len(arguments) == 0:
|
if len(arguments) == 0:
|
||||||
serverdata.muted = True
|
serverdata.muted = True
|
||||||
|
logger.log("Server muted by chat command")
|
||||||
|
sendchat("Server muted")
|
||||||
try:
|
try:
|
||||||
cl_id = int(arguments[0])
|
cl_id = int(arguments[0])
|
||||||
duration = int(arguments[1]) if len(arguments) >= 2 else 0.5
|
duration = int(arguments[1]) if len(arguments) >= 2 else 0.5
|
||||||
|
|
@ -397,9 +399,14 @@ def mute(arguments, clientid):
|
||||||
|
|
||||||
|
|
||||||
def un_mute(arguments, clientid):
|
def un_mute(arguments, clientid):
|
||||||
if len(arguments) == []:
|
|
||||||
serverdata.muted = False
|
|
||||||
try:
|
try:
|
||||||
|
if len(arguments) == 0:
|
||||||
|
# Unmute the entire server
|
||||||
|
serverdata.muted = False
|
||||||
|
logger.log("Server unmuted by chat command")
|
||||||
|
sendchat("Server unmuted")
|
||||||
|
return
|
||||||
|
|
||||||
cl_id = int(arguments[0])
|
cl_id = int(arguments[0])
|
||||||
for me in ba.internal.get_game_roster():
|
for me in ba.internal.get_game_roster():
|
||||||
if me["client_id"] == clientid:
|
if me["client_id"] == clientid:
|
||||||
|
|
@ -411,12 +418,23 @@ def un_mute(arguments, clientid):
|
||||||
sendchat(f'{myself} unmuted {ros["display_string"]}')
|
sendchat(f'{myself} unmuted {ros["display_string"]}')
|
||||||
return
|
return
|
||||||
for account in serverdata.recents: # backup case if player left the server
|
for account in serverdata.recents: # backup case if player left the server
|
||||||
if account['client_id'] == int(arguments[0]):
|
if account['client_id'] == cl_id:
|
||||||
pdata.unmute(account["pbid"])
|
pdata.unmute(account["pbid"])
|
||||||
logger.log(
|
logger.log(
|
||||||
f'unmuted {ros["display_string"]} by chat command, recents')
|
f'unmuted {account["display_string"]} by chat command, recents')
|
||||||
except:
|
sendchat(f'{myself} unmuted {account["display_string"]} from recent players')
|
||||||
pass
|
return
|
||||||
|
# If the specified player is not found
|
||||||
|
logger.error(f"Player with client ID {cl_id} not found")
|
||||||
|
sendchat("Player not found. Make sure to specify a valid player ID.")
|
||||||
|
except ValueError:
|
||||||
|
# Handle the case where int(arguments[0]) fails to convert to an integer
|
||||||
|
logger.error("Invalid argument provided for un_mute function.")
|
||||||
|
sendchat("Invalid argument provided. Make sure to specify a valid player ID.")
|
||||||
|
except Exception as e:
|
||||||
|
# Handle other exceptions (e.g., network errors, etc.)
|
||||||
|
logger.error(f"An error occurred in un_mute function: {e}")
|
||||||
|
sendchat("An error occurred while processing the command. Please try again later.")
|
||||||
|
|
||||||
|
|
||||||
def remove(arguments):
|
def remove(arguments):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue