L L4D2node

CBaseServer::BroadcastMessage

0x00107c40 · 474 bytes · __thiscall

_ZN11CBaseServer16BroadcastMessageER11INetMessageR16IRecipientFilter

Decompiled

undefined (3 params)

/* CBaseServer::BroadcastMessage(INetMessage&, IRecipientFilter&) */

void __thiscall
CBaseServer::BroadcastMessage(CBaseServer *this,INetMessage *param_1,IRecipientFilter *param_2)

{
  code *pcVar1;
  int *piVar2;
  char cVar3;
  undefined1 uVar4;
  int iVar5;
  int iVar6;
  undefined4 uVar7;
  undefined *puVar8;
  undefined *puVar9;
  int local_20;
  
  cVar3 = (**(code **)(*(int *)param_2 + 0xc))(param_2);
  if (cVar3 == '\0') {
    pcVar1 = *(code **)(*(int *)param_1 + 0xc);
    uVar4 = (**(code **)(*(int *)param_2 + 8))(param_2);
    (*pcVar1)(param_1,uVar4);
    iVar5 = (**(code **)(*(int *)param_2 + 0x10))(param_2);
    if (0 < iVar5) {
      local_20 = 0;
      do {
        iVar6 = (**(code **)(*(int *)param_2 + 0x14))(param_2,local_20);
        if ((iVar6 < 1) || (*(int *)(this + 0x120) < iVar6)) {
          cVar3 = (**(code **)(*(int *)param_2 + 0xc))(param_2);
          puVar8 = &DAT_002b6517;
          if (cVar3 == '\0') {
            puVar8 = &DAT_0029fe20;
          }
          cVar3 = (**(code **)(*(int *)param_2 + 8))(param_2);
          puVar9 = &DAT_002b6517;
          if (cVar3 == '\0') {
            puVar9 = &DAT_0029fe20;
          }
          uVar7 = (**(code **)(*(int *)param_1 + 0x24))(param_1);
          Msg("SV_BroadcastMessage:  Recipient Filter for message type %i (reliable: %s, init: %s) with bogus client index (%i) in list of %i clients\n"
              ,uVar7,puVar9,puVar8,iVar6,iVar5);
          cVar3 = (**(code **)(*(int *)param_1 + 0x20))(param_1);
          if (cVar3 != '\0') {
            uVar7 = (**(code **)(*(int *)param_1 + 0x24))(param_1);
            Host_Error("Reliable message (type %i) discarded.",uVar7);
          }
        }
        else {
          piVar2 = *(int **)(*(int *)(this + 0x114) + -4 + iVar6 * 4);
          cVar3 = (**(code **)(*piVar2 + 0x70))(piVar2);
          if (cVar3 != '\0') {
            cVar3 = (**(code **)(*piVar2 + 100))(piVar2,param_1,0,0);
            if (cVar3 == '\0') {
              cVar3 = (**(code **)(*(int *)param_1 + 0x20))(param_1);
              if (cVar3 != '\0') {
                uVar7 = (**(code **)(*piVar2 + 0x1c))(piVar2);
                DevMsg("BroadcastMessage: Reliable filter message overflow for client %s",uVar7);
              }
            }
          }
        }
        local_20 = local_20 + 1;
      } while (local_20 != iVar5);
    }
  }
  else {
    cVar3 = (**(code **)(*(int *)this + 0x58))(this);
    if (cVar3 != '\0') {
      ConDMsg(
             "SV_BroadcastMessage: Init message being created after signon buffer has been transmitted\n"
             );
    }
    cVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,this + 0xd4);
    if (cVar3 == '\0') {
      Sys_Error("SV_BroadcastMessage: Init message would overflow signon buffer!\n");
      return;
    }
  }
  return;
}

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)