L L4D2node

CResponseSystem::ParseOneResponse

0x005ba520 · 808 bytes · __thiscall

_ZN15CResponseSystem16ParseOneResponseEPKcR13ResponseGroupP17AI_ResponseParams

Decompiled

undefined (4 params)

/* CResponseSystem::ParseOneResponse(char const*, ResponseGroup&, AI_ResponseParams*) */

void __thiscall
CResponseSystem::ParseOneResponse
          (CResponseSystem *this,char *param_1,ResponseGroup *param_2,AI_ResponseParams *param_3)

{
  CResponseSystem *pCVar1;
  CResponseSystem CVar2;
  int iVar3;
  char cVar4;
  undefined2 uVar5;
  undefined4 uVar6;
  CResponseSystem *pCVar7;
  byte bVar8;
  uint uVar9;
  int iVar10;
  Response *pRVar11;
  undefined2 *puVar12;
  
  iVar3 = *(int *)(param_2 + 8);
  CUtlVector<Response,CUtlMemoryConservative<Response>>::GrowVector
            ((CUtlVector<Response,CUtlMemoryConservative<Response>> *)param_2,1);
  iVar10 = iVar3 * 0x50;
  CUtlVector<Response,CUtlMemoryConservative<Response>>::ShiftElementsRight
            ((CUtlVector<Response,CUtlMemoryConservative<Response>> *)param_2,iVar3,1);
  puVar12 = (undefined2 *)(iVar10 + *(int *)param_2);
  if (puVar12 == (undefined2 *)0x0) {
    pRVar11 = (Response *)0x0;
    uVar5 = float16::ConvertFloatTo16bits(1.0);
  }
  else {
    puVar12[7] = 0;
    puVar12[6] = 100;
    *(undefined4 *)((int)puVar12 + 0x19) = 0;
    *(undefined4 *)((int)puVar12 + 0x1d) = 0;
    *(undefined4 *)((int)puVar12 + 0x21) = 0;
    uVar5 = float16::ConvertFloatTo16bits(0.0);
    *(undefined1 *)(puVar12 + 8) = 0;
    *(byte *)((int)puVar12 + 0x2f) = *(byte *)((int)puVar12 + 0x2f) & 0xc0;
    *puVar12 = uVar5;
    puVar12[1] = uVar5;
    puVar12[2] = uVar5;
    puVar12[3] = uVar5;
    puVar12[4] = uVar5;
    puVar12[5] = uVar5;
    *(undefined2 *)((int)puVar12 + 0x11) = uVar5;
    *(undefined2 *)((int)puVar12 + 0x13) = uVar5;
    *(undefined4 *)((int)puVar12 + 0x15) = 0;
    *(undefined4 *)(puVar12 + 0x18) = 0;
    *(undefined4 *)(puVar12 + 0x1a) = 0;
    *(undefined4 *)(puVar12 + 0x1c) = 0;
    *(undefined4 *)(puVar12 + 0x1e) = 0;
    *(undefined4 *)(puVar12 + 0x20) = 0;
    *(undefined4 *)(puVar12 + 0x22) = 0;
    *(undefined4 *)(puVar12 + 0x24) = 0;
    *(undefined1 *)(puVar12 + 0x26) = 0;
    *(undefined4 *)(puVar12 + 0x14) = 0;
    uVar5 = float16::ConvertFloatTo16bits(1.0);
    *(undefined1 *)(puVar12 + 0x17) = 0;
    *(byte *)((int)puVar12 + 0x2f) = *(byte *)((int)puVar12 + 0x2f) & 0x3f;
    puVar12[0x16] = uVar5;
    pRVar11 = (Response *)(iVar10 + *(int *)param_2);
  }
  *(undefined2 *)(pRVar11 + 0x2c) = uVar5;
  if (param_3 != (AI_ResponseParams *)0x0) {
    *(undefined4 *)pRVar11 = *(undefined4 *)param_3;
    *(undefined4 *)(pRVar11 + 4) = *(undefined4 *)(param_3 + 4);
    *(undefined4 *)(pRVar11 + 8) = *(undefined4 *)(param_3 + 8);
    *(undefined2 *)(pRVar11 + 0xc) = *(undefined2 *)(param_3 + 0xc);
    *(undefined2 *)(pRVar11 + 0xe) = *(undefined2 *)(param_3 + 0xe);
    pRVar11[0x10] = *(Response *)(param_3 + 0x10);
    *(undefined4 *)(pRVar11 + 0x11) = *(undefined4 *)(param_3 + 0x11);
    *(undefined4 *)(pRVar11 + 0x15) = *(undefined4 *)(param_3 + 0x15);
    AI_ResponseParams::ScriptFollowup_t::operator=
              ((ScriptFollowup_t *)(pRVar11 + 0x19),(ScriptFollowup_t *)(param_3 + 0x19));
  }
  pCVar1 = this + 0x38c8;
  bVar8 = 4;
  CVar2 = this[0x38c8];
  if (CVar2 != (CResponseSystem)0x72) {
    if (CVar2 == (CResponseSystem)0x73) {
      CVar2 = this[0x38c9];
      bVar8 = 2;
      if ((CVar2 != (CResponseSystem)0x65) && (bVar8 = 1, CVar2 != (CResponseSystem)0x70)) {
        bVar8 = (CVar2 == (CResponseSystem)0x63) * '\x03';
      }
    }
    else {
      bVar8 = (CVar2 == (CResponseSystem)0x70) * '\x05';
    }
  }
  pRVar11[0x2f] = (Response)((byte)pRVar11[0x2f] & 0xc0 | bVar8);
  if (bVar8 == 0) {
    ResponseWarning(this,"response entry \'%s\' with unknown response type \'%s\'\n");
    return;
  }
  ParseToken(this);
  uVar6 = ResponseCopyString((char *)pCVar1);
  *(undefined4 *)(pRVar11 + 0x28) = uVar6;
LAB_005ba6e0:
  cVar4 = TokenWaiting(this);
  do {
    if (cVar4 == '\0') {
      return;
    }
    if (this[0x3d7c] == (CResponseSystem)0x0) {
      if (0 < *(int *)(this + 0x3d8c)) {
        iVar3 = *(int *)(this + 0x3d80);
        uVar6 = RR_Parse(*(char **)(iVar3 + 8),(char *)pCVar1);
        *(undefined4 *)(iVar3 + 8) = uVar6;
        *(int *)(*(int *)(this + 0x3d80) + 0xc) = *(int *)(*(int *)(this + 0x3d80) + 0xc) + 1;
      }
      CVar2 = this[0x38c8];
      if (CVar2 == (CResponseSystem)0x0) goto LAB_005ba7de;
LAB_005ba73b:
      uVar9 = 0xaaaaaaaa;
      pCVar7 = pCVar1;
      do {
        pCVar7 = pCVar7 + 1;
        uVar9 = (uint)(byte)CVar2 + uVar9 * 0x21;
        CVar2 = *pCVar7;
      } while (CVar2 != (CResponseSystem)0x0);
    }
    else {
      CVar2 = this[0x38c8];
      this[0x3d7c] = (CResponseSystem)0x0;
      if (CVar2 != (CResponseSystem)0x0) goto LAB_005ba73b;
LAB_005ba7de:
      uVar9 = 0xaaaaaaaa;
    }
    cVar4 = DispatchParseResponse
                      (this,(char *)pCVar1,uVar9,(CUtlMap *)(this + 0x3de8),pRVar11,param_2,
                       (AI_ResponseParams *)pRVar11);
    if (cVar4 != '\0') goto LAB_005ba6e0;
    ResponseWarning(this,"response entry \'%s\' with unknown command \'%s\'\n",param_1,pCVar1);
    cVar4 = TokenWaiting(this);
  } while( true );
}

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)