CServerDemo::LookupOrAddModel
0x005983f0 · 171 bytes · __thiscall
_ZN11CServerDemo16LookupOrAddModelEPKc
Decompiled
undefined (2 params)
/* CServerDemo::LookupOrAddModel(char const*) */
int __thiscall CServerDemo::LookupOrAddModel(CServerDemo *this,char *param_1)
{
char *__s2;
int iVar1;
int iVar2;
CUtlString local_2c [28];
if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
iVar2 = 0;
if (0 < *(int *)(this + 0x110)) {
do {
__s2 = CUtlString::operator_cast_to_char_
((CUtlString *)(iVar2 * 0x10 + *(int *)(this + 0x104)));
iVar1 = strcmp(param_1,__s2);
if (iVar1 == 0) {
return iVar2;
}
iVar2 = iVar2 + 1;
} while (iVar2 < *(int *)(this + 0x110));
}
CUtlString::CUtlString(local_2c,param_1);
/* try { // try from 00598483 to 00598487 has its CatchHandler @ 005984a5 */
iVar2 = CUtlVector<CUtlString,CUtlMemory<CUtlString,int>>::InsertBefore
((CUtlVector<CUtlString,CUtlMemory<CUtlString,int>> *)(this + 0x104),
*(int *)(this + 0x110),local_2c);
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_2c);
return iVar2;
}
return -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.