feat: VoiceTranscoder API 3.1 support (block natives) and VTC_PlaySound broadcast - #396
Open
Nord1cWarr1or wants to merge 2 commits into
Open
Nord1cWarr1or wants to merge 2 commits into
Nord1cWarr1or wants to merge 2 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Brings the module in line with the actual VoiceTranscoder metamod module (2017RC5, API 3.1) and exposes its block API to Pawn:
Vendor header sync —
reapi/include/vtc_api.hreplaced with the real module header (API 3.1):MajorVersion()/MinorVersion()naming, plus the previously missingBlockClient()/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.New natives (guarded at runtime by the cached minor version; on VTC < 3.1 they log an error and return
FALSEinstead 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),BlockClientdrops the voice packets at parse time — the player is not treated as speaking at all.VTC_PlaySoundbroadcast — the VTC API natively treatsreceiver = 0as "play to all clients" (client = nullptrskips the per-destination filter), but the adapter rejected it viaCHECK_ISPLAYER. The check is now0..maxClients, so plugins can broadcast.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
[100%] Built target reapi; only the pre-existing harmlessDT_TEXTRELld warning).API.cpp,Main.cpp); VTC 3.0 path covered by the runtime guard.Notes
fgetcchunk scan inPlaySoundhangs on a non-WAV file) will be reported to the VTC maintainer separately.