Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 55fdcd6

Browse files
authored
Add .coach and .spawn feature (#9)
* Rebase from `https://github.com/Source2ZE/CS2Fixes` Commit 7fba234f9400591175d827947c161d5ef0c97262 * Add `coach` functionality * Remove patches from original CS2Fixes plugin * Make coach killing timer configurable * Remove unnecessary features and renaming * Add already existing features * Revert admins.cfg steam key * Add dot to trigger chat command * Fix coach addition if already added * Now coach is killed on freezetime end * Fix coach money on round start * Clean coach prints * Spawns: add only competitive ones * Update from `CS2Fixes` and sdk * Fix coaching * Bump version * Fix map change crash * Clean coach chat print * Fix `.spawn` crash --------- Co-authored-by: marqdevx <[email protected]>
1 parent fbf11df commit 55fdcd6

File tree

456 files changed

+142109
-616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

456 files changed

+142109
-616
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ bld/
1313
[Bb]in/
1414
[Oo]bj/
1515
.vs/
16-
*.vcxproj.user
16+
*.vcxproj.user
17+
.vscode

AMBuildScript

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ class MMSPluginConfig(object):
188188
if builder.options.mms_path:
189189
self.mms_root = builder.options.mms_path
190190
else:
191-
self.mms_root = ResolveEnvPath('MMSOURCE112', 'mmsource-1.12')
191+
self.mms_root = ResolveEnvPath('MMSOURCE20', 'mmsource-2.0')
192+
if not self.mms_root:
193+
self.mms_root = ResolveEnvPath('MMSOURCE112', 'mmsource-1.12')
192194
if not self.mms_root:
193195
self.mms_root = ResolveEnvPath('MMSOURCE111', 'mmsource-1.11')
194196
if not self.mms_root:
@@ -410,7 +412,7 @@ class MMSPluginConfig(object):
410412
if compiler.target.arch == 'x86_64':
411413
compiler.defines += ['X64BITS', 'PLATFORM_64BITS']
412414

413-
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'dota', 'cs2', 'pvkii']:
415+
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'pvkii']:
414416
if compiler.target.platform in ['linux', 'mac']:
415417
compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE']
416418

AMBuilder

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,20 @@ for sdk_name in MMSPlugin.sdks:
5454
'src/commands.cpp',
5555
'src/addresses.cpp',
5656
'src/detours.cpp',
57+
'src/events.cpp',
5758
'src/utils/entity.cpp',
5859
'src/cs2_sdk/schema.cpp',
5960
'src/cs2_sdk/interfaces/cs2_interfaces.cpp',
6061
'src/cs2_sdk/interfaces/centitysystem.cpp',
6162
'src/ctimer.cpp',
62-
'src/playermanager.cpp'
63+
'src/playermanager.cpp',
64+
'src/gameconfig.cpp',
6365
]
6466

6567
if sdk_name in ['dota', 'cs2']:
6668
binary.sources += [
6769
os.path.join(sdk.path, 'tier1', 'convar.cpp'),
70+
os.path.join(sdk.path, 'tier1', 'generichash.cpp'),
6871
os.path.join(sdk.path, 'public', 'tier0', 'memoverride.cpp'),
6972
]
7073

CS2Fixes.vcxproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@
7272
</ImportGroup>
7373
<PropertyGroup Label="UserMacros" />
7474
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
75-
<TargetName>cs2scrim</TargetName>
75+
<TargetName>cs2fixes</TargetName>
7676
<LibraryPath>sdk\lib\public\win64;vendor/funchook/lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
77-
<OutDir>$(SolutionDir)/package/addons/cs2scrim/bin/win64/</OutDir>
77+
<OutDir>$(SolutionDir)/package/addons/cs2fixes/bin/win64/</OutDir>
7878
</PropertyGroup>
7979
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
80-
<TargetName>cs2scrim</TargetName>
80+
<TargetName>cs2fixes</TargetName>
8181
<LibraryPath>sdk\lib\public\win64;vendor/funchook/lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
82-
<OutDir>$(SolutionDir)/package/addons/cs2scrim/bin/win64/</OutDir>
82+
<OutDir>$(SolutionDir)/package/addons/cs2fixes/bin/win64/</OutDir>
8383
</PropertyGroup>
8484
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8585
<ClCompile>
@@ -165,6 +165,7 @@
165165
</Link>
166166
</ItemDefinitionGroup>
167167
<ItemGroup>
168+
<ClCompile Include="sdk\tier1\generichash.cpp" />
168169
<ClCompile Include="src\addresses.cpp" />
169170
<ClCompile Include="src\adminsystem.cpp" />
170171
<ClCompile Include="src\commands.cpp" />
@@ -175,6 +176,8 @@
175176
<ClCompile Include="src\ctimer.cpp" />
176177
<ClCompile Include="src\cvars.cpp" />
177178
<ClCompile Include="src\detours.cpp" />
179+
<ClCompile Include="src\events.cpp" />
180+
<ClCompile Include="src\gameconfig.cpp" />
178181
<ClCompile Include="src\mempatch.cpp" />
179182
<ClCompile Include="src\patches.cpp" />
180183
<ClCompile Include="src\playermanager.cpp" />
@@ -206,6 +209,7 @@
206209
<ClInclude Include="src\cdetour.h" />
207210
<ClInclude Include="src\ctimer.h" />
208211
<ClInclude Include="src\detours.h" />
212+
<ClInclude Include="src\eventlistener.h" />
209213
<ClInclude Include="src\mempatch.h" />
210214
<ClInclude Include="src\addresses.h" />
211215
<ClInclude Include="src\playermanager.h" />

CS2Fixes.vcxproj.filters

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,16 @@
8080
<ClCompile Include="src\playermanager.cpp">
8181
<Filter>Source Files</Filter>
8282
</ClCompile>
83+
<ClCompile Include="src\adminsystem.cpp">
84+
<Filter>Source Files</Filter>
85+
</ClCompile>
8386
<ClCompile Include="src\utils\entity.cpp">
87+
<Filter>Source Files\cs2_sdk\entity</Filter>
88+
</ClCompile>
89+
<ClCompile Include="src\events.cpp">
8490
<Filter>Source Files</Filter>
8591
</ClCompile>
86-
<ClCompile Include="src\adminsystem.cpp">
92+
<ClCompile Include="src\gameconfig.cpp">
8793
<Filter>Source Files</Filter>
8894
</ClCompile>
8995
</ItemGroup>
@@ -178,5 +184,8 @@
178184
<ClInclude Include="src\cs2_sdk\entity\ccsweaponbase.h">
179185
<Filter>Header Files\cs2_sdk\entity</Filter>
180186
</ClInclude>
187+
<ClInclude Include="src\eventlistener.h">
188+
<Filter>Header Files</Filter>
189+
</ClInclude>
181190
</ItemGroup>
182191
</Project>

PackageScript

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,11 @@ builder.AddCopy(os.path.join(builder.buildPath, MMSPlugin.plugin_name + '.vdf'),
4646
# Generate PDB info.
4747
with open(os.path.join(builder.buildPath, 'pdblog.txt'), 'wt') as fp:
4848
for line in pdb_list:
49-
fp.write(line.path + '\n')
49+
fp.write(line.path + '\n')
50+
51+
# Add CS2Fixes-specific files
52+
builder.AddFolder(os.path.join('addons', MMSPlugin.plugin_name, 'data'))
53+
configs_folder = builder.AddFolder(os.path.join('addons', MMSPlugin.plugin_name, 'configs'))
54+
gamedata_folder = builder.AddFolder(os.path.join('addons', MMSPlugin.plugin_name, 'gamedata'))
55+
builder.AddCopy(os.path.join(builder.sourcePath, 'configs', 'admins.cfg'), configs_folder)
56+
builder.AddCopy(os.path.join('gamedata', 'cs2fixes.games.txt'), gamedata_folder)

configs/admins.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Admins
2+
{
3+
"name" // can be anything
4+
{
5+
"steamid" "1234567890" // steamid64
6+
"flags" "abcdefg" // permission flags, same as sourcemod with z being everything
7+
}
8+
}

0 commit comments

Comments
 (0)