CWorkshopFileInfoManager::AddFileVoteInfoRequest
0x0021c660 · 373 bytes · __thiscall
_ZN24CWorkshopFileInfoManager22AddFileVoteInfoRequestEPK19PublishedFileInfo_tb
Decompiled
undefined (3 params)
/* CWorkshopFileInfoManager::AddFileVoteInfoRequest(PublishedFileInfo_t const*, bool) */
PublishedFileInfo_t __thiscall
CWorkshopFileInfoManager::AddFileVoteInfoRequest
(CWorkshopFileInfoManager *this,PublishedFileInfo_t *param_1,bool param_2)
{
int iVar1;
undefined4 uVar2;
char cVar3;
int iVar4;
void *pvVar5;
int iVar6;
int iVar7;
if (param_1 == (PublishedFileInfo_t *)0x0) {
return (PublishedFileInfo_t)0x0;
}
if ((!param_2) && (param_1[0x251c] != (PublishedFileInfo_t)0x0)) {
return param_1[0x251c];
}
iVar1 = *(int *)(this + 0x84);
iVar6 = *(int *)(this + 0x7c);
iVar7 = iVar1 + 1;
if (iVar6 < iVar7) {
iVar4 = *(int *)(this + 0x80);
if (-1 < iVar4) {
if (iVar4 == 0) {
if (iVar6 == 0) {
if (iVar7 < 5) {
iVar4 = 4;
goto LAB_0021c777;
}
iVar6 = 4;
}
do {
iVar4 = iVar6 * 2;
if (iVar7 <= iVar4) break;
iVar4 = iVar6 * 4;
iVar6 = iVar4;
} while (iVar4 < iVar7);
}
else {
for (iVar4 = (iVar1 / iVar4 + 1) * iVar4; iVar4 < iVar7; iVar4 = (iVar4 + iVar7) / 2) {
}
}
LAB_0021c777:
*(int *)(this + 0x7c) = iVar4;
if (*(void **)(this + 0x78) == (void *)0x0) {
pvVar5 = malloc(iVar4 << 3);
*(void **)(this + 0x78) = pvVar5;
}
else {
pvVar5 = realloc(*(void **)(this + 0x78),iVar4 << 3);
*(void **)(this + 0x78) = pvVar5;
iVar7 = *(int *)(this + 0x84) + 1;
}
goto LAB_0021c6a4;
}
}
pvVar5 = *(void **)(this + 0x78);
LAB_0021c6a4:
*(int *)(this + 0x84) = iVar7;
iVar7 = (iVar7 - iVar1) + -1;
*(void **)(this + 0x88) = pvVar5;
iVar1 = iVar1 * 8;
if (0 < iVar7) {
_V_memmove((void *)((int)pvVar5 + iVar1 + 8),(void *)((int)pvVar5 + iVar1),iVar7 * 8);
pvVar5 = *(void **)(this + 0x78);
}
uVar2 = *(undefined4 *)(param_1 + 4);
*(undefined4 *)((int)pvVar5 + iVar1) = *(undefined4 *)param_1;
*(undefined4 *)((int)pvVar5 + iVar1 + 4) = uVar2;
cVar3 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
if (cVar3 != '\0') {
LoggingSystem_Log(LOG_WORKSHOP,0,"[BaseModPanel] Added voting info query for %llu\n",
*(undefined4 *)param_1,*(undefined4 *)(param_1 + 4));
}
return (PublishedFileInfo_t)0x0;
}
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.