mirror of
https://github.com/alterware/master-server.git
synced 2026-03-13 12:13:02 +00:00
Compare commits
36 Commits
701f4fa722
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| e400581c19 | |||
| 1cf1ea982e | |||
| 9494fa0533 | |||
|
|
12c6170e1e | ||
|
|
b24ec456d8 | ||
|
|
bdaa39f669 | ||
| 7262b067ad | |||
| c11f8e48a3 | |||
|
|
627adb00bd | ||
|
|
2f02c7da79 | ||
| 24e6f5e8f1 | |||
| 4cc556a4a0 | |||
| 3a2a48909f | |||
| 7180d3bdc1 | |||
| 884de56d34 | |||
|
|
e8403ca3ba | ||
|
|
553a7be4e5 | ||
|
|
e7f1332abd | ||
|
|
85e11071b4 | ||
|
ca0dd5f7db
|
|||
| 291f3d7e70 | |||
| 40db083087 | |||
|
|
d63df17a9b | ||
|
|
c42efd812c | ||
|
07f54e71bd
|
|||
|
3231438f20
|
|||
| fd5b0da1af | |||
| 638f83694b | |||
|
|
0feed9adaf | ||
|
|
83c16a1b8c | ||
| 2554b7fd3c | |||
|
|
3f1c3acb57 | ||
|
a96634787e
|
|||
|
bb9a13e254
|
|||
| f533f8cd4d | |||
|
|
531e1d913d |
34
.github/actions/configure-gcc/action.yml
vendored
Normal file
34
.github/actions/configure-gcc/action.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: "Configure gcc"
|
||||||
|
description: "Installs and configures gcc in a specific version on an ubuntu image"
|
||||||
|
inputs:
|
||||||
|
gcc_version:
|
||||||
|
description: "The version of gcc to install. Must be the major version only."
|
||||||
|
required: true
|
||||||
|
enable_x86:
|
||||||
|
description: "Whether to enable x86 support."
|
||||||
|
default: "false"
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install g++ and multilib
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-${{ inputs.gcc_version }} g++-${{ inputs.gcc_version }} ${ADDITIONAL_PACKAGES}
|
||||||
|
env:
|
||||||
|
ADDITIONAL_PACKAGES: ${{ case(inputs.enable_x86 == 'true', format('gcc-{0}-multilib g++-{0}-multilib', inputs.gcc_version), '') }}
|
||||||
|
|
||||||
|
- name: Configure gcc
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
function register_gcc_version {
|
||||||
|
local version=$1
|
||||||
|
local priority=$2
|
||||||
|
|
||||||
|
update-alternatives \
|
||||||
|
--verbose \
|
||||||
|
--install /usr/bin/gcc gcc /usr/bin/gcc-${version} ${priority} \
|
||||||
|
--slave /usr/bin/g++ g++ /usr/bin/g++-${version}
|
||||||
|
}
|
||||||
|
|
||||||
|
register_gcc_version ${{ inputs.gcc_version }} 100
|
||||||
15
.github/dependabot.yml
vendored
15
.github/dependabot.yml
vendored
@@ -1,7 +1,12 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: gitsubmodule
|
- package-ecosystem: gitsubmodule
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: monthly
|
||||||
open-pull-requests-limit: 10
|
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
|
||||||
|
|||||||
38
.github/workflows/build.yml
vendored
38
.github/workflows/build.yml
vendored
@@ -16,7 +16,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PREMAKE_VERSION: "5.0.0-beta6"
|
PREMAKE_VERSION: "5.0.0-beta8"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
@@ -89,17 +89,16 @@ jobs:
|
|||||||
configuration:
|
configuration:
|
||||||
- release
|
- release
|
||||||
arch:
|
arch:
|
||||||
- x86
|
|
||||||
- amd64
|
- amd64
|
||||||
steps:
|
steps:
|
||||||
- name: Install g++ and multilib
|
- name: Enable i386 architecture
|
||||||
|
if: ${{ matrix.build_arch == 'x86' }}
|
||||||
|
run: dpkg --add-architecture i386
|
||||||
|
|
||||||
|
- name: Install base packages
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y wget tar git make gcc-13 g++-13 gcc-13-multilib g++-13-multilib
|
apt-get install -y wget tar git make curl
|
||||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
|
|
||||||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
|
|
||||||
update-alternatives --set gcc /usr/bin/gcc-13
|
|
||||||
update-alternatives --set g++ /usr/bin/g++-13
|
|
||||||
|
|
||||||
- name: Check out files
|
- name: Check out files
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
@@ -108,12 +107,11 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Install dependencies (x86)
|
- name: Configure gcc
|
||||||
if: matrix.arch == 'x86'
|
uses: ./.github/actions/configure-gcc
|
||||||
run: |
|
with:
|
||||||
dpkg --add-architecture i386
|
gcc_version: 14
|
||||||
apt-get update
|
enable_x86: ${{ case(matrix.build_arch == 'x86', 'true', 'false') }}
|
||||||
apt-get install -y gcc-13-multilib g++-13-multilib
|
|
||||||
|
|
||||||
- name: Install Premake5
|
- name: Install Premake5
|
||||||
uses: diamante0018/setup-premake@master
|
uses: diamante0018/setup-premake@master
|
||||||
@@ -272,7 +270,7 @@ jobs:
|
|||||||
name: linux-amd64-release
|
name: linux-amd64-release
|
||||||
|
|
||||||
- name: Install SSH key
|
- name: Install SSH key
|
||||||
uses: shimataro/ssh-key-action@v2.7.0
|
uses: shimataro/ssh-key-action@v2.8.0
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_PRIVATE_KEY }}
|
key: ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_PRIVATE_KEY }}
|
||||||
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
|
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
|
||||||
@@ -315,19 +313,19 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
uses: docker/setup-qemu-action@v3.6.0
|
uses: docker/setup-qemu-action@v3.7.0
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.12.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v3.4.0
|
uses: docker/login-action@v3.7.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USER }}
|
username: ${{ secrets.DOCKERHUB_USER }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- id: meta
|
- id: meta
|
||||||
uses: docker/metadata-action@v5.7.0
|
uses: docker/metadata-action@v5.10.0
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
alterware/master-server
|
alterware/master-server
|
||||||
@@ -337,7 +335,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
id: build-and-push
|
id: build-and-push
|
||||||
uses: docker/build-push-action@v6.15.0
|
uses: docker/build-push-action@v6.19.2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ Run using [Docker][docker-link]
|
|||||||
docker run -p 20810:20810/udp -e AW_STATS_LOCATION=<UTF-8 C-string> alterware/master-server:latest
|
docker run -p 20810:20810/udp -e AW_STATS_LOCATION=<UTF-8 C-string> alterware/master-server:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When setting the `AW_STATS_LOCATION` environment variable, you may want the container to write stats to a file or directory on the host system. In this case, you must **mount a directory from the host** into the container and ensure it has write permissions.
|
||||||
|
|
||||||
or run as a systemd service
|
or run as a systemd service
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -38,7 +40,7 @@ WantedBy=multi-user.target
|
|||||||
- Install [Premake5][premake5-link] and add it to your system PATH
|
- Install [Premake5][premake5-link] and add it to your system PATH
|
||||||
- Clone this repository using [Git][git-link]
|
- Clone this repository using [Git][git-link]
|
||||||
- Update the submodules using ``git submodule update --init --recursive``
|
- Update the submodules using ``git submodule update --init --recursive``
|
||||||
- Run Premake with either of these two options ``premake5 vs2022`` (Windows) or ``premake5 gmake2`` (Linux/macOS)
|
- Run Premake with either of these two options ``premake5 vs2022`` (Windows) or ``premake5 gmake`` (Linux/macOS)
|
||||||
|
|
||||||
**IMPORTANT**
|
**IMPORTANT**
|
||||||
Requirements for Unix systems:
|
Requirements for Unix systems:
|
||||||
|
|||||||
2
deps/GSL
vendored
2
deps/GSL
vendored
Submodule deps/GSL updated: 3325bbd33d...756c91ab89
2
deps/libtomcrypt
vendored
2
deps/libtomcrypt
vendored
Submodule deps/libtomcrypt updated: 3905c28913...a3cc5bf623
2
deps/libtommath
vendored
2
deps/libtommath
vendored
Submodule deps/libtommath updated: e823b0c34c...839ae9ea66
4
deps/premake/libtomcrypt.lua
vendored
4
deps/premake/libtomcrypt.lua
vendored
@@ -60,10 +60,6 @@ function libtomcrypt.project()
|
|||||||
buildoptions "-mcpu=apple-m1"
|
buildoptions "-mcpu=apple-m1"
|
||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
filter { "system:macosx", "platforms:amd64" }
|
|
||||||
buildoptions "-mcpu=x86-64"
|
|
||||||
filter {}
|
|
||||||
|
|
||||||
warnings "Off"
|
warnings "Off"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
end
|
end
|
||||||
|
|||||||
2
deps/zlib
vendored
2
deps/zlib
vendored
Submodule deps/zlib updated: 5a82f71ed1...da607da739
@@ -102,7 +102,7 @@ if os.getenv("CI") then
|
|||||||
defines "CI"
|
defines "CI"
|
||||||
end
|
end
|
||||||
|
|
||||||
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"}
|
multiprocessorcompile "On"
|
||||||
|
|
||||||
filter "configurations:release"
|
filter "configurations:release"
|
||||||
optimize "Size"
|
optimize "Size"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "memory.hpp"
|
#include "memory.hpp"
|
||||||
|
#include <cstdarg>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
template <class Type, std::size_t n>
|
template <class Type, std::size_t n>
|
||||||
@@ -29,12 +30,21 @@ namespace utils::string
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
const auto res = vsnprintf(entry->buffer_, entry->size_, format, ap);
|
va_list ap_copy;
|
||||||
|
va_copy(ap_copy, ap);
|
||||||
|
|
||||||
if (res > 0) break; // Success
|
const auto res = vsnprintf(entry->buffer_, entry->size_, format, ap_copy);
|
||||||
if (res == 0) return nullptr; // Error
|
va_end(ap_copy);
|
||||||
|
|
||||||
entry->double_size();
|
if (res < 0) return nullptr; // Error
|
||||||
|
|
||||||
|
if (static_cast<std::size_t>(res) >= entry->size_)
|
||||||
|
{
|
||||||
|
entry->double_size();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break; // Success
|
||||||
}
|
}
|
||||||
|
|
||||||
return entry->buffer_;
|
return entry->buffer_;
|
||||||
|
|||||||
Reference in New Issue
Block a user