Skip to content
Closed
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
108 changes: 0 additions & 108 deletions .github/workflows/build.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Continuous Integration

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

jobs:
build:
name: Build via Docker Compose
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build plugin inside container
run: docker compose up --build --abort-on-container-exit

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-package
path: dockerbuild/package

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

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: linux-package
path: ./Linux

- name: Package Linux .so
run: |
version="${GITHUB_REF#refs/tags/}"
tar -czf MultiAddonManager-${version}-linux.tar.gz -C Linux .

- name: Upload release archive
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: MultiAddonManager-*-linux.tar.gz
tag: ${{ github.ref }}
file_glob: true
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[submodule "hl2sdk-manifests"]
path = hl2sdk-manifests
url = https://github.com/alliedmodders/hl2sdk-manifests
[submodule "vendor/hl2sdk-cs2"]
path = vendor/hl2sdk-cs2
url = https://github.com/alliedmodders/hl2sdk
branch = cs2
[submodule "vendor/metamod-source"]
path = vendor/metamod-source
url = https://github.com/alliedmodders/metamod-source
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk

WORKDIR /app

RUN apt update && apt install -y clang-16
RUN ln -sf /usr/bin/clang-16 /usr/bin/clang && ln -sf /usr/bin/clang++-16 /usr/bin/clang++
RUN git clone https://github.com/alliedmodders/ambuild
RUN cd ambuild && python setup.py install && cd ..
RUN git config --global --add safe.directory /app

COPY ./docker-entrypoint.sh ./
ENV HL2SDKCS2=/app/source/vendor/hl2sdk-cs2
ENV MMSOURCE112=/app/source/vendor/metamod-source
WORKDIR /app/source
CMD ["/bin/bash", "./docker-entrypoint.sh"]
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
builder:
image: ambuilder
build: .
volumes:
- '.:/app/source'
6 changes: 6 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
mkdir dockerbuild
cd dockerbuild
pwd
python ../configure.py --enable-optimize --sdks cs2 --hl2sdk-manifests ./hl2sdk-manifests
ambuild
8 changes: 4 additions & 4 deletions src/multiaddonmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ SH_DECL_HOOK2(IGameEventManager2, LoadEventsFromFile, SH_NOATTRIB, 0, int, const
constexpr const byte g_HostStateRequest_Sig[] = "\x48\x89\x74\x24\x2A\x57\x48\x83\xEC\x2A\x33\xF6\x48\x8B\xFA\x48\x39\x35";
constexpr const byte g_ReplyConnection_Sig[] = "\x48\x8B\xC4\x55\x41\x54\x41\x55\x41\x57";
#else
constexpr const byte g_HostStateRequest_Sig[] = "\x55\x48\x89\xE5\x41\x56\x41\x55\x41\x54\x49\x89\xF4\x53\x48\x83\x7F";
constexpr const byte g_ReplyConnection_Sig[] = "\x55\xB9\x00\x01\x00\x00";
constexpr const byte g_HostStateRequest_Sig[] = "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x41\x54\x49\x89\xFC\x53\x48\x89\xF3\x48\x83\xEC\x18\x48\x83\x7F\x30\x00\x74\x70";
constexpr const byte g_ReplyConnection_Sig[] = "\x55\x48\x8D\x05\xE8\xC2\xC1\xFF\x66\x0F\xEF\xC0\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x41\x54\x49\x89\xFC\x53\x48\x89\xF3\x48\x81\xEC\xB8\x01\x00\x00";
#endif


// Offsets
constexpr int g_iServerAddonsOffset = 328;
constexpr int g_iServerAddonsOffset = 336;

#ifdef PLATFORM_WINDOWS
constexpr int g_iSendNetMessageOffset = 15;
constexpr int g_iClientListOffset = 624;
#else
constexpr int g_iSendNetMessageOffset = 16;
constexpr int g_iSendNetMessageOffset = 13;
constexpr int g_iClientListOffset = 640;
#endif

Expand Down
1 change: 1 addition & 0 deletions vendor/hl2sdk-cs2
Submodule hl2sdk-cs2 added at 35d0a3
1 change: 1 addition & 0 deletions vendor/metamod-source
Submodule metamod-source added at 5a282e