Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 9fe3edc

Browse files
authored
Merge pull request #47 from marqdevx/marqdevx/admins-cfg
Small fixes + cs2 update fix
2 parents 76509f6 + e4d6fb9 commit 9fe3edc

File tree

5 files changed

+50
-47
lines changed

5 files changed

+50
-47
lines changed

configs/admins.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Admins
22
{
33
"name" // can be anything
44
{
5-
"steamid" "1234567890" // steamid64
5+
"steam" "1234567890" // steamid64
66
"flags" "abcdefg" // permission flags, same as sourcemod with z being everything
77
}
88
}

gamedata/cs2fixes.games.txt

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,6 @@
100100
"windows" "\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\x3B\x91\xD0\x00\x00\x00"
101101
"linux" "\x55\x48\x89\xE5\x41\x55\x41\x54\x53\x48\x89\xFB\x48\x83\xEC\x08\x3B\xB7\xE0\x00\x00\x00"
102102
}
103-
// String: "Playing sound on non-networked entity %s"
104-
"CSoundEmitterSystem_EmitSound"
105-
{
106-
"library" "server"
107-
"windows" "\x48\x8B\xC4\x4C\x89\x40\x18\x55\x57"
108-
"linux" "\x48\xB8\x2A\x2A\x2A\x2A\xFF\xFF\xFF\xFF\x55\x48\x89\xE5\x41\x57\x41\x89\xF7"
109-
}
110103
// idk a good way to find this again, i just brute forced the vtable. offset is 133 on CTriggerPush
111104
"TriggerPush_Touch"
112105
{
@@ -326,20 +319,37 @@
326319
"linux" "\x48\x85\xF6\x74\x2A\x48\x8B\x47\x10\xF6\x40\x31\x02\x75\x2A\x48\x8B\x46\x10\xF6\x40\x31\x02\x75\x2A\xB8\x2A\x2A\x2A\x2A"
327320
}
328321

329-
// "CNetChan::SendNetMessage"
330-
"SendNetMessage"
322+
// "Attempted to find unknown particle system \"%s\"\n"
323+
"GetParticleSystemIndex"
331324
{
332-
"library" "networksystem"
333-
"windows" "\x48\x89\x5C\x24\x10\x48\x89\x6C\x24\x18\x48\x89\x74\x24\x20\x57\x41\x56\x41\x57\x48\x83\xEC\x40\x49\x8B\xE8"
334-
"linux" "\x55\x48\x89\xE5\x41\x57\x41\x89\xCF\x41\x56\x4C\x8D\xB7\x90\x76\x00\x00"
325+
"library" "server"
326+
"windows" "\x48\x89\x5C\x24\x08\x48\x89\x74\x24\x10\x57\x48\x81\xEC\x00\x01\x00\x00\x48\x8B\xF2\x48\x8B\xF9"
327+
"linux" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x49\x89\xFD\x41\x54\x48\x81\xEC\xE0\x00\x00\x00"
335328
}
336329

337-
// "Discarding pending request"
338-
"HostStateRequest"
330+
// "ParticleEffect", found in a function with 9 arguments
331+
"DispatchParticleEffect"
332+
{
333+
"library" "server"
334+
"windows" "\x48\x89\x5C\x24\x10\x48\x89\x74\x24\x18\x55\x57\x41\x56\x48\x8D\x6C\x24\xE1"
335+
"linux" "\x55\x48\x89\xE5\x41\x57\x41\x56\x49\x89\xFE\x41\x55\x45\x89\xCD\x41\x54\x49\x89\xD4\x53\x89\xCB\x48\x81\xEC\x2A\x2A\x2A\x2A"
336+
}
337+
338+
// search for "land_%s", this is called after that string is referenced (the one with 4 parameters).
339+
// (function that calls it also contains "T_Default.SuitLand").
340+
"CBaseEntity_EmitSoundFilter"
341+
{
342+
"library" "server"
343+
"windows" "\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x10\x48\x89\x74\x24\x18\x48\x89\x7C\x24\x20\x41\x56\x48\x83\xEC\x30\x48\x8B\xF9"
344+
"linux" "\x55\x48\x89\xE5\x41\x57\x41\x56\x49\x89\xD6\x41\x55\x41\x89\xF5\x41\x54\x49\x89\xFC\x53\x48\x83\xEC\x2A\x48"
345+
}
346+
347+
// "CNetworkStringTable::AddString"
348+
"CNetworkStringTable_AddString"
339349
{
340350
"library" "engine"
341-
"windows" "\x48\x89\x74\x24\x10\x57\x48\x83\xEC\x30\x33\xF6\x48\x8B\xFA"
342-
"linux" "\x55\x48\x89\xE5\x41\x56\x41\x55\x41\x54\x49\x89\xF4\x53\x48\x83\x7F\x30\x00"
351+
"windows" "\x48\x89\x5C\x24\x2A\x55\x56\x57\x48\x83\xEC\x60\x80\x79\x44\x02\x49\x8B\xF9"
352+
"linux" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x49\x89\xCD\x41\x54\x49\x89\xFC\x53\x89\xF3\x48\x83\xEC\x28\x80\x7F\x3C\x01"
343353
}
344354
}
345355
"Offsets"
@@ -414,13 +424,20 @@
414424
"windows" "584"
415425
"linux" "584"
416426
}
417-
418-
// "tried to sprint to a non-client", there will be a check above like this: if ( a2 >= *(v5 + 632) )
427+
// engine
428+
// "tried to sprint to a non-client", there will be a check above like this: if ( a2 >= *(v5 + 632) ), note that this is a CUtlVector
419429
"CNetworkGameServer_ClientList"
420430
{
421431
"windows" "77"
422432
"linux" "79"
423433
}
434+
435+
// Called right before printing "Warning: Can't add nullptr string to table %s\n"
436+
"CNetworkStringTable_GetTableName"
437+
{
438+
"windows" "1"
439+
"linux" "2"
440+
}
424441
}
425442
"Patches"
426443
{
@@ -470,4 +487,4 @@
470487
}
471488
}
472489
}
473-
}
490+
}

src/commands.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -402,36 +402,33 @@ CON_COMMAND_CHAT(pause, "Request pause")
402402
if (!player)
403403
return;
404404

405-
int iPlayer = player->GetPlayerSlot();
405+
if(match_paused) {
406+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX" Match already paused");
407+
return;
408+
}
406409

407-
CBasePlayerController* pPlayer = (CBasePlayerController*)g_pEntitySystem->GetBaseEntity((CEntityIndex)(player->GetPlayerSlot() + 1));
410+
match_paused = true;
408411

409412
g_pEngineServer2->ServerCommand("mp_pause_match");
410-
411413
ClientPrintAll(HUD_PRINTTALK, CHAT_PREFIX"\4%s \1requested a pause", player->GetPlayerName());
412-
413-
match_paused = true;
414414
ct_ready = false;
415415
t_ready = false;
416416
}
417417

418418
CON_COMMAND_CHAT(unpause, "Request unpause")
419419
{
420-
if(!g_bEnablePause)
420+
if(!g_bEnablePause || !player)
421421
return;
422422

423-
if (!player)
423+
if (!match_paused){
424+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"Match is not paused yet, type \5 .pause");
424425
return;
426+
}
425427

426-
if(!match_paused)
427-
return;
428-
429-
CBasePlayerController* pPlayer = (CBasePlayerController*)g_pEntitySystem->GetBaseEntity((CEntityIndex)(player->GetPlayerSlot() + 1));
430-
431-
int teamSide = pPlayer->m_iTeamNum();
432-
if( teamSide == CS_TEAM_T && !t_ready){
428+
int teamSide = player->m_iTeamNum();
429+
if(teamSide == CS_TEAM_T && !t_ready){
433430
t_ready = true;
434-
}else if( teamSide == CS_TEAM_CT && !ct_ready){
431+
}else if(teamSide == CS_TEAM_CT && !ct_ready){
435432
ct_ready = true;
436433
}
437434

src/cs2fixes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ const char *CS2Fixes::GetLicense()
616616

617617
const char *CS2Fixes::GetVersion()
618618
{
619-
return "1.1.0";
619+
return "1.1.1";
620620
}
621621

622622
const char *CS2Fixes::GetDate()

src/detours.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ extern CCSGameRules *g_pGameRules;
5151
DECLARE_DETOUR(UTIL_SayTextFilter, Detour_UTIL_SayTextFilter);
5252
DECLARE_DETOUR(UTIL_SayText2Filter, Detour_UTIL_SayText2Filter);
5353
//DECLARE_DETOUR(IsHearingClient, Detour_IsHearingClient);
54-
DECLARE_DETOUR(CSoundEmitterSystem_EmitSound, Detour_CSoundEmitterSystem_EmitSound);
5554
//DECLARE_DETOUR(TriggerPush_Touch, Detour_TriggerPush_Touch);
5655
DECLARE_DETOUR(CGameRules_Constructor, Detour_CGameRules_Constructor);
5756
//DECLARE_DETOUR(CBaseEntity_TakeDamageOld, Detour_CBaseEntity_TakeDamageOld);
@@ -72,12 +71,6 @@ static bool g_bBlockAllDamage = false;
7271
FAKE_BOOL_CVAR(cs2f_block_molotov_self_dmg, "Whether to block self-damage from molotovs", g_bBlockMolotovSelfDmg, false, false)
7372
FAKE_BOOL_CVAR(cs2f_block_all_dmg, "Whether to block all damage to players", g_bBlockAllDamage, false, false)
7473

75-
void FASTCALL Detour_CSoundEmitterSystem_EmitSound(ISoundEmitterSystemBase *pSoundEmitterSystem, CEntityIndex *a2, IRecipientFilter &filter, uint32 a4, void *a5)
76-
{
77-
//ConMsg("Detour_CSoundEmitterSystem_EmitSound\n");
78-
CSoundEmitterSystem_EmitSound(pSoundEmitterSystem, a2, filter, a4, a5);
79-
}
80-
8174

8275
void SayChatMessageWithTimer(IRecipientFilter &filter, const char *pText, CCSPlayerController *pPlayer, uint64 eMessageType)
8376
{
@@ -289,10 +282,6 @@ bool InitDetours(CGameConfig *gameConfig)
289282
success = false;
290283
UTIL_SayText2Filter.EnableDetour();
291284

292-
if (!CSoundEmitterSystem_EmitSound.CreateDetour(gameConfig))
293-
success = false;
294-
CSoundEmitterSystem_EmitSound.EnableDetour();
295-
296285
if (!CGameRules_Constructor.CreateDetour(gameConfig))
297286
success = false;
298287
CGameRules_Constructor.EnableDetour();

0 commit comments

Comments
 (0)