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

1.1.0 release #44

Merged
merged 17 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
13 changes: 7 additions & 6 deletions .github/workflows/compile-metamod-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
- pull_request

env:
HL2SDKCS2: /home/runner/work/mm-cs2-scrim/mm-cs2-scrim/sdk
MMSOURCE_DEV: /home/runner/work/mm-cs2-scrim/mm-cs2-scrim/metamod-source
HL2SDKCS2: /__w/mm-cs2-scrim/mm-cs2-scrim/sdk
MMSOURCE_DEV: /__w/mm-cs2-scrim/mm-cs2-scrim/metamod-source
CC: clang
CXX: clang++

jobs:
build:
runs-on: ubuntu-latest
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk

steps:
- name: Checkout
Expand Down Expand Up @@ -42,7 +43,7 @@ jobs:
ls -la
- name: Update submodules
run: |
cd /home/runner/work/mm-cs2-scrim/mm-cs2-scrim/metamod-source
cd metamod-source
git submodule update --recursive

- name: Compile
Expand All @@ -57,9 +58,9 @@ jobs:
sudo apt-get install python3 -y
sudo apt-get install gcc -y
echo ---
cd /home/runner/work/mm-cs2-scrim/mm-cs2-scrim/ambuild && sudo python3 ./setup.py install
cd ambuild && sudo python3 ./setup.py install
ls -la
cd /home/runner/work/mm-cs2-scrim/mm-cs2-scrim
cd ../
ls -la
mkdir build && cd build && python3 ../configure.py --enable-optimize --symbol-files --sdks cs2
mkdir build && cd build && python3 ../configure.py --sdks cs2 --targets x86_64
ambuild
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
35 changes: 23 additions & 12 deletions AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,60 @@ 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']


binary.sources += [
'src/cs2fixes.cpp',
'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
19 changes: 19 additions & 0 deletions CFGs/cs2scrim/cs2scrim.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// cvars for cs2scrim plugin
// you can enable/disable features from this config file
// by default all the features are enabled internally

//console command | Value | Chat command
cs2scrim_coach 1 //.coach
cs2scrim_pracc 1 //.pracc
cs2scrim_scrim 1 //.scrim
cs2scrim_demo 1 //.record .stoprecord
cs2scrim_restore 1 //.restore
cs2scrim_rcon 1 //.rcon
cs2scrim_pause 1 //.pause .unpause
cs2scrim_practice_spawn 1 //.spawn
cs2scrim_admin_ban 1 //.ban
cs2scrim_admin_kick 1 //.kick
cs2scrim_admin_gag 1 //.gag
cs2scrim_admin_slay 1 //.slay
cs2scrim_admin_teleport 1 //.goto
cs2scrim_admin_team 1 //.setteam
12 changes: 6 additions & 6 deletions CFGs/gotvcfg.cfg
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
sv_hibernate_postgame_delay 180

tv_allow_camera_man 1 // Auto director allows spectators to become camera man
tv_allow_camera_man 0 // Auto director allows spectators to become camera man
tv_allow_static_shots 1 // Auto director uses fixed level cameras for shots
tv_autorecord 0 // Automatically records all games as GOTV demos.
tv_chatgroupsize 0 // Set the default chat group size
tv_chattimelimit 8 // Limits spectators to chat only every n seconds
tv_debug 0 // GOTV debug info.
tv_delaymapchange 1 // Delays map change until broadcast is complete
tv_deltacache 2 // Enable delta entity bit stream cache
tv_delaymapchange 0 // Delays map change until broadcast is complete
tv_deltacache 0 // Enable delta entity bit stream cache
tv_dispatchmode 1 // Dispatch clients to relay proxies: 0=never, 1=if appropriate, 2=always
tv_enable 1 // Activates GOTV on server.
tv_maxclients 10 // Maximum client number on GOTV server.
tv_maxrate 20000 // Max GOTV spectator bandwidth rate allowed, 0 == unlimited
tv_maxclients 1 // Maximum client number on GOTV server.
tv_maxrate 0 // Max GOTV spectator bandwidth rate allowed, 0 == unlimited
tv_name "CS2Scrim - GOTV" // GOTV host name
tv_overridemaster 0 // Overrides the GOTV master root address.
tv_port 27016 // Host SourceTV port
tv_relaypassword schmetterling // GOTV password for relay proxies
tv_relayvoice 0 // Relay voice data: 0=off, 1=on
tv_snapshotrate 128 // Snapshots broadcasted per second
tv_timeout 30 // GOTV connection timeout in seconds.
tv_timeout 15 // GOTV connection timeout in seconds.
tv_title "CS2Scrim - GOTV" // Set title for GOTV spectator UI
tv_transmitall 1 // Transmit all entities (not only director view)

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"
Loading