diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f60e05c..31a8850 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,10 +38,10 @@ jobs: path: mmsource-2.0 submodules: recursive - - name: Checkout HL2SDK + - name: Checkout s2sdk uses: actions/checkout@v7 with: - repository: alliedmodders/hl2sdk + repository: alliedmodders/s2sdk ref: cs2 path: hl2sdk-cs2 diff --git a/extension.cpp b/extension.cpp index c99c5b8..6f0704b 100644 --- a/extension.cpp +++ b/extension.cpp @@ -37,7 +37,6 @@ #include #include -#include #if defined WIN32 #include #endif @@ -54,11 +53,6 @@ char dumpStoragePath[512]; std::string g_serverId; std::string g_UserId; -CGameEntitySystem *GameEntitySystem() -{ - return nullptr; -} - class GameSessionConfiguration_t { }; #if defined _LINUX KHook::Virtual gameFrameHook(&IServerGameDLL::GameFrame, &g_AcceleratorCS2, nullptr, &AcceleratorCS2::GameFrame); @@ -480,7 +474,7 @@ bool AcceleratorCS2::Load(PluginId id, ISmmAPI* ismm, char* error, size_t maxlen strncpy(crashCommandLine, CommandLine()->GetCmdLine(), sizeof(crashCommandLine) - 1); if (late) - StartupServer(nullptr, {}, nullptr, nullptr); + StartupServer(nullptr, {}, nullptr, ""); LoadServerId(); LoadConfig(); @@ -542,9 +536,9 @@ KHook::Return AcceleratorCS2::GameFrame(IServerGameDLL* pThis, bool simula #endif -KHook::Return AcceleratorCS2::StartupServer(INetworkServerService* pThis, const GameSessionConfiguration_t& config, ISource2WorldSession*, const char*) +KHook::Return AcceleratorCS2::StartupServer(INetworkServerService* pThis, const GameSessionConfiguration_t& config, ISource2WorldSession*, const char* pszMapName) { - strncpy(crashMap, g_pNetworkServerService->GetIGameServer()->GetMapName(), sizeof(crashMap) - 1); + strncpy(crashMap, pszMapName, sizeof(crashMap) - 1); return {KHook::Action::Ignore}; } diff --git a/extension.h b/extension.h index 8d6bbe3..2130d2e 100644 --- a/extension.h +++ b/extension.h @@ -2,7 +2,8 @@ #include "khook.hpp" #include #include -#include +#include +#include class AcceleratorCS2 : public ISmmPlugin, public IMetamodListener { @@ -20,5 +21,5 @@ class AcceleratorCS2 : public ISmmPlugin, public IMetamodListener const char* GetLogTag(); public: // Hooks KHook::Return GameFrame(IServerGameDLL* pThis, bool simulating, bool bFirstTick, bool bLastTick); - KHook::Return StartupServer(INetworkServerService* pThis, const GameSessionConfiguration_t& config, ISource2WorldSession*, const char*); + KHook::Return StartupServer(INetworkServerService* pThis, const GameSessionConfiguration_t& config, ISource2WorldSession*, const char* pszMapName); }; \ No newline at end of file diff --git a/premake/mm-linux.lua b/premake/mm-linux.lua index 6c9968b..a3aa484 100644 --- a/premake/mm-linux.lua +++ b/premake/mm-linux.lua @@ -1,8 +1,6 @@ files { path.join(SDK_PATH, "public", "tier0", "memoverride.cpp"), - path.join(SDK_PATH, "tier1", "convar.cpp"), - path.join(SDK_PATH, "entity2", "entityidentity.cpp"), - path.join(SDK_PATH, "entity2", "entitysystem.cpp"), + path.join(SDK_PATH, "tier0_perproject", "convar.cpp"), } libdirs { @@ -22,14 +20,10 @@ includedirs { path.join(SDK_PATH, "thirdparty", "protobuf-3.21.8", "src"), path.join(SDK_PATH, "common"), path.join(SDK_PATH, "game", "shared"), - path.join(SDK_PATH, "game", "server"), path.join(SDK_PATH, "public"), - path.join(SDK_PATH, "public", "engine"), path.join(SDK_PATH, "public", "mathlib"), path.join(SDK_PATH, "public", "tier0"), - path.join(SDK_PATH, "public", "tier1"), path.join(SDK_PATH, "public", "entity2"), - path.join(SDK_PATH, "public", "public", "entity2"), -- metamod path.join(MM_PATH, "core"), path.join(MM_PATH, "third_party", "khook", "include"), diff --git a/premake/mm-windows.lua b/premake/mm-windows.lua index 911b33b..de7ea68 100644 --- a/premake/mm-windows.lua +++ b/premake/mm-windows.lua @@ -1,7 +1,5 @@ files { - path.join(SDK_PATH, "tier1", "convar.cpp"), - path.join(SDK_PATH, "entity2", "entityidentity.cpp"), - path.join(SDK_PATH, "entity2", "entitysystem.cpp"), + path.join(SDK_PATH, "tier0_perproject", "convar.cpp"), } links { @@ -17,14 +15,10 @@ includedirs { path.join(SDK_PATH, "thirdparty", "protobuf-3.21.8", "src"), path.join(SDK_PATH, "common"), path.join(SDK_PATH, "game", "shared"), - path.join(SDK_PATH, "game", "server"), path.join(SDK_PATH, "public"), - path.join(SDK_PATH, "public", "engine"), path.join(SDK_PATH, "public", "mathlib"), path.join(SDK_PATH, "public", "tier0"), - path.join(SDK_PATH, "public", "tier1"), path.join(SDK_PATH, "public", "entity2"), - path.join(SDK_PATH, "public", "public", "entity2"), -- metamod path.join(MM_PATH, "core"), path.join(MM_PATH, "third_party", "khook", "include"),