L L4D2node

CUGCFileRequest::Update

0x00228860 · 473 bytes · __thiscall

_ZN15CUGCFileRequest6UpdateEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CUGCFileRequest::Update() */

undefined4 __thiscall CUGCFileRequest::Update(CUGCFileRequest *this)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  longdouble lVar4;
  int local_14;
  int local_10;
  
  uVar3 = *(undefined4 *)(this + 0x598);
  switch(uVar3) {
  case 0:
  case 3:
    break;
  case 1:
    (**(code **)(_DAT_00000000 + 100))
              (0,*(undefined4 *)(this + 0x38c),*(undefined4 *)(this + 0x390),&local_14,&local_10);
    if (local_10 != 0) {
      *(float *)(this + 0x5a0) = (float)local_14 / (float)local_10;
    }
    return *(undefined4 *)(this + 0x598);
  case 2:
    if (*(int *)(this + 0x394) == 0) {
      uVar3 = ThrowError(this,"[UGC] Lost handle to async handle for downloaded file write!\n");
    }
    else {
      iVar2 = (**(code **)(*g_pFullFileSystem + 0xd0))(g_pFullFileSystem,*(int *)(this + 0x394));
      if (iVar2 < 3) {
        if (0 < iVar2) {
          return uVar3;
        }
        if (iVar2 == -1) {
          uVar3 = ThrowError(this,"[UGC] Unable to write file to disc!\n");
          return uVar3;
        }
      }
      else if (iVar2 == 4) {
        return uVar3;
      }
      (**(code **)(*g_pFullFileSystem + 0xc4))(g_pFullFileSystem,*(undefined4 *)(this + 0x394),1);
      (**(code **)(*g_pFullFileSystem + 0xdc))(g_pFullFileSystem,*(undefined4 *)(this + 0x394));
      uVar3 = LOG_WORKSHOP;
      *(undefined4 *)(this + 0x394) = 0;
      cVar1 = LoggingSystem_IsChannelEnabled(uVar3,0);
      if (cVar1 != '\0') {
        lVar4 = (longdouble)Plat_FloatTime();
        LoggingSystem_Log(LOG_WORKSHOP,0,"[UGC] Async write completed for %s%c%s (%llu) (%f)\n",
                          this + 0x40,0x2f,this + 0x144,*(undefined4 *)(this + 0x38c),
                          *(undefined4 *)(this + 0x390),(double)lVar4);
      }
      MarkCompleteAndFree(this);
      uVar3 = *(undefined4 *)(this + 0x598);
    }
    break;
  case 4:
    *(undefined4 *)(this + 0x5a0) = 0x3f800000;
    return uVar3;
  default:
    uVar3 = 0xffffffff;
  }
  return uVar3;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)