10
10
#include < steam/steam_gameserver.h>
11
11
12
12
class CBaseServer ;
13
+ class CSteam3Server : public CSteamGameServerAPIContext { };
13
14
14
15
namespace GameTags
15
16
{
@@ -22,9 +23,13 @@ namespace GameTags
22
23
if ( RecalculateTags_original == nullptr )
23
24
LUA->ThrowError ( " unable to find CBaseServer::RecalculateTags" );
24
25
25
- gameserver_context = InterfacePointers::SteamGameServerAPIContext ( );
26
+ FunctionPointers::Steam3Server_t Steam3Server = FunctionPointers::Steam3Server ( );
27
+ if ( Steam3Server == nullptr )
28
+ LUA->ThrowError ( " unable to find Steam3Server" );
29
+
30
+ gameserver_context = Steam3Server ( );
26
31
if ( gameserver_context == nullptr )
27
- LUA->ThrowError ( " Failed to load required CSteamGameServerAPIContext interface. " );
32
+ LUA->ThrowError ( " unable to load CSteamGameServerAPIContext interface" );
28
33
}
29
34
30
35
void RecalculateTags ( )
@@ -63,13 +68,13 @@ namespace GameTags
63
68
64
69
private:
65
70
static FunctionPointers::CBaseServer_RecalculateTags_t RecalculateTags_original;
66
- static CSteamGameServerAPIContext *gameserver_context;
71
+ static CSteam3Server *gameserver_context;
67
72
static std::string gametags_substitute;
68
73
};
69
74
70
75
FunctionPointers::CBaseServer_RecalculateTags_t
71
76
CBaseServerProxy::RecalculateTags_original = nullptr ;
72
- CSteamGameServerAPIContext *CBaseServerProxy::gameserver_context = nullptr ;
77
+ CSteam3Server *CBaseServerProxy::gameserver_context = nullptr ;
73
78
std::string CBaseServerProxy::gametags_substitute;
74
79
75
80
void PreInitialize ( GarrysMod::Lua::ILuaBase *LUA )
0 commit comments