Removed Boost dependency, changed MySQL library to MariaDB

This commit is contained in:
2024-10-12 08:59:16 +03:00
parent 7cc9550efc
commit d4fa88b7e2
32 changed files with 117 additions and 260 deletions

View File

@ -7,14 +7,34 @@ For-profit usage of this material is certainly illegal without the proper
licensing agreements and is hereby discouraged (not legal advice). Even so, the
nature of this project is HIGHLY EXPERIMENTAL - bugs are to be expected for now.
## 1. Building and usage
### A. Use Docker to instantly bring up a server (recommended)
## 1. Usage
We aim to provide Docker images which _just work_ for your convenience.
A Docker Compose project is maintained in the [Deployment project](https://git.old-metin2.com/metin2/deploy).
Please head over there for further instructions.
### B. Build the binaries yourself (for advanced users)
## 2. Building
### A. Building Docker images
#### Building a Docker image from the repository
In order to build a local Docker image on your local architecture, just build the
provided Dockerfile in this project:
```shell
docker build -t metin2/server:test --provenance=false .
```
#### Publishing a multiplatform Docker image manually
This command is reserved only for repository maintainers in order to publish
new Docker images for public use with the Deployment project.
**WARNING:** Using WSL for building might lead to QEMU segmentation fault issues;
this can be worked around by using `binfmt` and `qemu-user-static` as described
[here](https://github.com/docker/buildx/issues/1170#issuecomment-1159350550).
```shell
docker build --push -t git.old-metin2.com/metin2/server:<IMAGE-TAG-HERE> --platform linux/amd64,linux/arm64 --provenance=false .
```
### B. Building the binaries yourself (for advanced users)
_Sadly, we're unable to provide hand-holding services. You should have some C++ development experience
going forward with this route._
@ -23,6 +43,7 @@ variety. This project is also compatible with WSL, even though WSL can be buggy
at times. FreeBSD/Windows compatibility is untested and unsupported for the
time being - there are other projects out there if that's what you want.
#### Setting up the requirements
On your Linux box, install the dependencies for `vcpkg` and the other libraries
we're going to install.
```shell
@ -39,18 +60,21 @@ Install `vcpkg` according to the [latest instructions](https://vcpkg.io/en/getti
Build and install the required libraries:
```shell
vcpkg install boost-system cryptopp effolkronium-random libmysql libevent lzo fmt spdlog argon2
vcpkg install cryptopp effolkronium-random libmariadb libevent lzo fmt spdlog argon2
```
Then, it's time to build your binaries. Your commands should look along the lines of:
#### Building the binaries
Instead of building the binaries directly from the CLI, we recommend using an IDE, since
you're probably doing some kind of development anyway. See the "Development" section for more information on that.
If you decide do build from the command line, make sure to find the right path for `vcpkg.cmake` and run the following:
```shell
mkdir build/
cd build && cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake ..
make -j $(nproc)
```
If everything goes right, you should now have compiled binaries you should just be able to use
as a drop-in replacement for your BSD binaries in your favourite serverfiles.
If everything goes right, you should now have compiled binaries in the `build/` directory.
## 2. Development
The preferred IDE in order to develop and debug the server is [CLion](https://www.jetbrains.com/clion/),
@ -103,7 +127,6 @@ This is a very serious security risk and one of the reasons this project is stil
## 5. Further plans
- Migrate `db.conf` and `game.conf` to a modern dotenv-like format, which would enable pretty nice Docker images.
- Add a health check to the Docker image.
- Use the [fmt](https://fmt.dev/latest/index.html) library for safe and modern string formatting.
- Handle kernel signals (SIGTERM, SIGHUP etc.) for gracefully shutting down the game server.
- Improve memory safety.