CBaseServer::GetNextUserID
0x00108590 · 181 bytes · __thiscall
_ZN11CBaseServer13GetNextUserIDEv
Decompiled
undefined (1 param)
/* CBaseServer::GetNextUserID() */
int __thiscall CBaseServer::GetNextUserID(CBaseServer *this)
{
int *piVar1;
int iVar2;
int iVar3;
int iVar4;
int local_24;
local_24 = 0;
iVar2 = *(int *)(this + 0x120);
if (-1 < iVar2) {
do {
iVar4 = 0;
iVar3 = (local_24 + *(int *)(this + 0x100) + 1) % 0x7fff;
if (iVar2 < 1) {
LAB_00108618:
if (iVar4 == iVar2) {
return iVar3;
}
}
else {
do {
piVar1 = *(int **)(*(int *)(this + 0x114) + iVar4 * 4);
iVar2 = (**(code **)(*piVar1 + 0x14))(piVar1);
if (iVar3 == iVar2) {
iVar2 = *(int *)(this + 0x120);
goto LAB_00108618;
}
iVar2 = *(int *)(this + 0x120);
iVar4 = iVar4 + 1;
} while (iVar4 < iVar2);
if (iVar4 == iVar2) {
return iVar3;
}
}
local_24 = local_24 + 1;
} while (local_24 <= iVar2);
}
return *(int *)(this + 0x100) + 1;
}
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.