CVEngineServer::PlaybackTempEntity
0x0022a6e0 · 2752 bytes · __thiscall
_ZN14CVEngineServer18PlaybackTempEntityER16IRecipientFilterfPKvPK9SendTablei
Decompiled
undefined (6 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CVEngineServer::PlaybackTempEntity(IRecipientFilter&, float, void const*, SendTable const*, int)
*/
void __thiscall
CVEngineServer::PlaybackTempEntity
(CVEngineServer *this,IRecipientFilter *param_1,float param_2,void *param_3,
SendTable *param_4,int param_5)
{
void *pvVar1;
uint uVar2;
undefined4 uVar3;
undefined4 uVar4;
char cVar5;
int iVar6;
int iVar7;
uint uVar8;
int iVar9;
byte *pbVar10;
int iVar11;
int iVar12;
undefined2 *puVar13;
uint uVar14;
int iVar15;
uint *puVar16;
int in_GS_OFFSET;
char *__size;
IRecipientFilter *pIVar17;
IRecipientFilter *local_274;
byte local_270;
undefined2 local_26c;
sbyte local_264;
undefined4 local_254;
undefined4 local_250;
bf_write local_248 [12];
int local_23c;
byte local_238;
undefined **local_230;
undefined1 local_22c;
undefined4 local_228;
undefined4 local_224;
undefined4 local_220;
undefined4 local_21c;
undefined4 local_218;
undefined4 local_214;
undefined4 local_210;
undefined4 local_20c;
undefined4 local_208;
undefined4 local_204;
undefined4 local_200;
undefined1 local_1fc;
undefined4 local_1f8;
undefined4 local_1f4;
undefined4 local_1f0;
undefined4 local_1ec;
undefined4 local_1e4;
undefined4 local_1dc;
undefined1 local_1d8;
undefined4 local_1d4;
undefined4 local_1d0;
int local_1b8 [2];
uint local_1b0;
uint local_1ac;
char local_1a8;
undefined1 local_1a0 [192];
undefined1 local_e0 [192];
int local_20;
local_254 = 0;
local_250 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (_exit == (IRecipientFilter *)0x0) {
local_274 = (IRecipientFilter *)0x0;
}
else {
(**(code **)(_exit + 0x50))
(_exit,&local_254,0,0,0,0,"/data/src/engine/./vengineserver_impl.cpp",0x7a5,
&PlaybackTempEntity(IRecipientFilter&,float,void_const*,SendTable_const*,int)::tm_fmt
,"(%s)%s","Unaccounted","PlaybackTempEntity");
local_274 = _exit;
}
uVar4 = local_250;
uVar3 = local_254;
iVar7 = _DAT_0040b9d4;
/* try { // try from 0022a7c3 to 0022a7c7 has its CatchHandler @ 0022b28c */
if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
if (*(char **)_DAT_0040b030 != "PlaybackTempEntity") {
/* try { // try from 0022af28 to 0022af39 has its CatchHandler @ 0022b28c */
_DAT_0040b030 =
(IRecipientFilter *)
CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2c8cc8,&DAT_00000001,0x2a054b);
}
CVProfNode::EnterScope();
DAT_0040b02c = '\0';
}
iVar7 = _DAT_003b8194;
if (0xfe < _DAT_003b8194) {
pvVar1 = *(void **)_DAT_003b8188;
if (pvVar1 != (void *)0x0) {
if (*(void **)((int)pvVar1 + 0x14) != (void *)0x0) {
operator_delete(*(void **)((int)pvVar1 + 0x14));
}
*(undefined ***)((int)pvVar1 + 0x1c) = &PTR__CEngineRecipientFilter_002ae5c8;
*(undefined4 *)((int)pvVar1 + 0x30) = 0;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)((int)pvVar1 + 0x24));
*(undefined4 *)((int)pvVar1 + 0x34) = *(undefined4 *)((int)pvVar1 + 0x24);
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)((int)pvVar1 + 0x24));
*(undefined ***)((int)pvVar1 + 0x1c) = &PTR__IRecipientFilter_002aa388;
operator_delete(pvVar1);
}
iVar7 = _DAT_003b8194 + -1;
if (0 < iVar7) {
/* try { // try from 0022a9a7 to 0022ac78 has its CatchHandler @ 0022b293 */
_V_memmove(_DAT_003b8188,_DAT_003b8188 + 4,iVar7 * 4);
iVar7 = _DAT_003b8194 + -1;
}
}
_DAT_003b8194 = iVar7;
uVar8 = param_5 + 1;
/* try { // try from 0022a888 to 0022a8e5 has its CatchHandler @ 0022b293 */
bf_write::bf_write(local_248,"PlaybackTempEntity",local_1a0,0xc0,-1);
cVar5 = SendTable_Encode(param_4,param_3,local_248,uVar8,(CUtlMemory *)0x0,false);
if (cVar5 == '\0') {
__size = "PlaybackTempEntity: SendTable_Encode returned false (ent %d), overflow? %i\n";
Host_Error("PlaybackTempEntity: SendTable_Encode returned false (ent %d), overflow? %i\n",uVar8,
(uint)local_238);
}
else {
cVar5 = (**(code **)(*(int *)param_1 + 8))(param_1);
if (cVar5 == '\0') {
/* try { // try from 0022af57 to 0022af5b has its CatchHandler @ 0022b293 */
puVar13 = operator_new(0x38);
/* try { // try from 0022af6a to 0022af6e has its CatchHandler @ 0022b1d9 */
CEngineRecipientFilter::CEngineRecipientFilter((CEngineRecipientFilter *)(puVar13 + 0xe));
*(undefined4 *)(puVar13 + 2) = 0;
*puVar13 = 0;
*(undefined4 *)(puVar13 + 8) = 0;
*(undefined4 *)(puVar13 + 0xc) = 0;
*(undefined4 *)(puVar13 + 4) = 0;
*(undefined4 *)(puVar13 + 6) = 0;
*(undefined4 *)(puVar13 + 10) = 0;
/* try { // try from 0022afab to 0022aff6 has its CatchHandler @ 0022b293 */
CEngineRecipientFilter::AddPlayersFromFilter
((CEngineRecipientFilter *)(puVar13 + 0xe),param_1);
local_26c = (undefined2)uVar8;
*(SendTable **)(puVar13 + 4) = param_4;
*(float *)(puVar13 + 2) = param_2;
*puVar13 = local_26c;
*(int *)(puVar13 + 8) = local_23c;
uVar8 = local_23c + 7 >> 3;
__size = operator_new__(uVar8);
*(char **)(puVar13 + 10) = __size;
_V_memcpy(__size,local_1a0,uVar8);
iVar6 = _DAT_003b8194;
iVar7 = _DAT_003b8194 + 1;
if ((_DAT_003b818c < iVar7) && (-1 < _DAT_003b8190)) {
if (_DAT_003b8190 == 0) {
if (_DAT_003b818c == 0) {
if (iVar7 < 9) {
_DAT_003b818c = 8;
goto LAB_0022b13f;
}
_DAT_003b818c = 8;
}
do {
_DAT_003b818c = _DAT_003b818c * 2;
} while (_DAT_003b818c < iVar7);
}
else {
for (_DAT_003b818c = (_DAT_003b8194 / _DAT_003b8190 + 1) * _DAT_003b8190;
_DAT_003b818c < iVar7; _DAT_003b818c = (_DAT_003b818c + iVar7) / 2) {
}
}
LAB_0022b13f:
__size = (char *)(_DAT_003b818c << 2);
if (_DAT_003b8188 == (IRecipientFilter *)0x0) {
_DAT_003b8188 = malloc((size_t)__size);
}
else {
pIVar17 = _DAT_003b8188;
_DAT_003b8188 = realloc(_DAT_003b8188,(size_t)__size);
iVar7 = _DAT_003b8194 + 1;
__size = (char *)pIVar17;
}
}
iVar9 = iVar6 * 4;
iVar6 = (iVar7 - iVar6) + -1;
_DAT_003b8194 = iVar7;
_DAT_003b8198 = _DAT_003b8188;
if (0 < iVar6) {
__size = (char *)(_DAT_003b8188 + iVar9 + 4);
/* try { // try from 0022b101 to 0022b105 has its CatchHandler @ 0022b293 */
_V_memmove(__size,_DAT_003b8188 + iVar9,iVar6 * 4);
}
*(undefined2 **)(_DAT_003b8188 + iVar9) = puVar13;
iVar7 = _DAT_0040b9d4;
if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
__size = (char *)_DAT_0040b030;
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0040b030 = *(IRecipientFilter **)(_DAT_0040b030 + 100);
}
DAT_0040b02c = _DAT_0040b030 == (IRecipientFilter *)0x40b034;
}
if (local_274 != (IRecipientFilter *)0x0) {
(**(code **)(local_274 + 0x54))(local_274,uVar3,uVar4,0,0,0);
__size = (char *)local_274;
}
goto LAB_0022a934;
}
__size = (char *)param_1;
iVar7 = (**(code **)(*(int *)param_1 + 0x10))(param_1);
if (0 < iVar7) {
iVar6 = 0;
uVar2 = (uint)(2.1474836e+09 <= param_2 * 100.0);
uVar2 = (int)(param_2 * 100.0 - (float)(-uVar2 & 0x4f000000)) ^ uVar2 * -0x80000000;
do {
__size = (char *)param_1;
iVar9 = (**(code **)(*(int *)param_1 + 0x14))(param_1,iVar6);
if ((0 < iVar9) && (iVar9 <= DAT_003b8080)) {
pIVar17 = *(IRecipientFilter **)(DAT_003b8074 + -4 + iVar9 * 4);
cVar5 = (**(code **)(*(int *)pIVar17 + 0x78))(pIVar17);
if (((cVar5 == '\0') ||
(__size = (char *)pIVar17, cVar5 = (**(code **)(*(int *)pIVar17 + 0x7c))(pIVar17),
cVar5 != '\0')) &&
(__size = (char *)pIVar17, cVar5 = (**(code **)(*(int *)pIVar17 + 0x74))(pIVar17),
iVar9 = local_23c, cVar5 != '\0')) {
__size = (char *)(pIVar17 + 4);
local_224 = 0;
local_220 = 0;
local_21c = 0;
local_218 = 0;
local_214 = 0;
local_210 = 0;
local_20c = 0;
local_208 = 0;
local_204 = 0;
local_200 = 0;
local_1fc = 0;
local_1f8 = 0;
local_1f4 = 0;
local_1f0 = 0;
local_1ec = 0;
local_22c = 1;
local_228 = 0;
local_230 = &PTR__SVC_TempEntities_002a1e88;
local_1d8 = 0;
local_1dc = 0;
local_1d4 = 0xffffffff;
local_1d0 = 0;
/* try { // try from 0022ad6e to 0022ad72 has its CatchHandler @ 0022b27b */
bf_write::bf_write((bf_write *)local_1b8);
local_22c = 1;
local_1e4 = 0;
/* try { // try from 0022adaf to 0022adb3 has its CatchHandler @ 0022b293 */
bf_write::StartWriting((bf_write *)local_1b8,local_e0,0xc0,0,-1);
if (param_2 == 0.0) {
if ((int)local_1b0 <= (int)local_1ac) goto LAB_0022b0ae;
if (local_1a8 == '\0') {
pbVar10 = (byte *)(((int)local_1ac >> 3) + local_1b8[0]);
*pbVar10 = *pbVar10 & ~(byte)(1 << ((byte)local_1ac & 7));
local_1ac = local_1ac + 1;
goto LAB_0022aa9f;
}
LAB_0022aaab:
if (local_1a8 == '\0') {
pbVar10 = (byte *)(((int)local_1ac >> 3) + local_1b8[0]);
*pbVar10 = *pbVar10 | (byte)(1 << ((byte)local_1ac & 7));
local_1ac = local_1ac + 1;
}
}
else {
if ((int)local_1ac < (int)local_1b0) {
if (local_1a8 == '\0') {
pbVar10 = (byte *)(((int)local_1ac >> 3) + local_1b8[0]);
*pbVar10 = *pbVar10 | (byte)(1 << ((byte)local_1ac & 7));
local_1ac = local_1ac + 1;
}
}
else {
local_1a8 = '\x01';
}
if ((int)local_1b0 < (int)(local_1ac + 0x10)) {
local_1ac = local_1b0;
}
else {
uVar14 = local_1ac & 0x1f;
iVar11 = ((int)local_1ac >> 5) * 4;
puVar16 = (uint *)(local_1b8[0] + iVar11);
*puVar16 = *puVar16 & *(uint *)(&DAT_003f2de0 + uVar14 * 0x84) |
uVar2 << (sbyte)uVar14;
iVar12 = 0x20 - uVar14;
if (iVar12 < 0x10) {
puVar16 = (uint *)(local_1b8[0] + 4 + iVar11);
*puVar16 = (&g_BitWriteMasks)[0x10 - iVar12] & *puVar16 |
uVar2 >> ((byte)iVar12 & 0x1f);
}
local_1ac = local_1ac + 0x10;
LAB_0022aa9f:
if ((int)local_1ac < (int)local_1b0) goto LAB_0022aaab;
}
LAB_0022b0ae:
local_1a8 = '\x01';
}
iVar11 = _DAT_003b805c;
if ((int)local_1b0 < (int)(local_1ac + _DAT_003b805c)) {
local_1a8 = '\x01';
local_1ac = local_1b0;
}
else {
iVar15 = ((int)local_1ac >> 5) * 4;
uVar14 = local_1ac & 0x1f;
puVar16 = (uint *)(iVar15 + local_1b8[0]);
local_264 = (sbyte)uVar14;
*puVar16 = *puVar16 & (&g_BitWriteMasks)[uVar14 * 0x21 + _DAT_003b805c] |
uVar8 << local_264;
iVar12 = 0x20 - uVar14;
if (iVar12 < iVar11) {
puVar16 = (uint *)(local_1b8[0] + 4 + iVar15);
local_270 = (byte)iVar12;
*puVar16 = (&g_BitWriteMasks)[iVar11 - iVar12] & *puVar16 |
uVar8 >> (local_270 & 0x1f);
}
local_1ac = local_1ac + iVar11;
}
bf_write::WriteBits((bf_write *)local_1b8,local_1a0,iVar9);
(**(code **)(*(int *)(pIVar17 + 4) + 0x78))(__size,&local_230,1,0);
}
}
iVar6 = iVar6 + 1;
} while (iVar6 != iVar7);
}
}
iVar7 = _DAT_0040b9d4;
if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
__size = (char *)_DAT_0040b030;
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0040b030 = *(IRecipientFilter **)(_DAT_0040b030 + 100);
}
DAT_0040b02c = _DAT_0040b030 == (IRecipientFilter *)0x40b034;
}
if (local_274 != (IRecipientFilter *)0x0) {
(**(code **)(local_274 + 0x54))(local_274,uVar3,uVar4,0,0,0);
__size = (char *)local_274;
}
LAB_0022a934:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail(__size);
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.