SV_Frame
0x001ffe40 · 1233 bytes · __cdecl
_Z8SV_Frameb
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SV_Frame(bool) */
void SV_Frame(bool param_1)
{
int iVar1;
char cVar2;
CSteam3Server *this;
int iVar3;
bool bVar4;
bool bVar5;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_44 = 0;
local_40 = 0;
if (_exit == 0) {
local_2c = 0;
}
else {
(**(code **)(_exit + 0x50))
(_exit,&local_44,0,0,0,0,"/data/src/engine/./sv_main.cpp",0xc3d,
&SV_Frame(bool)::tm_fmt,"(%s)%s","Unaccounted","SV_Frame");
local_2c = _exit;
}
iVar1 = _DAT_0040b9d4;
local_34 = local_44;
local_30 = local_40;
/* try { // try from 0020005e to 002000ac has its CatchHandler @ 00200377 */
if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
(iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
if ((char *)*_DAT_0040b030 != "SV_Frame") {
_DAT_0040b030 =
(int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2c343c,&DAT_00000001,0x2a054b);
}
CVProfNode::EnterScope();
DAT_0040b02c = '\0';
}
if ((serverGameDLL != (int *)0x0) && (param_1)) {
/* try { // try from 00200285 to 00200330 has its CatchHandler @ 0020037b */
(**(code **)(*serverGameDLL + 0x7c))(serverGameDLL,1);
}
/* try { // try from 001fff12 to 001ffff9 has its CatchHandler @ 0020037b */
if ((DAT_003b7f64 < 2) || (cVar2 = Host_ShouldRun(), cVar2 == '\0')) {
local_3c = 0;
local_38 = 0;
if (_SetSeed == 0) {
local_20 = 0;
}
else {
/* try { // try from 0020012f to 00200131 has its CatchHandler @ 0020037b */
(**(code **)(_SetSeed + 0x50))
(_SetSeed,&local_3c,0,_VStdLib_GetICVarFactory,0,0,"/data/src/engine/./sv_main.cpp",
0xc47,&SV_Frame(bool)::tm_fmt,&DAT_002c48a3,"ProcessSocket");
local_20 = _SetSeed;
}
local_28 = local_3c;
local_24 = local_38;
/* try { // try from 00200156 to 0020015a has its CatchHandler @ 0020034b */
NET_ProcessSocket(1,(IConnectionlessPacketHandler *)&sv);
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
iVar1 = _DAT_0040b9d4;
if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
(iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0040b030 = (int *)_DAT_0040b030[0x19];
}
DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
}
if (local_2c != 0) {
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
}
return;
}
bVar4 = DAT_003b7f64 != 3;
g_ServerGlobalVariables._16_4_ = DAT_003a1730;
bVar5 = false;
if (sv_noclipduringpause != 0) {
bVar5 = *(int *)(*(int *)(sv_noclipduringpause + 0x1c) + 0x30) != 0;
}
CNetworkStringTableContainer::Lock
((CNetworkStringTableContainer *)networkStringTableContainerServer,false);
CBaseServer::RunFrame((CBaseServer *)&sv);
if (DAT_003b8080 < 1) {
if (1 < DAT_003b8064) {
SV_Think(false);
}
}
else {
if (((serverGameDLL != (int *)0x0) &&
(cVar2 = (**(code **)(*serverGameDLL + 0x60))(serverGameDLL), cVar2 == '\0')) &&
((bVar5 != false || (bVar4)))) {
DAT_003b7f6c = DAT_003b7f6c + 1;
CNetworkStringTableContainer::SetTick
((CNetworkStringTableContainer *)networkStringTableContainerServer,DAT_003b7f6c);
}
SV_Think(bVar4);
}
if (param_1) {
if ((g_bThreadedEngine == '\0') || (1 < DAT_003b8064)) {
SV_SendClientUpdates(bVar4,bVar5);
}
else {
g_pDeferredServerWork = operator_new(0x18);
*g_pDeferredServerWork = &PTR_AddRef_002c3a08;
*(bool *)(g_pDeferredServerWork + 5) = bVar4;
g_pDeferredServerWork[3] = 1;
g_pDeferredServerWork[2] = &PTR__CFunctor2_002c3a24;
g_pDeferredServerWork[4] = SV_SendClientUpdates;
*(bool *)((int)g_pDeferredServerWork + 0x15) = bVar5;
}
}
CNetworkStringTableContainer::Lock
((CNetworkStringTableContainer *)networkStringTableContainerServer,true);
if (1 < DAT_003b8064) {
this = (CSteam3Server *)Steam3Server();
CSteam3Server::RunFrame(this);
}
iVar1 = _DAT_0040b9d4;
if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
(iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0040b030 = (int *)_DAT_0040b030[0x19];
}
DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
}
if (local_2c == 0) {
return;
}
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
return;
}
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.