CSpeechScriptBridge::Init
0x0080a600 · 222 bytes · __thiscall
_ZN19CSpeechScriptBridge4InitEv
Decompiled
undefined (1 param)
/* CSpeechScriptBridge::Init() */
undefined4 __thiscall CSpeechScriptBridge::Init(CSpeechScriptBridge *this)
{
char cVar1;
undefined4 uVar2;
HSCRIPT__ *pHVar3;
char *pcVar4;
if (*this == (CSpeechScriptBridge)0x0) {
Msg("CSpeechScriptBridge initializing...\n");
}
else {
pcVar4 = "CSpeechScriptBridge was double-initialized: tearing down and rebuilding\n";
Msg();
if (*this != (CSpeechScriptBridge)0x0) {
Term((CSpeechScriptBridge *)pcVar4);
}
}
uVar2 = (**(code **)(*g_pScriptVM + 0x3c))(g_pScriptVM,&DAT_00cc9865,0);
*(undefined4 *)(this + 4) = uVar2;
uVar2 = rr2::IResponseDB::CreateDB();
*(undefined4 *)(this + 0x10) = uVar2;
pHVar3 = (HSCRIPT__ *)0x0;
if (*(HSCRIPT__ **)(this + 4) != (HSCRIPT__ *)&DAT_ffffffff) {
pHVar3 = *(HSCRIPT__ **)(this + 4);
}
cVar1 = VScriptServerRunScript("response_testbed",pHVar3,true);
VScriptServerRunScriptForAllAddons("response_testbed",pHVar3,true);
pcVar4 = "loaded successfully";
if (cVar1 == '\0') {
pcVar4 = "failed to load";
}
Msg("\tHSCRIPT %s\n",pcVar4);
*this = (CSpeechScriptBridge)0x1;
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.