diff --git a/revoice/src/revoice_main.cpp b/revoice/src/revoice_main.cpp index acc30da..12ed5c2 100644 --- a/revoice/src/revoice_main.cpp +++ b/revoice/src/revoice_main.cpp @@ -9,9 +9,8 @@ void Rehlds_ClientConnected_Hook(IRehldsHook_ClientConnected* chain, IGameClient CRevoicePlayer* plr = GetPlayerByClientPtr(cl); plr->OnConnected(protocol); - if (protocol == 47) { - plr->InitVoice(vct_speex); - } + // default codec + plr->InitVoice(vct_speex); //for p48 we will query sv_version cvar value later in mm_ClientConnect } @@ -101,8 +100,8 @@ void SV_ParseVoiceData_emu(IGameClient* cl) { switch (srcPlayer->GetCodecType()) { case vct_silk: { - //if (nDataLength > MAX_SILK_DATA_LEN || srcPlayer->GetVoiceRate() > MAX_SILK_VOICE_RATE) - //return; + if (nDataLength > MAX_SILK_DATA_LEN || srcPlayer->GetVoiceRate() > MAX_SILK_VOICE_RATE) + return; silkData = chReceived; silkDataLen = nDataLength; speexData = transcodedBuf; @@ -111,8 +110,8 @@ void SV_ParseVoiceData_emu(IGameClient* cl) { } case vct_speex: - //if (nDataLength > MAX_SPEEX_DATA_LEN || srcPlayer->GetVoiceRate() > MAX_SPEEX_VOICE_RATE) - //return; + if (nDataLength > MAX_SPEEX_DATA_LEN || srcPlayer->GetVoiceRate() > MAX_SPEEX_VOICE_RATE) + return; speexData = chReceived; speexDataLen = nDataLength; silkData = transcodedBuf;