Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 3 additions & 9 deletions extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <google_breakpad/processor/stack_frame.h>
#include <processor/pathname_stripper.h>

#include <entity2/entitysystem.h>
#if defined WIN32
#include <corecrt_io.h>
#endif
Expand All @@ -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<IServerGameDLL, void, bool, bool, bool> gameFrameHook(&IServerGameDLL::GameFrame, &g_AcceleratorCS2, nullptr, &AcceleratorCS2::GameFrame);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -542,9 +536,9 @@ KHook::Return<void> AcceleratorCS2::GameFrame(IServerGameDLL* pThis, bool simula

#endif

KHook::Return<void> AcceleratorCS2::StartupServer(INetworkServerService* pThis, const GameSessionConfiguration_t& config, ISource2WorldSession*, const char*)
KHook::Return<void> 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};
}
Expand Down
5 changes: 3 additions & 2 deletions extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include "khook.hpp"
#include <ISmmPlugin.h>
#include <igameevents.h>
#include <iserver.h>
#include <engine2/isource2server.h>
#include <engine2/inetworkserverservice.h>

class AcceleratorCS2 : public ISmmPlugin, public IMetamodListener
{
Expand All @@ -20,5 +21,5 @@ class AcceleratorCS2 : public ISmmPlugin, public IMetamodListener
const char* GetLogTag();
public: // Hooks
KHook::Return<void> GameFrame(IServerGameDLL* pThis, bool simulating, bool bFirstTick, bool bLastTick);
KHook::Return<void> StartupServer(INetworkServerService* pThis, const GameSessionConfiguration_t& config, ISource2WorldSession*, const char*);
KHook::Return<void> StartupServer(INetworkServerService* pThis, const GameSessionConfiguration_t& config, ISource2WorldSession*, const char* pszMapName);
};
8 changes: 1 addition & 7 deletions premake/mm-linux.lua
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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"),
Expand Down
8 changes: 1 addition & 7 deletions premake/mm-windows.lua
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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"),
Expand Down
Loading