def match_rcon(matchid):
match = Match.query.get_or_404(matchid)
admintools_check(g.user, match)
command = request.values.get('command')
server = GameServer.query.get_or_404(match.server_id)
if command:
try:
rcon_response = server.send_rcon_command(
command, raise_errors=True)
if rcon_response:
rcon_response = Markup(rcon_response.replace('\n', '<br>'))
else:
rcon_response = 'No output'
flash(rcon_response)
except util.RconError as e:
print(e)
flash('Failed to send command: ' + str(e))
return redirect('/match/{}'.format(matchid))
评论列表
文章目录