Skip to content

v1.5.0.0

Latest

Choose a tag to compare

@ej-mentol ej-mentol released this 12 Oct 04:22

Added

  • New cvars:
    • cf_bind_ip — local IPv4 address bound by both listener and sender sockets (default 0.0.0.0 = all interfaces).
    • cf_say_only — when 1, only say / say_team commands are accepted from UDP.
      • Commands containing ;, CR, LF or NUL are rejected as a whole.
      • Default 0 (off).
  • New console commands:
    • cf_status — shows listener/sender socket states, OS routing probe to cf_server_ip, packet counters (RX, TX, filtered, denied), pong count, RTT, and configuration warnings.
    • cf_ifaces — lists local IPv4 interfaces via SIO_GET_INTERFACE_LIST and marks the route used for cf_server_ip.
    • cf_ping — sends a diagnostic round-trip ping probe to cf_server_ip:cf_server_port.
    • cf_reload — re-reads cvars, recreates listener/sender sockets, and resets statistics counters.
  • Ping/pong diagnostics:
    • cf_ping queues packet tag 0x10 (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_ip or cf_say_only) are always logged with WSA codes and descriptive hints.
    • Successful socket bindings and routing details are logged when cf_debug 1.
  • udp_test_client.py reference peer client:
    • Interface selection (-b / --bind) and target routing (-s, -sp).
    • Answers 0x10 pings with 0x1F PONG.
    • Renders GoldSrc color codes (0x01–0x04) as ANSI terminal colors.
    • Suppresses duplicate packets within a 200 ms sliding window (--show-dups to disable).

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_t on standard GoldSrc engines, then to the local player ID for own messages.
    • Evaluated via CSteamID::IsValid() and BIndividualAccount(): returns 0 for bots, LAN games, or when the engine provides no valid ID.
    • When cf_debug 1, logs the resolved source (src studio, hud, local, or none).
  • Safe client hook: wraps HUD_GetStudioModelInterface only when exported by the client library (returns 0 if absent).
  • Dynamic runtime configuration:
    • CVars are safely polled once per second in HUD_Frame and immediately on cf_reload.
    • Changing cf_bind_ip or cf_listen_port automatically re-binds the sockets.
    • cf_enabled and cf_listen_only apply dynamically at runtime without restarting worker threads.
  • Socket isolation: listener binds exclusively using SO_EXCLUSIVEADDRUSE on Windows (replacing SO_REUSEADDR) to prevent silent port hijacking.
  • Console output: all plugin messages now share a unified [CF] prefix.
  • Packet cleanup: CleanMessage preserves 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 is 0.
  • Peer on a LAN IP (not 127.0.0.1)
    • Set cf_server_ip to the peer's IP address.
    • Use cf_ifaces and cf_status to 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.15 will not receive packets sent to 127.0.0.1).
  • 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.
  • Port conflicts
    • If cf_listen_port is already occupied, the plugin reports WSA 10048 in the console instead of silently sharing the port. Change cf_listen_port or terminate the conflicting application.
  • Security
    • Any host reaching cf_listen_port can execute console commands. Use cf_say_only 1 to restrict input strictly to chat messages, or bind locally via cf_bind_ip 127.0.0.1.
  • Compatibility
    • No existing CVars were renamed or removed; existing configurations remain fully functional.