L L4D2node

CUGCFileRequestManager::PromoteRequestToTop

0x002230b0 · 233 bytes · __cdecl

_ZN22CUGCFileRequestManager19PromoteRequestToTopEy

Decompiled

undefined (1 param)

/* CUGCFileRequestManager::PromoteRequestToTop(unsigned long long) */

undefined4 CUGCFileRequestManager::PromoteRequestToTop(ulonglong param_1)

{
  int iVar1;
  UGCFileRequest_t *pUVar2;
  UGCFileRequest_t *pUVar3;
  int iVar4;
  undefined4 uVar5;
  UGCFileRequest_t *local_20 [4];
  
  pUVar3 = (UGCFileRequest_t *)GetFileRequestByHandle(param_1);
  if (pUVar3 == (UGCFileRequest_t *)0x0) {
LAB_0022310c:
    uVar5 = 0;
  }
  else {
    iVar1 = *(int *)((int)param_1 + 0x28);
    uVar5 = 0;
    if (iVar1 != 0) {
      pUVar2 = (UGCFileRequest_t *)**(int **)((int)param_1 + 0x1c);
      if (pUVar3 == pUVar2) {
        return 1;
      }
      iVar4 = 0;
      if (0 < iVar1) {
        do {
          iVar4 = iVar4 + 1;
          if (iVar4 == iVar1) goto LAB_0022310c;
        } while (pUVar3 != (UGCFileRequest_t *)(*(int **)((int)param_1 + 0x1c))[iVar4]);
        *(int *)(pUVar3 + 800) = *(int *)(pUVar2 + 800) + 1;
        CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
        ::RemoveAt((CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
                    *)((int)param_1 + 0x1c),iVar4);
        local_20[0] = pUVar3;
        CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
        ::Insert((CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
                  *)((int)param_1 + 0x1c),local_20);
        uVar5 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
        if ((char)uVar5 == '\0') {
          return 1;
        }
        LoggingSystem_Log(LOG_WORKSHOP,0,"[CUGCFileRequestManager] Promoted %llu to top of queue\n",
                          *(undefined4 *)pUVar3,*(undefined4 *)(pUVar3 + 4));
      }
    }
  }
  return uVar5;
}

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)