diff --git a/README.md b/README.md index a28e320..443ecb7 100644 --- a/README.md +++ b/README.md @@ -48,21 +48,14 @@ docker compose up database -d ### Builder les images ```bash -./scripts//build_docker_image.sh wotlk 2 -# version / nb threads +./scripts//build_docker_image.sh 2 +# nb threads ``` > L'image builder récupère le code source de cmangos pour le compiler, c'est long aussi ☕ ### Peupler la base de données -- Lançer la base de données: -```bash -docker compose up database -``` - -> Laisser tourner et ouvrir un autre terminal - - Dans un autre terminal, lançer le script d'import des données du jeu: ```bash ./docker/run.sh init-db @@ -76,6 +69,22 @@ docker compose up database ./scripts/create_realm.sh create_realm ``` +### Créer un compte + +```bash +docker attach wow-mangosd +# Appuyer sur Enter +mangosd> +# Créer un compte +account create 3 +# Ajouter email au compte +account set email +# Ajouter un niveau admin à un compte (0= player, 3=admin realm, -1=admin all realms) +account set gmlevel -1 +``` + + + -### Inteface pour créer les comptes +### Inteface pour créer les comptes (Optionnel mais pratique) Dans le dossier `registration/` se trouve une interface pour créer des comptes et gérer les changements de mots de passe diff --git a/build_docker_images.sh b/build_docker_images.sh deleted file mode 100755 index 64dd561..0000000 --- a/build_docker_images.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -source ".env" - -# Arguments -THREADS="${1:-2}" - -# Infos git -MANGOS_SHA1=$(curl -sSL "https://api.github.com/repos/cmangos/mangos-${WOW_VERSION}/commits/master" | jq -r .sha) -DATABASE_SHA1=$(curl -sSL "https://api.github.com/repos/cmangos/${WOW_VERSION}-db/commits/master" | jq -r .sha) - -VERSION="1.0.0-$(date -u +"%Y%m%d")" -DOCKER_IMAGE="wow-server" - -# Tags pour builder -BUILDER_IMAGE_TAG="${DOCKER_IMAGE}-${WOW_VERSION}:builder" -# Tags pour runner -RUNNER_IMAGE_TAG="${DOCKER_IMAGE}-${WOW_VERSION}:runner" - -echo "==== Build de l’image BUILDER ====" -docker buildx build \ - --build-arg EXPANSION="${WOW_VERSION}" \ - --build-arg MANGOS_SHA1="${MANGOS_SHA1}" \ - --build-arg DATABASE_SHA1="${DATABASE_SHA1}" \ - --build-arg THREADS="${THREADS}" \ - --build-arg VERSION="${VERSION}" \ - --target builder \ - --tag "${BUILDER_IMAGE_TAG}" \ - --load \ - docker/ - -echo "==== Build de l’image RUNNER ====" -docker buildx build \ - --build-arg EXPANSION="${WOW_VERSION}" \ - --build-arg MANGOS_SHA1="${MANGOS_SHA1}" \ - --build-arg DATABASE_SHA1="${DATABASE_SHA1}" \ - --build-arg THREADS="${THREADS}" \ - --build-arg VERSION="${VERSION}" \ - --target runner \ - --tag "${RUNNER_IMAGE_TAG}" \ - --load \ - docker/ - -echo "==== Images construites ====" -docker images | grep "${DOCKER_IMAGE}" diff --git a/docker/run.sh b/docker/run.sh index 2c82a7a..2d25717 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -8,10 +8,9 @@ source "${BASE_DIR}/.env" readonly NAME="cmangos-builder" readonly IMAGE="wow-server-${WOW_VERSION}:builder" -readonly VERSION="latest" readonly DATA_VOLUME="./mangosd_data" -readonly NETWORK="wow" +readonly NETWORK="wow-private-server_wow" if [[ -t 0 ]] && [[ -t 1 ]] then @@ -32,4 +31,4 @@ docker run ${TTY} \ -v "${DATA_VOLUME}":/home/mangos/data \ -v "${WOW_CLIENT_DIR}":/home/mangos/wow-client \ \ - "${IMAGE}:${VERSION}" ${@} + "${IMAGE}" ${@} diff --git a/registration/application/config/config.php b/registration/application/config/config.php index b24affd..591dd94 100644 --- a/registration/application/config/config.php +++ b/registration/application/config/config.php @@ -235,20 +235,21 @@ $config['db_auth_host'] = 'database'; $config['db_auth_port'] = '3306'; $config['db_auth_user'] = 'mangos'; $config['db_auth_pass'] = 'mangos00'; -$config['db_auth_dbname'] = 'wotlkrealmd'; +$config['db_auth_dbname'] = 'wotlkrealmd'; // A CHANGER EN FONCTION DE LA VERSION DE WOW (classicrealmd,tbcrealmd ou wotlkrealmd) /*=================================================================== Your character's databases. If your server has a lot of realms you can check the example at the bottom of the file. =====================================================================*/ +// A CHANGER EN FONCTION DU REALM NAME ET DE LA VERSION DE WOW $config['realmlists'] = array( "1" => array( 'realmid' => 1, // Realm ID - 'realmname' => "gregan-wotlk", // Realm Name + 'realmname' => "gregan-wotlk", // REALM NAME 'db_host' => "database", // MySQL Host IP 'db_port' => "3306", // MySQL Host Port 'db_user' => "mangos", // MySQL username 'db_pass' => 'mangos00', // MySQL password - 'db_name' => "wotlkcharacters" // Characters database name + 'db_name' => "wotlkcharacters" // VERSION DE WOW (classicrealmd,tbcrealmd ou wotlkrealmd) ) ); diff --git a/scripts/create_realm.sh b/scripts/create_realm.sh index 1655b31..f1d103d 100755 --- a/scripts/create_realm.sh +++ b/scripts/create_realm.sh @@ -7,7 +7,7 @@ readonly BASE_DIR="$(realpath "$(dirname "${0}")/..")" source "${BASE_DIR}/.env" # Nom du conteneur Docker -CONTAINER="wow-mangosd" +CONTAINER="database" function create_realm() { local REALM_NAME="${1}"