Skip to content

feat: VoiceTranscoder API 3.1 support (block natives) and VTC_PlaySound broadcast - #396

Open
Nord1cWarr1or wants to merge 2 commits into
rehlds:masterfrom
Nord1cWarr1or:feat/vtc-api31-block-natives
Open

Nord1cWarr1or wants to merge 2 commits into
rehlds:masterfrom
Nord1cWarr1or:feat/vtc-api31-block-natives

Conversation

@Nord1cWarr1or

Copy link
Copy Markdown
Member

What

Brings the module in line with the actual VoiceTranscoder metamod module (2017RC5, API 3.1) and exposes its block API to Pawn:

  1. Vendor header syncreapi/include/vtc_api.h replaced with the real module header (API 3.1): MajorVersion()/MinorVersion() naming, plus the previously missing BlockClient() / UnblockClient() / IsClientBlocked(). The vtable slot order is unchanged for slots 0–9, so existing binaries keep working against both API 3.0 and 3.1 modules.

  2. New natives (guarded at runtime by the cached minor version; on VTC < 3.1 they log an error and return FALSE instead of risking a vtable overrun):

    • native VTC_BlockClient(const index);
    • native VTC_UnblockClient(const index);
    • native bool:VTC_IsClientBlocked(const index);

    Unlike VTC_MuteClient (drops the voice at distribution stage, speaking events still fire), BlockClient drops the voice packets at parse time — the player is not treated as speaking at all.

  3. VTC_PlaySound broadcast — the VTC API natively treats receiver = 0 as "play to all clients" (client = nullptr skips the per-destination filter), but the adapter rejected it via CHECK_ISPLAYER. The check is now 0..maxClients, so plugins can broadcast.

  4. Compatibility — the minor-version gate in VTC_Api_Init() became a notice instead of a hard failure: VTC 3.0 modules keep working (all pre-existing natives unaffected), only the new block natives require API ≥ 3.1.

Verification

  • Builds cleanly on Linux 32-bit ([100%] Built target reapi; only the pre-existing harmless DT_TEXTREL ld warning).
  • Behavior verified statically against the VTC 3.1 sources (API.cpp, Main.cpp); VTC 3.0 path covered by the runtime guard.
  • Include docs are updated in this same PR (per the "native change must update the matching .inc" rule). The general documentation overhaul PR (docs: include documentation overhaul (engine/cssdk/gamedll/reunion) + cssdk constants expansion #395) keeps only the current-behavior notes; the three new native declarations live here to avoid overlap.

Notes

…roadcast

- sync vendored vtc_api.h with the real VTC module (2017RC5, API 3.1): MajorVersion/MinorVersion, BlockClient/UnblockClient/IsClientBlocked
- cache the real minor version at init; VTC 3.0 stays supported (the minor gate is a notice now, not fatal)
- new natives VTC_BlockClient/VTC_UnblockClient/VTC_IsClientBlocked with an API 3.1 guard (LogError + FALSE on older VTC)
- VTC_PlaySound: allow receiver = 0 (broadcast to all clients, natively supported by VTC); receivers above maxClients are still rejected
- reapi_vtc.inc: declare VTC_BlockClient/VTC_UnblockClient/VTC_IsClientBlocked
- VTC_PlaySound: document receiver 0 = all clients, gamedir-relative path and the PCM WAV requirement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant