update divers bugs

This commit is contained in:
Grégory Lebreton 2025-09-21 16:19:27 +02:00
parent 89afa03472
commit 4048e212dc
5 changed files with 26 additions and 62 deletions

View File

@ -48,21 +48,14 @@ docker compose up database -d
### Builder les images ### Builder les images
```bash ```bash
./scripts//build_docker_image.sh wotlk 2 ./scripts//build_docker_image.sh 2
# version / nb threads # nb threads
``` ```
> L'image builder récupère le code source de cmangos pour le compiler, c'est long aussi ☕ > L'image builder récupère le code source de cmangos pour le compiler, c'est long aussi ☕
### Peupler la base de données ### 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: - Dans un autre terminal, lançer le script d'import des données du jeu:
```bash ```bash
./docker/run.sh init-db ./docker/run.sh init-db
@ -76,6 +69,22 @@ docker compose up database
./scripts/create_realm.sh create_realm <NOM_DU_REALM> <IP_ADRESS_SERVER> ./scripts/create_realm.sh create_realm <NOM_DU_REALM> <IP_ADRESS_SERVER>
``` ```
### Créer un compte
```bash
docker attach wow-mangosd
# Appuyer sur Enter
mangosd>
# Créer un compte
account create <nom_compte> <mot_de_passe> 3
# Ajouter email au compte
account set email <nom_compte> <email> <confirmation_email>
# Ajouter un niveau admin à un compte (0= player, 3=admin realm, -1=admin all realms)
account set gmlevel <nom_compte> <niveau> -1
```
<!-- ```bash <!-- ```bash
docker exec <wow-mangosd> docker exec <wow-mangosd>
@ -88,7 +97,7 @@ INSERT INTO realmlist (id, name, address, port, icon, realmflags, timezone, allo
> Modifier le `NOM`, l'adresse `IP` du serveur (sauf si sur la même machine que le client) et la timezone si différent de Paris --> > Modifier le `NOM`, l'adresse `IP` du serveur (sauf si sur la même machine que le client) et la timezone si différent de Paris -->
### 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 Dans le dossier `registration/` se trouve une interface pour créer des comptes et gérer les changements de mots de passe

View File

@ -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 limage 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 limage 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}"

View File

@ -8,10 +8,9 @@ source "${BASE_DIR}/.env"
readonly NAME="cmangos-builder" readonly NAME="cmangos-builder"
readonly IMAGE="wow-server-${WOW_VERSION}:builder" readonly IMAGE="wow-server-${WOW_VERSION}:builder"
readonly VERSION="latest"
readonly DATA_VOLUME="./mangosd_data" readonly DATA_VOLUME="./mangosd_data"
readonly NETWORK="wow" readonly NETWORK="wow-private-server_wow"
if [[ -t 0 ]] && [[ -t 1 ]] if [[ -t 0 ]] && [[ -t 1 ]]
then then
@ -32,4 +31,4 @@ docker run ${TTY} \
-v "${DATA_VOLUME}":/home/mangos/data \ -v "${DATA_VOLUME}":/home/mangos/data \
-v "${WOW_CLIENT_DIR}":/home/mangos/wow-client \ -v "${WOW_CLIENT_DIR}":/home/mangos/wow-client \
\ \
"${IMAGE}:${VERSION}" ${@} "${IMAGE}" ${@}

View File

@ -235,20 +235,21 @@ $config['db_auth_host'] = 'database';
$config['db_auth_port'] = '3306'; $config['db_auth_port'] = '3306';
$config['db_auth_user'] = 'mangos'; $config['db_auth_user'] = 'mangos';
$config['db_auth_pass'] = 'mangos00'; $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. Your character's databases.
If your server has a lot of realms you can check the example at the bottom of the file. 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( $config['realmlists'] = array(
"1" => array( "1" => array(
'realmid' => 1, // Realm ID 'realmid' => 1, // Realm ID
'realmname' => "gregan-wotlk", // Realm Name 'realmname' => "gregan-wotlk", // REALM NAME
'db_host' => "database", // MySQL Host IP 'db_host' => "database", // MySQL Host IP
'db_port' => "3306", // MySQL Host Port 'db_port' => "3306", // MySQL Host Port
'db_user' => "mangos", // MySQL username 'db_user' => "mangos", // MySQL username
'db_pass' => 'mangos00', // MySQL password 'db_pass' => 'mangos00', // MySQL password
'db_name' => "wotlkcharacters" // Characters database name 'db_name' => "wotlkcharacters" // VERSION DE WOW (classicrealmd,tbcrealmd ou wotlkrealmd)
) )
); );

View File

@ -7,7 +7,7 @@ readonly BASE_DIR="$(realpath "$(dirname "${0}")/..")"
source "${BASE_DIR}/.env" source "${BASE_DIR}/.env"
# Nom du conteneur Docker # Nom du conteneur Docker
CONTAINER="wow-mangosd" CONTAINER="database"
function create_realm() { function create_realm() {
local REALM_NAME="${1}" local REALM_NAME="${1}"