Make server name learning opt-in to avoid lagging the game server

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
Debian
2026-09-16 21:35:10 +02:00
co-authored by Sisyphus
parent 190152733e
commit 9ea4aa122a
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -413,6 +413,7 @@ def main_loop(screen, args):
ui.print_message(f"^3[^7{timestamp}^3]^7 Requesting connection info...\n")
rcon.send_command(b'zmq_stats_password')
rcon.send_command(b'net_port')
if args.learn_names:
name_capture.request(rcon)
elif monitor_event and monitor_event[0] == zmq.EVENT_DISCONNECTED:
timestamp = time.strftime('%H:%M:%S')
@@ -612,6 +613,7 @@ if __name__ == '__main__':
# Apply config settings to args
args.config_log_level = config.get_log_level()
args.max_history = config.get_max_history(MAX_COMMAND_HISTORY)
args.learn_names = config.get_bool('behavior', 'learn_names', False)
# Handle --list
if args.list:
+4
View File
@@ -44,5 +44,9 @@ max_history = 10
[behavior]
# Seconds to confirm quit (press Ctrl-C twice within this window)
quit_timeout = 3.0
# Learn extra cvar/command names for autocomplete from the server.
# Sends cvarlist + cmdlist on connect: a large burst of messages that can
# lag the game server. Off by default; the built-in names always work.
learn_names = false
# Seconds before players respawn after death
respawn_delay = 3.0