1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-20 13:54:14 +01:00

Merged changes from 1.7 branch.

This commit is contained in:
Scott Ehlert 2009-02-25 22:40:11 -06:00
commit db5f531c78
65 changed files with 5318 additions and 232 deletions

View File

@ -16,3 +16,4 @@ a50090ca6e6a5f01122a9fbabc1ad6775cba5057 mmsource-1.3d
2b10484499c0e9fc131b4b296879a6d9b2f280d2 mmsource-1.6.1
3bce7260f26a48e37b0e849332d61ff1fde6b8b2 mmsource-1.6.2
c5e10372b1d4d50950aca7d112e0324000d0e6cd mmsource-1.7.0
a0e24af92af0a4523e5e7dd9b658f1204ce3fe2d mmsource-1.7.1

View File

@ -26,6 +26,7 @@
# include <stdio.h>
# include <signal.h>
# include <setjmp.h>
# include <stdint.h>
// http://www.die.net/doc/linux/man/man2/mprotect.2.html
# include <limits.h>
# ifndef PAGESIZE
@ -37,8 +38,8 @@
// We need to align addr down to pagesize on linux
// We assume PAGESIZE is a power of two
# define SH_LALIGN(x) (void*)((intptr_t)(x) & ~(PAGESIZE-1))
# define SH_LALDIF(x) ((intptr_t)(x) & (PAGESIZE-1))
# define SH_LALIGN(x) (void*)((uintptr_t)(x) & ~(PAGESIZE-1))
# define SH_LALDIF(x) ((uintptr_t)(x) & (PAGESIZE-1))
# else
# error Unsupported OS/Compiler
# endif

View File

@ -303,8 +303,6 @@ bool AlternatelyLoadMetamod(CreateInterfaceFn ifaceFactory, CreateInterfaceFn se
return false;
}
g_PluginMngr.SetAllLoaded();
return true;
}
@ -317,7 +315,10 @@ bool GameInit_handler()
g_SmmAPI.LoadAsVSP();
if (g_bIsBridgedAsVsp)
{
DoInitialPluginLoads();
g_PluginMngr.SetAllLoaded();
}
g_bGameInit = true;
@ -421,7 +422,7 @@ bool LoadFromVDF(const char *file, bool &skipped)
int LoadVDFPluginsFromDir(const char *dir, int &skipped)
{
bool success, skip;
bool success, skip;
int total = 0;
char path[MAX_PATH];
@ -453,10 +454,10 @@ int LoadVDFPluginsFromDir(const char *dir, int &skipped)
do
{
g_SmmAPI.PathFormat(path, sizeof(path), "%s\\%s", dir, fd.cFileName);
success = LoadFromVDF(path, skip);
if (skip)
skipped++;
else if (success)
success = LoadFromVDF(path, skip);
if (skip)
skipped++;
else if (success)
total++;
} while (FindNextFile(hFind, &fd));
@ -485,10 +486,10 @@ int LoadVDFPluginsFromDir(const char *dir, int &skipped)
continue;
}
g_SmmAPI.PathFormat(path, sizeof(path), "%s/%s", dir, pEnt->d_name);
success = LoadFromVDF(path, skip);
if (skip)
skipped++;
else if (success)
success = LoadFromVDF(path, skip);
if (skip)
skipped++;
else if (success)
total++;
}
@ -669,24 +670,24 @@ int LoadPluginsFromFile(const char *filepath, int &skipped)
return total;
}
int LoadPlugins(const char *filepath, const char *vdfpath)
{
int total, skipped, fskipped, vskipped;
const char *s = "";
total = LoadPluginsFromFile(filepath, fskipped);
total += LoadVDFPluginsFromDir(vdfpath, vskipped);
skipped = fskipped + vskipped;
if (total == 0 || total > 1)
s = "s";
if (skipped)
LogMessage("[META] Loaded %d plugin%s (%d already loaded)", total, s, skipped);
else
LogMessage("[META] Loaded %d plugin%s.", total, s);
return total;
int LoadPlugins(const char *filepath, const char *vdfpath)
{
int total, skipped, fskipped, vskipped;
const char *s = "";
total = LoadPluginsFromFile(filepath, fskipped);
total += LoadVDFPluginsFromDir(vdfpath, vskipped);
skipped = fskipped + vskipped;
if (total == 0 || total > 1)
s = "s";
if (skipped)
LogMessage("[META] Loaded %d plugin%s (%d already loaded)", total, s, skipped);
else
LogMessage("[META] Loaded %d plugin%s.", total, s);
return total;
}
void LogMessage(const char *msg, ...)

View File

@ -42,6 +42,7 @@
#define SOURCE_ENGINE_EPISODEONE 2 /**< Episode 1 Source Engine (second major SDK) */
#define SOURCE_ENGINE_ORANGEBOX 3 /**< Orange Box Source Engine (third major SDK) */
#define SOURCE_ENGINE_LEFT4DEAD 4 /**< Left 4 Dead */
#define SOURCE_ENGINE_DARKMESSIAH 5 /**< Dark Messiah Multiplayer (based on original engine) */
#define METAMOD_PLAPI_VERSION 14 /**< Version of this header file */
#define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */

View File

@ -54,7 +54,7 @@ ifeq "$(ENGINE)" "left4dead"
override ENGSET = true
endif
CFLAGS += -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
CFLAGS += -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc

View File

@ -194,13 +194,22 @@ mm_DetectGameInformation()
metamod_path.assign(mm_path);
/* Get value of -game from command line, defaulting to hl2 as engine seems to do */
const char *game_dir = provider->GetCommandLineValue("-game", "hl2");
const char *game_dir = provider->GetCommandLineValue("-game");
if (game_dir)
{
/* Get absolute path */
abspath(game_path, game_dir);
}
else
{
/* Get absolute path for current directory */
abspath(game_path, ".");
}
/* Get absolute path */
abspath(game_path, game_dir);
mod_path.assign(game_path);
engine_build = provider->DetermineSourceEngine(game_dir);;
engine_build = provider->DetermineSourceEngine(game_dir);
return true;
}
@ -577,8 +586,8 @@ Handler_LevelShutdown(void)
{
if (g_bIsVspBridged && !were_plugins_loaded)
{
g_PluginMngr.SetAllLoaded();
DoInitialPluginLoads();
g_PluginMngr.SetAllLoaded();
were_plugins_loaded = true;
in_first_level = true;
}
@ -1125,28 +1134,28 @@ ProcessVDF(const char *path, bool &skipped)
if (alias[0] != '\0')
g_PluginMngr.SetAlias(alias, file);
/* Attempt to find a file extension */
if (UTIL_GetExtension(file) == NULL)
{
g_pMetamod->PathFormat(full_path,
sizeof(full_path),
"%s/%s%s",
g_pMetamod->GetBaseDir(),
file,
#if defined WIN32 || defined _WIN32
".dll"
#else
"_i486.so"
#endif
);
}
else
{
g_pMetamod->PathFormat(full_path,
sizeof(full_path),
"%s/%s",
g_pMetamod->GetBaseDir(),
file);
/* Attempt to find a file extension */
if (UTIL_GetExtension(file) == NULL)
{
g_pMetamod->PathFormat(full_path,
sizeof(full_path),
"%s/%s%s",
g_pMetamod->GetBaseDir(),
file,
#if defined WIN32 || defined _WIN32
".dll"
#else
"_i486.so"
#endif
);
}
else
{
g_pMetamod->PathFormat(full_path,
sizeof(full_path),
"%s/%s",
g_pMetamod->GetBaseDir(),
file);
}
id = g_PluginMngr.Load(full_path, Pl_File, already, error, sizeof(error));

View File

@ -113,10 +113,12 @@ bool Command_Meta(IMetamodSourceCommandInfo *info)
}
#endif
#if SOURCE_ENGINE == SE_ORANGEBOX
#if SOURCE_ENGINE == SE_LEFT4DEAD
CONMSG(" Engine: Left 4 Dead (2008)\n");
#elif SOURCE_ENGINE == SE_ORANGEBOX
CONMSG(" Engine: Episode 2 (Orange Box, 2007)\n");
#else
CONMSG(" Engine: Left 4 Dead (2008)\n");
CONMSG(" Engine: Dark Messiah (2006)\n");
#endif
// Display user messages

View File

@ -115,7 +115,7 @@ namespace SourceMM
* @param val Default string to return if none found.
* @return Parameter value.
*/
virtual const char *GetCommandLineValue(const char *key, const char *defval) =0;
virtual const char *GetCommandLineValue(const char *key, const char *defval=NULL) =0;
/**
* @brief Prints a string to the remote server console.

View File

@ -341,3 +341,19 @@ bool UTIL_Relatize(char buffer[],
return true;
}
bool UTIL_VerifySignature(const void *addr, const char *sig, size_t len)
{
unsigned char *addr1 = (unsigned char *) addr;
unsigned char *addr2 = (unsigned char *) sig;
for (size_t i = 0; i < len; i++)
{
if (addr2[i] == '*')
continue;
if (addr1[i] != addr2[i])
return false;
}
return true;
}

View File

@ -85,5 +85,15 @@ bool UTIL_Relatize(char buffer[],
const char *relTo,
const char *relFrom);
/**
* @brief Compares memory address against a signature.
*
* @param addr Memory address to check.
* @param sig Signature used to check against memory address. Accept 0x2A as wildcard.
* @param len Length of signature.
* @return True if signature was verified, false otherwise.
*/
bool UTIL_VerifySignature(const void *addr, const char *sig, size_t len);
#endif //_INCLUDE_UTIL_H

View File

@ -5,16 +5,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mm_core", "mm_core.vcproj",
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Orange Box|Win32 = Release - Orange Box|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32

View File

@ -40,9 +40,10 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SE_ORANGEBOX=3;SE_LEFT4DEAD=4;SOURCE_ENGINE=3"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=3"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -123,11 +124,12 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="3"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SE_ORANGEBOX=3;SE_LEFT4DEAD=4;SOURCE_ENGINE=3"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=3"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@ -209,9 +211,10 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SE_ORANGEBOX=3;SE_LEFT4DEAD=4;SOURCE_ENGINE=4"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=4"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -292,11 +295,12 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="3"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SE_ORANGEBOX=3;SE_LEFT4DEAD=4;SOURCE_ENGINE=4"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=4"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@ -354,6 +358,177 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Dark Messiah|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=2"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)/metamod.2.darkm.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="libc.lib;libcd.lib;libcmt.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/sourcemm.pdb"
SubSystem="2"
EnableCOMDATFolding="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/sourcemm.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Dark Messiah|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="3"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=2"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
BufferSecurityCheck="false"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)/metamod.2.darkm.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="libc.lib;libcd.lib;libcmtd.lib"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/sourcemm.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>

View File

@ -27,13 +27,20 @@
#include "console.h"
#include "provider_ep2.h"
#include "metamod_util.h"
using namespace SourceHook;
SMConVarAccessor g_SMConVarAccessor;
#if SOURCE_ENGINE >= SE_ORANGEBOX
#else
#define RegisterConCommand RegisterConCommandBase
#endif
bool SMConVarAccessor::RegisterConCommandBase(ConCommandBase *pCommand)
{
m_RegisteredCommands.push_back(pCommand);
pCommand->SetNext(NULL);
icvar->RegisterConCommand(pCommand);
@ -48,8 +55,128 @@ bool SMConVarAccessor::Register(ConCommandBase *pCommand)
return true;
}
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
void SMConVarAccessor::RemoveMetamodCommands()
{
icvar->UnregisterConCommand(pCommand);
List<ConCommandBase *>::iterator iter;
for (iter = m_RegisteredCommands.begin(); iter != m_RegisteredCommands.end(); iter++)
{
Unregister(*iter);
}
}
#if SOURCE_ENGINE == SE_DARKMESSIAH
/* Signature for ICvar::GetCommands() in vstdlib for Win32 and Linux.
*
* 20226EE0 A1 50 5C 5A 20 mov eax,dword ptr ds:[205A5C50h] <-- What we want
* 20226EE5 C3 ret
*/
#define CMDLIST_SIG "\xA1\x2A\x2A\x2A\x2A\xC3"
#define CMDLIST_SIGLEN 6
/* Linux symbol name of ConCommandBase list in vstdlib */
#define CMDLIST_SYMBOL "_ZN14ConCommandBase18s_pConCommandBasesE"
/* This function retrieves the address of the var that holds the top of the ConCommandBase list.
* Having this allows us to change the beginning of this list with ease.
*
* This craziness eliminates the need for the eternal command/cvar used previously which
* could have caused a crash as a result of registering commands/cvars more than once.
*/
bool SMConVarAccessor::InitConCommandBaseList()
{
char *vfunc = (char *)SH_GET_ORIG_VFNPTR_ENTRY(icvar, &ICvar::GetCommands);
if (*vfunc == '\xE9')
{
/* Get address from displacement...
*
* Add 5 because it's relative to next instruction:
* Opcode <1 byte> + 32-bit displacement <4 bytes>
*/
vfunc += *reinterpret_cast<int *>(vfunc + 1) + 5;
}
if (!vfunc)
{
return false;
}
#ifdef OS_WIN32
if (UTIL_VerifySignature(vfunc, CMDLIST_SIG, CMDLIST_SIGLEN))
{
/* Skip past 0xA1 and get addr of ConCommandBase list var */
m_TopConCommandBase = *reinterpret_cast<ConCommandBase ***>(vfunc + 1);
return true;
}
#elif defined OS_LINUX
/* Try dlsym first */
char path[PATH_SIZE];
if (GetFileOfAddress((void *)icvar, path, sizeof(path)))
{
void *handle = dlopen(path, RTLD_NOW);
if (handle)
{
m_TopConCommandBase = reinterpret_cast<ConCommandBase **>(dlsym(handle, CMDLIST_SYMBOL));
dlclose(handle);
return true;
}
}
/* If dlsym failed, then verify signature of function */
if (!m_TopConCommandBase && UTIL_VerifySignature(vfunc, CMDLIST_SIG, CMDLIST_SIGLEN))
{
/* Skip past 0xA1 and get addr of ConCommandBase list var */
m_TopConCommandBase = *reinterpret_cast<ConCommandBase ***>(vfunc + 1);
return true;
}
#endif
return false;
}
#endif
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
{
#if SOURCE_ENGINE >= SE_ORANGEBOX
icvar->UnregisterConCommand(pCommand);
#else
ConCommandBase *pCur = NULL;
ConCommandBase *pPrev = NULL;
if (!pCommand)
{
return;
}
pCur = icvar->GetCommands();
if (!m_TopConCommandBase || !pCur)
{
return;
}
if (pCur == pCommand)
{
*m_TopConCommandBase = const_cast<ConCommandBase *>(pCommand->GetNext());
pCommand->SetNext(NULL);
return;
}
pPrev = pCur;
pCur = const_cast<ConCommandBase *>(pCur->GetNext());
while (pCur)
{
if (pCur == pCommand)
{
pPrev->SetNext(const_cast<ConCommandBase *>(pCommand->GetNext()));
pCommand->SetNext(NULL);
}
pPrev = pCur;
pCur = const_cast<ConCommandBase *>(pCur->GetNext());
}
#endif
}

View File

@ -33,8 +33,8 @@
#undef _DEBUG
#endif
#include <interface.h>
#include <eiface.h>
#include "convar.h"
#include <eiface.h>
#include <sh_list.h>
#if defined DEBUG2
#undef DEBUG2
@ -47,6 +47,14 @@ public:
bool RegisterConCommandBase(ConCommandBase *pCommand);
bool Register(ConCommandBase *pCommand);
void Unregister(ConCommandBase *pCommand);
void RemoveMetamodCommands();
#if SOURCE_ENGINE == SE_DARKMESSIAH
bool InitConCommandBaseList();
private:
ConCommandBase **m_TopConCommandBase;
#endif
private:
SourceHook::List<ConCommandBase *> m_RegisteredCommands;
};
extern SMConVarAccessor g_SMConVarAccessor;

View File

@ -56,13 +56,23 @@ struct UsrMsgInfo
int size;
String name;
};
/* Imports */
#if SOURCE_ENGINE == SE_DARKMESSIAH
#undef CommandLine
DLL_IMPORT ICommandLine *CommandLine();
#endif
/* Functions */
bool CacheUserMessages();
#if SOURCE_ENGINE >= SE_ORANGEBOX
void ClientCommand(edict_t *pEdict, const CCommand &args);
void LocalCommand_Meta(const CCommand &args);
#else
void ClientCommand(edict_t *pEdict);
void LocalCommand_Meta();
#endif
void _ServerCommand();
/* Variables */
static bool usermsgs_extracted = false;
@ -79,7 +89,11 @@ IServerGameClients *gameclients = NULL;
IMetamodSourceProvider *provider = &g_Ep1Provider;
ConCommand meta_local_cmd("meta", LocalCommand_Meta, "Metamod:Source control options");
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
#else
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *);
#endif
bool AssumeUserMessages()
{
@ -99,7 +113,11 @@ bool AssumeUserMessages()
void BaseProvider::ConsolePrint(const char *str)
{
#if SOURCE_ENGINE >= SE_ORANGEBOX
ConMsg("%s", str);
#else
Msg("%s", str);
#endif
}
void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
@ -111,13 +129,17 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
DisplayError("Could not find IVEngineServer! Metamod cannot load.");
return;
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
icvar = (ICvar *)((engineFactory)(CVAR_INTERFACE_VERSION, NULL));
#else
icvar = (ICvar *)((engineFactory)(VENGINE_CVAR_INTERFACE_VERSION, NULL));
#endif
if (!icvar)
{
DisplayError("Could not find ICvar! Metamod cannot load.");
return;
}
g_pCVar = icvar;
if ((gameclients = (IServerGameClients *)(serverFactory("ServerGameClients003", NULL)))
== NULL)
@ -132,14 +154,26 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
return;
}
RegisterConCommandBase(&meta_local_cmd);
conbases_unreg.push_back(&meta_local_cmd);
#if SOURCE_ENGINE >= SE_ORANGEBOX
g_pCVar = icvar;
#endif
g_SMConVarAccessor.RegisterConCommandBase(&meta_local_cmd);
if ((usermsgs_extracted = CacheUserMessages()) == false)
{
usermsgs_extracted = AssumeUserMessages();
}
#if SOURCE_ENGINE == SE_DARKMESSIAH
if (!g_SMConVarAccessor.InitConCommandBaseList())
{
/* This is very unlikely considering it's old engine */
mm_LogMessage("[META] Warning: Failed to find ConCommandBase list!");
mm_LogMessage("[META] Warning: ConVars and ConCommands cannot be unregistered properly! Please file a bug report.");
}
#endif
if (gameclients)
{
SH_ADD_HOOK_STATICFUNC(IServerGameClients, ClientCommand, gameclients, ClientCommand, false);
@ -148,14 +182,14 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
void BaseProvider::Notify_DLLShutdown_Pre()
{
List<ConCommandBase *>::iterator iter;
g_SMConVarAccessor.RemoveMetamodCommands();
for (iter = conbases_unreg.begin();
iter != conbases_unreg.end();
iter++)
#if SOURCE_ENGINE == SE_DARKMESSIAH
if (g_Metamod.IsLoadedAsGameDLL())
{
UnregisterConCommandBase((*iter));
icvar->UnlinkVariables(FCVAR_GAMEDLL);
}
#endif
}
bool BaseProvider::IsRemotePrintingAvailable()
@ -204,7 +238,7 @@ const char *BaseProvider::GetCommandLineValue(const char *key, const char *defva
{
if (key[0] == '-' || key[0] == '+')
{
return CommandLine_Tier0()->ParmValue(key, defval);
return CommandLine()->ParmValue(key, defval);
}
else if (icvar)
{
@ -354,8 +388,10 @@ int BaseProvider::DetermineSourceEngine(const char *game)
{
#if SOURCE_ENGINE == SE_LEFT4DEAD
return SOURCE_ENGINE_LEFT4DEAD;
#else
#elif SOURCE_ENGINE == SE_ORANGEBOX
return SOURCE_ENGINE_ORANGEBOX;
#else
return SOURCE_ENGINE_DARKMESSIAH;
#endif
}
@ -376,8 +412,7 @@ ConVar *BaseProvider::CreateConVar(const char *name,
ConVar *pVar = new ConVar(name, defval, newflags, help);
RegisterConCommandBase(pVar);
conbases_unreg.push_back(pVar);
g_SMConVarAccessor.RegisterConCommandBase(pVar);
return pVar;
}
@ -433,6 +468,7 @@ bool BaseProvider::ProcessVDF(const char *file, char path[], size_t path_len, ch
return true;
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
class GlobCommand : public IMetamodSourceCommandInfo
{
public:
@ -457,17 +493,48 @@ public:
private:
const CCommand *m_cmd;
};
#else
class GlobCommand : public IMetamodSourceCommandInfo
{
public:
unsigned int GetArgCount()
{
return engine->Cmd_Argc() - 1;
}
const char *GetArg(unsigned int num)
{
return engine->Cmd_Argv(num);
}
const char *GetArgString()
{
return engine->Cmd_Args();
}
};
#endif
#if SOURCE_ENGINE >= SE_ORANGEBOX
void LocalCommand_Meta(const CCommand &args)
{
GlobCommand cmd(&args);
#else
void LocalCommand_Meta()
{
GlobCommand cmd;
#endif
Command_Meta(&cmd);
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
void ClientCommand(edict_t *pEdict, const CCommand &_cmd)
{
GlobCommand cmd(&_cmd);
#else
void ClientCommand(edict_t *pEdict)
{
GlobCommand cmd;
#endif
if (strcmp(cmd.GetArg(0), "meta") == 0)
{
Command_ClientMeta(pEdict, &cmd);
@ -477,26 +544,6 @@ void ClientCommand(edict_t *pEdict, const CCommand &_cmd)
RETURN_META(MRES_IGNORED);
}
bool vcmp(const void *_addr1, const void *_addr2, size_t len)
{
unsigned char *addr1 = (unsigned char *)_addr1;
unsigned char *addr2 = (unsigned char *)_addr2;
for (size_t i=0; i<len; i++)
{
if (addr2[i] == '*')
{
continue;
}
if (addr1[i] != addr2[i])
{
return false;
}
}
return true;
}
//////////////////////////////////////////////////////////////////////
// EVEN MORE HACKS HERE! YOU HAVE BEEN WARNED! //
// Signatures necessary in finding the pointer to the CUtlDict that //
@ -510,7 +557,7 @@ bool vcmp(const void *_addr1, const void *_addr2, size_t len)
#define MSGCLASS_SIG "\x8B\x0D\x2A\x2A\x2A\x2A\x56"
#define MSGCLASS_OFFS 2
/* Dystopia Wimdows hack */
/* Dystopia Windows hack */
#define MSGCLASS2_SIGLEN 16
#define MSGCLASS2_SIG "\x56\x8B\x74\x24\x2A\x85\xF6\x7C\x2A\x3B\x35\x2A\x2A\x2A\x2A\x7D"
#define MSGCLASS2_OFFS 11
@ -539,9 +586,11 @@ struct UserMessage
typedef CUtlDict<UserMessage *, int> UserMsgDict;
/* This is the ugliest function in all of SourceMM */
/* This is the ugliest function in all of MM:S */
bool CacheUserMessages()
{
UserMsgDict *dict = NULL;
/* Get address of original GetUserMessageInfo() */
char *vfunc = (char *)SH_GET_ORIG_VFNPTR_ENTRY(server, &IServerGameDLL::GetUserMessageInfo);
@ -558,9 +607,7 @@ bool CacheUserMessages()
vfunc += *reinterpret_cast<int *>(vfunc + 1) + 5;
}
CUtlDict<UserMessage *, int> *dict = NULL;
if (vcmp(vfunc, MSGCLASS_SIG, MSGCLASS_SIGLEN))
if (UTIL_VerifySignature(vfunc, MSGCLASS_SIG, MSGCLASS_SIGLEN))
{
/* Get address of CUserMessages instance */
char **userMsgClass = *reinterpret_cast<char ***>(vfunc + MSGCLASS_OFFS);
@ -568,7 +615,7 @@ bool CacheUserMessages()
/* Get address of CUserMessages::m_UserMessages */
dict = reinterpret_cast<UserMsgDict *>(*userMsgClass);
}
else if (vcmp(vfunc, MSGCLASS2_SIG, MSGCLASS2_SIGLEN))
else if (UTIL_VerifySignature(vfunc, MSGCLASS2_SIG, MSGCLASS2_SIGLEN))
{
#ifdef OS_WIN32
/* If we get here, the code is possibly inlined like in Dystopia */
@ -587,7 +634,7 @@ bool CacheUserMessages()
#endif
#ifdef OS_WIN32
}
else if (vcmp(vfunc, MSGCLASS3_SIG, MSGCLASS3_SIGLEN))
else if (UTIL_VerifySignature(vfunc, MSGCLASS3_SIG, MSGCLASS3_SIGLEN))
{
/* Get address of CUserMessages instance */
char **userMsgClass = *reinterpret_cast<char ***>(vfunc + MSGCLASS3_OFFS);

View File

@ -48,7 +48,11 @@ void VSPListener::ClientActive(edict_t *pEntity)
{
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
PLUGIN_RESULT VSPListener::ClientCommand(edict_t *pEntity, const CCommand &cmd)
#else
PLUGIN_RESULT VSPListener::ClientCommand(edict_t *pEntity)
#endif
{
return PLUGIN_CONTINUE;
}
@ -134,6 +138,7 @@ bool VSPListener::Load(CreateInterfaceFn interfaceFactory, CreateInterfaceFn gam
return true;
}
#if SOURCE_ENGINE != SE_DARKMESSIAH
void VSPListener::OnQueryCvarValueFinished(QueryCvarCookie_t iCookie,
edict_t *pPlayerEntity,
EQueryCvarValueStatus eStatus,
@ -141,4 +146,5 @@ void VSPListener::OnQueryCvarValueFinished(QueryCvarCookie_t iCookie,
const char *pCvarValue)
{
}
#endif

View File

@ -38,6 +38,8 @@
#define _DEBUG
#endif
class VSPListener : public IServerPluginCallbacks
{
public:
@ -58,9 +60,15 @@ public:
virtual void SetCommandClient(int index);
virtual void ClientSettingsChanged(edict_t *pEdict);
virtual PLUGIN_RESULT ClientConnect(bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
#if SOURCE_ENGINE >= SE_ORANGEBOX
virtual PLUGIN_RESULT ClientCommand(edict_t *pEntity, const CCommand &cmd);
#else
virtual PLUGIN_RESULT ClientCommand(edict_t *pEntity);
#endif
virtual PLUGIN_RESULT NetworkIDValidated(const char *pszUserName, const char *pszNetworkID);
#if SOURCE_ENGINE != SE_DARKMESSIAH
virtual void OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue );
#endif
public:
bool IsLoaded();
void SetLoadable(bool loadable);

View File

@ -26,6 +26,7 @@
# include <stdio.h>
# include <signal.h>
# include <setjmp.h>
# include <stdint.h>
// http://www.die.net/doc/linux/man/man2/mprotect.2.html
# include <limits.h>
# ifndef PAGESIZE
@ -37,8 +38,8 @@
// We need to align addr down to pagesize on linux
// We assume PAGESIZE is a power of two
# define SH_LALIGN(x) (void*)((intptr_t)(x) & ~(PAGESIZE-1))
# define SH_LALDIF(x) ((intptr_t)(x) % PAGESIZE)
# define SH_LALIGN(x) (void*)((uintptr_t)(x) & ~(PAGESIZE-1))
# define SH_LALDIF(x) ((uintptr_t)(x) % PAGESIZE)
# else
# error Unsupported OS/Compiler
# endif

View File

@ -34,17 +34,29 @@
#include <loader_bridge.h>
#include "provider/provider_ep2.h"
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#else
SH_DECL_HOOK0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
#endif
ConCommand *g_plugin_unload = NULL;
bool g_bIsTryingToUnload;
#if SOURCE_ENGINE >= SE_ORANGEBOX
void InterceptPluginUnloads(const CCommand &args)
#else
void InterceptPluginUnloads()
#endif
{
g_bIsTryingToUnload = true;
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
void InterceptPluginUnloads_Post(const CCommand &args)
#else
void InterceptPluginUnloads_Post()
#endif
{
g_bIsTryingToUnload = false;
}
@ -69,7 +81,7 @@ public:
pGlobals = playerInfoManager->GetGlobalVars();
char gamedll_iface[] = "ServerGameDLL000";
for (unsigned int i = 5; i <= 50; i++)
for (unsigned int i = 3; i <= 50; i++)
{
gamedll_iface[15] = '0' + i;
if ((server = (IServerGameDLL *)info->gsFactory(gamedll_iface, NULL)) != NULL)
@ -107,7 +119,20 @@ public:
g_Metamod.NotifyVSPListening(info->vsp_callbacks, info->vsp_version);
mm_StartupMetamod(true);
#if SOURCE_ENGINE >= SE_ORANGEBOX
g_plugin_unload = icvar->FindCommand("plugin_unload");
#else
const ConCommandBase *pBase = icvar->GetCommands();
while (pBase != NULL)
{
if (pBase->IsCommand() && strcmp(pBase->GetName(), "plugin_unload") == 0)
{
g_plugin_unload = (ConCommand *)pBase;
break;
}
pBase = pBase->GetNext();
}
#endif
if (g_plugin_unload != NULL)
{

View File

@ -36,17 +36,14 @@
#include <sh_memory.h>
#include "utility.h"
#include "gamedll.h"
#include "valve_commandline.h"
#undef GetCommandLine
class IServerGameDLL;
typedef ICommandLine *(*GetCommandLine)();
#define MAX_GAMEDLL_PATHS 10
IGameDllBridge* gamedll_bridge = NULL;
static int game_info_detected = 0;
static const char *game_name = NULL;
static char gamedll_paths[MAX_GAMEDLL_PATHS][PLATFORM_MAX_PATH];
static void *gamedll_libs[MAX_GAMEDLL_PATHS];
static unsigned int gamedll_path_count = 0;
@ -57,24 +54,15 @@ static int gamedll_version = 0;
static int isgd_shutdown_index = -1;
#if defined _WIN32
#define TIER0_NAME "bin\\tier0.dll"
#define VSTDLIB_NAME "bin\\vstdlib.dll"
#define SERVER_NAME "server.dll"
#elif defined __linux__
#define TIER0_NAME "bin/tier0_i486.so"
#define VSTDLIB_NAME "bin/vstdlib_i486.so"
#define SERVER_NAME "server_i486.so"
#endif
static bool
mm_DetectGameInformation()
{
void *lib;
char error[255];
GetCommandLine valve_cmdline;
char mm_path[PLATFORM_MAX_PATH];
char lib_path[PLATFORM_MAX_PATH];
char game_name[PLATFORM_MAX_PATH];
char game_path[PLATFORM_MAX_PATH];
if (game_info_detected)
@ -82,43 +70,8 @@ mm_DetectGameInformation()
game_info_detected = -1;
if (!mm_ResolvePath(TIER0_NAME, lib_path, sizeof(lib_path)))
if ((game_name = mm_GetGameName()) == NULL)
{
mm_LogFatal("Could not find path for: " TIER0_NAME);
return false;
}
if ((lib = mm_LoadLibrary(lib_path, error, sizeof(error))) == NULL)
{
mm_LogFatal("Could not load %s: %s", lib_path, error);
return false;
}
valve_cmdline = (GetCommandLine)mm_GetLibAddress(lib, "CommandLine_Tier0");
if (valve_cmdline == NULL)
{
/* We probably have a Ship engine. */
mm_UnloadLibrary(lib);
if (!mm_ResolvePath(VSTDLIB_NAME, lib_path, sizeof(lib_path)))
{
mm_LogFatal("Could not find path for: " VSTDLIB_NAME);
return false;
}
if ((lib = mm_LoadLibrary(lib_path, error, sizeof(error))) == NULL)
{
mm_LogFatal("Could not load %s: %s", lib_path, error);
return false;
}
valve_cmdline = (GetCommandLine)mm_GetLibAddress(lib, "CommandLine");
}
mm_UnloadLibrary(lib);
if (valve_cmdline == NULL)
{
mm_LogFatal("Could not locate any command line functionality");
return false;
}
@ -128,10 +81,6 @@ mm_DetectGameInformation()
return false;
}
mm_Format(game_name,
sizeof(game_name),
"%s",
valve_cmdline()->ParmValue("-game", "hl2"));
if (!mm_ResolvePath(game_name, game_path, sizeof(game_path)))
{
mm_LogFatal("Could not resolve path: %s", game_name);
@ -261,7 +210,7 @@ public:
QueryValveInterface fileSystemFactory,
void *pGlobals)
{
MetamodBackend backend = mm_DetermineBackend(engineFactory);
MetamodBackend backend = mm_DetermineBackend(engineFactory, game_name);
char error[255];
if (backend == MMBackend_UNKNOWN)

View File

@ -35,6 +35,11 @@
#include "serverplugin.h"
#include "gamedll.h"
#include "utility.h"
#include "valve_commandline.h"
#undef GetCommandLine
typedef ICommandLine *(*GetCommandLine)();
static HMODULE mm_library = NULL;
static char mm_fatal_logfile[PLATFORM_MAX_PATH] = "metamod-fatal.log";
@ -64,11 +69,12 @@ mm_LogFatal(const char *message, ...)
fclose(fp);
}
static const char *backend_names[3] =
static const char *backend_names[] =
{
"1.ep1",
"2.ep2",
"2.l4d"
"2.l4d",
"2.darkm"
};
#if defined _WIN32
@ -163,8 +169,76 @@ mm_GetProcAddress(const char *name)
return mm_GetLibAddress(mm_library, name);
}
#if defined _WIN32
#define TIER0_NAME "bin\\tier0.dll"
#define VSTDLIB_NAME "bin\\vstdlib.dll"
#elif defined __linux__
#define TIER0_NAME "bin/tier0_i486.so"
#define VSTDLIB_NAME "bin/vstdlib_i486.so"
#endif
const char *
mm_GetGameName()
{
void *lib;
char error[255];
GetCommandLine valve_cmdline;
char lib_path[PLATFORM_MAX_PATH];
const char *game_name;
if (!mm_ResolvePath(TIER0_NAME, lib_path, sizeof(lib_path)))
{
mm_LogFatal("Could not find path for: " TIER0_NAME);
return NULL;
}
if ((lib = mm_LoadLibrary(lib_path, error, sizeof(error))) == NULL)
{
mm_LogFatal("Could not load %s: %s", lib_path, error);
return NULL;
}
valve_cmdline = (GetCommandLine)mm_GetLibAddress(lib, "CommandLine_Tier0");
if (valve_cmdline == NULL)
{
/* We probably have a Ship engine. */
mm_UnloadLibrary(lib);
if (!mm_ResolvePath(VSTDLIB_NAME, lib_path, sizeof(lib_path)))
{
mm_LogFatal("Could not find path for: " VSTDLIB_NAME);
return NULL;
}
if ((lib = mm_LoadLibrary(lib_path, error, sizeof(error))) == NULL)
{
mm_LogFatal("Could not load %s: %s", lib_path, error);
return NULL;
}
valve_cmdline = (GetCommandLine)mm_GetLibAddress(lib, "CommandLine");
}
mm_UnloadLibrary(lib);
if (valve_cmdline == NULL)
{
mm_LogFatal("Could not locate any command line functionality");
return NULL;
}
game_name = valve_cmdline()->ParmValue("-game");
/* This probably means that the game directory is actually the current directory */
if (!game_name)
{
game_name = ".";
}
return game_name;
}
MetamodBackend
mm_DetermineBackend(QueryValveInterface engineFactory)
mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name)
{
/* Check for L4D */
if (engineFactory("VEngineServer022", NULL) != NULL &&
@ -180,11 +254,16 @@ mm_DetermineBackend(QueryValveInterface engineFactory)
{
return MMBackend_Episode2;
}
/* Check for EP1 */
/* Check for Episode One/Old Engine */
else if (engineFactory("VModelInfoServer001", NULL) != NULL &&
(engineFactory("VEngineCvar003", NULL) != NULL ||
engineFactory("VEngineCvar002", NULL) != NULL))
{
/* Check for Dark Messiah which has a weird directory structure */
if (strcmp(game_name, ".") == 0)
{
return MMBackend_DarkMessiah;
}
return MMBackend_Episode1;
}
}

View File

@ -64,6 +64,7 @@ enum MetamodBackend
MMBackend_Episode1 = 0,
MMBackend_Episode2,
MMBackend_Left4Dead,
MMBackend_DarkMessiah,
MMBackend_UNKNOWN
};
@ -79,8 +80,11 @@ mm_UnloadMetamodLibrary();
extern void
mm_LogFatal(const char *message, ...);
extern const char *
mm_GetGameName();
extern MetamodBackend
mm_DetermineBackend(QueryValveInterface qvi);
mm_DetermineBackend(QueryValveInterface qvi, const char *game_name);
#endif /* _INCLUDE_METAMOD_SOURCE_LOADER_H_ */

View File

@ -77,6 +77,7 @@ IVspBridge *vsp_bridge = NULL;
*/
class ServerPlugin
{
const char *game_name;
unsigned int vsp_version;
bool load_allowed;
public:
@ -91,14 +92,19 @@ public:
load_allowed = false;
MetamodBackend backend = mm_DetermineBackend(engineFactory);
if ((game_name = mm_GetGameName()) == NULL)
{
return false;
}
MetamodBackend backend = mm_DetermineBackend(engineFactory, game_name);
if (backend == MMBackend_UNKNOWN)
{
mm_LogFatal("Could not detect engine version");
return false;
}
else if (backend >= MMBackend_Episode2)
else if (backend == MMBackend_Episode2 || backend == MMBackend_Left4Dead)
{
/* We need to insert the right type of call into this vtable */
void **vtable_src;

View File

@ -32,7 +32,7 @@ ifeq "$(ENGINE)" "original"
HL2SDK = $(HL2SDK_ORIG)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/linux_sdk
CFLAGS += -DSOURCE_ENGINE=2
CFLAGS += -DSOURCE_ENGINE=1
METAMOD = $(MMSOURCE17)/core-legacy
INCLUDE += -I$(HL2SDK)/public/dlls
SRCDS = $(SRCDS_BASE)
@ -59,7 +59,7 @@ ifeq "$(ENGINE)" "left4dead"
override ENGSET = true
endif
CFLAGS += -DSE_EPISODEONE=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
CFLAGS += -DSE_EPISODEONE=1 -SE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc

View File

@ -22,10 +22,9 @@
extern IVEngineServer *engine;
extern CGlobalVars *gpGlobals;
/**
* For non-OrangeBox builds, we have to make wrappers.
*/
#if SOURCE_ENGINE == SE_EPISODEONE
#if SOURCE_ENGINE == SE_EPISODEONE && defined METAMOD_PLAPI_VERSION
#error "Metamod:Source 1.6 API is not supported on the old engine."
#endif
/**
* MM:S 1.4.x needs older API calls.
@ -35,12 +34,15 @@ extern CGlobalVars *gpGlobals;
#define GetServerFactory serverFactory
#define MM_Format snprintf
#define GetCGlobals pGlobals
#define ENGINE_CALL(func) SH_CALL(m_EngineCC, func)
#else
#error "Metamod:Source 1.6 is not supported on the old engine."
#define ENGINE_CALL(func) SH_CALL(engine, func)
#define MM_Format g_SMAPI->Format
#endif
#if SOURCE_ENGINE <= SE_DARKMESSIAH
/**
* Wrap the CCommand class so our code looks the same for both engines.
* Wrap the CCommand class so our code looks the same on all engines.
*/
class CCommand
{
@ -60,14 +62,7 @@ public:
}
};
#define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
#define ENGINE_CALL(func) SH_CALL(m_EngineCC, func)
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#define ENGINE_CALL(func) SH_CALL(engine, func)
#define MM_Format g_SMAPI->Format
#define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
#endif
/**

View File

@ -5,20 +5,26 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_mm", "sample_mm.vcpr
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Debug - Original|Win32 = Debug - Original|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Orange Box|Win32 = Release - Orange Box|Win32
Release - Original|Win32 = Release - Original|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32
@ -27,6 +33,6 @@ Global
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Original|Win32.Build.0 = Release - Original|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNodde = FALSE
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -39,10 +39,10 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=1"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -120,9 +120,9 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=1"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
@ -175,6 +175,166 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample_mm.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample_mm.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Orange Box|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
@ -199,7 +359,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=3"
@ -280,7 +440,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=3"
RuntimeLibrary="0"
@ -359,7 +519,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=4"
@ -440,7 +600,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=4"
RuntimeLibrary="0"

View File

@ -5,20 +5,26 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_mm", "sample_mm.vcpr
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Debug - Original|Win32 = Debug - Original|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Orange Box|Win32 = Release - Orange Box|Win32
Release - Original|Win32 = Release - Original|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32

View File

@ -40,10 +40,10 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=1"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -120,9 +120,9 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=1"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
@ -174,6 +174,164 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample_mm.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=2"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample_mm.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Orange Box|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
@ -198,7 +356,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=3"
@ -278,7 +436,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=3"
RuntimeLibrary="0"
@ -356,7 +514,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=4"
@ -436,7 +594,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_MM_EXPORTS;SOURCE_ENGINE=4"
RuntimeLibrary="0"

View File

@ -100,7 +100,7 @@ bool SamplePlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, gameclients, this, &SamplePlugin::Hook_ClientConnect, false);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, gameclients, this, &SamplePlugin::Hook_ClientCommand, false);
#if SOURCE_ENGINE == SE_EPISODEONE
#if !defined METAMOD_PLAPI_VERSION
m_EngineCC = SH_GET_CALLCLASS(engine);
#endif
@ -130,7 +130,7 @@ bool SamplePlugin::Unload(char *error, size_t maxlen)
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, gameclients, this, &SamplePlugin::Hook_ClientConnect, false);
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientCommand, gameclients, this, &SamplePlugin::Hook_ClientCommand, false);
#if SOURCE_ENGINE == SE_EPISODEONE
#if !defined METAMOD_PLAPI_VERSION
SH_RELEASE_CALLCLASS(m_EngineCC);
#endif
@ -165,7 +165,7 @@ void SamplePlugin::Hook_ClientCommand(edict_t *pEntity, const CCommand &args)
void SamplePlugin::Hook_ClientCommand(edict_t *pEntity)
#endif
{
#if SOURCE_ENGINE == SE_EPISODEONE
#if SOURCE_ENGINE <= SE_DARKMESSIAH
CCommand args;
#endif

View File

@ -72,7 +72,7 @@ public:
const char *GetDate();
const char *GetLogTag();
private:
#if SOURCE_ENGINE == SE_EPISODEONE
#if !defined METAMOD_PLAPI_VERSION
SourceHook::CallClass<IVEngineServer> *m_EngineCC;
#endif
};

View File

@ -32,7 +32,7 @@ ifeq "$(ENGINE)" "original"
HL2SDK = $(HL2SDK_ORIG)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/linux_sdk
CFLAGS += -DSOURCE_ENGINE=2
CFLAGS += -DSOURCE_ENGINE=1
METAMOD = $(MMSOURCE17)/core-legacy
INCLUDE += -I$(HL2SDK)/public/dlls
SRCDS = $(SRCDS_BASE)
@ -59,7 +59,7 @@ ifeq "$(ENGINE)" "left4dead"
override ENGSET = true
endif
CFLAGS += -DSE_EPISODEONE=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
CFLAGS += -DSE_EPISODEONE=1 -SE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc

View File

@ -5,20 +5,26 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stub_mm", "stub_mm.vcproj",
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Debug - Original|Win32 = Debug - Original|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Orange Box|Win32 = Release - Orange Box|Win32
Release - Original|Win32 = Release - Original|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32
@ -27,6 +33,6 @@ Global
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Original|Win32.Build.0 = Release - Original|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -39,7 +39,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=2"
@ -120,7 +120,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=2"
RuntimeLibrary="0"
@ -175,6 +175,166 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\stub_mm.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\stub_mm.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Orange Box|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
@ -199,7 +359,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
@ -280,7 +440,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
RuntimeLibrary="0"
@ -359,7 +519,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=4"
@ -440,7 +600,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=4"
RuntimeLibrary="0"

View File

@ -5,20 +5,26 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stub_mm", "stub_mm.vcproj",
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Debug - Original|Win32 = Debug - Original|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Orange Box|Win32 = Release - Orange Box|Win32
Release - Original|Win32 = Release - Original|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32

View File

@ -40,7 +40,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=2"
@ -120,7 +120,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=2"
RuntimeLibrary="0"
@ -174,6 +174,164 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\stub_mm.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Dark Messiah|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK-DARKM)\lib\public\tier0.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\tier1.lib&quot; &quot;$(HL2SDK-DARKM)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\stub_mm.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Orange Box|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
@ -198,7 +356,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
@ -278,7 +436,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=3"
RuntimeLibrary="0"
@ -356,7 +514,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=4"
@ -436,7 +594,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STUB_MM_EXPORTS;SOURCE_ENGINE=4"
RuntimeLibrary="0"

View File

@ -12,11 +12,12 @@ require 'helpers.pm';
chdir('..');
chdir('..');
# Folder .vcproj Engine Binary Suffix type
Build('loader', 'mm_loader', '', 'server', 'full');
Build('core-legacy', 'mm_core-legacy', '', 'metamod.1.ep1', '');
Build('core', 'mm_core', 'OrangeBox', 'metamod.2.ep2', '');
Build('core', 'mm_core', 'Left4Dead', 'metamod.2.l4d', '');
# Folder .vcproj Engine Binary Suffix type Platform
Build('loader', 'mm_loader', '', 'server', 'full', 'both');
Build('core-legacy', 'mm_core-legacy', '', 'metamod.1.ep1', '', 'both');
Build('core', 'mm_core', 'OrangeBox', 'metamod.2.ep2', '', 'both');
Build('core', 'mm_core', 'Left4Dead', 'metamod.2.l4d', '', 'both');
Build('core', 'mm_core', 'DarkMessiah', 'metamod.2.darkm', '', 'windows');
#Structure our output folder
mkdir('OUTPUT');
@ -44,10 +45,15 @@ sub Copy
sub Build
{
my ($srcdir, $vcproj, $objdir, $binary, $suffix) = (@_);
my ($srcdir, $vcproj, $objdir, $binary, $suffix, $platform) = (@_);
if ($^O eq "linux")
{
if ($platform eq "windows")
{
return;
}
if ($suffix eq 'full')
{
$binary .= '_i486.so';
@ -56,10 +62,16 @@ sub Build
{
$binary .= '.so';
}
BuildLinux($srcdir, $objdir, $binary);
}
else
{
if ($platform eq "linux")
{
return;
}
$binary .= '.dll';
BuildWindows($srcdir, $vcproj, $objdir, $binary);
}
@ -82,6 +94,10 @@ sub BuildWindows
{
$param = "Release - Left 4 Dead";
}
elsif ($build eq "DarkMessiah")
{
$param = "Release - Dark Messiah";
}
print "Clean building $srcdir...\n";
$vcbuilder = $ENV{'VC9BUILDER'};

View File

@ -24,6 +24,7 @@ symstore("loader\\msvc9\\server.*", $version);
symstore("core-legacy\\msvc9\\Release\\metamod.1.ep1.*", $version);
symstore("core\\msvc9\\Release - Orange Box\\metamod.2.ep2.*", $version);
symstore("core\\msvc9\\Release - Left 4 Dead\\metamod.2.l4d.*", $version);
symstore("core\\msvc9\\Release - Dark Messiah\\metamod.2.darkm.*", $version);
#Lowercase DLLs. Sigh.
my (@files);

View File

@ -1,8 +1,19 @@
2009/02/25 1.7.1:
- Added support for the Source engine version that runs Dark Messiah. The
development of this feature would not be possible without the support of the
following people from the game's community: Dylan Riggs, Carl Pettengill, Ed
Moreland, and Christian.
- Fixed a bug where plugin aliases defined in VDF files were not working on the
Orange Box and Left 4 Dead engines.
- Fixed SourceHook passing invalid mprotect() values (bug 3642).
- Fixed "late" load parameter always being true in VSP mode (bug 3532).
- Added MSVC project templates for plugins, from Daedilus.
2008/11/26 1.7.0:
- Metamod:Source now uses a unified package that will run on all supported
Source engines. This means you do not have to download a version based on
which Source engine or game you use.
- Added support for the Source Engine version that runs Left 4 Dead.
- Added support for the Source engine version that runs Left 4 Dead.
- The 'meta refresh' command now handles plugins loaded from VDF files.
- Fixed amb1952: Crash when the first plugin listed in metaplugins.ini had an
alias and was not on the first line of the file.

Binary file not shown.

View File

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="MMSProjectTemplate"
ProjectGUID="{F8052FF1-63ED-4A4F-B70D-B4C0A9250BB4}"
RootNamespace="MMSProjectTemplate"
Keyword="CustomAppWizProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Install|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Installing the template, $(ProjectName), into $(VCInstallDir)"
CommandLine="xcopy &quot;$(ProjectDir)VC&quot; &quot;$(VCInstallDir)&quot; /s /y"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Template Files"
Filter="txt"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin.vcproj"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin.vdf"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_engine.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_hooks.cpp"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_hooks.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_mm.cpp"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_mm.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\ReadMe.txt"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\StdMMS.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\Templates.inf"
>
</File>
</Filter>
<Filter
Name="HTML Files"
Filter="htm"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\HTML\1033\default.htm"
DeploymentContent="true"
>
</File>
</Filter>
<Filter
Name="Image Files"
Filter="bmp"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Images\MMSProjectTemplate.gif"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Images\MMSProjectTemplate_Background.gif"
>
</File>
</Filter>
<Filter
Name="Script Files"
Filter="js"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Scripts\1033\default.js"
>
</File>
</Filter>
<Filter
Name="VCProject Files"
Filter="vsz;vsdir;ico;vcproj;csproj;css;inf"
>
<File
RelativePath=".\VC\VCProjects\MMSProjectTemplate.ico"
>
</File>
<File
RelativePath=".\VC\VCProjects\Metamod\MMSProjectTemplate.vsdir"
>
</File>
<File
RelativePath=".\VC\VCProjects\MMSProjectTemplate.vsz"
>
</File>
</Filter>
<Filter
Name="1033 Files"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\Images\DottedHori.gif"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\Images\DottedVert.gif"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\NewStyles.css"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\Images\spacer.gif"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="MMSProjectTemplate"
ProjectGUID="{F8052FF1-63ED-4A4F-B70D-B4C0A9250BB4}"
RootNamespace="MMSProjectTemplate"
Keyword="CustomAppWizProj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Install|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Installing the template, $(ProjectName), into $(VCInstallDir)"
CommandLine="xcopy &quot;$(ProjectDir)VC&quot; &quot;$(VCInstallDir)&quot; /s /y"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Template Files"
Filter="txt"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin.vcproj"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin.vdf"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_engine.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_hooks.cpp"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_hooks.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_mm.cpp"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\plugin_mm.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\ReadMe.txt"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\StdMMS.h"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Templates\1033\Templates.inf"
>
</File>
</Filter>
<Filter
Name="HTML Files"
Filter="htm"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\HTML\1033\default.htm"
DeploymentContent="true"
>
</File>
</Filter>
<Filter
Name="Image Files"
Filter="bmp"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Images\metamod-site.gif"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Images\MMSProjectTemplate.gif"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Images\MMSProjectTemplate_Background.gif"
>
</File>
</Filter>
<Filter
Name="Script Files"
Filter="js"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\Scripts\1033\default.js"
>
</File>
</Filter>
<Filter
Name="VCProject Files"
Filter="vsz;vsdir;ico;vcproj;csproj;css;inf"
>
<File
RelativePath=".\VC\VCProjects\MMSProjectTemplate.ico"
>
</File>
<File
RelativePath=".\VC\VCProjects\Metamod\MMSProjectTemplate.vsdir"
>
</File>
<File
RelativePath=".\VC\VCProjects\MMSProjectTemplate.vsz"
>
</File>
</Filter>
<Filter
Name="1033 Files"
>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\Images\DottedHori.gif"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\Images\DottedVert.gif"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\NewStyles.css"
>
</File>
<File
RelativePath=".\VC\VCWizards\AppWiz\Metamod\MMSProjectTemplate\1033\Images\spacer.gif"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,6 @@
VSWIZARD 7.0
Wizard=VsWizard.VsWizardEngine.8.0
Param="WIZARD_NAME = MMSProjectTemplate"
Param="RELATIVE_PATH = VCWizards\AppWiz\Metamod"
Param="FALLBACK_LCID = 1033"

View File

@ -0,0 +1 @@
..\MMSProjectTemplate.vsz| |Metamod C++ Project|1|This wizard will create a Metamod Source Plugin Project.| |6777| |<MMSProjectTemplate>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View File

@ -0,0 +1,782 @@
/******************************************************************************/
/*DEFAULT STYLES FOR ALL SECTIONS**********************************************/
/******************************************************************************/
body { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
background-color: buttonface;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
overflow: auto; }
a:link { color: captiontext;
text-decoration: none; }
a:visited { color: captiontext;
text-decoration: none; }
a:active { color: captiontext;
text-decoration: none; }
a:hover { color: captiontext;
text-decoration: underline; }
table { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
width: 100%; }
table.one { table-layout: fixed;
height: 100%;
width: 100%; }
/*DEFAULT STYLES FOR THE 'INTRODUCTION' TABLE**********************************/
/******************************************************************************/
table.two { table-layout: fixed;
height: 79px;
width: 100%;
background-color: window; }
td.image { text-align: right; }
/*DEFAULT STYLES FOR THE 'NAVIGATION' TABLE************************************/
/******************************************************************************/
table.linkText { line-height: 95%;
width: 1.7in;
height: 2.6em;
position: relative;
left: 0.1in;
z-index: 2; }
span { position: relative;
z-index: 3; }
span.horiLine1 { height: 30px;
width: 166px;
position: absolute;
top: -1px;
left: -1px;
bottom: -1px;
z-index: 2; }
/*DEFAULT STYLES FOR THE ALL BUTTONS AND THE 'BUTTONS' TABLE*******************/
/******************************************************************************/
button { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
height: 23px;
cursor: hand; }
.buttons { width: 100%; }
/*DEFAULT STYLES FOR THE 'CONTENT' TABLE***************************************/
/******************************************************************************/
table.fixedSize { table-layout: fixed; }
table.content { table-layout: fixed;
height: 100%;
width: 100%; }
ol { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
margin-top: -1px;
margin-bottom: 16px; }
ul { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
margin-top: 3px;
margin-bottom: 16px; }
li { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
position: relative;
left: -15px;
margin-bottom: 1px; }
span.itemTextTop { position: relative; }
span.itemText { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
line-height: 9pt;
position: relative;
top: -3px; }
span.itemTextIndent { position: relative;
left: 17px;
top: -3px; }
span.sideBtnHidden { width: 100%;
margin-top: 3px;
margin-bottom: 0px; }
div.itemTextRadioAa { position: relative;
top: -17px;
left: 17px;
margin-bottom: -25px; }
div.itemTextRadioA { position: relative;
top: -19px;
left: 17px;
margin-bottom: -25px; }
div.itemTextRadioB { position: relative;
top: -19px;
left: 25px;
margin-bottom: -25px; }
div.itemTextRadioIndentA { position: relative;
top: -17px;
left: 30px;
margin-bottom: -25px; }
div.itemTextRadioIndentB { position: relative;
top: -17px;
left: 42px;
margin-bottom: -25px; }
div.itemTextCheckboxA { position: relative;
top: -17px;
left: 17px;
margin-bottom: -23px; }
div.itemTextCheckboxB { position: relative;
top: -18px;
left: 25px;
padding-top: 1px;
margin-bottom: -25px; }
div.itemTextCheckboxIndentB { position: relative;
top: -16px;
left: 42px;
margin-bottom: -25px; }
input { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext; }
select { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext; }
.radio { position: relative;
top: -2px;
left: 4px; }
.radioA { position: relative;
top: -1px;
margin-left: -4px;
z-index: 2; }
.radioIndent { margin-top: -2px;
margin-left: 17px; }
.radioIndentA { margin-top: -2px;
margin-left: 9px; }
.checkbox { position: relative;
top: -1px;
margin-left: -4px;
z-index: 2; }
.checkboxA { position: relative;
top: -2px;
left: 4px; }
.checkboxIndent { position:relative;
margin-top: -1px;
margin-left: 21px; }
.comment { width: 578px;
position: relative;
top: 5px;
bottom: 6px; }
.commentA { width: 398px;
position: relative;
top: 5px;
bottom: 6px; }
.commentB { width: 578px;
position: relative;
top: 3px;
bottom: -3px; }
/****THIS IS THE STANDARD TABBED WIZARD, TWO COLUMN INPUT BOX******************/
input.sideBtn { width: 193px;
position: relative;
top: 3px; }
/****THIS IS THE STANDARD THREE COLUMN WIZARD INPUT BOX************************/
input.sideBtnThreeColumn { width: 185px;
position: relative;
top: 3px; }
/****THIS IS THE DEFAULT INPUT BOX IN NON-TABBED AND 2 COLUMN WIZARD***********/
input.itemTextTwoColumnLong { width: 283px;
position: relative;
top: 3px; }
/****THIS IS AN INPUT BOX INDENTED UNDER A CHECKBOX SECTION********************/
input.sideBtnIndent { width: 175px;
position: relative;
top: 3px;
left: 18px;
bottom: 6px; }
/****THIS INPUT BOX HAS IS INDENTED UNDER A HEADING AND RULE SECTION***********/
input.sideBtnB { width: 185px;
position: relative;
top: 3px;
bottom: 6px; }
input.sideBtnBA { width: 175px;
position: relative;
top: 3px;
bottom: 6px; }
/****THIS INPUT BOX HAS A "..." BUTTON BESIDE IT AND IT'S A TABBED WIZARD******/
input.sideBtn2 { width: 169px;
position: relative;
top: 3px;
bottom: 6px; }
/****"..." BUTTON IN A NON-TABBED, 3 COLUMN WIZARD*****************************/
input.sideBtn2ThreeColumn { width: 161px;
position: relative;
top: 3px;
bottom: 6px; }
/****THIS IS AN INPUT BOX IN NON-TABBED AND 2 COLUMN WIZARD WITH A BUTTON******/
input.TwoColumnLongButton { width: 259px;
position: relative;
top: 3px;
bottom: 6px; }
/****THIS INPUT BOX HAS A "..." BUTTON BESIDE IT AND IT'S UNDER A CHECKBOX*****/
input.sidebtn2Indent { width: 151px;
position: relative;
top: 3px;
left: 18px;
bottom: 6px; }
/****"..." BUTTON IS UNDER A SECTION IN A TWO COLUMN AND TABBED WIZARD*********/
input.sidebtn21 { width: 161px;
position: relative;
top: 3px;
bottom: 6px; }
/****"..." BUTTON IS UNDER A SECTION IN A THREE COLUMN AND TABBED WIZARD*********/
input.sidebtn21A { width: 153px;
position: relative;
top: 3px;
bottom: 6px; }
/****THIS IS THE STANDARD TABBED WIZARD, TWO COLUMN SELECTION BOX**************/
select.sidebtn { width: 193px;
position: relative;
top: 4px;
bottom: -3px; }
select.sidebtnNoWidth { position: relative;
top: 4px;
bottom: -3px; }
/****THIS IS THE STANDARD TABBED WIZARD, ONE COLUMN SELECTION BOX**************/
select.sideBtnOneCLong { width: 398px;
position: relative;
top: 3px; }
/****THIS IS THE STANDARD THREE COLUMN WIZARD INPUT BOX************************/
select.sideBtnThreeColumn { width: 185px;
position: relative;
top: 4px;
bottom: -3px; }
/****THIS IS THE DEFAULT INPUT BOX IN NON-TABBED AND 2 COLUMN WIZARD***********/
select.itemTextTwoColumnLong { width: 283px;
position: relative;
top: 4px;
bottom: -3px; }
/****THIS SELECTION BOX IS INDENTED UNDER A HEADING AND RULE SECTION***********/
select.sidebtnB { width: 164px;
position: relative;
top: 4px;
left: 8px;
bottom: -3px; }
/****THIS SELECTION BOX IS BELOW AND ASSOCIATED WITH A CHECKBOX****************/
select.sidebtn2 { width: 164px;
position: relative;
top: 11px;
left: 17px;
bottom: -3px; }
select.sidebtnIndent { width: 175px;
position: relative;
top: 4px;
left: 18px;
bottom: -3px; }
/****THIS SELECTION BOX IS BELOW AND ASSOCIATED WITH A CHECKBOX AND HEADING****/
select.sidebtn2AShort { width: 168px;
position: relative;
top: 4px;
left: 25px;
bottom: -3px; }
/****THIS SELECTION BOX IS IN A TABBED, TWO COLUM WIZARD AND FOR < << > >>*****/
select.sidebtn3 { width: 177px;
position: relative;
top: 4px;
bottom: -3px; }
/****THIS IS A SELECTION BOX IN NON-TABBED AND 2 COLUMN WIZARD WITH A BUTTON***/
select.TwoColumnLongButton { width: 259px;
position: relative;
top: 4px;
bottom: -3px; }
/****THIS IS A SELECTION BOX IN NON-TABBED AND 2 COLUMN WIZARD WITH A BUTTON***/
select.IndentListBoxWithButton { width: 283px;
position: relative;
top: 4px;
bottom: -3px;
left: 18px; }
/****THIS IS THE DEFAULT OBJECT DROP DOWN IN 2 COLUMN AND TABBED WIZARD********/
object.itemtext { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
width: 193px;
height: 2em;
position: relative;
top: 4px;
margin-bottom: 0px; }
/****THIS IS THE DEFAULT OBJECT DROP DOWN IN 3 COLUMN AND NON-TABBED WIZARD****/
object.itemtextThreeColumn { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
width: 185px;
height: 2em;
position: relative;
top: 4px;
margin-bottom: 0px; }
/****THIS IS THE DEFAULT OBJECT DROP DOWN IN NON-TABBED AND 2 COLUMN WIZARD****/
object.itemTextTwoColumnLong{ font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext;
width: 283px;
height: 2em;
position: relative;
top: 4px;
margin-bottom: 0px; }
.dropdowncombo { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif;
font-weight: normal;
font-size: 8pt;
color: buttontext; }
/****MOVES RADIO TEXT UP A BIT WHEN INLINE*************************************/
span.upABit { position: relative;
top: -2px; }
/****THIS DEFINES A STANDARD BUTTON IN THE CONTENT SECTION*********************/
.buttonClass { margin-top: 0px;
margin-bottom: -6px; }
/****THIS DEFINES ADD/REMOVE BUTTONS IN THE CONTENT SECTION********************/
.buttonClass2 { width: 75px;
padding-top: 1px;
margin-top: 7px; }
/****THIS DEFINES A "..." BUTTON IN THE CONTENT SECTION OUT OF THE SPAN TAG****/
.buttonClass3 { height: 19px;
width: 20px;
position: relative;
left: 1px;
top: 0px; }
/****THIS DEFINES A "..." BUTTON IN THE CONTENT SECTION WITHIN THE SPAN TAG***/
.buttonClass3Custom { height: 19px;
width: 20px;
position: relative;
left: 4px;
top: 3px; }
/****THIS DEFINES A "..." BUTTON IN THE CONTENT SECTION AND UNDER A CHECKBOX***/
.buttonClass3Indent { height: 19px;
width: 20px;
position: relative;
top: 0px;
left: 10px; }
/****THIS DEFINES A ">>" BUTTON IN THE CONTENT SECTION************************/
.buttonClass4 { margin-bottom: 4px;
width: 25px; }
/****THIS DEFINES ADD/REMOVE BUTTONS HORIZONTALLY IN THE CONTENT SECTION******/
.buttonClass5 { position: relative;
top: 4px;
width: 75px; }
/****THIS SETS THE LEFT MARGIN FOR THE REMOVE BUTTON***************************/
#removeBtn { margin-left: 4px; }
/****THIS SETS THE LEFT MARGIN FOR INDENTED SECTION UNDER CHECKBOXES***********/
label.indent { margin-left: 18px; }
/****THIS SETS THE LEFT MARGIN FOR INDENTED SECTION UNDER CHECKBOXES***********/
label.indent2 { margin-left: 25px; }
/****THIS MOVES CHECK BOX AND RADIO TEXT UP A BIT******************************/
label.upABit { position: relative;
top: -2px; }
/****THIS BOLDS < << > >> BUTTONS**********************************************/
b.bigFont { font-size: 135%; }
/****THESE ARE CUSTOM VERTICAL SPACING ELEMENTS********************************/
p.spacer { margin-bottom: -28px; }
p.elementSpacer { margin-bottom: -12px; }
p.elementSpacer2 { margin-bottom: -19px; }
p.elementSpacer3 { margin-bottom: -3px; }
p.elementSpacer4 { margin-bottom: 7px; }
p.elementSpacer5 { margin-bottom: 5px; }
p.elementSpacer6 { margin-bottom: -24px; }
p.elementSpacer7 { margin-bottom: -11px; }
p.elementSpacer8 { margin-bottom: -15px; }
p.elementSpacer9 { margin-bottom: -7px; }
p.elementSpacer10 { margin-bottom: 6px; }
p.elementSpacer11 { margin-bottom: -1px; }
p.elementSpacer12 { margin-bottom: -17px; }
p.elementSpacer13 { margin-bottom: -23px; }
p.elementSpacer14 { margin-bottom: -25px; }
p.elementSpacer15 { margin-bottom: -13px; }
p.elementSpacer16 { margin-bottom: -22px; }
p.elementSpacer17 { margin-bottom: -32px; }
p.elementSpacer18 { margin-bottom: -14px; }
p.elementSpacer19 { margin-bottom: -10px; }
p.elementSpacer21 { margin-bottom: -16px; }
p.elementSpacer22 { margin-bottom: 3px; }
/*CUSTOM STYLES FOR THE 'CONTENT' FRAME****************************************/
/******************************************************************************/
/*CUSTOM SPACING FOR MFC UI PAGE - SET UP FOR LOC PURPOSES*******************/
/**************************************************************************/
p.elementSpacer20 { margin-bottom: -13px; }
/*CUSTOM STYLE FOR MFC UI PAGE - SET UP FOR LOC PURPOSES*******************/
/**************************************************************************/
input.sideBtnLoc { width: 193px;
position: relative;
top: 3px; }
/*PLACES SPACE BETWEEN ADD/REMOVE BUTTONS**********************************/
/**************************************************************************/
span.spacer8 { width: 1px; }
/*SETS TEXT BOX TO APPROPRIATE WIDTH IN MFCAppWiz**************************/
/**************************************************************************/
#CLASS_NAMES { width: 399px; }
/*MOVES SELECT BOX UP IN CSharpIndexerWiz, Interface, Method,**************/
/*InterfaceMethod, AND MemFunctionWiz**************************************/
#PARAMETER_LIST { margin-top: -1px; }
/*MOVES SELECT BOX UP IN CSharpMethodWiz***********************************/
/**************************************************************************/
#PARAMETER_LIST1 { margin-top: -1px; }
/*SETS SELECTION BOX WIDTH IN CSharpInterfaceMethod AND CSharpMethodWiz****/
/**************************************************************************/
#PARAMETER_MODIFIER { width: 58px; }
/*SETS INDENT FOR ATLCustom AND MFCCustom Wizards**************************/
/**************************************************************************/
span.itemTextIndent1 { position: relative;
left: 8px;
top: -3px; }
/*SETS INDENT ON OBJECT FOR CSharpMethodWiz********************************/
/**************************************************************************/
span.customObjectIndent { margin-left: 8px; }
/*SETS CUSTOM INDENT FOR SECTION IN CSHARPMETHODWIZ************************/
/**************************************************************************/
span.sidebtn { position: relative;
top: 4px;
bottom: -3px; }
/*SETS CUSTOM INDENT FOR SECTION IN CSHARPMETHODWIZ************************/
/**************************************************************************/
span.itemtextspecial { position: relative;
top: -20px;
left: 9px;
bottom: -3px; }
/*SETS CUSTOM INDENT FOR SECTION IN CSHARPMETHODWIZ************************/
/**************************************************************************/
span.sidebtnspecial { position: relative;
top: -2px;
left: 53px;
bottom: -3px; }
/**************************************************************************/
/*MODIFIED POSITIONING*****************************************************/
/**************************************************************************/
/*Position and border change + link to the script file (absolutely needed)!!*/
table.three { table-layout: fixed;
height: 100%;
position: absolute;
left: -1px;
border-right: solid 2px Window; }
/*Color change*/
span.activeLink { color: WindowText;
text-decoration: none;
word-wrap: break-word;
cursor: hand;
width: 100%;
padding-top: 1px;
padding-bottom: 1px; }
/*Color change*/
span.activeLink2 { color: WindowText;
text-decoration: underline;
word-wrap: break-word;
cursor: hand;
width: 100%;
padding-top: 1px;
padding-bottom: 1px; }
/*Color change*/
span.inactiveLink { color: GrayText;
text-decoration: none;
word-wrap: break-word;
cursor: default;
width: 100%;
padding-top: 1px;
padding-bottom: 1px; }
/*Turned off dotted line*/
span.vertLine1 { height: 100%;
width: 1px;
position: absolute;
top: 0px;
left: -1px;
bottom: 0px;
z-index: 2; }
/*Style for width-control of the left-side links bar */
.LinkPane { width: 1.9in; }
/*Removed bolding of text*/
table.linkTextSelected { line-height: 95%;
width: 1.7in;
height: 2.6em;
position: relative;
left: 0.1in;
z-index: 2; }
/*Removed bolding of text and made width bigger*/
table.linkTextSelectedIndent { line-height: 95%;
width: 1.7in;
height: 2.6em;
position: relative;
top: -2px;
left: 0.2in;
z-index: 2; }
/*Changed left margin and position of top of element and made width bigger*/
table.linkTextIndent { line-height: 95%;
width: 1.6in;
height: 2.6em;
position: relative;
top: -2px;
left: 0.2in;
z-index: 2; }
/*Removed background color, changed top, and bottom margins*/
div.linkSelected { height: 2.6em;
position: relative;
top: -6px;
left: 0px;
right: 0px;
z-index: 1;
margin-bottom: -.7em; }
/*Changed top and bottom margins*/
div.link { height: 2em;
position: relative;
top: -6px;
left: 0px;
right: 0px;
z-index: 1;
margin-bottom: -.7em; }
/*Comment out
div.vertLine { background: url(Images/DottedVert.gif) repeat;
height: 125%;
width: 1px;
position: relative;
top: -12px;
left: -1px; }*/
/*Deleted dotted line*/
span.vertLine1 { height: 100%;
width: 1px;
position: absolute;
top: 0px;
left: -1px;
bottom: 0px;
z-index: 2; }
/*Changed background color and add alpha*/
td.three { background-color: Window;
filter: Alpha(Opacity = 25); }
/*Removed all background image modification elements and set image to 0 opacity*/
td.threeCustom { filter: Alpha(Opacity = 0); }
/*Comment out
td.dottedline { background: url(Images/DottedHori.gif) repeat; }*/
/*Removed border color*/
div.inlineA { position: relative;
top: 4px;
width: 100%;
height: 1px; }
/*Changed border color*/
div.inlineB { position: relative;
top: -9px;
margin-bottom: -20px;
width: 100%;
height: 1px;
border-top: solid ThreeDShadow 1px; }
/*Changed position of element*/
h4.head { font-weight: bold;
font-size: 10pt;
color: windowtext;
position: absolute;
top: 16px;
left: 120px;
height: 58px; }
/*Hide element*/
p.subhead { display: none;
color: windowtext;
position: relative;
top: -1.5em;
left: 1em; }
/*Changed alignment to right*/
td.image { text-align: left; }
/*Added item to control positioning of element*/
div.smallA { position: absolute;
top: 0px;
left: 12px;
height: 78px;
width: 110px;
vertical-align: bottom; }
/*Added item to control positioning of element - 1 misspelling in html so dup of above*/
div.smalA { position: absolute;
top: 0px;
left: 12px;
height: 78px;
width: 110px;
vertical-align: bottom; }
/*Added item to control positioning of element*/
div.small { position: absolute;
top: 0px;
left: 12px;
height: 78px;
width: 110px;
vertical-align: bottom; }
/*Added all positioning informaiton*/
img.smallest { background-color: activecaption;
position: relative;
bottom: 1px; }
/*Added item to control positioning of element*/
img.small { position: relative;
bottom: 1px; }
/*Add height specification*/
td.rule { background-color: window;
height: 1px; }
/*Info for new button*/
#PreviousBtn { position: relative;
right: -79px; }
/*Info for new button*/
#NextBtn { position: relative;
right: -79px; }
/*Reposition button*/
#FinishBtn { position: relative;
right: -79px; }
/*Reposition button*/
#CancelBtn { position: relative;
right: -79px; }
/*Hide button*/
#HelpBtn { display: none; }
/**************************************************************************/

View File

@ -0,0 +1,571 @@
<html dir="LTR">
<head>
<title>'MMSProjectTemplate'</title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link id="LINKURL" rel="stylesheet" href="../../1033/NewStyles.css">
<symbol name='WIZARD_DIALOG_TITLE' type="text" value='MMSProjectTemplate'></symbol>
<symbol name='PLUGIN_TEMPLATE_NAME' type="text" value='MMSProjectTemplate'></symbol>
<symbol name='APP_TYPE_SUMMARY' type="text" value='//TODO: Application summary'></symbol>
<!--Function Hooks-->
<SYMBOL NAME='IServerGameDLL_ServerActivate' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_GameInit' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_GameFrame' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_GameShutdown' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_LevelInit' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_LevelShutdown' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_GetAllServerClasses' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_GetTickInterval' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameDLL_GetGameDescription' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientActive' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientConnect' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientDisconnect' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientCommand' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientPutInServer' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientSettingsChanged' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientSetupVisibility' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ClientEarPosition' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_PostClientMessagesSent' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_ProcessUsercmds' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_NetworkIDValidated' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_GetPlayerState' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_GetPlayerLimits' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_GetReplayDelay' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_GetBugReportInfo' TYPE=checkbox VALUE=false></SYMBOL>
<SYMBOL NAME='IServerGameClients_SetCommandClient' TYPE=checkbox VALUE=false></SYMBOL>
</head>
<body bgcolor="BUTTONFACE" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" onload="InitDocument(document);" onkeydown="OnKey();" onkeypress="OnPress();">
<table class="ONE" height="100%" width="100%" border="0" cellpadding="0" cellspacing="0">
<col width="100%">
<!--OPEN OF INTRODUCTORY INFORMATION TABLE-->
<tr valign="TOP">
<td height="50" width="100%" colspan="2">
<table class="TWO" border="0" cellpadding="0" cellspacing="0">
<col width="12">
<col>
<col width="12">
<tr>
<td valign="TOP" width="12" style="height: 4px">
&nbsp;
</td>
<td valign="TOP" style="height: 4px">
&nbsp;
</td>
<td valign="TOP" width="12" style="height: 4px">
&nbsp;
</td>
<td class="IMAGE" valign="BOTTOM" width="110" rowspan="2">
<div class="SMALLA" id="Layer0">
<img class="SMALLEST" src="../../Images/MMSProjectTemplate.gif" alt="" border="0" style="left: -7px; bottom: -4px; width: 39px; height: 42px;">
</div>
</td>
<td valign="TOP" height="12" width="6" rowspan="2">
&nbsp;
</td>
</tr>
<tr>
<td valign="TOP" width="12" style="height: 59px">
&nbsp;
</td>
<td valign="TOP" style="height: 59px">
<h4 class="HEAD" id="HEAD" style="left: 46px; width: 500px; top: 3px">
Metamod Source Plugin Project Wizard<span style="font-size: 7pt"><br />
<br />
This wizard will help you configure a C++ Metamod Source plugin project.</span></h4>
<p class="SUBHEAD" id="SUBHEAD">
</p>
</td>
<td valign="TOP" width="12" style="height: 59px">
&nbsp;
</td>
</tr>
<tr>
<td valign="TOP" class="RULE" colspan="5" height="2">
<table border="0" width="100%" height="1" cellpadding="0" cellspacing="0">
<tr valign="TOP">
<td height="1" width="100%" bgcolor="BUTTONSHADOW">
<img src="../../Images/spacer.gif" height="1" width="1" alt=""></td>
<td height="1" width="1" bgcolor="WINDOW">
<img src="../../Images/spacer.gif" height="1" width="1" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!--CLOSE OF INTRODUCTORY INFORMATION TABLE-->
<!--OPEN OF NAVIGATION, CONTENT, AND BUTTON TABLES-->
<tr valign="TOP">
<td valign="TOP" style="height: 100%">
<!--OPEN OF CONTENT AND BUTTON TABLE-->
<table class="ONE" border="0" cellpadding="0" cellspacing="0">
<col width="100%">
<tr valign="TOP">
<td height="100%">
<!--OPEN OF CONTENT-->
<table class="CONTENT" border="0" cellpadding="0" cellspacing="0">
<col width="12">
<col width="185">
<col width="12">
<col width="185">
<col width="12">
<col width="185">
<col width="12">
<tr>
<td valign="TOP" height="12" colspan="5">
&nbsp;
</td>
</tr>
<tr valign="TOP">
<td valign="TOP" width="12">
&nbsp;
</td>
<td valign="TOP" colspan="3" style="width: 1px;">
<span class="itemTextTop">
<table>
<tr>
<td style="width: 232px;" align="left" valign="top">
<table>
<!--Author /////////////////////////////////////////////////////////////////////////////-->
<tr>
<td style="width: 280px">
Author:&nbsp; <em>This is the name of the author.<br />
</em>
<input id="PLUGIN_AUTHOR" style="width: 280px" type="text" value="metamodsource.net" /></td>
</tr>
<!--URL ////////////////////////////////////////////////////////////////////////////////-->
<tr>
<td style="width: 280px">
URL:&nbsp; <em>This is the URL to the author's web site<br />
</em>
<input id="PLUGIN_URL" style="width: 280px" type="text" value="http://www.metamodsource.net/" /></td>
</tr>
<!--License ////////////////////////////////////////////////////////////////////////////-->
<tr>
<td style="width: 280px">
License:&nbsp; <em>This is the plugin's license.<br />
</em>
<input id="PLUGIN_LICENSE" style="width: 280px" type="text" value='Copyright © 2008' /></td>
</tr>
<!--Plugin Name ////////////////////////////////////////////////////////////////////////-->
<tr>
<td style="width: 280px">
Plugin Name:&nbsp; <em>This is the name of the plugin.<br />
</em>
<input id="PLUGIN_NAME" style="width: 280px" type="text" value="MyMetamodPlugin" /></td>
</tr>
<!--Plugin Description /////////////////////////////////////////////////////////////////-->
<tr>
<td style="width: 280px">
Plugin Description:&nbsp; <em>This is the plugin's description.<br />
<input id="PLUGIN_DESC" style="width: 280px" type="text" value="My Metamod Plugin" /></em></td>
</tr>
<!--Plugin DLL /////////////////////////////////////////////////////////////////////////-->
<tr>
<td style="width: 280px">
Plugin DLL:&nbsp; <em>This is the name of the plugin's .dll file.</em><br />
<input id="PLUGIN_DLL" style="width: 280px" type="text" value="MyMetamodPlugin.dll" /></td>
</tr>
<!--Plugin Class ///////////////////////////////////////////////////////////////////////-->
<tr>
<td style="width: 280px">
Plugin Class: &nbsp; <em>This is the name of the plugin's class.</em><br />
<input id="PLUGIN_CLASS" style="width: 280px" type="text" value="CMyMetamodPlugin" /></td>
</tr>
</table>
</td>
<td align="left" style="width: 20px;" valign="top">
</td>
<td style="width: 238px;" align="left" valign="top">
<table>
<tr>
<td>
Function Hooks:&nbsp; <em>These functions will be auto generated.&nbsp;</em><br />
<div style="background: #fff; overflow: auto; height: 21.14em; border-left: 1px solid #404040; border-top: 1px solid #404040; border-bottom: 1px solid #404040; border-right: 1px solid #404040; width: 278px;">
<!--IServerGameDLL - ServerActivate /////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_ServerActivate' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_ServerActivate' name='checkbox[]'>IServerGameDLL - ServerActivate()
</label>
<!--IServerGameDLL - GameInit ///////////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_GameInit' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_GameInit' name='checkbox[]'>IServerGameDLL - GameInit()
</label>
<!--IServerGameDLL - GameFrame //////////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_GameFrame' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_GameFrame' name='checkbox[]'>IServerGameDLL - GameFrame()
</label>
<!--IServerGameDLL - GameShutdown ///////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_GameShutdown' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_GameShutdown' name='checkbox[]'>IServerGameDLL - GameShutdown()
</label>
<!--IServerGameDLL - LevelInit //////////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_LevelInit' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_LevelInit' name='checkbox[]'>IServerGameDLL - LevelInit()
</label>
<!--IServerGameDLL - LevelShutdown //////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_LevelShutdown' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_LevelShutdown' name='checkbox[]'>IServerGameDLL - LevelShutdown()
</label>
<!--IServerGameDLL - GetTickInterval ////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_GetAllServerClasses' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_GetAllServerClasses' name='checkbox[]'>IServerGameDLL - GetAllServerClasses()
</label>
<!--IServerGameDLL - GetTickInterval ////////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_GetTickInterval' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_GetTickInterval' name='checkbox[]'>IServerGameDLL - GetTickInterval()
</label>
<!--IServerGameDLL - GetGameDescription /////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameDLL_GetGameDescription' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameDLL_GetGameDescription' name='checkbox[]'>IServerGameDLL - GetGameDescription()
</label>
<!--IServerGameClients - ClientActive ///////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientActive' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientActive' name='checkbox[]'>IServerGameClients - ClientActive()
</label>
<!--IServerGameClients - ClientConnect //////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientConnect' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientConnect' name='checkbox[]'>IServerGameClients - ClientConnect()
</label>
<!--IServerGameClients - ClientDisconnect ///////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientDisconnect' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientDisconnect' name='checkbox[]'>IServerGameClients - ClientDisconnect()
</label>
<!--IServerGameClients - ClientCommand //////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientCommand' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientCommand' name='checkbox[]'>IServerGameClients - ClientCommand()
</label>
<!--IServerGameClients - ClientPutInServer //////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientPutInServer' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientPutInServer' name='checkbox[]'>IServerGameClients - ClientPutInServer()
</label>
<!--IServerGameClients - ClientSettingsChanged //////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientSettingsChanged' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientSettingsChanged' name='checkbox[]'>IServerGameClients - ClientSettingsChanged()
</label>
<!--IServerGameClients - ClientSetupVisibility //////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientSetupVisibility' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientSetupVisibility' name='checkbox[]'>IServerGameClients - ClientSetupVisibility()
</label>
<!--IServerGameClients - ClientEarPosition //////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ClientEarPosition' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ClientEarPosition' name='checkbox[]'>IServerGameClients - ClientEarPosition()
</label>
<!--IServerGameClients - PostClientMessagesSent /////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_PostClientMessagesSent' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_PostClientMessagesSent' name='checkbox[]'>IServerGameClients - PostClientMessagesSent()
</label>
<!--IServerGameClients - ProcessUsercmds ////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_ProcessUsercmds' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_ProcessUsercmds' name='checkbox[]'>IServerGameClients - ProcessUsercmds()
</label>
<!--IServerGameClients - NetworkIDValidated /////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_NetworkIDValidated' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_NetworkIDValidated' name='checkbox[]'>IServerGameClients - NetworkIDValidated()
</label>
<!--IServerGameClients - GetPlayerState /////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_GetPlayerState' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_GetPlayerState' name='checkbox[]'>IServerGameClients - GetPlayerState()
</label>
<!--IServerGameClients - GetPlayerLimits ////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_GetPlayerLimits' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_GetPlayerLimits' name='checkbox[]'>IServerGameClients - GetPlayerLimits()
</label>
<!--IServerGameClients - GetReplayDelay /////////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_GetReplayDelay' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_GetReplayDelay' name='checkbox[]'>IServerGameClients - GetReplayDelay()
</label>
<!--IServerGameClients - GetBugReportInfo ///////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_GetBugReportInfo' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_GetBugReportInfo' name='checkbox[]'>IServerGameClients - GetBugReportInfo()
</label>
<!--IServerGameClients - SetCommandClient ///////////////////////////////////////////////////////////////////////-->
<label for='IServerGameClients_SetCommandClient' style='padding-left: 3px; padding-right: 3px; display: block;'>
<input class="CheckBox" type='checkbox' id='IServerGameClients_SetCommandClient' name='checkbox[]'>IServerGameClients - SetCommandClient()
</label>
</div>
<table>
<tr>
<td style="height: 22px; width: 50%;">
<input id="CHECK_ALL" style="width: 100%" type="button" value="Check All" onclick="OnCheckAll(document);" /></td>
<td style="height: 22px; width: 50%;">
<input id="UNCHECK_ALL" style="width: 100%" type="button" value="Uncheck All" onclick="OnUncheckAll(document);" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</span>
</td>
<td valign="TOP">
&nbsp;
</td>
</tr>
<tr>
<td valign="TOP" colspan="7">
&nbsp;
</td>
</tr>
</table>
<!--CLOSE OF CONTENT//-->
</td>
</tr>
<tr valign="BOTTOM">
<td height="48">
<!--OPEN OF BUTTON HTML//-->
<table height="48" border="0" cellpadding="0" cellspacing="0">
<col width="12">
<col>
<col width="75">
<col width="4">
<col width="75">
<col width="4">
<col width="75">
<col width="12">
<tr>
<td valign="TOP" class="RULE" colspan="8" style="height: 1px">
<table border="0" width="100%" height="1" cellpadding="0" cellspacing="0">
<tr valign="TOP">
<td height="1" width="100%" bgcolor="BUTTONSHADOW">
<img src="../../Images/spacer.gif" height="1" width="1" alt=""></td>
<td height="1" width="1" bgcolor="WINDOW">
<img src="../../Images/spacer.gif" height="1" width="1" alt=""></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="TOP" colspan="8" style="height: 11px">
&nbsp;
</td>
</tr>
<tr>
<td valign="MIDDLE" height="23" style="width: 12px">
&nbsp;
</td>
<td valign="TOP" height="23">
&nbsp;
</td>
<td valign="MIDDLE" height="23" width="75">
<button class="BUTTONS" id="FinishBtn" accesskey="F" onclick="OnFinish(document);">
<u>F</u>inish</button>
</td>
<td valign="MIDDLE" height="23" width="4">
&nbsp;
</td>
<td valign="MIDDLE" height="23" width="75">
<button class="BUTTONS" id="CancelBtn" accesskey="C" onclick="window.external.Finish(document, 'cancel');">
<u>C</u>ancel</button>
</td>
<td valign="MIDDLE" height="23" width="4">
&nbsp;
</td>
<td valign="MIDDLE" height="23" style="width: 75px">
<button class="BUTTONS" id="HelpBtn" accesskey="H" onclick="window.external.OnHelp('vc.appwiz.custom.overview');">
<u>H</u>elp</button>
</td>
<td valign="MIDDLE" height="23" style="width: 12px">
&nbsp;
</td>
</tr>
<tr>
<td valign="TOP" colspan="8" style="height: 17px">
&nbsp;
</td>
</tr>
</table>
<!--CLOSE OF BUTTON HTML//-->
</td>
</tr>
</table>
<!--CLOSE OF NAVIGATION, CONTENT, AND BUTTON TABLES//-->
</td>
</tr>
</table>
</body>
</html>
<script language="JSCRIPT">
// This is an example of a function which initializes the page
function InitDocument(document)
{
setDirection();
if (window.external.FindSymbol('DOCUMENT_FIRST_LOAD'))
{
// This function sets the default symbols based
// on the values specified in the SYMBOL tags above
window.external.SetDefaults(document);
}
// Load the document and initialize the controls
// with the appropriate symbol values
window.external.Load(document);
// Initialize the default values
var author = document.getElementById("PLUGIN_AUTHOR").value;
var project_name = window.external.FindSymbol("PROJECT_NAME");
var strip_name = project_name.replace(/ /g, "");
document.getElementById("PLUGIN_LICENSE").value = "Copyright © 2008 " + author;
document.getElementById("PLUGIN_NAME").value = strip_name;
document.getElementById("PLUGIN_DESC").value = "Metamod Source Plugin: " + strip_name;
document.getElementById("PLUGIN_DLL").value = strip_name + ".dll";
document.getElementById("PLUGIN_CLASS").value = "C" + strip_name;
}
// Checks all functions in the list
function OnCheckAll(document)
{
var a=0;
var check_boxes = document.getElementsByName('checkbox[]');
for(a=0; a<check_boxes.length; a++)
{
check_boxes[a].checked = true;
}
}
// Unchecks all functions in the list
function OnUncheckAll(document)
{
var a=0;
var check_boxes = document.getElementsByName('checkbox[]');
for(a=0; a<check_boxes.length; a++)
{
check_boxes[a].checked = false;
}
}
// If the wizard has more than 1 page, this
// function will browse to the page specified
function Next(document, linkto)
{
window.external.Next(document, linkto);
}
// This is an example of a function which
// gets called when the user clicks on 'Finish'
function OnFinish(document)
{
//var checkBox = document.getElementById(boxID);
//checkBoxValue = checkBox.value;
OnWizFinish(document);
}
</script>
<script id="INCLUDE_SCRIPT" language="JSCRIPT"></script>
<script id="INCLUDE_COMMON" language="JSCRIPT"></script>
<!--
Common.js is a script file which contains the helper functions
used by the wizards. Include this line if you want to
call these functions from your html scripts.
//-->
<script>
var strPath = window.external.FindSymbol("PRODUCT_INSTALLATION_DIR");
strPath += "VCWizards/";
strPath += window.external.GetHostLocale();
var strScriptPath = strPath + "/Script.js";
var strCommonPath = strPath + "/Common.js";
document.scripts("INCLUDE_SCRIPT").src = strScriptPath;
document.scripts("INCLUDE_COMMON").src = strCommonPath;
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,497 @@
///////////////////////////////////////////////////////////////////////////////////////////
// //
// //
// File: Default.js //
// //
// //
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Use wizard.ReportError to display a message box for debugging
// wizard.ReportError("<your message here>", true);
///////////////////////////////////////////////////////////////////////////////////////////
// OnFinish
function OnFinish(selProj, selObj)
{
try
{
// Get the new project name and path
var strProjectName = wizard.FindSymbol('PROJECT_NAME');
var strProjectPath = wizard.FindSymbol('PROJECT_PATH');
var strProjectTemplateName = wizard.FindSymbol('PLUGIN_TEMPLATE_NAME'); // Defined in default.htm
// Get the current date and add a symbol CURRENT_DATE
var curr_time = new Date();
var month = curr_time.getMonth() + 1;
var day = curr_time.getDate();
var year = curr_time.getFullYear();
var today = year + '-' + month + '-' + day;
wizard.AddSymbol('CURRENT_DATE', today);
// Set the path to where the template is installed
var strPluginPath = wizard.FindSymbol('PROJECT_TEMPLATE_PATH') +
"\\AppWiz\\Metamod\\" +
strProjectTemplateName + "\\";
wizard.AddSymbol('PLUGIN_INSTALL_PATH', strPluginPath);
wizard.AddSymbol('PLUGIN_SOURCE_FILES', "Plugin Source Files");
wizard.AddSymbol('PLUGIN_HEADER_FILES', "Plugin Header Files");
wizard.AddSymbol('PLUGIN_RESOURCE_FILES', "Resource Files");
// Create the custom project
selProj = CreateCustomProject(strProjectName, strProjectPath);
AddConfig(selProj, strProjectName);
AddFilters(selProj);
// Create the custom .inf file
var InfFile = CreateCustomInfFile();
AddFilesToCustomProj(selProj, strProjectName, strProjectPath, InfFile);
PchSettings(selProj);
InfFile.Delete();
// Save the project
selProj.Object.Save();
}
// Catch Exceptions
catch(ex)
{
if(ex.description.length != 0)
{
SetErrorInfo(ex);
}
return ex.number
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// CreateCustomProject
function CreateCustomProject(strProjectName, strProjectPath)
{
try
{
// Create the project's solution
var strInstallPath = wizard.FindSymbol('PLUGIN_INSTALL_PATH');
var strProjTemplate = strInstallPath + '\\Templates\\1033\\plugin.vcproj';
if(wizard.FindSymbol("CLOSE_SOLUTION"))
{
var Solution = dte.Solution;
Solution.Close();
var strSolutionName = wizard.FindSymbol("VS_SOLUTION_NAME");
if(strSolutionName.length)
{
var strSolutionPath = strProjectPath.substr(0, strProjectPath.length - strProjectName.length);
Solution.Create(strSolutionPath, strSolutionName);
}
}
// Override the new solution with our custom plugin.vcproj file
var oTarget = wizard.FindSymbol("TARGET");
var strProjectNameWithExt = strProjectName + '.vcproj';
if(wizard.FindSymbol("WIZARD_TYPE") == vsWizardAddSubProject)
{
return oTarget.AddFromTemplate(strProjTemplate, strProjectNameWithExt).SubProject;
}
return oTarget.AddFromTemplate(strProjTemplate, strProjectPath, strProjectNameWithExt);
}
// Catch Exceptions
catch(ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// CreateCustomInfFile
function CreateCustomInfFile()
{
try
{
var fso = new ActiveXObject('Scripting.FileSystemObject');
var TemporaryFolder = 2;
var tfolder = fso.GetSpecialFolder(TemporaryFolder);
var strTempFolder = tfolder.Drive + '\\' + tfolder.Name;
var strWizTempFile = strTempFolder + "\\" + fso.GetTempName();
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
var strInfFile = strTemplatePath + '\\Templates.inf';
wizard.RenderTemplate(strInfFile, strWizTempFile);
return fso.GetFile(strWizTempFile);
}
// Catch Exceptions
catch(ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// DelFile
function DelFile(fso, strWizTempFile)
{
try
{
// Delete the file
if(fso.FileExists(strWizTempFile))
{
var tmpFile = fso.GetFile(strWizTempFile);
tmpFile.Delete();
}
}
// Catch Exceptions
catch(ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// AddFilters
function AddFilters(proj)
{
// Our plugin.vcproj has filters
}
///////////////////////////////////////////////////////////////////////////////////////////
// AddConfig
function AddConfig(proj, strProjectName)
{
try
{
// Get the plugin dll name
var plugin_dll = wizard.FindSymbol('PLUGIN_DLL');
if(plugin_dll.indexOf(".dll") < 0)
{
plugin_dll = plugin_dll + ".dll";
}
var project_exports = strProjectName.toUpperCase() + "_EXPORTS";
project_exports = project_exports.replace(/ /g, "_") + ";";
// Debug - Original -> Configuration Properties -> C/C++ -> Preprocessor
var config = proj.Object.Configurations('Debug - Original');
var CLTool = config.Tools('VCCLCompilerTool');
var LinkTool = config.Tools('VCLinkerTool');
CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions;
LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll;
// Release - Original -> Configuration Properties -> C/C++ -> Preprocessor
config = proj.Object.Configurations('Release - Original');
CLTool = config.Tools('VCCLCompilerTool');
LinkTool = config.Tools('VCLinkerTool');
CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions;
LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll;
// Debug - Orange Box -> Configuration Properties -> C/C++ -> Preprocessor
config = proj.Object.Configurations('Debug - Orange Box');
CLTool = config.Tools('VCCLCompilerTool');
LinkTool = config.Tools('VCLinkerTool');
CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions;
LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll;
// Release - Orange Box -> Configuration Properties -> C/C++ -> Preprocessor
config = proj.Object.Configurations('Release - Orange Box');
CLTool = config.Tools('VCCLCompilerTool');
LinkTool = config.Tools('VCLinkerTool');
CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions;
LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll;
// Debug - Left 4 Dead -> Configuration Properties -> C/C++ -> Preprocessor
config = proj.Object.Configurations('Debug - Left 4 Dead');
CLTool = config.Tools('VCCLCompilerTool');
LinkTool = config.Tools('VCLinkerTool');
CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions;
LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll;
// Release - Left 4 Dead -> Configuration Properties -> C/C++ -> Preprocessor
config = proj.Object.Configurations('Release - Left 4 Dead');
CLTool = config.Tools('VCCLCompilerTool');
LinkTool = config.Tools('VCLinkerTool');
CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions;
LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll;
}
// Catch Exceptions
catch(ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// PchSettings
function PchSettings(proj)
{
// TODO: specify pch settings
}
///////////////////////////////////////////////////////////////////////////////////////////
// GetTargetName
function GetTargetName(strName)
{
try
{
var strTarget = strName;
var strPluginName = wizard.FindSymbol('PLUGIN_NAME');
var strPluginClass = wizard.FindSymbol('PLUGIN_CLASS');
// Target ReadMe File
if(strName == "ReadMe.txt")
{
strTarget = "ReadMe.txt";
}
// Target StdMMS File
else if(strName == "StdMMS.h")
{
strTarget = "StdMMS.h";
}
// Target plugin_mm File
else if(strName == "plugin_mm.h")
{
strTarget = "Plugin\\" + strPluginClass + ".h";
}
// Target plugin_mm File
else if(strName == "plugin_mm.cpp")
{
strTarget = "Plugin\\" + strPluginClass + ".cpp";
}
// Target plugin_hooks File
else if(strName == "plugin_hooks.h")
{
strTarget = "Plugin\\" + strPluginClass + "Hooks.h";
}
// Target plugin_hooks File
else if(strName == "plugin_hooks.cpp")
{
strTarget = "Plugin\\" + strPluginClass + "Hooks.cpp";
}
// Target plugin_engine File
else if(strName == "plugin_engine.h")
{
strTarget = "Plugin\\" + strPluginClass + "Engine.h";
}
// Target plugin_mm File
else if(strName == "plugin.vdf")
{
if(strPluginName.length)
{
strPluginName = strPluginName.replace(/ /g, "");
strTarget = "Bin\\" + strPluginName + ".vdf";
}
}
return strTarget;
}
// Catch Exceptions
catch(ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// AddFilesToCustomProj
function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile)
{
try
{
var vcProjectItems = proj.ProjectItems;
var vcProjectFilters = proj.Object.Filters;
// Get references to the filters of the project
var vcFilterSource = vcProjectFilters.Item(wizard.FindSymbol('PLUGIN_SOURCE_FILES'));
var vcFilterHeader = vcProjectFilters.Item(wizard.FindSymbol('PLUGIN_HEADER_FILES'));
var vcFilterRez = vcProjectFilters.Item(wizard.FindSymbol('PLUGIN_RESOURCE_FILES'));
var strTemplatePath = wizard.FindSymbol('PLUGIN_INSTALL_PATH') + "Templates\\1033\\";
var FileStream = InfFile.OpenAsTextStream(1, -2);
// Process the template files
while(!FileStream.AtEndOfStream)
{
var strLine = FileStream.ReadLine();
if(strLine == '')
{
continue;
}
// Retrieve the file parameters
var strName = strLine;
var strTargetFile = GetTargetName(strName);
var strTemplateFile = strTemplatePath + '\\' + strLine;
var strProjectFile = strProjectPath + '\\' + strTargetFile;
// "true" will only copy the file from template_file
// to target_file without rendering / adding to the project
var bCopyOnly = false;
var strExt = strName.substr(strName.lastIndexOf("."));
if(strExt == ".bmp" ||
strExt == ".ico" ||
strExt == ".gif" ||
strExt == ".rtf" ||
strExt == ".css")
{
bCopyOnly = true;
}
wizard.RenderTemplate(strTemplateFile, strProjectFile, bCopyOnly);
if(!KeepOutsideProject(strName))
{
// Add source files to the 'Plugin Source Files' filter
if(strExt == '.cpp' ||
strExt == '.cxx' ||
strExt == '.c')
{
vcFilterSource.AddFile(strTargetFile);
}
// Add header files to the 'Plugin Header Files' filter
else if(strExt == '.hpp' ||
strExt == '.h')
{
vcFilterHeader.AddFile(strTargetFile);
}
// Add resource files to the 'Resource Files' filter
else if(strExt == '.rc2' || strExt == '.ico' ||
strExt == '.gif' || strExt == '.bmp' ||
strExt == '.vdf' || strExt == '.rc')
{
vcFilterRez.AddFile(strTargetFile);
}
// Just add the rest to the project
else
{
proj.Object.AddFile(strTargetFile);
}
}
}
FileStream.Close();
}
// Catch Exceptions
catch(ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// KeepOutsideProject
function KeepOutsideProject(strName)
{
try
{
var bAdd = false;
if(strName == "ReadMe.txt")
{
bAdd = true;
}
return bAdd;
}
// Catch Exceptions
catch(ex)
{
throw ex;
}
}

View File

@ -0,0 +1,5 @@
========================================================================
[!output PLUGIN_NAME] : Project Overview
========================================================================
MMS Plugin Project has created this [!output PLUGIN_NAME] project for you as a starting point.

View File

@ -0,0 +1,44 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: StdMMS.h
// Author: [!output PLUGIN_AUTHOR]
// Date: [!output CURRENT_DATE]
//
// License: [!output PLUGIN_LICENSE]
//
// This software is provided 'as-is', without any express or
// implied warranty. In no event will the authors be held liable
// for any damages arising from the use of this software.
//
// Based on code written by AlliedModders LLC. Sample Plugin
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _StdMMS_H
#define _StdMMS_H
///////////////////////////////////////////////////////
// Include Standard Headers
#include <stdio.h>
///////////////////////////////////////////////////////
// Include MetaMod Headers
#include <ISmmPlugin.h>
#include <IGameEvents.h>
#include <IPlayerInfo.h>
#include <Sh_Vector.h>
///////////////////////////////////////////////////////
// Include [!output PROJECT_NAME] Headers
#include "Plugin/[!output PLUGIN_CLASS]Hooks.h"
#include "Plugin/[!output PLUGIN_CLASS].h"
#include "Plugin/[!output PLUGIN_CLASS]Engine.h"
// TODO: Add your own headers here.
// ex. #include "MyCode/MyInclude.h"
#endif // _StdMMS_H

View File

@ -0,0 +1,8 @@
StdMMS.h
plugin_mm.h
plugin_mm.cpp
plugin_hooks.h
plugin_hooks.cpp
plugin_engine.h
plugin.vdf
ReadMe.txt

View File

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject ProjectType="Visual C++">
<!-- Platforms ////////////////////////////////////////////////////////////// -->
<Platforms>
<Platform Name="Win32"/>
</Platforms>
<!-- Configurations ///////////////////////////////////////////////////////// -->
<Configurations>
<!-- Debug - Original /////////////////// -->
<Configuration Name="Debug - Original|Win32"
OutputDirectory=".\Build\$(ConfigurationName)"
IntermediateDirectory=".\Build\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2">
<Tool Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;.\&quot;;&quot;..\&quot;;&quot;..\..\&quot;;&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCE_ENGINE=2;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"/>
<Tool Name="VCLinkerTool"
AdditionalDependencies="tier0.lib tier1.lib vstdlib.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(HL2SDK)\lib\public\&quot;"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"/>
</Configuration>
<!-- Release - Original ///////////////// -->
<Configuration Name="Release - Original|Win32"
OutputDirectory=".\Build\$(ConfigurationName)"
IntermediateDirectory=".\Build\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1">
<Tool Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;.\&quot;;&quot;..\&quot;;&quot;..\..\&quot;;&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCE_ENGINE=2;"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"/>
<Tool Name="VCLinkerTool"
AdditionalDependencies="tier0.lib tier1.lib vstdlib.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(HL2SDK)\lib\public\&quot;"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
</Configuration>
<!-- Debug - Orange Box ///////////////// -->
<Configuration Name="Debug - Orange Box|Win32"
OutputDirectory=".\Build\$(ConfigurationName)"
IntermediateDirectory=".\Build\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2">
<Tool Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;.\&quot;;&quot;..\&quot;;&quot;..\..\&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCE_ENGINE=3;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"/>
<Tool Name="VCLinkerTool"
AdditionalDependencies="tier0.lib tier1.lib vstdlib.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(HL2SDKOB)\lib\public\&quot;"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"/>
</Configuration>
<!-- Release - Orange Box /////////////// -->
<Configuration Name="Release - Orange Box|Win32"
OutputDirectory=".\Build\$(ConfigurationName)"
IntermediateDirectory=".\Build\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1">
<Tool Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;.\&quot;;&quot;..\&quot;;&quot;..\..\&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCE_ENGINE=3;"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"/>
<Tool Name="VCLinkerTool"
AdditionalDependencies="tier0.lib tier1.lib vstdlib.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(HL2SDKOB)\lib\public\&quot;"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
</Configuration>
<!-- Debug - Left 4 Dead //////////////// -->
<Configuration Name="Debug - Left 4 Dead|Win32"
OutputDirectory=".\Build\$(ConfigurationName)"
IntermediateDirectory=".\Build\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2">
<Tool Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="&quot;.\&quot;;&quot;..\&quot;;&quot;..\..\&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCE_ENGINE=4;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"/>
<Tool Name="VCLinkerTool"
AdditionalDependencies="tier0.lib tier1.lib vstdlib.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(HL2SDKL4D)\lib\public\&quot;"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"/>
</Configuration>
<!-- Release - Left 4 Dead ////////////// -->
<Configuration Name="Release - Left 4 Dead|Win32"
OutputDirectory=".\Build\$(ConfigurationName)"
IntermediateDirectory=".\Build\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1">
<Tool Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
AdditionalIncludeDirectories="&quot;.\&quot;;&quot;..\&quot;;&quot;..\..\&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCE_ENGINE=4;"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"/>
<Tool Name="VCLinkerTool"
AdditionalDependencies="tier0.lib tier1.lib vstdlib.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(HL2SDKL4D)\lib\public\&quot;"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
</Configuration>
</Configurations>
<!-- Files //////////////////////////////////////// -->
<Files>
<Filter Name="Plugin Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
</Filter>
<Filter Name="Plugin Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
<Filter Name="Resource Files"
Filter="vdf;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
</Files>
</VisualStudioProject>

View File

@ -0,0 +1,5 @@
"Metamod Plugin"
{
"alias" "[!output PLUGIN_NAME]"
"file" "Addons/Metamod/Plugins/[!output PLUGIN_NAME]/Bin/[!output PLUGIN_DLL]"
}

View File

@ -0,0 +1,124 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: [!output PLUGIN_CLASS]Engine.h
// Author: [!output PLUGIN_AUTHOR]
// Date: [!output CURRENT_DATE]
//
// License: [!output PLUGIN_LICENSE]
//
// This software is provided 'as-is', without any express or
// implied warranty. In no event will the authors be held liable
// for any damages arising from the use of this software.
//
// Based on code written by AlliedModders LLC. Sample Plugin
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MMS_ENGINE_H
#define _MMS_ENGINE_H
#include <eiface.h>
/////////////////////////////////////////////////////////////////////////
// Class [!output PLUGIN_CLASS]
class [!output PLUGIN_CLASS];
/////////////////////////////////////////////////////////////////////////
// Episode One
#if SOURCE_ENGINE == SE_EPISODEONE
/////////////////////////////////////////////////////////////////////////
#if !defined METAMOD_PLAPI_VERSION
#define GetEngineFactory engineFactory
#define GetServerFactory serverFactory
#define MM_Format snprintf
#define GetCGlobals pGlobals
#else
#error "Metamod:Source 1.6 is not supported on the old engine."
#endif
/////////////////////////////////////////////////////////////////////////
// Wrap the CCommand class so our code looks the same for both engines.
class CCommand
{
public:
const char *ArgS()
{
return [!output PLUGIN_CLASS]::EngineServer->Cmd_Args();
}
int ArgC()
{
return [!output PLUGIN_CLASS]::EngineServer->Cmd_Argc();
}
const char *Arg(int index)
{
return [!output PLUGIN_CLASS]::EngineServer->Cmd_Argv(index);
}
};
#define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
#define ENGINE_CALL(func) SH_CALL(m_engine_server, func)
/////////////////////////////////////////////////////////////////////////
// Episode Orange Box or newer
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#define ENGINE_CALL(func) SH_CALL([!output PLUGIN_CLASS]::EngineServer, func)
#define MM_Format g_SMAPI->Format
#endif
/////////////////////////////////////////////////////////////////////////
// Left 4 Dead engine removed these from IVEngineServer
#if SOURCE_ENGINE >= SE_LEFT4DEAD
inline int IndexOfEdict(const edict_t* edict)
{
return (int)(edict - [!output PLUGIN_CLASS]::GlobalVars->baseEdict);
}
inline edict_t* PEntityOfEntIndex(int entity_index)
{
if (entity_index >= 0 && entity_index < [!output PLUGIN_CLASS]::GlobalVars->maxEntities)
{
return (edict_t *)([!output PLUGIN_CLASS]::GlobalVars->baseEdict + entity_index);
}
return NULL;
}
#else
inline int IndexOfEdict(const edict_t* edict)
{
return [!output PLUGIN_CLASS]::EngineServer->IndexOfEdict(edict);
}
inline edict_t* PEntityOfEntIndex(int entity_index)
{
return [!output PLUGIN_CLASS]::EngineServer->PEntityOfEntIndex(entity_index);
}
#endif
/////////////////////////////////////////////////////////////////////////
// Define snprintf
#if defined WIN32 && !defined snprintf
#define snprintf _snprintf
#endif
#endif // _MMS_ENGINE_H

View File

@ -0,0 +1,675 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: [!output PLUGIN_CLASS]Hooks.cpp
// Author: [!output PLUGIN_AUTHOR]
// Date: [!output CURRENT_DATE]
//
// License: [!output PLUGIN_LICENSE]
//
// This software is provided 'as-is', without any express or
// implied warranty. In no event will the authors be held liable
// for any damages arising from the use of this software.
//
// Based on code written by AlliedModders LLC. Sample Plugin
//
///////////////////////////////////////////////////////////////////////////////
#include "StdMMS.h"
/////////////////////////////////////////////////////////////////////////
// Declare the Hooks
[!if IServerGameDLL_ServerActivate]
SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t*, int, int);
[!endif]
[!if IServerGameDLL_GameInit]
SH_DECL_HOOK0(IServerGameDLL, GameInit, SH_NOATTRIB, 0, bool);
[!endif]
[!if IServerGameDLL_GameFrame]
SH_DECL_HOOK1_void(IServerGameDLL, GameFrame, SH_NOATTRIB, 0, bool);
[!endif]
[!if IServerGameDLL_GameShutdown]
SH_DECL_HOOK0_void(IServerGameDLL, GameShutdown, SH_NOATTRIB, 0);
[!endif]
[!if IServerGameDLL_LevelInit]
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, 0, bool, char const*, char const*, char const*, char const*, bool, bool);
[!endif]
[!if IServerGameDLL_LevelShutdown]
SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, 0);
[!endif]
[!if IServerGameDLL_GetAllServerClasses]
SH_DECL_HOOK0(IServerGameDLL, GetAllServerClasses, SH_NOATTRIB, 0, ServerClass*);
[!endif]
[!if IServerGameDLL_GetTickInterval]
SH_DECL_HOOK0(IServerGameDLL, GetTickInterval, const, 0, float);
[!endif]
[!if IServerGameDLL_GetGameDescription]
SH_DECL_HOOK0(IServerGameDLL, GetGameDescription, SH_NOATTRIB, 0, const char*);
[!endif]
[!if IServerGameClients_ClientActive]
SH_DECL_HOOK2_void(IServerGameClients, ClientActive, SH_NOATTRIB, 0, edict_t*, bool);
[!endif]
[!if IServerGameClients_ClientConnect]
SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, edict_t*, const char*, const char *, char *, int);
[!endif]
[!if IServerGameClients_ClientDisconnect]
SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, edict_t*);
[!endif]
[!if IServerGameClients_ClientPutInServer]
SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, edict_t*, char const *);
[!endif]
[!if IServerGameClients_ClientSettingsChanged]
SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, edict_t*);
[!endif]
[!if IServerGameClients_ClientSetupVisibility]
SH_DECL_HOOK4_void(IServerGameClients, ClientSetupVisibility, SH_NOATTRIB, 0, edict_t*, edict_t*, unsigned char*, int);
[!endif]
[!if IServerGameClients_ClientEarPosition]
SH_DECL_HOOK2_void(IServerGameClients, ClientEarPosition, SH_NOATTRIB, 0, edict_t*, Vector*);
[!endif]
[!if IServerGameClients_PostClientMessagesSent]
SH_DECL_HOOK0_void(IServerGameClients, PostClientMessagesSent, SH_NOATTRIB, 0);
[!endif]
[!if IServerGameClients_ProcessUsercmds]
SH_DECL_HOOK7(IServerGameClients, ProcessUsercmds, SH_NOATTRIB, 0, float, edict_t*, bf_read*, int, int, int, bool, bool);
[!endif]
[!if IServerGameClients_GetPlayerLimits]
SH_DECL_HOOK3_void(IServerGameClients, GetPlayerLimits, const, 0, int&, int&, int&);
[!endif]
[!if IServerGameClients_GetPlayerState]
SH_DECL_HOOK1(IServerGameClients, GetPlayerState, SH_NOATTRIB, 0, CPlayerState*, edict_t*);
[!endif]
[!if IServerGameClients_GetReplayDelay]
SH_DECL_HOOK2(IServerGameClients, GetReplayDelay, SH_NOATTRIB, 0, int, edict_t*, int&);
[!endif]
[!if IServerGameClients_GetBugReportInfo]
SH_DECL_HOOK2_void(IServerGameClients, GetBugReportInfo, SH_NOATTRIB, 0, char*, int);
[!endif]
[!if IServerGameClients_SetCommandClient]
SH_DECL_HOOK1_void(IServerGameClients, SetCommandClient, SH_NOATTRIB, 0, int);
[!endif]
SH_DECL_HOOK2(IGameEventManager2, FireEvent, SH_NOATTRIB, 0, bool, IGameEvent*, bool);
#if SOURCE_ENGINE >= SE_ORANGEBOX
[!if IServerGameClients_NetworkIDValidated]
SH_DECL_HOOK2_void(IServerGameClients, NetworkIDValidated, SH_NOATTRIB, 0, const char *, const char *);
[!endif]
[!if IServerGameClients_ClientCommand]
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t*, const CCommand&);
[!endif]
#else
[!if IServerGameClients_ClientCommand]
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t*);
[!endif]
#endif
/////////////////////////////////////////////////////////////////////////
// AddHooks
void [!output PLUGIN_CLASS]::AddHooks()
{
// Add the ServerGameDLL hooks
[!if IServerGameDLL_ServerActivate]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedServerActivate, true);
[!endif]
[!if IServerGameDLL_GameInit]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameInit, true);
[!endif]
[!if IServerGameDLL_GameFrame]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameFrame, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameFrame, true);
[!endif]
[!if IServerGameDLL_GameShutdown]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameShutdown, true);
[!endif]
[!if IServerGameDLL_LevelInit]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelInit, true);
[!endif]
[!if IServerGameDLL_LevelShutdown]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelShutdown, true);
[!endif]
[!if IServerGameDLL_GetAllServerClasses]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GetAllServerClasses, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetAllServerClasses, true);
[!endif]
[!if IServerGameDLL_GetTickInterval]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GetTickInterval, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetTickInterval, true);
[!endif]
[!if IServerGameDLL_GetGameDescription]
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GetGameDescription, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetGameDescription, true);
[!endif]
// Add the ServerGameClients hooks
[!if IServerGameClients_ClientActive]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientActive, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientActive, true);
[!endif]
[!if IServerGameClients_ClientConnect]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientConnect, true);
[!endif]
[!if IServerGameClients_ClientDisconnect]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientDisconnect, true);
[!endif]
[!if IServerGameClients_ClientCommand]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientCommand, true);
[!endif]
[!if IServerGameClients_ClientPutInServer]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientPutInServer, true);
[!endif]
[!if IServerGameClients_ClientSettingsChanged]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSettingsChanged, true);
[!endif]
[!if IServerGameClients_ClientSetupVisibility]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSetupVisibility, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSetupVisibility, true);
[!endif]
[!if IServerGameClients_ClientEarPosition]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientEarPosition, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientEarPosition, true);
[!endif]
[!if IServerGameClients_PostClientMessagesSent]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, PostClientMessagesSent, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedPostClientMessagesSent, true);
[!endif]
[!if IServerGameClients_ProcessUsercmds]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ProcessUsercmds, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedProcessUsercmds, false);
[!endif]
[!if IServerGameClients_GetPlayerLimits]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetPlayerLimits, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerLimits, true);
[!endif]
[!if IServerGameClients_GetPlayerState]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetPlayerState, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerState, true);
[!endif]
[!if IServerGameClients_GetReplayDelay]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetReplayDelay, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetReplayDelay, true);
[!endif]
[!if IServerGameClients_GetBugReportInfo]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetBugReportInfo, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetBugReportInfo, true);
[!endif]
[!if IServerGameClients_SetCommandClient]
SH_ADD_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedSetCommandClient, true);
[!endif]
[!if IServerGameClients_NetworkIDValidated]
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_ADD_HOOK_MEMFUNC(IServerGameClients, NetworkIDValidated, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedNetworkIDValidated, true);
#endif
[!endif]
}
/////////////////////////////////////////////////////////////////////////
// RemoveHooks
void [!output PLUGIN_CLASS]::RemoveHooks()
{
// Remove the ServerGameDLL hooks
[!if IServerGameDLL_ServerActivate]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedServerActivate, true);
[!endif]
[!if IServerGameDLL_GameInit]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameInit, true);
[!endif]
[!if IServerGameDLL_GameFrame]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameFrame, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameFrame, true);
[!endif]
[!if IServerGameDLL_GameShutdown]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameShutdown, true);
[!endif]
[!if IServerGameDLL_LevelInit]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelInit, true);
[!endif]
[!if IServerGameDLL_LevelShutdown]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelShutdown, true);
[!endif]
[!if IServerGameDLL_GetAllServerClasses]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GetAllServerClasses, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetAllServerClasses, true);
[!endif]
[!if IServerGameDLL_GetTickInterval]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GetTickInterval, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetTickInterval, true);
[!endif]
[!if IServerGameDLL_GetGameDescription]
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GetGameDescription, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetGameDescription, true);
[!endif]
// Remove the ServerGameClients hooks
[!if IServerGameClients_ClientActive]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientActive, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientActive, true);
[!endif]
[!if IServerGameClients_ClientConnect]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientConnect, true);
[!endif]
[!if IServerGameClients_ClientDisconnect]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientDisconnect, true);
[!endif]
[!if IServerGameClients_ClientCommand]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientCommand, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientCommand, true);
[!endif]
[!if IServerGameClients_ClientPutInServer]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientPutInServer, true);
[!endif]
[!if IServerGameClients_ClientSettingsChanged]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSettingsChanged, true);
[!endif]
[!if IServerGameClients_ClientSetupVisibility]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientSetupVisibility, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSetupVisibility, true);
[!endif]
[!if IServerGameClients_ClientEarPosition]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientEarPosition, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientEarPosition, true);
[!endif]
[!if IServerGameClients_PostClientMessagesSent]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, PostClientMessagesSent, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedPostClientMessagesSent, true);
[!endif]
[!if IServerGameClients_ProcessUsercmds]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ProcessUsercmds, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedProcessUsercmds, true);
[!endif]
[!if IServerGameClients_GetPlayerLimits]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetPlayerLimits, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerLimits, true);
[!endif]
[!if IServerGameClients_GetPlayerState]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetPlayerState, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerState, true);
[!endif]
[!if IServerGameClients_GetReplayDelay]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetReplayDelay, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetReplayDelay, true);
[!endif]
[!if IServerGameClients_GetBugReportInfo]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetBugReportInfo, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetBugReportInfo, true);
[!endif]
[!if IServerGameClients_SetCommandClient]
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedSetCommandClient, true);
[!endif]
[!if IServerGameClients_NetworkIDValidated]
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, NetworkIDValidated, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedNetworkIDValidated, true);
#endif
[!endif]
}
[!if IServerGameDLL_ServerActivate]
/////////////////////////////////////////////////////////////////////////
// HookedServerActivate
// The server is about to activate
void [!output PLUGIN_CLASS]::HookedServerActivate(edict_t* edict_list, int edict_count, int client_max)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameDLL_GameInit]
/////////////////////////////////////////////////////////////////////////
// HookedGameInit
// This is called when a new game is started. (restart, map)
bool [!output PLUGIN_CLASS]::HookedGameInit()
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, true);
}
[!endif]
[!if IServerGameDLL_GameFrame]
/////////////////////////////////////////////////////////////////////////
// HookedGameFrame
// The server should run physics / think on all edicts
void [!output PLUGIN_CLASS]::HookedGameFrame(bool simulating)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameDLL_GameShutdown]
/////////////////////////////////////////////////////////////////////////
// HookedGameShutdown
// This is called when a game ends (server disconnect, death,
// restart, load). NOT on level transitions within a game
void [!output PLUGIN_CLASS]::HookedGameShutdown()
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameDLL_LevelInit]
/////////////////////////////////////////////////////////////////////////
// HookedLevelInit
// Called any time a new level is started (after
// GameInit() also on level transitions within a game)
bool [!output PLUGIN_CLASS]::HookedLevelInit(const char* map_name, char const* map_entities, char const* old_level,
char const* landmark_name, bool load_game, bool bkgnd)
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, true);
}
[!endif]
[!if IServerGameDLL_LevelShutdown]
/////////////////////////////////////////////////////////////////////////
// HookedLevelShutdown
// Called when a level is shutdown (including changing levels)
void [!output PLUGIN_CLASS]::HookedLevelShutdown()
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameDLL_GetAllServerClasses]
/////////////////////////////////////////////////////////////////////////
// HookedGetAllServerClasses
// Gets the list of datatable classes to the engine. The engine
// matches class names from here with edict_t::classname to figure
// out how to encode a class's data for networking
ServerClass* [!output PLUGIN_CLASS]::HookedGetAllServerClasses()
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, NULL);
}
[!endif]
[!if IServerGameDLL_GetTickInterval]
/////////////////////////////////////////////////////////////////////////
// HookedGetTickInterval
// Get the simulation interval (must be compiled with identical values
// into both client and game .dll for MOD!!!). Right now this is only
// requested at server startup time so it can't be changed on the fly, etc.
float [!output PLUGIN_CLASS]::HookedGetTickInterval() const
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, 0.0f);
}
[!endif]
[!if IServerGameDLL_GetGameDescription]
/////////////////////////////////////////////////////////////////////////
// HookedGetGameDescription
// Returns string describing current .dll.
// e.g. TeamFortress 2, Half-Life 2
const char* [!output PLUGIN_CLASS]::HookedGetGameDescription()
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, "");
}
[!endif]
[!if IServerGameClients_ClientActive]
/////////////////////////////////////////////////////////////////////////
// HookedClientActive
// Client is going active. If load_game is true, don't
// spawn the player because its state is already setup.
void [!output PLUGIN_CLASS]::HookedClientActive(edict_t* entity, bool load_game)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_ClientConnect]
/////////////////////////////////////////////////////////////////////////
// HookedClientConnect
// Client is connecting to server (return false to reject the connection)
// You can specify a rejection message by writing it into reject
bool [!output PLUGIN_CLASS]::HookedClientConnect(edict_t* entity, const char* name, const char* address, char* reject, int reject_len)
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, true);
}
[!endif]
[!if IServerGameClients_ClientDisconnect]
/////////////////////////////////////////////////////////////////////////
// HookedClientDisconnect
// Client is disconnecting from server
void [!output PLUGIN_CLASS]::HookedClientDisconnect(edict_t* entity)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_ClientCommand]
/////////////////////////////////////////////////////////////////////////
// HookedClientCommand
// The client has typed a command at the console
#if SOURCE_ENGINE >= SE_ORANGEBOX
void [!output PLUGIN_CLASS]::HookedClientCommand(edict_t* entity, const CCommand& args)
#else
void [!output PLUGIN_CLASS]::HookedClientCommand(edict_t* entity)
#endif
{
// Verify the parameters
#if SOURCE_ENGINE == SE_EPISODEONE
CCommand args;
#endif
if(!entity || entity->IsFree())
{
RETURN_META(MRES_IGNORED);
}
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_ClientPutInServer]
/////////////////////////////////////////////////////////////////////////
// HookedClientPutInServer
// Client is connected and should be put in the game
void [!output PLUGIN_CLASS]::HookedClientPutInServer(edict_t* entity, char const* name)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_ClientSettingsChanged]
/////////////////////////////////////////////////////////////////////////
// HookedClientSettingsChanged
// A player changed one / several replicated cvars (name etc...)
void [!output PLUGIN_CLASS]::HookedClientSettingsChanged(edict_t* edict)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_ClientSetupVisibility]
/////////////////////////////////////////////////////////////////////////
// HookedClientSetupVisibility
// Determine PVS origin and set PVS for the player / view entity
void [!output PLUGIN_CLASS]::HookedClientSetupVisibility(edict_t* view_entity, edict_t* client, unsigned char *pvs, int pvs_size)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_ClientEarPosition]
/////////////////////////////////////////////////////////////////////////
// HookedClientEarPosition
// Get the ear position for a specified client
void [!output PLUGIN_CLASS]::HookedClientEarPosition(edict_t* entity, Vector* ear_origin)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_PostClientMessagesSent]
/////////////////////////////////////////////////////////////////////////
// HookedPostClientMessagesSent
// Let the game .dll do stuff after messages have been sent
// to all of the clients once the server frame is complete
void [!output PLUGIN_CLASS]::HookedPostClientMessagesSent()
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_ProcessUsercmds]
/////////////////////////////////////////////////////////////////////////
// HookedProcessUsercmds
// A block of CUserCmds has arrived from the user, decode
// them and buffer for execution during player simulation
float [!output PLUGIN_CLASS]::HookedProcessUsercmds(edict_t* player, bf_read* buf, int num_cmds, int total_cmds,
int dropped_packets, bool ignore, bool paused)
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, 0.0f);
}
[!endif]
[!if IServerGameClients_NetworkIDValidated]
/////////////////////////////////////////////////////////////////////////
// HookedNetworkIDValidated
// A user has had their network id setup and validated
void [!output PLUGIN_CLASS]::HookedNetworkIDValidated(const char* user_name, const char* network_id)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_GetPlayerLimits]
/////////////////////////////////////////////////////////////////////////
// HookedGetPlayerLimits
// Get server max players and lower bound for the same
void [!output PLUGIN_CLASS]::HookedGetPlayerLimits(int& min_players, int& max_players, int& default_max) const
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_GetPlayerState]
/////////////////////////////////////////////////////////////////////////
// HookedGetPlayerState
// For players, looks up the CPlayerState structure corresponding to the player
CPlayerState* [!output PLUGIN_CLASS]::HookedGetPlayerState(edict_t* player)
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, NULL);
}
[!endif]
[!if IServerGameClients_GetReplayDelay]
/////////////////////////////////////////////////////////////////////////
// HookedGetReplayDelay
// Returns number of delay ticks if player is in Replay mode (0 = no delay)
int [!output PLUGIN_CLASS]::HookedGetReplayDelay(edict_t* player, int& entity)
{
// TODO: Implement Method
RETURN_META_VALUE(MRES_IGNORED, 0);
}
[!endif]
[!if IServerGameClients_GetBugReportInfo]
/////////////////////////////////////////////////////////////////////////
// HookedGetBugReportInfo
// Anything this game .dll wants to add to the bug reporter text
//(e.g., the entity/model under the picker crosshair) can be added here
void [!output PLUGIN_CLASS]::HookedGetBugReportInfo(char* buf, int size)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]
[!if IServerGameClients_SetCommandClient]
/////////////////////////////////////////////////////////////////////////
// HookedSetCommandClient
// Sets the client index for the client who typed the command into his / her console
void [!output PLUGIN_CLASS]::HookedSetCommandClient(int index)
{
// TODO: Implement Method
RETURN_META(MRES_IGNORED);
}
[!endif]

View File

@ -0,0 +1,278 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: [!output PLUGIN_CLASS]Hooks.h
// Author: [!output PLUGIN_AUTHOR]
// Date: [!output CURRENT_DATE]
//
// License: [!output PLUGIN_LICENSE]
//
// This software is provided 'as-is', without any express or
// implied warranty. In no event will the authors be held liable
// for any damages arising from the use of this software.
//
// Based on code written by AlliedModders LLC. Sample Plugin
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _PLUGIN_HOOKS_H
#define _PLUGIN_HOOKS_H
[!if IServerGameDLL_ServerActivate]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_SERVER_ACTIVATE
#define DECL_HOOK_SERVER_ACTIVATE \
\
void HookedServerActivate(edict_t* edict_list, \
int edict_count, \
int client_max)
[!endif]
[!if IServerGameDLL_GameInit]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GAME_INIT
#define DECL_HOOK_GAME_INIT \
\
bool HookedGameInit()
[!endif]
[!if IServerGameDLL_GameFrame]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GAME_FRAME
#define DECL_HOOK_GAME_FRAME \
\
void HookedGameFrame(bool simulating)
[!endif]
[!if IServerGameDLL_GameShutdown]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GAME_SHUTDOWN
#define DECL_HOOK_GAME_SHUTDOWN \
\
void HookedGameShutdown()
[!endif]
[!if IServerGameDLL_LevelInit]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_LEVEL_INIT
#define DECL_HOOK_LEVEL_INIT \
\
bool HookedLevelInit(const char* map_name, \
char const* map_entities, \
char const* old_level, \
char const* landmark_name, \
bool load_game, bool bkgnd)
[!endif]
[!if IServerGameDLL_LevelShutdown]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_LEVEL_SHUTDOWN
#define DECL_HOOK_LEVEL_SHUTDOWN \
\
void HookedLevelShutdown();
[!endif]
[!if IServerGameDLL_GetAllServerClasses]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GET_ALL_SERVER_CLASSES
#define DECL_HOOK_GET_ALL_SERVER_CLASSES \
\
ServerClass* HookedGetAllServerClasses()
[!endif]
[!if IServerGameDLL_GetTickInterval]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GET_TICK_INTERVAL
#define DECL_HOOK_GET_TICK_INTERVAL \
\
float HookedGetTickInterval() const
[!endif]
[!if IServerGameDLL_GetGameDescription]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GET_GAME_DESC
#define DECL_HOOK_GET_GAME_DESC \
\
const char* HookedGetGameDescription()
[!endif]
[!if IServerGameClients_ClientActive]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_ACTIVE
#define DECL_HOOK_CLIENT_ACTIVE \
\
void HookedClientActive(edict_t* entity, \
bool load_game)
[!endif]
[!if IServerGameClients_ClientConnect]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_CONNECT
#define DECL_HOOK_CLIENT_CONNECT \
\
bool HookedClientConnect(edict_t* entity, \
const char* name, \
const char* address, \
char* reject, \
int reject_len)
[!endif]
[!if IServerGameClients_ClientDisconnect]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_DISCONNECT
#define DECL_HOOK_CLIENT_DISCONNECT \
\
void HookedClientDisconnect(edict_t* entity)
[!endif]
[!if IServerGameClients_ClientCommand]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_COMMAND
#if SOURCE_ENGINE >= SE_ORANGEBOX
#define DECL_HOOK_CLIENT_COMMAND \
\
void HookedClientCommand(edict_t* entity, \
const CCommand& args)
#else
#define DECL_HOOK_CLIENT_COMMAND \
\
void HookedClientCommand(edict_t* entity)
#endif
[!endif]
[!if IServerGameClients_ClientPutInServer]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_PUT_IN_SERVER
#define DECL_HOOK_CLIENT_PUT_IN_SERVER \
\
void HookedClientPutInServer(edict_t* entity, \
char const* name)
[!endif]
[!if IServerGameClients_ClientSettingsChanged]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_SETTINGS_CHANGED
#define DECL_HOOK_CLIENT_SETTINGS_CHANGED \
\
void HookedClientSettingsChanged(edict_t* edict)
[!endif]
[!if IServerGameClients_ClientSetupVisibility]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_SETUP_VISIBILITY
#define DECL_HOOK_CLIENT_SETUP_VISIBILITY \
\
void HookedClientSetupVisibility(edict_t* view_entity, \
edict_t* client, \
unsigned char *pvs, \
int pvs_size)
[!endif]
[!if IServerGameClients_ClientEarPosition]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_CLIENT_EAR_POSITION
#define DECL_HOOK_CLIENT_EAR_POSITION \
\
void HookedClientEarPosition(edict_t* entity, \
Vector* ear_origin)
[!endif]
[!if IServerGameClients_PostClientMessagesSent]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_POST_CLIENT_MESSAGES_SENT
#define DECL_HOOK_POST_CLIENT_MESSAGES_SENT \
\
void HookedPostClientMessagesSent()
[!endif]
[!if IServerGameClients_ProcessUsercmds]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_PROCESS_USER_CMDS
#define DECL_HOOK_PROCESS_USER_CMDS \
\
float HookedProcessUsercmds(edict_t* player, \
bf_read* buf, \
int num_cmds, \
int total_cmds, \
int dropped_packets, \
bool ignore, \
bool paused)
[!endif]
[!if IServerGameClients_NetworkIDValidated]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_NETWORK_ID_VALIDATED
#define DECL_HOOK_NETWORK_ID_VALIDATED \
\
void HookedNetworkIDValidated(const char* user_name, \
const char* network_id)
[!endif]
[!if IServerGameClients_GetPlayerLimits]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GET_PLAYER_LIMITS
#define DECL_HOOK_GET_PLAYER_LIMITS \
\
void HookedGetPlayerLimits(int& min_players, \
int& max_players, \
int& default_max) const
[!endif]
[!if IServerGameClients_GetPlayerState]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GET_PLAYER_STATE
#define DECL_HOOK_GET_PLAYER_STATE \
\
CPlayerState* HookedGetPlayerState(edict_t* player)
[!endif]
[!if IServerGameClients_GetReplayDelay]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GET_REPLAY_DELAY
#define DECL_HOOK_GET_REPLAY_DELAY \
\
int HookedGetReplayDelay(edict_t* player, \
int& entity)
[!endif]
[!if IServerGameClients_GetBugReportInfo]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_GET_BUG_REPORT_INFO
#define DECL_HOOK_GET_BUG_REPORT_INFO \
\
void HookedGetBugReportInfo(char* buf, int size)
[!endif]
[!if IServerGameClients_SetCommandClient]
/////////////////////////////////////////////////////////////////////////
// Define DECL_HOOK_SET_COMMAND_CLIENT
#define DECL_HOOK_SET_COMMAND_CLIENT \
\
void HookedSetCommandClient(int index)
[!endif]
#endif // _PLUGIN_HOOKS_H

View File

@ -0,0 +1,215 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: [!output PLUGIN_CLASS].cpp
// Author: [!output PLUGIN_AUTHOR]
// Date: [!output CURRENT_DATE]
//
// License: [!output PLUGIN_LICENSE]
//
// This software is provided 'as-is', without any express or
// implied warranty. In no event will the authors be held liable
// for any damages arising from the use of this software.
//
// Based on code written by AlliedModders LLC. Sample Plugin
//
///////////////////////////////////////////////////////////////////////////////
#include "StdMMS.h"
/////////////////////////////////////////////////////////////////////////
// Global Variables
IServerGameDLL* [!output PLUGIN_CLASS]::GameServer(NULL);
IServerGameClients* [!output PLUGIN_CLASS]::GameClients(NULL);
IVEngineServer* [!output PLUGIN_CLASS]::EngineServer(NULL);
IServerPluginHelpers* [!output PLUGIN_CLASS]::PluginHelpers(NULL);
IGameEventManager2* [!output PLUGIN_CLASS]::GameEvents(NULL);
IServerPluginCallbacks* [!output PLUGIN_CLASS]::VspCallbacks(NULL);
IPlayerInfoManager* [!output PLUGIN_CLASS]::PlayerInfoManager(NULL);
ICvar* [!output PLUGIN_CLASS]::CVar(NULL);
CGlobalVars* [!output PLUGIN_CLASS]::GlobalVars(NULL);
/////////////////////////////////////////////////////////////////////////
// Class BaseAccessor
// This is needed to register cvars / CON_COMMANDs
class BaseAccessor : public IConCommandBaseAccessor
{
public:
bool RegisterConCommandBase(ConCommandBase *pCommandBase)
{
// Always call META_REGCVAR instead
// of going through the [!output PLUGIN_CLASS]::EngineServer
return META_REGCVAR(pCommandBase);
}
}
s_BaseAccessor;
///////////////////////////////////////////////////////////////////////////////
// Expose the Plugin
[!output PLUGIN_CLASS] [!output PLUGIN_CLASS]::Global;
PLUGIN_EXPOSE([!output PLUGIN_CLASS], [!output PLUGIN_CLASS]::Global);
/////////////////////////////////////////////////////////////////////////
// Load
bool [!output PLUGIN_CLASS]::Load(PluginId id, ISmmAPI* ismm, char* error, size_t maxlen, bool late)
{
PLUGIN_SAVEVARS();
// Get the current Enginefactory interfaces
GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::EngineServer, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::GameEvents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::PluginHelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::CVar, ICvar, CVAR_INTERFACE_VERSION);
// Get the current ServerFactory interfaces
GET_V_IFACE_ANY(GetServerFactory, [!output PLUGIN_CLASS]::GameServer, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
GET_V_IFACE_ANY(GetServerFactory, [!output PLUGIN_CLASS]::GameClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
GET_V_IFACE_ANY(GetServerFactory, [!output PLUGIN_CLASS]::PlayerInfoManager, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER);
// Get the current Globals interfaces
[!output PLUGIN_CLASS]::GlobalVars = ismm->GetCGlobals();
// Load the VSP listener. This is usually needed for IServerPluginHelpers
#if defined METAMOD_PLAPI_VERSION
if (([!output PLUGIN_CLASS]::VspCallbacks = ismm->GetVSPInfo(NULL)) == NULL)
#endif
{
ismm->AddListener(this, this);
ismm->EnableVSPListener();
}
// Add the hooks
AddHooks();
// Get the engine server interface
#if SOURCE_ENGINE == SE_EPISODEONE
m_engine_server = SH_GET_CALLCLASS([!output PLUGIN_CLASS]::EngineServer);
#endif
ENGINE_CALL(&IVEngineServer::LogPrint)("All hooks started!\n");
// Register the base accessor
#if SOURCE_ENGINE >= SE_ORANGEBOX
g_pCVar = [!output PLUGIN_CLASS]::CVar;
ConVar_Register(0, &s_BaseAccessor);
#else
ConCommandBaseMgr::OneTimeInit(&s_BaseAccessor);
#endif
return true;
}
/////////////////////////////////////////////////////////////////////////
// Unload
bool [!output PLUGIN_CLASS]::Unload(char *error, size_t maxlen)
{
// Remove the hooks
RemoveHooks();
// Release the engine server interface
#if SOURCE_ENGINE == SE_EPISODEONE
SH_RELEASE_CALLCLASS(m_engine_server);
#endif
return true;
}
/////////////////////////////////////////////////////////////////////////
// OnVSPListening
void [!output PLUGIN_CLASS]::OnVSPListening(IServerPluginCallbacks* vsp_callbacks)
{
[!output PLUGIN_CLASS]::VspCallbacks = vsp_callbacks;
}
/////////////////////////////////////////////////////////////////////////
// GetVersion
const char* [!output PLUGIN_CLASS]::GetVersion()
{
return "1.0.0.0";
}
/////////////////////////////////////////////////////////////////////////
// GetDate
const char* [!output PLUGIN_CLASS]::GetDate()
{
return __DATE__;
}
/////////////////////////////////////////////////////////////////////////
// GetLogTag
const char* [!output PLUGIN_CLASS]::GetLogTag()
{
return "[!output PLUGIN_NAME]Log";
}
/////////////////////////////////////////////////////////////////////////
// GetLicense
const char* [!output PLUGIN_CLASS]::GetLicense()
{
return "[!output PLUGIN_LICENSE]";
}
/////////////////////////////////////////////////////////////////////////
// GetAuthor
const char* [!output PLUGIN_CLASS]::GetAuthor()
{
return "[!output PLUGIN_AUTHOR]";
}
/////////////////////////////////////////////////////////////////////////
// GetDescription
const char* [!output PLUGIN_CLASS]::GetDescription()
{
return "[!output PLUGIN_DESC]";
}
/////////////////////////////////////////////////////////////////////////
// GetName
const char* [!output PLUGIN_CLASS]::GetName()
{
return "[!output PLUGIN_NAME]";
}
/////////////////////////////////////////////////////////////////////////
// GetURL
const char* [!output PLUGIN_CLASS]::GetURL()
{
return "[!output PLUGIN_URL]";
}

View File

@ -0,0 +1,173 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: [!output PLUGIN_CLASS].h
// Author: [!output PLUGIN_AUTHOR]
// Date: [!output CURRENT_DATE]
//
// License: [!output PLUGIN_LICENSE]
//
// This software is provided 'as-is', without any express or
// implied warranty. In no event will the authors be held liable
// for any damages arising from the use of this software.
//
// Based on code written by AlliedModders LLC. Sample Plugin
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _PLUGIN_H
#define _PLUGIN_H
/////////////////////////////////////////////////////////////////////////
class CCommand;
/////////////////////////////////////////////////////////////////////////
// Class [!output PLUGIN_CLASS]
class [!output PLUGIN_CLASS] : public ISmmPlugin, public IMetamodListener
{
////////////////////////////////////////
// Plugin Interface
public:
virtual bool Load(PluginId id,
ISmmAPI* ismm,
char* error,
size_t maxlen,
bool late);
virtual bool Unload(char* error, size_t maxlen);
virtual void OnVSPListening(IServerPluginCallbacks* vsp_callbacks);
////////////////////////////////////////
// Plugin Info
public:
virtual const char* GetAuthor();
virtual const char* GetName();
virtual const char* GetDescription();
virtual const char* GetURL();
virtual const char* GetLicense();
virtual const char* GetVersion();
virtual const char* GetDate();
virtual const char* GetLogTag();
////////////////////////////////////////
// Plugin Globals
public:
static IServerGameDLL* GameServer;
static IServerGameClients* GameClients;
static IVEngineServer* EngineServer;
static IServerPluginHelpers* PluginHelpers;
static IGameEventManager2* GameEvents;
static IServerPluginCallbacks* VspCallbacks;
static IPlayerInfoManager* PlayerInfoManager;
static ICvar* CVar;
static CGlobalVars* GlobalVars;
static [!output PLUGIN_CLASS] Global;
////////////////////////////////////////
// Hooks
private:
void AddHooks();
void RemoveHooks();
[!if IServerGameDLL_ServerActivate]
DECL_HOOK_SERVER_ACTIVATE;
[!endif]
[!if IServerGameDLL_GameInit]
DECL_HOOK_GAME_INIT;
[!endif]
[!if IServerGameDLL_GameFrame]
DECL_HOOK_GAME_FRAME;
[!endif]
[!if IServerGameDLL_GameShutdown]
DECL_HOOK_GAME_SHUTDOWN;
[!endif]
[!if IServerGameDLL_LevelInit]
DECL_HOOK_LEVEL_INIT;
[!endif]
[!if IServerGameDLL_LevelShutdown]
DECL_HOOK_LEVEL_SHUTDOWN;
[!endif]
[!if IServerGameDLL_GetAllServerClasses]
DECL_HOOK_GET_ALL_SERVER_CLASSES;
[!endif]
[!if IServerGameDLL_GetTickInterval]
DECL_HOOK_GET_TICK_INTERVAL;
[!endif]
[!if IServerGameDLL_GetGameDescription]
DECL_HOOK_GET_GAME_DESC;
[!endif]
[!if IServerGameClients_ClientActive]
DECL_HOOK_CLIENT_ACTIVE;
[!endif]
[!if IServerGameClients_ClientConnect]
DECL_HOOK_CLIENT_CONNECT;
[!endif]
[!if IServerGameClients_ClientDisconnect]
DECL_HOOK_CLIENT_DISCONNECT;
[!endif]
[!if IServerGameClients_ClientCommand]
DECL_HOOK_CLIENT_COMMAND;
[!endif]
[!if IServerGameClients_ClientPutInServer]
DECL_HOOK_CLIENT_PUT_IN_SERVER;
[!endif]
[!if IServerGameClients_ClientSettingsChanged]
DECL_HOOK_CLIENT_SETTINGS_CHANGED;
[!endif]
[!if IServerGameClients_ClientSetupVisibility]
DECL_HOOK_CLIENT_SETUP_VISIBILITY;
[!endif]
[!if IServerGameClients_ClientEarPosition]
DECL_HOOK_CLIENT_EAR_POSITION;
[!endif]
[!if IServerGameClients_PostClientMessagesSent]
DECL_HOOK_POST_CLIENT_MESSAGES_SENT;
[!endif]
[!if IServerGameClients_ProcessUsercmds]
DECL_HOOK_PROCESS_USER_CMDS;
[!endif]
[!if IServerGameClients_NetworkIDValidated]
DECL_HOOK_NETWORK_ID_VALIDATED;
[!endif]
[!if IServerGameClients_GetPlayerLimits]
DECL_HOOK_GET_PLAYER_LIMITS;
[!endif]
[!if IServerGameClients_GetPlayerState]
DECL_HOOK_GET_PLAYER_STATE;
[!endif]
[!if IServerGameClients_GetReplayDelay]
DECL_HOOK_GET_REPLAY_DELAY;
[!endif]
[!if IServerGameClients_GetBugReportInfo]
DECL_HOOK_GET_BUG_REPORT_INFO;
[!endif]
[!if IServerGameClients_SetCommandClient]
DECL_HOOK_SET_COMMAND_CLIENT;
[!endif]
////////////////////////////////////////
// Plugin Variables
protected:
#if SOURCE_ENGINE == SE_EPISODEONE
SourceHook::CallClass<IVEngineServer>* m_engine_server;
#endif
};
/////////////////////////////////////////////////////////////////////////
// Global Vars
PLUGIN_GLOBALVARS();
#endif // _PLUGIN_H