CMapListManager::RefreshList
0x0017f190 · 488 bytes · __thiscall
_ZN15CMapListManager11RefreshListEv
Decompiled
undefined (1 param)
/* CMapListManager::RefreshList() */
void __thiscall CMapListManager::RefreshList(CMapListManager *this)
{
char *pcVar1;
int iVar2;
int iVar3;
int in_GS_OFFSET;
char *local_ec;
undefined4 local_e8;
undefined4 local_e4;
char local_e0 [96];
char local_80 [96];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(float *)(this + 0x24) == -1.0) {
BuildList(this);
}
else if (*(float *)(this + 0x24) + 60.0 <= realtime) {
ConDMsg("Refreshing map list...\n");
V_strncpy(local_e0,"maps/*.bsp",0x60);
pcVar1 = (char *)Sys_FindFirst(local_e0,(char *)0x0,0);
while (pcVar1 != (char *)0x0) {
iVar2 = V_stristr(pcVar1,".360.bsp");
if (iVar2 == 0) {
V_snprintf(local_80,0x60,"maps/%s",pcVar1);
local_e8 = 1;
local_e4 = 0;
local_ec = local_80;
iVar2 = CUtlRBTree<CUtlMap<char_const*,CMapListItem,int>::Node_t,int,CUtlMap<char_const*,CMapListItem,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CMapListItem,int>::Node_t,int>,int>>
::Find((CUtlRBTree<CUtlMap<char_const*,CMapListItem,int>::Node_t,int,CUtlMap<char_const*,CMapListItem,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CMapListItem,int>::Node_t,int>,int>>
*)this,(Node_t *)&local_ec);
if (iVar2 == -1) {
local_ec = (char *)0x1;
local_e8 = 0;
local_e8 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x34))(g_pFileSystem + 4,local_80,0)
;
local_ec = &DAT_00000001;
CUtlDict<CMapListItem,int>::Insert
((CUtlDict<CMapListItem,int> *)this,local_80,(CMapListItem *)&local_ec);
this[0x28] = (CMapListManager)0x1;
}
else {
iVar3 = iVar2 * 0x1c + *(int *)(this + 4);
iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x34))(g_pFileSystem + 4,local_80,0);
if (iVar2 != *(int *)(iVar3 + 0x18)) {
*(int *)(iVar3 + 0x18) = iVar2;
*(undefined4 *)(iVar3 + 0x14) = 1;
this[0x28] = (CMapListManager)0x1;
}
}
}
pcVar1 = (char *)Sys_FindNext((char *)0x0,0);
}
Sys_FindClose();
*(float *)(this + 0x24) = realtime;
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.