mirror of
https://github.com/onyx-and-iris/q3rcon-cli.git
synced 2026-04-13 04:23:38 +00:00
pass send_command(interpret=True) for commands that return long responses. note, it strips the first `"` from cvar responses which causes CVAR_REGEX to fail.
24 lines
692 B
Python
24 lines
692 B
Python
from aioq3rcon import Client
|
|
from clypi import Command, Spinner, arg
|
|
from typing_extensions import override
|
|
|
|
from q3rcon_cli import console
|
|
|
|
|
|
class Maprestart(Command):
|
|
"""Restarts the current map."""
|
|
|
|
host: str = arg(inherited=True)
|
|
port: int = arg(inherited=True)
|
|
password: str = arg(inherited=True)
|
|
|
|
@override
|
|
async def run(self):
|
|
async with Spinner('Restarting map', suffix='...'):
|
|
async with Client(
|
|
self.host, self.port, self.password, timeout=3, fragment_read_timeout=1
|
|
) as client:
|
|
response = await client.send_command('map_restart', interpret=True)
|
|
|
|
console.out.print_response(response)
|