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

Commit

Permalink
Add .coach and .spawn feature (#9)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
marqdevx and marqdevx authored Nov 7, 2023
1 parent fbf11df commit 55fdcd6
Show file tree
Hide file tree
Showing 456 changed files with 142,109 additions and 616 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ bld/
[Bb]in/
[Oo]bj/
.vs/
*.vcxproj.user
*.vcxproj.user
.vscode
6 changes: 4 additions & 2 deletions AMBuildScript
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ class MMSPluginConfig(object):
if builder.options.mms_path:
self.mms_root = builder.options.mms_path
else:
self.mms_root = ResolveEnvPath('MMSOURCE112', 'mmsource-1.12')
self.mms_root = ResolveEnvPath('MMSOURCE20', 'mmsource-2.0')
if not self.mms_root:
self.mms_root = ResolveEnvPath('MMSOURCE112', 'mmsource-1.12')
if not self.mms_root:
self.mms_root = ResolveEnvPath('MMSOURCE111', 'mmsource-1.11')
if not self.mms_root:
Expand Down Expand Up @@ -410,7 +412,7 @@ class MMSPluginConfig(object):
if compiler.target.arch == 'x86_64':
compiler.defines += ['X64BITS', 'PLATFORM_64BITS']

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

Expand Down
5 changes: 4 additions & 1 deletion AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,20 @@ for sdk_name in MMSPlugin.sdks:
'src/commands.cpp',
'src/addresses.cpp',
'src/detours.cpp',
'src/events.cpp',
'src/utils/entity.cpp',
'src/cs2_sdk/schema.cpp',
'src/cs2_sdk/interfaces/cs2_interfaces.cpp',
'src/cs2_sdk/interfaces/centitysystem.cpp',
'src/ctimer.cpp',
'src/playermanager.cpp'
'src/playermanager.cpp',
'src/gameconfig.cpp',
]

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

Expand Down
12 changes: 8 additions & 4 deletions CS2Fixes.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>cs2scrim</TargetName>
<TargetName>cs2fixes</TargetName>
<LibraryPath>sdk\lib\public\win64;vendor/funchook/lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
<OutDir>$(SolutionDir)/package/addons/cs2scrim/bin/win64/</OutDir>
<OutDir>$(SolutionDir)/package/addons/cs2fixes/bin/win64/</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>cs2scrim</TargetName>
<TargetName>cs2fixes</TargetName>
<LibraryPath>sdk\lib\public\win64;vendor/funchook/lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
<OutDir>$(SolutionDir)/package/addons/cs2scrim/bin/win64/</OutDir>
<OutDir>$(SolutionDir)/package/addons/cs2fixes/bin/win64/</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -165,6 +165,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="sdk\tier1\generichash.cpp" />
<ClCompile Include="src\addresses.cpp" />
<ClCompile Include="src\adminsystem.cpp" />
<ClCompile Include="src\commands.cpp" />
Expand All @@ -175,6 +176,8 @@
<ClCompile Include="src\ctimer.cpp" />
<ClCompile Include="src\cvars.cpp" />
<ClCompile Include="src\detours.cpp" />
<ClCompile Include="src\events.cpp" />
<ClCompile Include="src\gameconfig.cpp" />
<ClCompile Include="src\mempatch.cpp" />
<ClCompile Include="src\patches.cpp" />
<ClCompile Include="src\playermanager.cpp" />
Expand Down Expand Up @@ -206,6 +209,7 @@
<ClInclude Include="src\cdetour.h" />
<ClInclude Include="src\ctimer.h" />
<ClInclude Include="src\detours.h" />
<ClInclude Include="src\eventlistener.h" />
<ClInclude Include="src\mempatch.h" />
<ClInclude Include="src\addresses.h" />
<ClInclude Include="src\playermanager.h" />
Expand Down
11 changes: 10 additions & 1 deletion CS2Fixes.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@
<ClCompile Include="src\playermanager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\adminsystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\utils\entity.cpp">
<Filter>Source Files\cs2_sdk\entity</Filter>
</ClCompile>
<ClCompile Include="src\events.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\adminsystem.cpp">
<ClCompile Include="src\gameconfig.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
Expand Down Expand Up @@ -178,5 +184,8 @@
<ClInclude Include="src\cs2_sdk\entity\ccsweaponbase.h">
<Filter>Header Files\cs2_sdk\entity</Filter>
</ClInclude>
<ClInclude Include="src\eventlistener.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
9 changes: 8 additions & 1 deletion PackageScript
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ builder.AddCopy(os.path.join(builder.buildPath, MMSPlugin.plugin_name + '.vdf'),
# Generate PDB info.
with open(os.path.join(builder.buildPath, 'pdblog.txt'), 'wt') as fp:
for line in pdb_list:
fp.write(line.path + '\n')
fp.write(line.path + '\n')

# Add CS2Fixes-specific files
builder.AddFolder(os.path.join('addons', MMSPlugin.plugin_name, 'data'))
configs_folder = builder.AddFolder(os.path.join('addons', MMSPlugin.plugin_name, 'configs'))
gamedata_folder = builder.AddFolder(os.path.join('addons', MMSPlugin.plugin_name, 'gamedata'))
builder.AddCopy(os.path.join(builder.sourcePath, 'configs', 'admins.cfg'), configs_folder)
builder.AddCopy(os.path.join('gamedata', 'cs2fixes.games.txt'), gamedata_folder)
8 changes: 8 additions & 0 deletions configs/admins.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Admins
{
"name" // can be anything
{
"steamid" "1234567890" // steamid64
"flags" "abcdefg" // permission flags, same as sourcemod with z being everything
}
}
Loading

0 comments on commit 55fdcd6

Please sign in to comment.