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

Commit

Permalink
Marqdevx/rebase/cs2fixes 1.5.0 (#43)
Browse files Browse the repository at this point in the history
* Rebase from @CS2Fixes 1.5.0

* Remove unused functions

* Fix addresses

* Fix addresses namespace

* Fix changelevel crash

* add credits and warmup end

* Remove unused `Playerpawnbase` header

Now the `CCSPlayerPawnBase` is inside `CCSPlayerPawn` class header

* Fix client crash onTransmit

* Dont install ambuild when its already done

* Cleared get slots APis

* Re-add new features after rebase

---------

Co-authored-by: marqdevx <[email protected]>
  • Loading branch information
marqdevx and marqdevx authored Mar 1, 2024
1 parent 5a448f7 commit 51aea6d
Show file tree
Hide file tree
Showing 130 changed files with 29,672 additions and 1,728 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#Original at https://github.com/Source2ZE/CS2Fixes/blob/main/.github/workflows/build.yml
name: CI

on:
push:
tags:
- '*'
branches:
- main
paths-ignore:
- LICENSE
- README.md
- 'configs**'
- '**.sln'
- '**.vcxproj**'
pull_request:
paths-ignore:
- LICENSE
- README.md
- 'configs**'
- '**.sln'
- '**.vcxproj**'

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
env:
HL2SDKCS2: ${{ github.workspace }}/mm-cs2-scrim/sdk
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
- os: ubuntu-latest
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mm-cs2-scrim
submodules: recursive

- name: Checkout Metamod
uses: actions/checkout@v4
with:
repository: alliedmodders/metamod-source
ref: master
path: mmsource-2.0
submodules: recursive

- name: Checkout AMBuild
uses: actions/checkout@v4
with:
repository: alliedmodders/ambuild
path: ambuild

- name: Install AMBuild
run: |
cd ambuild && python setup.py install && cd ..
- name: Build
working-directory: mm-cs2-scrim
shell: bash
run: |
mkdir build && cd build
python ../configure.py --enable-optimize --symbol-files --sdks cs2
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}
path: mm-cs2-scrim/build/package

release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Package
run: |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
ls -Rall
if [ -d "./Linux/" ]; then
cd ./Linux/
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz *
cd -
fi
if [ -d "./Windows/" ]; then
cd ./Windows/
zip -r ../${{ github.event.repository.name }}-${version}-windows.zip *
cd -
fi
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.event.repository.name }}-*
tag: ${{ github.ref }}
file_glob: true
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Dd]ebug/
/[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
/[Rr]elease/
[Rr]eleases/
[Pp]ublish/
[Pp]roperties/
Expand Down
4 changes: 1 addition & 3 deletions AMBuildScript
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ class MMSPluginConfig(object):
cxx.linkflags += ['/NODEFAULTLIB:libcmt']
else:
cxx.cflags += ['/MT']
cxx.linkflags += ['/NODEFAULTLIB:libcmt']
cxx.defines += [
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_SECURE_NO_WARNINGS',
Expand Down Expand Up @@ -470,8 +469,7 @@ class MMSPluginConfig(object):
else:
compiler.postlink += [os.path.join(lib_folder, 'interfaces_i486.a')]

if sdk.name == 'bms':
compiler.postlink += [os.path.join(lib_folder, 'mathlib.a')]
compiler.postlink += [os.path.join(lib_folder, 'mathlib.a')]

binary = self.Library(compiler, name)
compiler = binary.compiler
Expand Down
34 changes: 23 additions & 11 deletions AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ for sdk_name in MMSPlugin.sdks:
os.path.join(builder.sourcePath, 'vendor', 'subhook'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'include'),
os.path.join(builder.sourcePath, 'vendor', 'protobuf-3.21.8', 'src'),
os.path.join(builder.sourcePath, 'protobuf', 'generated'),
]

target_folder = 'Debug' if builder.options.debug else 'Release'
target_protobuf = 'libprotobufd' if builder.options.debug else 'libprotobuf'

if binary.compiler.target.platform == 'linux':
binary.compiler.postlink += [
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', 'libfunchook.a'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', 'libdistorm.a'),
os.path.join(builder.sourcePath, 'vendor', 'protobuf-lib', 'libprotobuf.a'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'libfunchook.a'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'libdistorm.a'),
os.path.join(builder.sourcePath, 'vendor', 'protobuf-lib', target_folder, target_protobuf + '.a'),
]
binary.sources += ['src/utils/plat_unix.cpp']
elif binary.compiler.target.platform == 'windows':
binary.compiler.postlink += [
os.path.join('psapi.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', 'funchook.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', 'distorm.lib'),
os.path.join(builder.sourcePath, 'vendor', 'protobuf-lib', 'libprotobuf.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'funchook.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'distorm.lib'),
os.path.join(builder.sourcePath, 'vendor', 'protobuf-lib', target_folder, target_protobuf + '.lib'),
os.path.join(builder.sourcePath, 'sdk', 'lib', 'public', 'win64', 'steam_api64.lib')
]
binary.sources += ['src/utils/plat_win.cpp']

Expand All @@ -50,25 +55,32 @@ for sdk_name in MMSPlugin.sdks:
'src/mempatch.cpp',
'src/patches.cpp',
'src/cvars.cpp',
'src/adminsystem.cpp',
'src/adminsystem.cpp',
'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/gameconfig.cpp',
'src/gamesystem.cpp',
'src/entitylistener.cpp',
]

if sdk_name in ['dota', 'cs2']:
binary.sources += [
os.path.join(sdk.path, 'entity2', 'entitysystem.cpp'),
os.path.join(sdk.path, 'entity2', 'entityidentity.cpp'),
os.path.join(sdk.path, 'entity2', 'entitykeyvalues.cpp'),
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'),
os.path.join(sdk.path, 'tier1', 'keyvalues3.cpp'),
]

if sdk_name in ['dota', 'cs2'] and (binary.compiler.target.platform == 'windows' and builder.options.debug != '1') or binary.compiler.target.platform == 'linux':
binary.sources += [
os.path.join(sdk.path, 'public', 'tier0', 'memoverride.cpp')
]

if cxx.target.arch == 'x86':
Expand Down
3 changes: 2 additions & 1 deletion CFGs/pracc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ sv_grenade_trajectory_prac_pipreview 1

buddha_reset_hp 100
buddha 1
say "Practice CFG Mode loaded"
say "Practice CFG loaded"
say "by ρλd"
4 changes: 3 additions & 1 deletion CFGs/scrim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ mp_autokick 0
mp_match_can_clinch 0

mp_freezetime 20
mp_warmup_end
mp_restartgame 1

cash_team_bonus_shorthanded 0

say mr24 loaded
say "Competitive MR24 loaded"
say "by ρλd"
53 changes: 38 additions & 15 deletions CS2Fixes.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand Down Expand Up @@ -124,15 +124,17 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>src/utils;src/cs2_sdk;sdk/public;sdk/public/tier0;sdk/game/shared;sdk/game/server;sdk/public/tier1;minhook/include;$(MMSOURCE112)/core;$(MMSOURCE112)/core/sourcehook;vendor/subhook;vendor/funchook/include;sdk/public/entity2;sdk/public/game/server;vendor/protobuf-3.21.8/src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>protobuf/generated;src/utils;src/cs2_sdk;sdk/public;sdk/public/tier0;sdk/game/shared;sdk/game/server;sdk/public/tier1;sdk/public/mathlib;minhook/include;$(MMSOURCE112)/core;$(MMSOURCE112)/core/sourcehook;vendor/subhook;vendor/funchook/include;sdk/public/entity2;sdk/public/game/server;vendor/protobuf-3.21.8/src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>interfaces.lib;tier0.lib;tier1.lib;psapi.lib;funchook.lib;distorm.lib;vendor/protobuf-lib/libprotobuf.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>sdk/lib/public/win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>interfaces.lib;mathlib.lib;tier0.lib;tier1.lib;psapi.lib;funchook.lib;distorm.lib;steam_api64.lib;vendor/protobuf-lib/Debug/libprotobufd.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>sdk/lib/public/win64;vendor/funchook/lib/Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ShowProgress>
</ShowProgress>
</Link>
Expand All @@ -148,39 +150,50 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>src/utils;src/cs2_sdk;sdk/public;sdk/public/tier0;sdk/game/shared;sdk/game/server;sdk/public/tier1;minhook/include;$(MMSOURCE112)/core;$(MMSOURCE112)/core/sourcehook;vendor/subhook;vendor/funchook/include;sdk/public/entity2;sdk/public/game/server;vendor/protobuf-3.21.8/src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>protobuf/generated;src/utils;src/cs2_sdk;sdk/public;sdk/public/tier0;sdk/game/shared;sdk/game/server;sdk/public/tier1;sdk/public/mathlib;minhook/include;$(MMSOURCE112)/core;$(MMSOURCE112)/core/sourcehook;vendor/subhook;vendor/funchook/include;sdk/public/entity2;sdk/public/game/server;vendor/protobuf-3.21.8/src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>interfaces.lib;tier0.lib;tier1.lib;psapi.lib;funchook.lib;distorm.lib;vendor/protobuf-lib/libprotobuf.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>sdk/lib/public/win64;vendor/funchook/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>interfaces.lib;mathlib.lib;tier0.lib;tier1.lib;psapi.lib;funchook.lib;distorm.lib;steam_api64.lib;vendor/protobuf-lib/Release/libprotobuf.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>sdk/lib/public/win64;vendor/funchook/lib/Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ShowProgress>
</ShowProgress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="sdk\tier1\generichash.cpp" />
<ClCompile Include="sdk\entity2\entityidentity.cpp" />
<ClCompile Include="sdk\entity2\entitykeyvalues.cpp" />
<ClCompile Include="sdk\entity2\entitysystem.cpp" />
<ClCompile Include="sdk\public\tier0\memoverride.cpp" />
<ClCompile Include="sdk\tier1\keyvalues3.cpp" />
<ClCompile Include="src\addresses.cpp" />
<ClCompile Include="src\adminsystem.cpp" />
<ClCompile Include="src\commands.cpp" />
<ClCompile Include="src\cs2fixes.cpp" />
<ClCompile Include="src\cs2_sdk\interfaces\centitysystem.cpp" />
<ClCompile Include="src\cs2_sdk\interfaces\cs2_interfaces.cpp" />
<ClCompile Include="src\cs2_sdk\schema.cpp" />
<ClCompile Include="src\ctimer.cpp" />
<ClCompile Include="src\cvars.cpp" />
<ClCompile Include="src\detours.cpp" />
<ClCompile Include="src\discord.cpp" />
<ClCompile Include="src\events.cpp" />
<ClCompile Include="src\gameconfig.cpp" />
<ClCompile Include="src\gamesystem.cpp" />
<ClCompile Include="src\httpmanager.cpp" />
<ClCompile Include="src\map_votes.cpp" />
<ClCompile Include="src\mempatch.cpp" />
<ClCompile Include="src\patches.cpp" />
<ClCompile Include="src\playermanager.cpp" />
<ClCompile Include="src\user_preferences.cpp" />
<ClCompile Include="src\votemanager.cpp" />
<ClCompile Include="src\zombiereborn.cpp" />
<ClCompile Include="src\entitylistener.cpp" />
<ClCompile Include="sdk\tier1\convar.cpp" />
<ClCompile Include="src\utils\entity.cpp" />
<ClCompile Include="src\utils\plat_unix.cpp" />
Expand All @@ -191,29 +204,39 @@
<ClInclude Include="src\commands.h" />
<ClInclude Include="src\common.h" />
<ClInclude Include="src\cs2fixes.h" />
<ClInclude Include="src\cs2_sdk\cschemasystem.h" />
<ClInclude Include="src\cs2_sdk\entity\cbaseentity.h" />
<ClInclude Include="src\cs2_sdk\entity\cbasemodelentity.h" />
<ClInclude Include="src\cs2_sdk\entity\cbaseplayercontroller.h" />
<ClInclude Include="src\cs2_sdk\entity\cbaseplayerpawn.h" />
<ClInclude Include="src\cs2_sdk\entity\ccollisionproperty.h" />
<ClInclude Include="src\cs2_sdk\entity\ccsplayercontroller.h" />
<ClInclude Include="src\cs2_sdk\entity\ccsplayerpawn.h" />
<ClInclude Include="src\cs2_sdk\entity\centityidentity.h" />
<ClInclude Include="src\cs2_sdk\entity\cglowproperty.h" />
<ClInclude Include="src\cs2_sdk\entity\ccsweaponbase.h" />
<ClInclude Include="src\cs2_sdk\entity\cgamerules.h" />
<ClInclude Include="src\cs2_sdk\entity\cparticlesystem.h" />
<ClInclude Include="src\cs2_sdk\entity\ctakedamageinfo.h" />
<ClInclude Include="src\cs2_sdk\entity\globaltypes.h" />
<ClInclude Include="src\cs2_sdk\entity\lights.h" />
<ClInclude Include="src\cs2_sdk\entity\services.h" />
<ClInclude Include="src\cs2_sdk\interfaces\cgameresourceserviceserver.h" />
<ClInclude Include="src\cs2_sdk\interfaces\cschemasystem.h" />
<ClInclude Include="src\cs2_sdk\interfaces\cs2_interfaces.h" />
<ClInclude Include="src\cs2_sdk\schema.h" />
<ClInclude Include="src\cdetour.h" />
<ClInclude Include="src\ctimer.h" />
<ClInclude Include="src\detours.h" />
<ClInclude Include="src\discord.h" />
<ClInclude Include="src\eventlistener.h" />
<ClInclude Include="src\gamesystem.h" />
<ClInclude Include="src\gameconfig.h" />
<ClInclude Include="src\httpmanager.h" />
<ClInclude Include="src\mempatch.h" />
<ClInclude Include="src\addresses.h" />
<ClInclude Include="src\playermanager.h" />
<ClInclude Include="src\recipientfilters.h" />
<ClInclude Include="src\votemanager.h" />
<ClInclude Include="src\map_votes.h" />
<ClInclude Include="src\user_preferences.h" />
<ClInclude Include="src\zombiereborn.h" />
<ClInclude Include="src\entitylistener.h" />
<ClInclude Include="src\utils\entity.h" />
<ClInclude Include="src\utils\module.h" />
<ClInclude Include="src\utils\plat.h" />
Expand Down
Loading

0 comments on commit 51aea6d

Please sign in to comment.