L L4D2node

CRConServer::SendRCONResponse

0x0020b100 · 432 bytes · __thiscall

_ZN11CRConServer16SendRCONResponseEiPKvib

Decompiled

undefined (5 params)

/* CRConServer::SendRCONResponse(int, void const*, int, bool) */

undefined4 __thiscall
CRConServer::SendRCONResponse(CRConServer *this,int param_1,void *param_2,int param_3,bool param_4)

{
  CSocketCreator *this_00;
  int __fd;
  int iVar1;
  ssize_t sVar2;
  undefined4 uVar3;
  uint uVar4;
  int iVar5;
  
  this_00 = (CSocketCreator *)(this + 4);
  __fd = CSocketCreator::GetAcceptedSocketHandle(this_00,param_1);
  if (__fd < 0) {
    return 0;
  }
  iVar1 = CSocketCreator::GetAcceptedSocketData(this_00,param_1);
  uVar3 = 0;
  if ((param_4) || (*(ushort *)(iVar1 + 0x56) == 0)) {
    iVar5 = 0;
    if (0 < param_3) {
      do {
        sVar2 = send(__fd,(void *)((int)param_2 + iVar5),param_3 - iVar5,0x4000);
        if (sVar2 == -1) {
          uVar3 = SocketWouldBlock();
          if ((char)uVar3 != '\0') {
            if (!param_4) {
              uVar4 = CUtlLinkedList<CUtlBuffer,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CUtlBuffer,unsigned_short>,unsigned_short>>
                      ::InsertAfter((CUtlLinkedList<CUtlBuffer,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CUtlBuffer,unsigned_short>,unsigned_short>>
                                     *)(iVar1 + 0x44),0xffff);
              CUtlBuffer::Put((CUtlBuffer *)((uVar4 & 0xffff) * 0x3c + *(int *)(iVar1 + 0x44)),
                              (void *)((int)param_2 + iVar5),param_3 - iVar5);
              return 0;
            }
            CUtlBuffer::SeekGet((CUtlBuffer *)
                                ((uint)*(ushort *)(iVar1 + 0x50) * 0x3c + *(int *)(iVar1 + 0x44)),1,
                                iVar5);
            return 0;
          }
          goto LAB_0020b224;
        }
        if (0 < sVar2) {
          iVar5 = iVar5 + sVar2;
        }
      } while (iVar5 < param_3);
    }
  }
  else {
    if (100 < *(ushort *)(iVar1 + 0x56)) {
LAB_0020b224:
      CSocketCreator::CloseAcceptedSocket(this_00,param_1);
      return uVar3;
    }
    uVar4 = CUtlLinkedList<CUtlBuffer,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CUtlBuffer,unsigned_short>,unsigned_short>>
            ::InsertBefore((CUtlLinkedList<CUtlBuffer,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CUtlBuffer,unsigned_short>,unsigned_short>>
                            *)(iVar1 + 0x44),0xffff);
    CUtlBuffer::Put((CUtlBuffer *)((uVar4 & 0xffff) * 0x3c + *(int *)(iVar1 + 0x44)),param_2,param_3
                   );
  }
  return 1;
}

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)