CWin32UploadGameStats::SendGracefulClose
0x00213790 · 473 bytes · __thiscall
_ZN21CWin32UploadGameStats17SendGracefulCloseER22EGameStatsUploadStatusR10CUtlBuffer
Decompiled
undefined (3 params)
/* CWin32UploadGameStats::SendGracefulClose(EGameStatsUploadStatus&, CUtlBuffer&) */
bool __thiscall
CWin32UploadGameStats::SendGracefulClose
(CWin32UploadGameStats *this,EGameStatsUploadStatus *param_1,CUtlBuffer *param_2)
{
char cVar1;
ssize_t sVar2;
void *pvVar3;
int iVar4;
undefined1 local_20;
undefined1 local_1f;
undefined1 local_1e;
undefined1 local_1d;
UpdateProgress(*(TGameStatsParameters **)(this + 0x2c),"Closing connection to server.");
*(undefined4 *)(param_2 + 0xc) = 0;
*(undefined4 *)(param_2 + 0x10) = 0;
*(undefined4 *)(param_2 + 0x20) = 0;
*(undefined4 *)(param_2 + 0x1c) = 0;
param_2[0x14] = (CUtlBuffer)0x0;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)param_2);
if (((byte)param_2[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckPut(param_2,4);
if (cVar1 != '\0') {
if (((byte)param_2[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) = 1
;
iVar4 = *(int *)(param_2 + 0x10);
}
else {
iVar4 = *(int *)(param_2 + 0x10);
pvVar3 = (void *)((iVar4 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
if (pvVar3 != (void *)0x0) {
local_20 = 0;
local_1f = 0;
local_1e = 0;
local_1d = 1;
_V_memcpy(pvVar3,&local_20,4);
iVar4 = *(int *)(param_2 + 0x10);
}
}
*(int *)(param_2 + 0x10) = iVar4 + 4;
CUtlBuffer::AddNullTermination(param_2);
}
}
else {
CUtlBuffer::Printf(param_2,"%d",1);
}
if (((((byte)param_2[0x15] & 1) != 0) && (*(int *)(param_2 + 0x10) != 0)) &&
(*(char *)(*(int *)param_2 + ((*(int *)(param_2 + 0x10) + -1) - *(int *)(param_2 + 0x20))) ==
'\n')) {
iVar4 = 0;
if (((byte)param_2[0x15] & 0x10) == 0) {
iVar4 = *(int *)(param_2 + 0x18);
}
while (iVar4 = iVar4 + -1, -1 < iVar4) {
cVar1 = CUtlBuffer::CheckPut(param_2,1);
if (cVar1 != '\0') {
*(undefined1 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) = 9
;
*(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_2);
}
}
}
cVar1 = CUtlBuffer::CheckPut(param_2,1);
if (cVar1 != '\0') {
*(undefined1 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) = 0;
*(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_2);
}
sVar2 = send(*(int *)(this + 0x28),*(void **)param_2,*(size_t *)(param_2 + 0x10),0);
if (sVar2 == -1) {
UpdateProgress(*(TGameStatsParameters **)(this + 0x2c),"Send failed.");
*(undefined4 *)param_1 = 1;
}
else {
*(undefined4 *)(this + 0x14) = 9;
}
return sVar2 != -1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.