Browse Source

KPACUBO

master
gsd 2 years ago
parent
commit
1a70330080
  1. 16
      ext/python-a2s-rcon-api/service.py

16
ext/python-a2s-rcon-api/service.py

@ -94,12 +94,16 @@ class SourceBackend:
if(request.password == None): if(request.password == None):
return Response(status_code = 403) return Response(status_code = 403)
status_lines:str = await VALVE_SERVER_RCON( try:
"status", status_lines:str = await VALVE_SERVER_RCON(
host = request.address, "status",
port = request.port, host = request.address,
passwd = request.password port = request.port,
) passwd = request.password
)
except UnicodeDecodeError as err:
print(f"Cannot execute 'status' on {request.address}:{request.port}, error: {err}")
return Response(status_code = 500)
try: try:
start_index = status_lines.index("# userid") start_index = status_lines.index("# userid")

Loading…
Cancel
Save