Skip to content

Commit 3e08554

Browse files
committed
Initial version, just removes devonly flags
0 parents  commit 3e08554

File tree

4 files changed

+338
-0
lines changed

4 files changed

+338
-0
lines changed

msvc10/recording_helpers.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual C++ Express 2010
4+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recording_helpers", "recording_helpers.vcxproj", "{B3E797CF-4E77-4C9D-B8A8-7589B6902206}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32
9+
Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32
13+
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32
14+
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32
15+
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal

msvc10/recording_helpers.vcxproj

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug - Left 4 Dead 2|Win32">
5+
<Configuration>Debug - Left 4 Dead 2</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release - Left 4 Dead 2|Win32">
9+
<Configuration>Release - Left 4 Dead 2</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{B3E797CF-4E77-4C9D-B8A8-7589B6902206}</ProjectGuid>
15+
<RootNamespace>recording_helpers</RootNamespace>
16+
<Keyword>Win32Proj</Keyword>
17+
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'" Label="Configuration">
20+
<ConfigurationType>DynamicLibrary</ConfigurationType>
21+
<CharacterSet>MultiByte</CharacterSet>
22+
<WholeProgramOptimization>true</WholeProgramOptimization>
23+
</PropertyGroup>
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'" Label="Configuration">
25+
<ConfigurationType>DynamicLibrary</ConfigurationType>
26+
<CharacterSet>MultiByte</CharacterSet>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
29+
<ImportGroup Label="ExtensionSettings">
30+
</ImportGroup>
31+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'" Label="PropertySheets">
32+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
33+
</ImportGroup>
34+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'" Label="PropertySheets">
35+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
36+
</ImportGroup>
37+
<PropertyGroup Label="UserMacros" />
38+
<PropertyGroup>
39+
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
40+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
41+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'">$(Configuration)\</IntDir>
42+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug.playerslots - Left 4 Dead 2|Win32'">$(Configuration)\</IntDir>
43+
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'">true</LinkIncremental>
44+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
45+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'">$(Configuration)\</IntDir>
46+
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'">false</LinkIncremental>
47+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'">recording_helpers</TargetName>
48+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'">recording_helpers</TargetName>
49+
</PropertyGroup>
50+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'">
51+
<ClCompile>
52+
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
53+
<Optimization>Disabled</Optimization>
54+
<AdditionalIncludeDirectories>..;$(HL2SDKL4D2)\public;$(HL2SDKL4D2)\public\engine;$(HL2SDKL4D2)\public\tier0;$(HL2SDKL4D2)\public\tier1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
55+
<PreprocessorDefinitions>WIN32;COMPILER_MSVC;COMPILER_MSVC32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
56+
<MinimalRebuild>true</MinimalRebuild>
57+
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
58+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
59+
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
60+
<RuntimeTypeInfo>false</RuntimeTypeInfo>
61+
<PrecompiledHeader>
62+
</PrecompiledHeader>
63+
<WarningLevel>Level3</WarningLevel>
64+
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
65+
</ClCompile>
66+
<Link>
67+
<AdditionalDependencies>$(HL2SDKL4D2)\lib\public\tier0.lib;$(HL2SDKL4D2)\lib\public\tier1.lib;$(HL2SDKL4D2)\lib\public\vstdlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
68+
<OutputFile>$(OutDir)recording_helpers.dll</OutputFile>
69+
<IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
70+
<GenerateDebugInformation>true</GenerateDebugInformation>
71+
<SubSystem>Windows</SubSystem>
72+
<RandomizedBaseAddress>false</RandomizedBaseAddress>
73+
<DataExecutionPrevention>
74+
</DataExecutionPrevention>
75+
<TargetMachine>MachineX86</TargetMachine>
76+
</Link>
77+
</ItemDefinitionGroup>
78+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'">
79+
<ClCompile>
80+
<AdditionalOptions>/MP%(AdditionalOptions)</AdditionalOptions>
81+
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
82+
<AdditionalIncludeDirectories>..;$(HL2SDKL4D2)\public;$(HL2SDKL4D2)\public\engine;$(HL2SDKL4D2)\public\tier0;$(HL2SDKL4D2)\public\tier1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
83+
<PreprocessorDefinitions>WIN32;COMPILER_MSVC;COMPILER_MSVC32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
84+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
85+
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
86+
<RuntimeTypeInfo>false</RuntimeTypeInfo>
87+
<PrecompiledHeader>
88+
</PrecompiledHeader>
89+
<WarningLevel>Level3</WarningLevel>
90+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
91+
</ClCompile>
92+
<Link>
93+
<AdditionalDependencies>$(HL2SDKL4D2)\lib\public\tier0.lib;$(HL2SDKL4D2)\lib\public\tier1.lib;$(HL2SDKL4D2)\lib\public\vstdlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
94+
<OutputFile>$(OutDir)recording_helpers.dll</OutputFile>
95+
<IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
96+
<GenerateDebugInformation>true</GenerateDebugInformation>
97+
<SubSystem>Windows</SubSystem>
98+
<OptimizeReferences>true</OptimizeReferences>
99+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
100+
<RandomizedBaseAddress>false</RandomizedBaseAddress>
101+
<DataExecutionPrevention>
102+
</DataExecutionPrevention>
103+
<TargetMachine>MachineX86</TargetMachine>
104+
</Link>
105+
</ItemDefinitionGroup>
106+
<ItemGroup>
107+
<ClCompile Include="..\recording_helpers.cpp" />
108+
</ItemGroup>
109+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
110+
<ImportGroup Label="ExtensionTargets">
111+
</ImportGroup>
112+
</Project>

recording_helpers.cpp

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
#include <cstdlib>
2+
#include "eiface.h"
3+
#include "icvar.h"
4+
#include "tier1/iconvar.h"
5+
#include "tier1/convar.h"
6+
7+
// memdbgon must be the last include file in a .cpp file!!!
8+
//#include "tier0/memdbgon.h"
9+
10+
class RecordingHelpers: public IServerPluginCallbacks
11+
{
12+
public:
13+
// IServerPluginCallbacks methods
14+
virtual bool Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory );
15+
virtual void Unload( void );
16+
virtual void Pause( void );
17+
virtual void UnPause( void );
18+
virtual const char *GetPluginDescription( void );
19+
virtual void LevelInit( char const *pMapName );
20+
virtual void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax );
21+
virtual void GameFrame( bool simulating );
22+
virtual void LevelShutdown( void );
23+
virtual void ClientActive( edict_t *pEntity );
24+
virtual void ClientFullyConnect( edict_t *pEntity );
25+
virtual void ClientDisconnect( edict_t *pEntity );
26+
virtual void ClientPutInServer( edict_t *pEntity, char const *playername );
27+
virtual void SetCommandClient( int index );
28+
virtual void ClientSettingsChanged( edict_t *pEdict );
29+
virtual PLUGIN_RESULT ClientConnect( bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen );
30+
virtual PLUGIN_RESULT ClientCommand( edict_t *pEntity, const CCommand &args );
31+
virtual PLUGIN_RESULT NetworkIDValidated( const char *pszUserName, const char *pszNetworkID );
32+
virtual void OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue );
33+
34+
// added with version 3 of the interface.
35+
virtual void OnEdictAllocated( edict_t *edict );
36+
virtual void OnEdictFreed( const edict_t *edict );
37+
38+
};
39+
40+
41+
RecordingHelpers g_RecordingHelpersPlugin;
42+
EXPOSE_SINGLE_INTERFACE_GLOBALVAR(RecordingHelpers, IServerPluginCallbacks, INTERFACEVERSION_ISERVERPLUGINCALLBACKS, g_RecordingHelpersPlugin );
43+
44+
ICvar * g_pCvar = NULL;
45+
46+
47+
//---------------------------------------------------------------------------------
48+
// Purpose: called once per server frame, do recurring work here (like checking for timeouts)
49+
//---------------------------------------------------------------------------------
50+
void RecordingHelpers::GameFrame( bool simulating )
51+
{
52+
}
53+
54+
//---------------------------------------------------------------------------------
55+
// Purpose: called when the plugin is loaded, load the interface we need from the engine
56+
//---------------------------------------------------------------------------------
57+
bool RecordingHelpers::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory )
58+
{
59+
g_pCvar = reinterpret_cast<ICvar *>(interfaceFactory(CVAR_INTERFACE_VERSION,NULL));
60+
61+
if(g_pCvar == NULL)
62+
{
63+
Warning("RecordingHelpers: Failed to get Cvar interface.\n");
64+
return false;
65+
}
66+
67+
// Remove all devonly flags
68+
ICvar::Iterator iter(g_pCvar);
69+
for ( iter.SetFirst() ; iter.IsValid() ; iter.Next() )
70+
{
71+
ConCommandBase *cmd = iter.Get();
72+
cmd->RemoveFlags(FCVAR_DEVELOPMENTONLY);
73+
}
74+
return true;
75+
}
76+
77+
//---------------------------------------------------------------------------------
78+
// Purpose: called when the plugin is unloaded (turned off)
79+
//---------------------------------------------------------------------------------
80+
void RecordingHelpers::Unload( void )
81+
{
82+
}
83+
84+
//---------------------------------------------------------------------------------
85+
// Purpose: called when the plugin is paused (i.e should stop running but isn't unloaded)
86+
//---------------------------------------------------------------------------------
87+
void RecordingHelpers::Pause( void )
88+
{
89+
}
90+
91+
//---------------------------------------------------------------------------------
92+
// Purpose: called when the plugin is unpaused (i.e should start executing again)
93+
//---------------------------------------------------------------------------------
94+
void RecordingHelpers::UnPause( void )
95+
{
96+
}
97+
98+
//---------------------------------------------------------------------------------
99+
// Purpose: the name of this plugin, returned in "plugin_print" command
100+
//---------------------------------------------------------------------------------
101+
const char *RecordingHelpers::GetPluginDescription( void )
102+
{
103+
return "RecordingHelpers 0.1, ProdigySim";
104+
}
105+
106+
//---------------------------------------------------------------------------------
107+
// Purpose: called on level start
108+
//---------------------------------------------------------------------------------
109+
void RecordingHelpers::LevelInit( char const *pMapName )
110+
{
111+
}
112+
113+
//---------------------------------------------------------------------------------
114+
// Purpose: called on level start, when the server is ready to accept client connections
115+
// edictCount is the number of entities in the level, clientMax is the max client count
116+
//---------------------------------------------------------------------------------
117+
void RecordingHelpers::ServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
118+
{
119+
}
120+
121+
//---------------------------------------------------------------------------------
122+
// Purpose: called on level end (as the server is shutting down or going to a new map)
123+
//---------------------------------------------------------------------------------
124+
void RecordingHelpers::LevelShutdown( void ) // !!!!this can get called multiple times per map change
125+
{
126+
}
127+
128+
//---------------------------------------------------------------------------------
129+
// Purpose: called when a client spawns into a server (i.e as they begin to play)
130+
//---------------------------------------------------------------------------------
131+
void RecordingHelpers::ClientActive( edict_t *pEntity )
132+
{
133+
}
134+
135+
void RecordingHelpers::ClientFullyConnect( edict_t *pEntity )
136+
{
137+
}
138+
139+
//---------------------------------------------------------------------------------
140+
// Purpose: called when a client leaves a server (or is timed out)
141+
//---------------------------------------------------------------------------------
142+
void RecordingHelpers::ClientDisconnect( edict_t *pEntity )
143+
{
144+
}
145+
146+
//---------------------------------------------------------------------------------
147+
// Purpose: called on
148+
//---------------------------------------------------------------------------------
149+
void RecordingHelpers::ClientPutInServer( edict_t *pEntity, char const *playername )
150+
{
151+
}
152+
153+
//---------------------------------------------------------------------------------
154+
// Purpose: called on level start
155+
//---------------------------------------------------------------------------------
156+
void RecordingHelpers::SetCommandClient( int index )
157+
{
158+
}
159+
160+
//---------------------------------------------------------------------------------
161+
// Purpose: called on level start
162+
//---------------------------------------------------------------------------------
163+
void RecordingHelpers::ClientSettingsChanged( edict_t *pEdict )
164+
{
165+
}
166+
167+
//---------------------------------------------------------------------------------
168+
// Purpose: called when a client joins a server
169+
//---------------------------------------------------------------------------------
170+
PLUGIN_RESULT RecordingHelpers::ClientConnect( bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen )
171+
{
172+
return PLUGIN_CONTINUE;
173+
}
174+
175+
//---------------------------------------------------------------------------------
176+
// Purpose: called when a client types in a command (only a subset of commands however, not CON_COMMAND's)
177+
//---------------------------------------------------------------------------------
178+
PLUGIN_RESULT RecordingHelpers::ClientCommand( edict_t *pEntity, const CCommand &args )
179+
{
180+
return PLUGIN_CONTINUE;
181+
}
182+
183+
//---------------------------------------------------------------------------------
184+
// Purpose: called when a client is authenticated
185+
//---------------------------------------------------------------------------------
186+
PLUGIN_RESULT RecordingHelpers::NetworkIDValidated( const char *pszUserName, const char *pszNetworkID )
187+
{
188+
return PLUGIN_CONTINUE;
189+
}
190+
191+
//---------------------------------------------------------------------------------
192+
// Purpose: called when a cvar value query is finished
193+
//---------------------------------------------------------------------------------
194+
void RecordingHelpers::OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue )
195+
{
196+
}
197+
void RecordingHelpers::OnEdictAllocated( edict_t *edict )
198+
{
199+
}
200+
void RecordingHelpers::OnEdictFreed( const edict_t *edict )
201+
{
202+
}

recording_helpers.vdf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"Plugin"
2+
{
3+
"file" "addons/recording_helpers"
4+
}

0 commit comments

Comments
 (0)