mirror of
https://github.com/accelerator74/l4dtoolz.git
synced 2025-07-19 01:48:39 +08:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
763fbf3b96 | |||
3295b7aeae | |||
c510965a8a | |||
e5e9bac1c0 | |||
e1a6182665 | |||
679b6f54c0 | |||
a7e01138c7 | |||
5b19701a0e | |||
c7ee545ce9 |
@ -1,6 +1,7 @@
|
||||
name: l4d2-build
|
||||
name: build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@ -29,6 +30,7 @@ jobs:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- ubuntu-20.04
|
||||
- windows-latest
|
||||
|
||||
mm_version:
|
||||
@ -41,6 +43,9 @@ jobs:
|
||||
- os: ubuntu-latest
|
||||
os_short: linux
|
||||
|
||||
- os: ubuntu-20.04
|
||||
os_short: oldlinux
|
||||
|
||||
- os: windows-latest
|
||||
os_short: win
|
||||
|
||||
@ -93,6 +98,13 @@ jobs:
|
||||
python -m pip install wheel
|
||||
pip install git+https://github.com/accelerator74/ambuild
|
||||
|
||||
- name: Checking out hl2sdk-l4d
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: alliedmodders/hl2sdk
|
||||
ref: l4d
|
||||
path: hl2sdk-l4d
|
||||
|
||||
- name: Checking out hl2sdk-l4d2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
@ -105,16 +117,61 @@ jobs:
|
||||
with:
|
||||
path: src
|
||||
|
||||
- name: Compiling ${{ github.event.repository.name }} files
|
||||
- name: Compiling ${{ github.event.repository.name }}-l4d files
|
||||
working-directory: src
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
mkdir build_l4d
|
||||
cd build_l4d
|
||||
python ../configure.py --enable-optimize --sdks="l4d" --mms-path="${{ github.workspace }}/metamod-${{ matrix.mm_version }}"
|
||||
ambuild
|
||||
|
||||
- name: Compiling ${{ github.event.repository.name }}-l4d2 files
|
||||
working-directory: src
|
||||
run: |
|
||||
mkdir build_l4d2
|
||||
cd build_l4d2
|
||||
python ../configure.py --enable-optimize --sdks="l4d2" --mms-path="${{ github.workspace }}/metamod-${{ matrix.mm_version }}"
|
||||
ambuild
|
||||
|
||||
- name: Uploading package
|
||||
- name: Uploading l4d package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}-l4d-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
|
||||
path: src/build_l4d/package
|
||||
|
||||
- name: Uploading l4d2 package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}-l4d2-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
|
||||
path: src/build/package
|
||||
path: src/build_l4d2/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
|
||||
for folder in ${{ github.event.repository.name }}*; do
|
||||
if [ -d "$folder" ]; then
|
||||
echo "Processing folder: $folder"
|
||||
cd $folder
|
||||
tar -czf ../$folder.tar.gz -T <(\ls -1)
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: '*.tar.gz'
|
||||
tag: ${{ github.ref }}
|
||||
file_glob: true
|
120
.github/workflows/l4d_build.yml
vendored
120
.github/workflows/l4d_build.yml
vendored
@ -1,120 +0,0 @@
|
||||
name: l4d-build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- LICENSE
|
||||
- README.md
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths-ignore:
|
||||
- LICENSE
|
||||
- README.md
|
||||
schedule:
|
||||
- cron: '30 03 01 */3 *' # Artifacts expire every 3 months
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build with mms${{ matrix.mm_version }} on ${{ matrix.os_short }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
|
||||
mm_version:
|
||||
- "master"
|
||||
|
||||
include:
|
||||
- mm_version: "master"
|
||||
mm_branch: "master"
|
||||
|
||||
- os: ubuntu-latest
|
||||
os_short: linux
|
||||
|
||||
- os: windows-latest
|
||||
os_short: win
|
||||
|
||||
steps:
|
||||
- name: Prepare env
|
||||
shell: bash
|
||||
run: |
|
||||
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
||||
|
||||
- name: Install (Linux)
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang g++-multilib
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
|
||||
- name: Add msbuild to PATH (Windows)
|
||||
if: startsWith(runner.os, 'Windows')
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Install (Windows)
|
||||
if: startsWith(runner.os, 'Windows')
|
||||
shell: cmd
|
||||
run: |
|
||||
:: See https://github.com/microsoft/vswhere/wiki/Find-VC
|
||||
for /f "usebackq delims=*" %%i in (`vswhere -latest -property installationPath`) do (
|
||||
call "%%i"\Common7\Tools\vsdevcmd.bat -arch=x86 -host_arch=x64
|
||||
)
|
||||
:: Loop over all environment variables and make them global.
|
||||
for /f "delims== tokens=1,2" %%a in ('set') do (
|
||||
echo>>"%GITHUB_ENV%" %%a=%%b
|
||||
)
|
||||
|
||||
- name: Checking out MM:Source
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: alliedmodders/metamod-source
|
||||
ref: ${{ matrix.mm_branch }}
|
||||
path: metamod-${{ matrix.mm_version }}
|
||||
|
||||
- name: Setting up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Setting up ambuild
|
||||
run: |
|
||||
python -m pip install wheel
|
||||
pip install git+https://github.com/accelerator74/ambuild
|
||||
|
||||
- name: Checking out hl2sdk-l4d
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: alliedmodders/hl2sdk
|
||||
ref: l4d
|
||||
path: hl2sdk-l4d
|
||||
|
||||
- name: Checking out own repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: src
|
||||
|
||||
- name: Compiling ${{ github.event.repository.name }} files
|
||||
working-directory: src
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
python ../configure.py --enable-optimize --sdks="l4d" --mms-path="${{ github.workspace }}/metamod-${{ matrix.mm_version }}"
|
||||
ambuild
|
||||
|
||||
- name: Uploading package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}-l4d-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
|
||||
path: src/build/package
|
@ -14,7 +14,7 @@ builder.options.add_option('--enable-debug', action='store_const', const='1', de
|
||||
help='Enable debugging symbols')
|
||||
builder.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt',
|
||||
help='Enable optimization')
|
||||
builder.options.add_option('-s', '--sdks', default='all', dest='sdks',
|
||||
builder.options.add_option('-s', '--sdks', default='present', dest='sdks',
|
||||
help='Build against specified SDKs; valid args are "all", "present", or '
|
||||
'comma-delimited list of engine names (default: %default)')
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
const char* engine_dll = "engine.so";
|
||||
int slots_offs = 94; // m_numGameSlots (in CGameServer::ExecGameTypeCfg)
|
||||
int reserved_offs = 45; // m_nReservationCookie (in CBaseServer::ReplyReservationRequest)
|
||||
int reservation_idx = 60; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable
|
||||
int maxhuman_idx = 132; // CTerrorGameRules::GetMaxHumanPlayers vtable
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
int sv_offs = 6; // IServer pointer (in IVEngineServer::CreateFakeClient)
|
||||
int slots_offs = 96; // m_numGameSlots (in CGameServer::ExecGameTypeCfg)
|
||||
int reserved_offs = 368; // m_nReservationCookie (in CBaseServer::ReplyReservationRequest)
|
||||
int reservation_idx = 59; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable
|
||||
int maxhuman_idx = 131; // CTerrorGameRules::GetMaxHumanPlayers vtable
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
const char* engine_dll = "engine_srv.so";
|
||||
int slots_offs = 95; // m_numGameSlots (in CGameServer::ExecGameTypeCfg)
|
||||
int reserved_offs = 364; // m_nReservationCookie (in CBaseServer::ReplyReservationRequest)
|
||||
int reservation_idx = 62; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable
|
||||
int maxhuman_idx = 137; // CTerrorGameRules::GetMaxHumanPlayers vtable
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
int sv_offs = 8; // IServer pointer (in IVEngineServer::CreateFakeClient)
|
||||
int slots_offs = 96; // m_numGameSlots (in CGameServer::ExecGameTypeCfg)
|
||||
int reserved_offs = 368; // m_nReservationCookie (in CBaseServer::ReplyReservationRequest)
|
||||
int reservation_idx = 61; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable
|
||||
int maxhuman_idx = 136; // CTerrorGameRules::GetMaxHumanPlayers vtable
|
||||
|
||||
|
@ -54,7 +54,7 @@ void l4dtoolz::OnChangeUnreserved ( IConVar *var, const char *pOldValue, float f
|
||||
}
|
||||
if(new_value != old_value) {
|
||||
if(new_value == 1) {
|
||||
engine->ServerCommand("sv_allow_lobby_connect_only 0\n");
|
||||
g_pCVar->FindVar("sv_allow_lobby_connect_only")->SetValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,6 +74,10 @@ void Hook_ApplyGameSettings(KeyValues *pKV)
|
||||
void Hook_ReplyReservationRequest(netadr_s& adr, CBitRead& inmsg)
|
||||
{
|
||||
if (sv_force_unreserved.GetInt()) {
|
||||
if (g_pGameIServer != NULL) {
|
||||
if (*(uint64_t*)(((char*)g_pGameIServer)+reserved_offs) != 0)
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
@ -115,7 +119,9 @@ bool l4dtoolz::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool
|
||||
int* m_nMaxClientsLimit = (int*)(((uint**)g_pGameIServer)+maxplayers_offs);
|
||||
if (*m_nMaxClientsLimit != 0x12) {
|
||||
Warning("Couldn't patch maxplayers\n");
|
||||
g_pGameIServer = NULL;
|
||||
if (!late) {
|
||||
g_pGameIServer = NULL;
|
||||
}
|
||||
} else {
|
||||
*m_nMaxClientsLimit = 0x20;
|
||||
const char *pszCmdLineMax;
|
||||
@ -235,7 +241,7 @@ const char *l4dtoolz::GetLicense()
|
||||
|
||||
const char *l4dtoolz::GetVersion()
|
||||
{
|
||||
return "2.0.0";
|
||||
return "2.0.1";
|
||||
}
|
||||
|
||||
const char *l4dtoolz::GetDate()
|
||||
|
Reference in New Issue
Block a user