-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
932 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
vcproj/ | ||
tests/ | ||
docs/ | ||
docker/ | ||
|
||
sonar-project.properties | ||
*.md | ||
Jenkinsfile | ||
.* | ||
gdb_debug | ||
client_assertions.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Mariadb | ||
MYSQL_DATABASE=otservbr-global | ||
MYSQL_USER=otxserver | ||
MYSQL_PASSWORD=otxserver | ||
MYSQL_ROOT_PASSWORD=root | ||
|
||
# Login | ||
LOGIN_HTTP_PORT=8080 | ||
LOGIN_GRPC_PORT=9090 | ||
MYSQL_HOST=database | ||
MYSQL_PORT=3306 | ||
MYSQL_DBNAME=otservbr-global | ||
MYSQL_USER=otxserver | ||
MYSQL_PASS=otxserver | ||
SERVER_NAME=OTServBR-Global | ||
SERVER_IP=127.0.0.1 | ||
SERVER_PORT=7172 | ||
SERVER_LOCATION=BRA | ||
RATE_LIMITER_RATE=2 | ||
RATE_LIMITER_BURST=5 | ||
|
||
# Server | ||
toggleDownloadMap=false | ||
statusProtocolPort=7171 | ||
gameProtocolPort=7172 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Getting Started with docker | ||
|
||
## - Requirements | ||
- Docker 19 and docker-compose 1.17 | ||
- Execute the script root directory /docker/data/download-myaac.sh | ||
- To use global ip change the login.py on world to use that ip and | ||
also change in config.lua.dist | ||
- Client pointing to http://<ip>:8080/login.php | ||
|
||
### Default Values (docker-compose.yml) | ||
- Ports: 7171, 7172, 80(web), 3306, 8080(login) | ||
- Database Server: database | ||
- Database Name/User/Password: otserver | ||
|
||
### - Commands | ||
To compile and start database, webserver and otserver just run | ||
``` | ||
$ docker-compose up -d | ||
``` | ||
Sometimes the server will not start due to database take too long to start | ||
so you can restart it | ||
``` | ||
docker-compose restart otserver | ||
or | ||
docker-compose stop otserver | ||
docker-compose start otserver | ||
``` | ||
|
||
To compile your changes in otserver, just stop and start | ||
``` | ||
$ docker-compose up -d --build otserver | ||
``` | ||
|
||
### - Observations | ||
- The data folder persist db and webserver data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Stage 1: Download all dependencies | ||
FROM ubuntu:23.04 AS dependencies | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends cmake git \ | ||
unzip build-essential ca-certificates curl zip unzip tar \ | ||
pkg-config ninja-build autoconf automake libtool libluajit-5.1-dev libluajit-5.1-common \ | ||
python3 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /opt | ||
COPY vcpkg.json /opt | ||
RUN vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') \ | ||
&& echo "vcpkg commit ID: $vcpkgCommitId" \ | ||
&& git clone https://github.com/Microsoft/vcpkg.git \ | ||
&& cd vcpkg \ | ||
&& git checkout $vcpkgCommitId \ | ||
&& ./bootstrap-vcpkg.sh | ||
|
||
WORKDIR /opt/vcpkg | ||
COPY vcpkg.json /opt/vcpkg/ | ||
RUN VCPKG_FORCE_SYSTEM_BINARIES=1 /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install | ||
|
||
# Stage 2: create build | ||
FROM dependencies AS build | ||
|
||
COPY . /srv/ | ||
WORKDIR /srv | ||
|
||
RUN export VCPKG_ROOT=/opt/vcpkg/ && VCPKG_FORCE_SYSTEM_BINARIES=1 cmake --preset linux-release && cmake --build --preset linux-release | ||
|
||
# Stage 3: load data and execute | ||
FROM ubuntu:23.04 | ||
|
||
VOLUME [ "/data" ] | ||
|
||
COPY --from=build /srv/build/linux-release/bin/otxserver /bin/otxserver | ||
COPY LICENSE *.sql key.pem /otxserver/ | ||
COPY data /otxserver/data | ||
COPY data-otxserver /otxserver/data-otxserver | ||
COPY data-otservbr-global /otxserver/data-otservbr-global | ||
COPY config.lua.dist /otxserver/config.lua | ||
|
||
WORKDIR /otxserver | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
mariadb-client libluajit-5.1-dev libluajit-5.1-common wget curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY docker/data/01-test_account.sql 01-test_account.sql | ||
COPY docker/data/02-test_account_players.sql 02-test_account_players.sql | ||
COPY docker/data/start.sh start.sh | ||
|
||
ENTRYPOINT ["/otxserver/start.sh"] |
Oops, something went wrong.