Skip to content

Commit

Permalink
feat: add how to change conf and add a second realm
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehonal committed Nov 7, 2022
1 parent 00a29ec commit 0b0d261
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
!/var/shared
/var/shared/*
!/var/shared/.gitkeep
/conf/*
!/conf/dist

/.env

Expand Down
69 changes: 65 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ The list of GM commands is available [here](https://www.azerothcore.org/wiki/GM-

Do you need a **game client**? check [this page](https://www.azerothcore.org/wiki/client-setup)!


**IMPORTANT** to read the list of all the containers you can attach to, run the `docker ps` command.

## Ask for support

If you need support about the docker installation, use one of the following channels:
Expand Down Expand Up @@ -175,7 +178,65 @@ the AzerothCore project, you can extend this docker by adding external and share

### How to create a second multirealm environment

Check the /conf/dist folder that contains an override file ready to be used to implement a secondary worldserver
Check the /conf/dist folder that contains an override file ready to be used to implement a secondary worldserver. Just copy-paste this file in the same folder of the `docker-compose.yml`

You also need to create a `worldserver2.conf` file under the `conf/` folder. You can do that by running this command:

```docker compose cp ac-worldserver:/azerothcore/env/dist/etc/worldserver.conf conf```

Create the following configurations inside the worldserver2.conf:

```
RealmID = 2
LoginDatabaseInfo = "ac-database;3306;root;password;acore_auth"
WorldDatabaseInfo = "ac-database;3306;root;password;acore_world2"
CharacterDatabaseInfo = "ac-database;3306;root;password;acore_characters2"
```

Finally you need to access your database and change the ```acore_auth.realmlist``` table by adding a second realm with the port ```8086```

Now you can restart your containers by running:

```
docker compose down
docker compose up
```

### Changing your server configurations

To change the `*.conf` files of your server you need to extract them from the container and then create a volume to re-inject the modified file
into the container again.

To do this you can use these commands to copy the files from the container to your conf folder:

```
docker compose cp ac-worldserver:/azerothcore/env/dist/etc/authserver.conf conf
docker compose cp ac-worldserver:/azerothcore/env/dist/etc/worldserver.conf conf
docker compose cp ac-worldserver:/azerothcore/env/dist/etc/dbimport.conf conf
```

then create a `docker-compose.override.yml` file in the same folder of the `docker-compose.yml` file
and add this configurations:

```
version: '3.9'
services:
ac-worldserver:
volumes:
- ./conf/worldserver.conf:/azerothcore/env/dist/etc/worldserver.conf
- ./conf/authserver.conf:/azerothcore/env/dist/etc/authserver.conf
- ./conf/dbimport.conf:/azerothcore/env/dist/etc/dbimport.conf
```

In this way you can inject the 3 extracted files from your host into the container

Now you can change the configurations as you wish and restart the server.

You can find the list of all the configurations available in these files:

1. worldserver.conf: https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/apps/worldserver/worldserver.conf.dist
2. authserver.conf: https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/apps/authserver/authserver.conf.dist

### Customize your server with the database

Expand Down Expand Up @@ -213,10 +274,10 @@ Inside our **docker compose.yml** there's the **ac-eluna-ts-dev** service which

Within your **.env** file set this variable: **DOCKER_CLIENT_DATA_FOLDER=** with the **absolute path** of the "Data" folder of your game client.

Now run this command: **docker compose run --rm ac-dev-tools bash** to access the shell of the **ac-dev-tools** container. Once inside you can run the following commands:
Now run this command: **docker compose run --rm --no-deps ac-dev-tools bash** to access the shell of the **ac-dev-tools** container. Once inside you can run the following commands:

* **./maps** -> to extract dbc and maps
* **./vmap4extractor && ./vmap4assembler** -> to extract and assemble the vertical maps
* **./map_extractor** -> to extract dbc, Cameras and maps
* **./vmap4_extractor && ./vmap4_assembler** -> to extract and assemble the vertical maps
* **./mmaps_generator** -> to extract and generate the movement maps

After the extraction (it can take hours) the file will be available inside the `ac-client-data-*` volumes.
Expand Down
61 changes: 36 additions & 25 deletions conf/dist/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
version: '3.9'

x-networks: &networks
networks:
- ac-network

x-ac-shared-conf: &ac-shared-conf
<<: *networks
working_dir: /azerothcore
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
environment:
DBLIST: WORLD2
DB_WORLD_NAME: acore_world2
DB_WORLD2_CONF: "MYSQL_USER='root'; MYSQL_PASS='password'; MYSQL_HOST='ac-database'; MYSQL_PORT='3306';"
depends_on:
ac-database:
condition: service_healthy

services:
#=========================
#
# This override file contains all the configuration needed
# to setup a second realm.
# Remember to add this realm into your realmlist database.
#
#==========================

ac-worldserver-2:
<<: *ac-shared-conf
working_dir: /azerothcore
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master}
stdin_open: true
tty: true
restart: unless-stopped
Expand All @@ -28,16 +21,34 @@ services:
- ${DOCKER_SOAP_EXTERNAL_PORT:-7879}:7878
networks:
- ac-network
volumes_from:
- ac-client-data:ro
volumes:
- ./conf/worldserver2.conf:/azerothcore/env/dist/etc/worldserver.conf
- ./scripts/lua:/azerothcore/env/dist/bin/lua_scripts/scripts
- ${DOCKER_VOL_TOOLS_DBC:-ac-client-data-dbc}:/azerothcore/env/dist/data/dbc:ro
- ${DOCKER_VOL_TOOLS_MAPS:-ac-client-data-maps}:/azerothcore/env/dist/data/maps:ro
- ${DOCKER_VOL_TOOLS_VMAPS:-ac-client-data-vmaps}:/azerothcore/env/dist/data/vmaps:ro
- ${DOCKER_VOL_TOOLS_MMAPS:-ac-client-data-mmaps}:/azerothcore/env/dist/data/mmaps:ro
depends_on:
ac-database:
condition: service_healthy
ac-eluna-ts-dev:
condition: service_started
ac-client-data:
condition: service_started
ac-db-import-2:
condition: service_completed_successfully

ac-db-import-2:
<<: *ac-shared-conf
command: ./acore.sh db-assembler import-all
profiles: [db-import]
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master}
command: ./env/dist/bin/dbimport
environment:
AC_DISABLE_INTERACTIVE: "1"
volumes:
- ./conf/worldserver2.conf:/azerothcore/env/dist/etc/dbimport.conf
networks:
- ac-network
depends_on:
ac-database:
condition: service_healthy

networks:
ac-network:
ac-db-import:
condition: service_completed_successfully
5 changes: 1 addition & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ services:
<<: *ac-shared-conf
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-7.0.0-dev.0}
command: ./env/dist/bin/dbimport
tmpfs:
- /azerothcore/env/dist/temp
environment:
AC_DISABLE_INTERACTIVE: "1"
#profiles: [db-import]
Expand All @@ -125,7 +123,7 @@ services:
cap_add:
- SYS_NICE # CAP_SYS_NICE
ports:
- ${DOCKER_DB_EXTERNAL_PORT:-63306}:3306
- ${DOCKER_DB_EXTERNAL_PORT:-63300}:3306
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
Expand All @@ -148,7 +146,6 @@ services:
- ac-database # needed by the server *.conf file

ac-dev-server:
<<: *networks
tty: true
privileged: true
user: root
Expand Down

0 comments on commit 0b0d261

Please sign in to comment.