Skip to content

Executing too many cheat commands results in client getting kicked #29

@Ayuto

Description

@Ayuto

Kick message: #GameUI_Disconnect_TooManyCommands

Temporary workaround:

from cvars import cvar
from commands.server import ServerCommand
from engines.server import queue_command_string

sv_quota_stringcmdspersecond = cvar.find_var('sv_quota_stringcmdspersecond')
if sv_quota_stringcmdspersecond is None:
    raise Exception('Fix is not required for this game.')

old_value = sv_quota_stringcmdspersecond.get_string()

@ServerCommand('ent_fire')
def on_ent_fire(command):
    sv_quota_stringcmdspersecond.set_string('99999')
    queue_command_string(f'sv_quota_stringcmdspersecond {old_value}')

This needs to be improved, because of:

  1. DOS attacks if sv_cheats is enabled
  2. Also needs to be done for the other cheat commands like es.give, es.entcreate, etc.
  3. It's ugly

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions