From 9ea4aa122adcec09ac222252b3c38d6a788e0512 Mon Sep 17 00:00:00 2001 From: Debian Date: Wed, 16 Sep 2026 21:35:10 +0200 Subject: [PATCH] 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 --- main.py | 4 +++- qlpycon.conf.example | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 4b807a8..bb78f6c 100644 --- a/main.py +++ b/main.py @@ -413,7 +413,8 @@ 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') - name_capture.request(rcon) + if args.learn_names: + name_capture.request(rcon) elif monitor_event and monitor_event[0] == zmq.EVENT_DISCONNECTED: timestamp = time.strftime('%H:%M:%S') ui.print_message(f"^3[^7{timestamp}^3] ^8^1Disconnected from server - waiting for reconnect...^0^7\n") @@ -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: diff --git a/qlpycon.conf.example b/qlpycon.conf.example index b8ff505..7143c50 100644 --- a/qlpycon.conf.example +++ b/qlpycon.conf.example @@ -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