mirror of
https://github.com/alterware/master-server.git
synced 2026-03-12 03:33:03 +00:00
Compare commits
28 Commits
62be40ebcc
...
0.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | ||
| 701f4fa722 | |||
|
|
7e3aa9facc |
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
|
||||
updates:
|
||||
- package-ecosystem: gitsubmodule
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: monthly
|
||||
open-pull-requests-limit: 10
|
||||
- package-ecosystem: gitsubmodule
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: monthly
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: monthly
|
||||
|
||||
|
||||
36
.github/workflows/build.yml
vendored
36
.github/workflows/build.yml
vendored
@@ -16,7 +16,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
PREMAKE_VERSION: "5.0.0-beta6"
|
||||
PREMAKE_VERSION: "5.0.0-beta8"
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
@@ -89,17 +89,16 @@ jobs:
|
||||
configuration:
|
||||
- release
|
||||
arch:
|
||||
- x86
|
||||
- amd64
|
||||
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: |
|
||||
apt-get update
|
||||
apt-get install -y wget tar git make gcc-13 g++-13 gcc-13-multilib g++-13-multilib
|
||||
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
|
||||
apt-get install -y wget tar git make curl
|
||||
|
||||
- name: Check out files
|
||||
uses: actions/checkout@main
|
||||
@@ -108,12 +107,11 @@ jobs:
|
||||
fetch-depth: 0
|
||||
lfs: false
|
||||
|
||||
- name: Install dependencies (x86)
|
||||
if: matrix.arch == 'x86'
|
||||
run: |
|
||||
dpkg --add-architecture i386
|
||||
apt-get update
|
||||
apt-get install -y gcc-13-multilib g++-13-multilib
|
||||
- name: Configure gcc
|
||||
uses: ./.github/actions/configure-gcc
|
||||
with:
|
||||
gcc_version: 14
|
||||
enable_x86: ${{ case(matrix.build_arch == 'x86', 'true', 'false') }}
|
||||
|
||||
- name: Install Premake5
|
||||
uses: diamante0018/setup-premake@master
|
||||
@@ -315,19 +313,19 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@v3.6.0
|
||||
uses: docker/setup-qemu-action@v3.7.0
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.10.0
|
||||
uses: docker/setup-buildx-action@v3.12.0
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3.4.0
|
||||
uses: docker/login-action@v3.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- id: meta
|
||||
uses: docker/metadata-action@v5.7.0
|
||||
uses: docker/metadata-action@v5.10.0
|
||||
with:
|
||||
images: |
|
||||
alterware/master-server
|
||||
@@ -337,7 +335,7 @@ jobs:
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v6.15.0
|
||||
uses: docker/build-push-action@v6.18.0
|
||||
with:
|
||||
context: .
|
||||
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
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
```
|
||||
@@ -38,7 +40,7 @@ WantedBy=multi-user.target
|
||||
- Install [Premake5][premake5-link] and add it to your system PATH
|
||||
- Clone this repository using [Git][git-link]
|
||||
- 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**
|
||||
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: a6b9aff7aa...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"
|
||||
filter {}
|
||||
|
||||
filter { "system:macosx", "platforms:amd64" }
|
||||
buildoptions "-mcpu=x86-64"
|
||||
filter {}
|
||||
|
||||
warnings "Off"
|
||||
kind "StaticLib"
|
||||
end
|
||||
|
||||
2
deps/zlib
vendored
2
deps/zlib
vendored
Submodule deps/zlib updated: 5a82f71ed1...570720b0c2
@@ -102,7 +102,7 @@ if os.getenv("CI") then
|
||||
defines "CI"
|
||||
end
|
||||
|
||||
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"}
|
||||
multiprocessorcompile "On"
|
||||
|
||||
filter "configurations:release"
|
||||
optimize "Size"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "memory.hpp"
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
|
||||
template <class Type, std::size_t n>
|
||||
@@ -29,12 +30,21 @@ namespace utils::string
|
||||
|
||||
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
|
||||
if (res == 0) return nullptr; // Error
|
||||
const auto res = vsnprintf(entry->buffer_, entry->size_, format, ap_copy);
|
||||
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_;
|
||||
|
||||
Reference in New Issue
Block a user