CVoiceGameMgr::UpdateMasks
0x00584740 · 792 bytes · __thiscall
_ZN13CVoiceGameMgr11UpdateMasksEv
Decompiled
undefined (1 param)
/* CVoiceGameMgr::UpdateMasks() */
void __thiscall CVoiceGameMgr::UpdateMasks(CVoiceGameMgr *this)
{
int iVar1;
int iVar2;
int iVar3;
char cVar4;
CBasePlayer *pCVar5;
int *piVar6;
int iVar7;
int iVar8;
uint uVar9;
int iVar10;
uint uVar11;
bool bVar12;
int *local_64;
uint *local_5c;
int *local_58;
char local_45;
uint local_44 [2];
undefined **local_3c [11];
iVar10 = 0;
local_58 = &g_BanMasks;
local_64 = &g_SentBanMasks;
local_5c = &g_SentGameRulesMasks;
*(undefined8 *)(this + 0xc) = 0;
iVar3 = *(int *)(sv_alltalk._28_4_ + 0x30);
if (0 < *(int *)(this + 8)) {
do {
iVar1 = iVar10 + 1;
pCVar5 = (CBasePlayer *)UTIL_PlayerByIndex(iVar1);
if ((pCVar5 != (CBasePlayer *)0x0) &&
(cVar4 = (**(code **)(*(int *)pCVar5 + 0x778))(pCVar5), cVar4 == '\0')) {
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
/* try { // try from 005847d5 to 005847d9 has its CatchHandler @ 00584a73 */
CRecipientFilter::AddRecipient((CRecipientFilter *)local_3c,pCVar5);
uVar11 = 1 << ((byte)iVar10 & 0x1f);
iVar10 = iVar10 >> 5;
if (((&g_bWantModEnable)[iVar10] & uVar11) != 0) {
/* try { // try from 0058480f to 00584a5c has its CatchHandler @ 00584a88 */
UserMessageBegin((IRecipientFilter *)local_3c,"RequestState");
MessageEnd();
(&g_bWantModEnable)[iVar10] = (&g_bWantModEnable)[iVar10] & ~uVar11;
}
local_44[0] = 0;
local_44[1] = 0;
local_45 = '\0';
if ((((&g_PlayerModEnable)[iVar10] & uVar11) != 0) && (0 < *(int *)(this + 8))) {
iVar7 = 0;
do {
iVar2 = iVar7 + 1;
piVar6 = (int *)UTIL_PlayerByIndex(iVar2);
if (((piVar6 != (int *)0x0) &&
(cVar4 = (**(code **)(*piVar6 + 0x778))(piVar6), cVar4 == '\0')) &&
((cVar4 = (**(code **)(**(int **)(this + 4) + 8))
(*(int **)(this + 4),pCVar5,piVar6,&local_45), cVar4 != '\0' ||
(iVar3 != 0)))) {
iVar8 = iVar7 >> 5;
uVar9 = 1 << ((byte)iVar7 & 0x1f);
local_44[iVar8] = local_44[iVar8] | uVar9;
if (local_45 == '\0') {
local_3c[iVar8 + -1] = (undefined **)((uint)local_3c[iVar8 + -1] & ~uVar9);
}
else {
local_3c[iVar8 + -1] = (undefined **)((uint)local_3c[iVar8 + -1] | uVar9);
}
}
iVar7 = iVar2;
} while (iVar2 < *(int *)(this + 8));
}
iVar7 = memcmp(local_44,local_5c,4);
if ((iVar7 != 0) || (iVar7 = memcmp(local_58,local_64,4), iVar7 != 0)) {
*local_5c = local_44[0];
*local_64 = *local_58;
UserMessageBegin((IRecipientFilter *)local_3c,"VoiceMask");
MessageWriteLong(local_44[0]);
MessageWriteLong(*local_58);
MessageWriteByte((uint)(((&g_PlayerModEnable)[iVar10] & uVar11) != 0));
MessageEnd();
}
iVar10 = 0;
while (iVar10 < *(int *)(this + 8)) {
while( true ) {
iVar7 = iVar10 >> 5;
uVar11 = 1 << ((byte)iVar10 & 0x1f);
if ((local_44[iVar7] & uVar11) == 0) {
bVar12 = false;
}
else {
bVar12 = (local_58[iVar7] & uVar11) == 0;
}
iVar10 = iVar10 + 1;
(**(code **)(*g_pVoiceServer + 0xc))(g_pVoiceServer,iVar1,iVar10,bVar12);
if (!bVar12) break;
(**(code **)(*g_pVoiceServer + 0x10))
(g_pVoiceServer,iVar1,iVar10,((uint)local_3c[iVar7 + -1] & uVar11) != 0);
if (*(int *)(this + 8) <= iVar10) goto LAB_00584954;
}
}
LAB_00584954:
local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
}
local_58 = local_58 + 1;
local_64 = local_64 + 1;
local_5c = local_5c + 1;
iVar10 = iVar1;
} while (iVar1 < *(int *)(this + 8));
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.