L L4D2node

CBaseClient::SendServerInfo

0x000fbf60 · 2052 bytes · __thiscall

_ZN11CBaseClient14SendServerInfoEv

Decompiled

undefined (1 param)

/* CBaseClient::SendServerInfo() */

undefined4 __thiscall CBaseClient::SendServerInfo(CBaseClient *this)

{
  code *pcVar1;
  undefined **ppuVar2;
  char cVar3;
  uchar *puVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  char *pcVar9;
  int *piVar10;
  KeyValues *this_00;
  int in_GS_OFFSET;
  longlong lVar11;
  int local_1164;
  bf_write local_1160 [24];
  undefined **local_1148;
  undefined1 local_1144;
  undefined4 local_1140;
  undefined4 local_113c;
  undefined4 local_1138;
  undefined8 local_1134;
  undefined4 local_112c;
  undefined4 local_1128;
  undefined8 local_1124;
  undefined4 local_111c;
  undefined4 local_1118;
  undefined1 local_1114;
  undefined8 local_1110;
  undefined4 local_1108;
  undefined4 local_1104;
  undefined4 local_10fc;
  undefined4 local_10f8;
  undefined4 local_10f4;
  undefined **local_10f0;
  undefined1 local_10ec;
  undefined4 local_10e8;
  undefined4 local_10e4;
  undefined4 local_10e0;
  undefined8 local_10dc;
  undefined4 local_10d4;
  undefined4 local_10d0;
  undefined8 local_10cc;
  undefined4 local_10c4;
  undefined4 local_10c0;
  undefined1 local_10bc;
  undefined8 local_10b8;
  undefined4 local_10b0;
  undefined4 local_10ac;
  undefined4 local_10a4;
  undefined4 local_10a0;
  undefined4 local_109c;
  undefined4 local_1098;
  undefined4 local_1094;
  undefined4 local_1090;
  undefined4 local_108c;
  undefined4 local_1088;
  undefined4 local_1084;
  undefined4 local_1080;
  undefined4 local_107c;
  undefined4 local_1078;
  undefined4 local_1074;
  char local_1070 [2048];
  undefined **local_870;
  undefined1 local_86c;
  undefined4 local_868;
  undefined4 local_864;
  undefined4 local_860;
  undefined8 local_85c;
  undefined4 local_854;
  undefined4 local_850;
  undefined8 local_84c;
  undefined4 local_844;
  undefined4 local_840;
  undefined1 local_83c;
  undefined8 local_838;
  undefined4 local_830;
  undefined4 local_82c;
  char *local_824;
  uint local_80c;
  undefined4 local_804;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  COM_TimestampedLog(" CBaseClient::SendServerInfo");
  puVar4 = (uchar *)NET_AllocPayload();
                    /* try { // try from 000fbfb6 to 000fc15a has its CatchHandler @ 000fc794 */
  bf_write::bf_write(local_1160,"SV_SendServerinfo->msg",puVar4,0x37aa0,-1);
                    /* try { // try from 000fc74b to 000fc74d has its CatchHandler @ 000fc794 */
  if ((*(int *)(developer._28_4_ + 0x30) != 0) ||
     (cVar3 = (**(code **)(**(int **)(this + 0xb8) + 0x68))(*(int **)(this + 0xb8)), cVar3 != '\0'))
  {
    CBaseServer::GetMasterServerPlayerCounts
              ((CBaseServer *)&sv,&local_1164,(int *)&local_1148,(int *)&local_10f0);
    uVar5 = (**(code **)(**(int **)(this + 0xb8) + 0x40))(*(int **)(this + 0xb8));
    uVar6 = build_number();
    ppuVar2 = local_10f0;
    uVar7 = (**(code **)(**(int **)(this + 0xb8) + 0x3c))(*(int **)(this + 0xb8));
    uVar8 = (**(code **)(*serverGameDLL + 0x2c))(serverGameDLL);
    V_snprintf(local_1070,0x800,
               "\n%s\nMap: %s\nPlayers: %i (%i bots) / %i humans\nBuild: %d\nServer Number: %i\n\n",
               uVar8,uVar7,local_1164,ppuVar2,local_1148,uVar6,uVar5);
    local_864 = 0;
    local_860 = 0;
    local_85c = 0;
    local_854 = 0;
    local_850 = 0;
    local_84c = 0;
    local_844 = 0;
    local_840 = 0;
    local_83c = 0;
    local_838 = 0;
    local_830 = 0;
    local_82c = 0;
    local_868 = 0;
    local_870 = &PTR__SVC_Print_002a1768;
    local_86c = 0;
    local_824 = local_1070;
    SVC_Print::WriteToBuffer((SVC_Print *)&local_870,local_1160);
  }
  local_804 = *(undefined4 *)(this + 0x30);
  local_864 = 0;
  local_860 = 0;
  local_854 = 0;
  local_85c = 0;
  local_850 = 0;
  local_84c = 0;
  local_844 = 0;
  local_840 = 0;
  local_83c = 0;
  local_838 = 0;
  local_830 = 0;
  local_82c = 0;
  local_86c = 1;
  local_868 = 0;
  local_870 = &PTR__SVC_ServerInfo_002a1828;
                    /* try { // try from 000fc205 to 000fc22b has its CatchHandler @ 000fc772 */
  (**(code **)(**(int **)(this + 0xb8) + 0xbc))(*(int **)(this + 0xb8),(SVC_ServerInfo *)&local_870)
  ;
  SVC_ServerInfo::WriteToBuffer((SVC_ServerInfo *)&local_870,local_1160);
  if (((g_pMatchFramework != (int *)0x0) &&
      (lVar11 = CBaseServer::GetReservationCookie((CBaseServer *)&sv), lVar11 == 0)) &&
     (1 < (int)local_80c)) {
                    /* try { // try from 000fc6d2 to 000fc6fc has its CatchHandler @ 000fc772 */
    DevMsg("Telling clients to connect (%d maxclients)\n");
    piVar10 = (int *)(**(code **)(*g_pMatchFramework + 0x1c))(g_pMatchFramework);
    pcVar1 = *(code **)(*piVar10 + 8);
    this_00 = KeyValues::operator_new((KeyValues *)0x2c,local_80c);
                    /* try { // try from 000fc71e to 000fc722 has its CatchHandler @ 000fc7b0 */
    KeyValues::KeyValues(this_00,"OnEngineListenServerStarted",(IKeyValuesSystem *)0x0,false);
                    /* try { // try from 000fc736 to 000fc737 has its CatchHandler @ 000fc772 */
    (*pcVar1)(piVar10,this_00);
  }
  local_10fc = *(undefined4 *)(*(int *)(this + 0xb8) + 0xc);
  local_1134 = 0;
  local_113c = 0;
  local_1138 = 0;
  local_112c = 0;
  *(undefined4 *)(this + 0xf8) = local_10fc;
  local_1128 = 0;
  local_1124 = 0;
  local_111c = 0;
  local_1118 = 0;
  local_1114 = 0;
  local_1110 = 0;
  local_1108 = 0;
  local_1104 = 0;
  local_1140 = 0;
  local_1148 = &PTR__NET_Tick_002a1b28;
  local_1144 = 0;
  local_10f8 = 0;
  local_10f4 = 0;
                    /* try { // try from 000fc2fc to 000fc30e has its CatchHandler @ 000fc7fa */
  NET_Tick::WriteToBuffer((NET_Tick *)&local_1148,local_1160);
  cVar3 = (**(code **)(**(int **)(this + 0xe8) + 0x18))(*(int **)(this + 0xe8));
  if (cVar3 == '\0') {
    local_10e4 = 0;
    local_10e0 = 0;
    local_10dc = 0;
    local_10d4 = 0;
    local_10d0 = 0;
    local_10cc = 0;
    local_10c4 = 0;
    local_10c0 = 0;
    local_10bc = 0;
    local_10b8 = 0;
    local_10b0 = 0;
    local_10ac = 0;
    local_10ec = 1;
    local_10e8 = 0;
    local_10f0 = &PTR__NET_SetConVar_002a1ca8;
    local_10a4 = 0;
    local_10a0 = 0;
    local_109c = 0;
    local_1098 = 0;
    local_1094 = 0;
                    /* try { // try from 000fc3f4 to 000fc40a has its CatchHandler @ 000fc7c4 */
    Host_BuildConVarUpdateMessage((CUtlVector *)&local_10a4,0x2000,true);
    NET_SetConVar::WriteToBuffer((NET_SetConVar *)&local_10f0,local_1160);
    local_10f0 = &PTR__NET_SetConVar_002a1ca8;
    local_1098 = 0;
    CUtlMemory<NetMessageCvar_t,int>::Purge((CUtlMemory<NetMessageCvar_t,int> *)&local_10a4);
    local_1094 = local_10a4;
    CUtlMemory<NetMessageCvar_t,int>::Purge((CUtlMemory<NetMessageCvar_t,int> *)&local_10a4);
  }
                    /* try { // try from 000fc446 to 000fc489 has its CatchHandler @ 000fc7fa */
  pcVar9 = (char *)(**(code **)(**(int **)(this + 0xb8) + 0x3c))(*(int **)(this + 0xb8));
  CNetworkStringTableContainer::WriteBaselines
            (*(CNetworkStringTableContainer **)(*(int *)(this + 0xb8) + 0xbc),pcVar9,local_1160);
  this[0xb5] = (CBaseClient)0x0;
  SetSignonState(this,3);
  local_10a0 = (**(code **)(**(int **)(this + 0xb8) + 0x40))(*(int **)(this + 0xb8));
  local_10a4 = *(undefined4 *)(this + 0xec);
  local_10e4 = 0;
  local_10e0 = 0;
  local_10dc = 0;
  local_10d4 = 0;
  local_10d0 = 0;
  local_10cc = 0;
  local_10c4 = 0;
  local_10c0 = 0;
  local_10bc = 0;
  local_10b8 = 0;
  local_10b0 = 0;
  local_10ac = 0;
  local_10ec = 1;
  local_10e8 = 0;
  local_10f0 = &PTR__NET_SignonState_002a1888;
  local_1098 = 0;
  local_1094 = 0;
  local_1090 = 0;
  local_108c = 0;
  local_1088 = 0;
  local_1084 = 0;
  local_1080 = 0;
  local_107c = 0;
  local_1078 = 0;
  local_1074 = 0;
  local_109c = 0;
                    /* try { // try from 000fc5a9 to 000fc5f0 has its CatchHandler @ 000fc798 */
  FillSignOnFullServerInfo(this,(NET_SignonState *)&local_10f0);
  NET_SignonState::WriteToBuffer((NET_SignonState *)&local_10f0,local_1160);
  uVar5 = (**(code **)(**(int **)(this + 0xe8) + 0xac))(*(int **)(this + 0xe8),local_1160,1);
  if ((char)uVar5 == '\0') {
    (**(code **)(*(int *)this + 0x3c))(this,"Server info data overflow");
  }
  else {
                    /* try { // try from 000fc6a7 to 000fc6ab has its CatchHandler @ 000fc798 */
    COM_TimestampedLog(" CBaseClient::SendServerInfo(finished)");
  }
  local_10f0 = &PTR__NET_SignonState_002a1888;
  local_1078 = 0;
  CUtlMemory<char,int>::Purge((CUtlMemory<char,int> *)&local_1084);
  local_1074 = local_1084;
  CUtlMemory<char,int>::Purge((CUtlMemory<char,int> *)&local_1084);
  local_108c = 0;
  CUtlMemory<char,int>::Purge((CUtlMemory<char,int> *)&local_1098);
  local_1088 = local_1098;
  CUtlMemory<char,int>::Purge((CUtlMemory<char,int> *)&local_1098);
  local_10f0 = &PTR__INetMessage_002a1188;
  local_1148 = &PTR__INetMessage_002a1188;
  local_870 = &PTR__INetMessage_002a1188;
  NET_FreePayload(puVar4);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)