finally updating name and steamID by just reconnecting, no more game relaunching

This commit is contained in:
2026-07-24 10:09:52 +01:00
parent 19ee3072a0
commit 19e7ff4f14
3 changed files with 168 additions and 59 deletions
+24
View File
@@ -173,6 +173,30 @@ def handle_input(event):
xdotool('click', button)
elif t == 'release_keys':
release_all_keys()
elif t == 'connect_to_server':
threading.Thread(target=_connect_to_server_sequence, daemon=True).start()
# ── Automated menu-connect sequence ──────────────────────────────────────────
# Triggered when the signaling server writes a new password (real visitor IP)
# into GameMenu.res for a new controller. Opens the in-game escape menu,
# moves the mouse to the "UNLOZE | ZombieEscape" button at its fixed absolute
# position (measured empirically at 800x600: x=110, y=348), and clicks it.
# This re-connects the client with the freshly-written password, which the
# server-side connect extension reads to assign the correct name/SteamID —
# all without restarting the CSS process itself.
CONNECT_BUTTON_X = 110
CONNECT_BUTTON_Y = 348
def _connect_to_server_sequence():
log.info('connect_to_server: opening menu')
xdotool('key', 'Escape')
time.sleep(0.5) # let the menu render
xdotool('mousemove', '--sync', str(CONNECT_BUTTON_X), str(CONNECT_BUTTON_Y))
time.sleep(0.2) # let the button highlight/register hover
xdotool('click', '1')
log.info('connect_to_server: clicked ZombieEscape button')
# ── GStreamer Pipeline ────────────────────────────────────────────────────────
class CSSStreamAgent: