diff --git a/core/provider/provider_ep2.cpp b/core/provider/provider_ep2.cpp index 3a0337f..2f69607 100644 --- a/core/provider/provider_ep2.cpp +++ b/core/provider/provider_ep2.cpp @@ -43,7 +43,7 @@ #include #endif -#if SOURCE_ENGINE == SE_DOTA +#if SOURCE_ENGINE == SE_DOTA && defined( _WIN32 ) SH_DECL_HOOK1(ISource2ServerConfig, AllowDedicatedServers, const, 0, bool, EUniverse); bool BaseProvider::AllowDedicatedServers(EUniverse universe) const { @@ -239,7 +239,7 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory, SH_ADD_HOOK_STATICFUNC(IServerGameClients, ClientCommand, gameclients, ClientCommand, false); } -#if SOURCE_ENGINE == SE_DOTA +#if SOURCE_ENGINE == SE_DOTA && defined( _WIN32 ) SH_ADD_VPHOOK(ISource2ServerConfig, AllowDedicatedServers, serverconfig, SH_MEMBER(this, &BaseProvider::AllowDedicatedServers), false); #endif } diff --git a/core/provider/provider_ep2.h b/core/provider/provider_ep2.h index fe46da6..dea6c4e 100644 --- a/core/provider/provider_ep2.h +++ b/core/provider/provider_ep2.h @@ -81,7 +81,7 @@ public: virtual const char *GetUserMessage(int index, int *size=NULL); virtual int DetermineSourceEngine(); virtual bool ProcessVDF(const char *file, char path[], size_t path_len, char alias[], size_t alias_len); -#if SOURCE_ENGINE == SE_DOTA +#if SOURCE_ENGINE == SE_DOTA && defined( _WIN32 ) bool AllowDedicatedServers(EUniverse universe) const; #endif }; diff --git a/loader/gamedll.cpp b/loader/gamedll.cpp index 2726e1a..e46bc83 100644 --- a/loader/gamedll.cpp +++ b/loader/gamedll.cpp @@ -52,7 +52,9 @@ static ISource2ServerConfig *config_iface = NULL; static QueryValveInterface gamedll_qvi = NULL; static int gamedll_version = 0; static int isgd_shutdown_index = -1; +#if defined _WIN32 static int is2sc_allowdedi_index = 21; +#endif static char mm_path[PLATFORM_MAX_PATH]; static bool g_is_source2 = false; @@ -229,15 +231,19 @@ mm_PatchDllInit(bool patch); static void mm_PatchDllShutdown(); +#if defined _WIN32 static void mm_PatchAllowDedicated(bool patch); +#endif static void mm_PatchConnect(bool patch); static void *isgd_orig_init = NULL; static void *isgd_orig_shutdown = NULL; +#if defined _WIN32 static void *is2sc_orig_allowdedi = NULL; +#endif static void *is2sc_orig_connect = NULL; class VEmptyClass @@ -299,11 +305,13 @@ public: return result; } +#if defined _WIN32 virtual bool AllowDedicatedServers(int universe) const { mm_PatchAllowDedicated(false); return true; } +#endif }; class ISource2Server @@ -661,6 +669,7 @@ mm_PatchDllShutdown() vtable_dest[isgd_shutdown_index] = vtable_src[mfp.vtblindex]; } +#if defined _WIN32 static void mm_PatchAllowDedicated(bool patch) { @@ -694,6 +703,7 @@ mm_PatchAllowDedicated(bool patch) is2sc_orig_allowdedi = NULL; } } +#endif static void mm_PatchConnect(bool patch) @@ -776,7 +786,9 @@ mm_GameDllRequest(const char *name, int *ret) gamedll_qvi = qvi; mm_PatchConnect(true); +#if defined _WIN32 mm_PatchAllowDedicated(true); +#endif if (ret != NULL) *ret = 0;