Skip to content

Commit 01af113

Browse files
committed
remove(hooks): CGameRules_Constructor
1 parent aa3c941 commit 01af113

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

plugin_files/gamedata/signatures.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
"windows": "48 85 C9 0F 84 2A 2A 2A 2A 48 89 5C 24 2A 55",
55
"linux": "55 48 89 E5 41 57 49 89 CF 41 56 49 89 D6 41 55 41 89 F5 41 54 4C 8D A5 A0 FE FF FF"
66
},
7-
"CGameRules_Constructor": {
8-
"lib": "server",
9-
"windows": "48 89 5C 24 2A 48 89 74 24 2A 57 48 83 EC 2A 8B 15 2A 2A 2A 2A 48 8D 05 2A 2A 2A 2A 48 89 01 33 F6 65 48 8B 04 25 2A 2A 2A 2A 48 8B D9 48 89 71 2A 48 8B 3C D0 B8 2A 2A 2A 2A 40 38 34 38 75 2A E8 2A 2A 2A 2A B8 2A 2A 2A 2A 48 8B 04 38 48 89 43 2A 48 89 73 2A 48 89 73 2A 89 73 2A C7 43 2A 2A 2A 2A 2A 48 89 B3",
10-
"linux": "55 48 8D 05 2A 2A 2A 2A 48 89 E5 53 48 89 FB 48 83 EC 2A 48 89 07 66 48 8D 3D 2A 2A 2A 2A 66 66 48 E8 2A 2A 2A 2A C7 43 2A 2A 2A 2A 2A 48 C7 43 2A 2A 2A 2A 2A 48 C7 43 2A 2A 2A 2A 2A C7 43 2A 2A 2A 2A 2A 48 C7 83"
11-
},
127
"ServerMovementUnlock": {
138
"lib": "server",
149
"windows": "76 ? F2 0F 10 57 ? 0F 28 ? F3 0F ? ? 0F 28 ?",

src/entrypoint.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ IGameEventSystem* g_pGameEventSystem = nullptr;
6969
CEntityListener g_entityListener;
7070
CSteamGameServerAPIContext g_SteamAPI;
7171
CSchemaSystem* g_pSchemaSystem2 = nullptr;
72+
CCSGameRules* gameRules = nullptr;
7273

7374
class CGameResourceService
7475
{
@@ -600,6 +601,9 @@ void CEntityListener::OnEntityCreated(CEntityInstance* pEntity)
600601
PluginEvent* event = new PluginEvent("core", nullptr, nullptr);
601602
g_pluginManager->ExecuteEvent("core", "OnEntityCreated", encoders::msgpack::SerializeToString({ string_format("%p", (void*)pEntity) }), event);
602603
delete event;
604+
605+
if (std::string(pEntity->GetClassname()) == "cs_gamerules")
606+
gameRules = ((CCSGameRulesProxy*)pEntity)->m_pGameRules;
603607
}
604608

605609
void CEntityListener::OnEntityDeleted(CEntityInstance* pEntity)

src/entrypoint.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class GameSessionConfiguration_t
4242
{
4343
};
4444

45+
class CCSGameRules;
46+
4547
class Swiftly : public ISmmPlugin, public IMetamodListener
4648
{
4749
public:
@@ -104,6 +106,7 @@ extern IGameEventManager2* g_gameEventManager;
104106
extern IGameEventSystem* g_pGameEventSystem;
105107
extern CSteamGameServerAPIContext g_SteamAPI;
106108
extern INetworkSystem* g_pNetworkSystem;
109+
extern CCSGameRules* gameRules;
107110

108111
PLUGIN_GLOBALVARS();
109112

src/plugins/core/scripting/utils.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44
#include "../../PluginManager.h"
55
#include "../../../usermessages/usermessages.h"
66

7-
void Hook_CGameRules_Constructor(CGameRules* pThis);
8-
CCSGameRules* gameRules = nullptr;
9-
10-
FuncHook<decltype(Hook_CGameRules_Constructor)> CGameRules_ConstructorT(Hook_CGameRules_Constructor, "CGameRules_Constructor");
11-
12-
void Hook_CGameRules_Constructor(CGameRules* pThis)
13-
{
14-
gameRules = (CCSGameRules*)pThis;
15-
CGameRules_ConstructorT(pThis);
16-
}
17-
187
bool scripting_IsWindows()
198
{
209
return WIN_LINUX(true, false);

0 commit comments

Comments
 (0)