Repository navigation
Releases
Releases · ej-mentol/Chat-Forwarder
v1.5.0.0
Added
- New cvars:
cf_bind_ip— local IPv4 address bound by both listener and sender sockets (default0.0.0.0= all interfaces).cf_say_only— when1, onlysay/say_teamcommands are accepted from UDP.- Commands containing
;, CR, LF or NUL are rejected as a whole. - Default
0(off).
- Commands containing
- New console commands:
cf_status— shows listener/sender socket states, OS routing probe tocf_server_ip, packet counters (RX, TX, filtered, denied), pong count, RTT, and configuration warnings.cf_ifaces— lists local IPv4 interfaces viaSIO_GET_INTERFACE_LISTand marks the route used forcf_server_ip.cf_ping— sends a diagnostic round-trip ping probe tocf_server_ip:cf_server_port.cf_reload— re-reads cvars, recreates listener/sender sockets, and resets statistics counters.
- Ping/pong diagnostics:
cf_pingqueues packet tag0x10(ping <nonce>).- A peer may reply with
0x1F+PONG <nonce> <ip>:<port>. - Successful pong updates measured RTT and the peer-seen external IP address in
cf_status. - Backwards-compatible: peers ignoring ping continue functioning normally.
- In-game console diagnostics from network threads:
- Errors (bind failures, WSA socket errors, packets dropped by
cf_allow_iporcf_say_only) are always logged with WSA codes and descriptive hints. - Successful socket bindings and routing details are logged when
cf_debug 1.
- Errors (bind failures, WSA socket errors, packets dropped by
udp_test_client.pyreference peer client:- Interface selection (
-b/--bind) and target routing (-s,-sp). - Answers
0x10pings with0x1F PONG. - Renders GoldSrc color codes (
0x01–0x04) as ANSI terminal colors. - Suppresses duplicate packets within a 200 ms sliding window (
--show-dupsto disable).
- Interface selection (
Changed
CHAT(0x12) packets now carry the message author's SteamID64 instead of always the local player's:- On Sven Co-op, resolved directly via the engine studio player table (
player_info_sc_t). - Falls back to
hud_player_info_ton standard GoldSrc engines, then to the local player ID for own messages. - Evaluated via
CSteamID::IsValid()andBIndividualAccount(): returns0for bots, LAN games, or when the engine provides no valid ID. - When
cf_debug 1, logs the resolved source (src studio,hud,local, ornone).
- On Sven Co-op, resolved directly via the engine studio player table (
- Safe client hook: wraps
HUD_GetStudioModelInterfaceonly when exported by the client library (returns0if absent). - Dynamic runtime configuration:
- CVars are safely polled once per second in
HUD_Frameand immediately oncf_reload. - Changing
cf_bind_iporcf_listen_portautomatically re-binds the sockets. cf_enabledandcf_listen_onlyapply dynamically at runtime without restarting worker threads.
- CVars are safely polled once per second in
- Socket isolation: listener binds exclusively using
SO_EXCLUSIVEADDRUSEon Windows (replacingSO_REUSEADDR) to prevent silent port hijacking. - Console output: all plugin messages now share a unified
[CF]prefix. - Packet cleanup:
CleanMessagepreserves GoldSrc color bytes (0x01–0x04) and formatting (\n,\r,\t), stripping all other control codes.
Fixed
- Fixed silent listener thread termination on socket errors or bind failures (the thread now logs the WSA error, sleeps, and retries).
- Thread-safety: worker threads no longer access engine
cvar_t*pointers directly (network config is snapshotted via thread-safe structure). - Receive buffer enlarged from 256 to 512 bytes to accommodate longer command strings.
- Prevented static variable ODR violation in inline queue push logic (
dropCount_moved to member variable).
Upgrade notes
- Receivers / Parsers
- Ignore unknown packet tag bytes for forward compatibility.
- The 8-byte SteamID field in
CHAT(0x12) now contains the author's SteamID64 instead of the local player's. Fall back to the player name when this field is0.
- Peer on a LAN IP (not 127.0.0.1)
- Set
cf_server_ipto the peer's IP address. - Use
cf_ifacesandcf_statusto verify OS routing. - If bound to a specific IP, the peer must target that same interface (e.g. a peer bound to
192.168.0.15will not receive packets sent to127.0.0.1).
- Set
cf_allow_ip- Compares the UDP datagram source IP. A peer on the same PC sending to a LAN IP arrives from that LAN IP, not from
127.0.0.1.
- Compares the UDP datagram source IP. A peer on the same PC sending to a LAN IP arrives from that LAN IP, not from
- Port conflicts
- If
cf_listen_portis already occupied, the plugin reportsWSA 10048in the console instead of silently sharing the port. Changecf_listen_portor terminate the conflicting application.
- If
- Security
- Any host reaching
cf_listen_portcan execute console commands. Usecf_say_only 1to restrict input strictly to chat messages, or bind locally viacf_bind_ip 127.0.0.1.
- Any host reaching
- Compatibility
- No existing CVars were renamed or removed; existing configurations remain fully functional.
v1.4.5.2
v1.4.5.2
Fixed
- Race on cvar_t::string in OutputDebugStringA/QueueTask, read from a foreign thread while main thread could mutate it. Moved to mutex-guarded snapshot
- udp_test_client: dedup now scoped by tag, no longer suppresses identical text arriving on different channels
Small update
Security: Independent Listener Filtering (cf_allow_ip)
Incoming command security is now decoupled from the outgoing log destination:
- Added a new CVar: cf_allow_ip (Defaults to *).
- The plugin now accepts incoming UDP console commands from the IP address specified in this CVar, regardless of the
cf_server_ip setting. - How it works: By default (*), the plugin accepts commands from any IP address to ensure out-of-the-box
compatibility on local networks. If your control bot or script is on a specific machine (e.g., 192.168.0.10), you
should explicitly restrict access by setting cf_allow_ip "192.168.0.10" in your configuration.
v1.4.5
Protocol & Core
- Updated UDP Protocol: Transitioned to a new binary packet structure. Each packet now includes an 8-byte SteamID64
field (Layout: [1-byte Tag] [8-byte SteamID64 LE] [Message Body]). - SteamID Integration: The plugin now captures the local player's SteamID64 and forwards it with chat messages,
allowing for precise player identification. - Safe Shutdown: Enhanced thread management and resource deallocation. The plugin now explicitly waits for worker
threads to terminate and close network sockets. While this ensures a clean exit and prevents crashes, it may cause
a slight delay when closing the game. - Internal Stability: Added safety checks for message buffers and implemented a reentry guard for system log
capturing to prevent infinite recursion. - Version Bump: Core plugin updated to version 1.4.5.
UDP Test Client (Python)
- Interface Selection: Added an interactive startup menu to select the network interface/IP address for binding the
listener. - CLI Arguments: Added support for command-line arguments:
-b / --bind: Specify bind IP.
-s / --server: Specify target server IP.
-lp / -sp: Customize listen and send ports.
--show-dups: Toggle to disable duplicate filtering. - Duplicate Suppression: Implemented a default 200ms window to filter redundant messages (e.g., engine loopbacks on
listen servers). - SteamID Formatting: Automatic conversion of raw SteamID64 to the legacy STEAM_0:Y:Z format for more familiar
console output. - UI Improvements: Aligned all message tags ([CHAT], [SYS], etc.) for consistent vertical formatting and added a
startup hint for --help. - Stability: Refined KeyboardInterrupt handling for a cleaner exit (no stack traces) when pressing Ctrl+C.
Chat Forwarder v1.4.4
fix(client): dedup only suppresses SYS, not CHAT/GAME/NET Previously the first-arriving tag would win regardless of priority, so if SYS arrived before CHAT the user's chat message would be dropped. Now only tags in DEDUP_SUPPRESS_TAGS (SYS by default) are ever silently dropped. All other tags (CHAT, GAME, NET, STUFF) always display and register their content into the dedup buffer so subsequent SYS echoes of the same message are suppressed correctly in both arrival orders: SYS first -> shown, registered -> CHAT shown -> 2nd SYS DROPPED CHAT first -> shown, registered -> SYS DROPPED
Chat Forwarder v1.4.3
- Forward game chat, logs, and commands via UDP (0x12-0x16 protocol)
- Add autonomous build script (build_plugin.ps1)
- Add standalone Python test client with ANSI colors
- Document protocol and configuration in README.md
- Preserve GoldSrc color codes (0x01-0x04) in forwarded messages