Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init #1

Merged
merged 9 commits into from
Sep 23, 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @/Re-HLDS/developers
62 changes: 62 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docker Image CI

on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '.vscode/**'
pull_request:
workflow_dispatch:

jobs:

build:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- steam_legacy
- public
mod:
# - valve
- cstrike
# - czero
# - dod
# - gearbox
# - tfc
# - ricochet
# - dmc

env:
needToPush: ${{ github.ref == 'refs/heads/master' }}

steps:
- uses: actions/[email protected]
- uses: docker/[email protected]

- name: Log in to Docker Hub
if: ${{ env.needToPush }}
uses: docker/[email protected]
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/[email protected]
env:
OWNER: ${{ vars.DOCKER_USERNAME }}
REPO: ${{ vars.DOCKER_REPOSITORY }}
TAG: ${{ matrix.branch }}
with:
context: .
file: ./Dockerfile
push: ${{ env.needToPush }}
tags: |
${{ env.OWNER }}/${{ env.REPO }}:${{ env.TAG }}
${{ env.TAG == 'steam_legacy' && format('{0}/{1}:latest', env.OWNER, env.REPO) || null}}
build-args: |
APPBRANCH=${{ matrix.branch }}
MOD=${{ matrix.mod }}
cache-from: type=gha,scope=build-${{ matrix.mod }}-${{ matrix.branch }}
cache-to: type=gha,mode=max,scope=build-${{ matrix.mod }}-${{ matrix.branch }}
96 changes: 96 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,windows,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,windows,visualstudiocode

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/linux,macos,windows,visualstudiocode
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build image",
"type": "docker-build",
"dockerBuild": {
"context": "${workspaceFolder}",
"tag": "testdemos:latest"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "Run container",
"command": "docker run --rm -ti testdemos:latest",
"dependsOn": [
"Build image"
]
}
],
"inputs": [
{
"type": "pickString",
"id": "betaBranch",
"default": "public",
"description": "Select DepotsDownloader branch.",
"options": [
"public",
"steam_legacy"
]
}
]
}
76 changes: 76 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
FROM debian:stable-slim AS download_hlds_windows

LABEL creator="Sergey Shorokhov <[email protected]>"

# Install required packages
RUN set -x \
&& apt-get update \
&& apt-get install -y --install-recommends \
curl \
libarchive-tools \
&& rm -rf /var/lib/apt/lists/*

# Download and install DepotDownloader
ARG DepotDownloader_URL="https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.7.1/DepotDownloader-linux-x64.zip"
RUN curl -sSL ${DepotDownloader_URL} | bsdtar -xvf - -C /usr/local/bin/ \
&& chmod +x /usr/local/bin/DepotDownloader

ENV APPDIR=/opt/hlds
WORKDIR ${APPDIR}

ARG APPID=90
ARG APPBRANCH=steam_legacy
ARG OS=windows
ARG MOD=cstrike

RUN DepotDownloader -os ${OS} -dir ${APPDIR} -app ${APPID} -beta ${APPBRANCH} -depot 1
RUN DepotDownloader -os ${OS} -dir ${APPDIR} -app ${APPID} -beta ${APPBRANCH} -depot 5
RUN DepotDownloader -os ${OS} -dir ${APPDIR} -app ${APPID} -beta ${APPBRANCH} -depot 11
RUN DepotDownloader -os ${OS} -dir ${APPDIR} -app ${APPID} -beta ${APPBRANCH} -depot 1004

SHELL ["/bin/bash", "-c"]

# Fix first run crash and STEAM Validation rejected issue
RUN cp ${APPDIR}/${MOD}/steam_appid.txt ${APPDIR} \
&& touch ${APPDIR}/${MOD}/{banned,listip}.cfg

# Remove unnecessary files
RUN rm -rf linux64 .DepotDownloader utils/ \
&& find . \
\( \
-name '*.so' -o \
-name '*64.dll' -o \
-name '*.dylib' \
\) -exec rm -rf {} \;

# Remove *.bsp
# RUN find . -name '*.bsp' \
# \( \
# -not -name 'rehlds_*' \
# -not -name 'regamedll_*' \
# -not -name 'de_dust2*' \
# -not -name 'crossfire*' \
# \) \
# -delete


FROM debian:stable-slim AS test_runner

RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y \
wine32 \
rsync \
&& rm -rf /var/lib/apt/lists/*

ENV WINEDEBUG=-all
ENV WINEDLLOVERRIDES=mshtml=

COPY --from=download_hlds_windows /opt/hlds /opt/HLDS

WORKDIR /opt/HLDS
# Add test depend files
COPY testdemos_files .

# CMD [ "./test.sh" ]
# CMD wine hlds.exe --rehlds-enable-all-hooks --rehlds-test-play "testdemos/cstrike-basic-1.bin" -game cstrike -console -port 27039 +map regamedll_test_map_v5
Binary file not shown.
40 changes: 40 additions & 0 deletions testdemos_files/deps/regamedll/cstrike/server.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Use this file to configure your DEDICATED server.
// This config file is executed on server start.

// disable autoaim
sv_aim 0

// disable clients' ability to pause the server
pausable 0

// default server name. Change to "Bob's Server", etc.
hostname "Counter-Strike 1.6 Server"

sv_minupdaterate 30
sv_maxupdaterate 101

sv_minrate 10000
sv_maxupdaterate 50000

// maximum client movement speed
sv_maxspeed 320

// 20 minute timelimit
mp_timelimit 20
mp_startmoney 16000
mp_flashlight 1

mp_autoteambalance 1
mp_limitteams 3
mp_roundtime 1.5
mp_c4timer 25
mp_friendlyfire 1

sv_cheats 0
sv_allowupload 0
sv_send_logos 0

// load ban files
exec listip.cfg
exec banned.cfg

Binary file added testdemos_files/deps/regamedll/swds.dll
Binary file not shown.
Binary file added testdemos_files/deps/rehlds/cstrike/dlls/mp.dll
Binary file not shown.
31 changes: 31 additions & 0 deletions testdemos_files/deps/rehlds/cstrike/server.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Use this file to configure your DEDICATED server.
// This config file is executed on server start.

// disable autoaim
sv_aim 0

// disable clients' ability to pause the server
pausable 0

// default server name. Change to "Bob's Server", etc.
hostname "CS Test Server [Steam]"

rcon_password "vH9.ChfusK"
sv_minupdaterate 30
sv_maxupdaterate 101

sv_minrate 10000
sv_maxupdaterate 50000

// maximum client movement speed
sv_maxspeed 320

// 20 minute timelimit
mp_timelimit 20

sv_cheats 0

// load ban files
exec listip.cfg
exec banned.cfg

Binary file added testdemos_files/hlds.exe
Binary file not shown.
Binary file added testdemos_files/swds.dll
Binary file not shown.
Loading