diff --git a/builder/InstallFullDB.config b/builder/InstallFullDB.config index 8cba055..eff65e7 100644 --- a/builder/InstallFullDB.config +++ b/builder/InstallFullDB.config @@ -58,10 +58,10 @@ DEV_UPDATES="NO" ## Define if AHBot SQL updates need to be applied (by default, assume the core is built without AHBot) ## Set the variable to "YES" to import AHBot sql. -AHBOT="NO" +AHBOT="YES" ## Define if the 'src/modules/PlayerBots/sql' directory for processing development SQL files needs to be used ## Set the variable to "YES" to use the playerbots directory -PLAYERBOTS_DB="NO" +PLAYERBOTS_DB="YES" # Enjoy using the tool diff --git a/builder/run.sh b/builder/run.sh index dee8e02..9e217f2 100755 --- a/builder/run.sh +++ b/builder/run.sh @@ -7,8 +7,10 @@ readonly BASE_DIR="$(realpath "$(dirname "${0}")/..")" source "${BASE_DIR}/.env" readonly NAME="cmangos-builder" -readonly IMAGE="ghcr.io/byloth/cmangos/${WOW_VERSION}/builder" -readonly VERSION="latest" +# readonly IMAGE="ghcr.io/byloth/cmangos/${WOW_VERSION}/builder" +# readonly VERSION="latest" +readonly IMAGE="byloth/cmangos-${WOW_VERSION}/builder" +readonly VERSION="develop" readonly DATA_VOLUME="cmangos_mangosd_data" readonly NETWORK="cmangos_default" diff --git a/docker-compose.yml b/docker-compose.yml index b4e7a23..8ac1305 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,8 @@ services: - ./database:/etc/mysql/conf.d:ro mangosd: - image: "ghcr.io/byloth/cmangos/${WOW_VERSION}:latest" + # image: "ghcr.io/byloth/cmangos/${WOW_VERSION}:latest" + image: byloth/cmangos-tbc:develop depends_on: - mariadb @@ -40,7 +41,8 @@ services: - ./runner/config:/opt/mangos/conf:ro realmd: - image: "ghcr.io/byloth/cmangos/${WOW_VERSION}:latest" + # image: "ghcr.io/byloth/cmangos/${WOW_VERSION}:latest" + image: byloth/cmangos-tbc:develop depends_on: - mariadb diff --git a/runner/config/ahbot.conf b/runner/config/ahbot.conf new file mode 100644 index 0000000..e99daf9 --- /dev/null +++ b/runner/config/ahbot.conf @@ -0,0 +1,8 @@ +#################################################### +# CMaNGOS Auction House Bot - Configuration file # +#################################################### + +AhBot.Enabled = 1 + +AuctionHouseBot.Seller.Enabled = 0 +AuctionHouseBot.Buyer.Enabled = 0 diff --git a/runner/config/aiplayerbot.conf b/runner/config/aiplayerbot.conf new file mode 100644 index 0000000..10942ec --- /dev/null +++ b/runner/config/aiplayerbot.conf @@ -0,0 +1,5 @@ +############################################### +# CMaNGOS AI Playerbot - Configuration file # +############################################### + +AiPlayerbot.Enabled = 1 diff --git a/runner/config/anticheat.conf b/runner/config/anticheat.conf new file mode 100644 index 0000000..0719499 --- /dev/null +++ b/runner/config/anticheat.conf @@ -0,0 +1,12 @@ +############################################ +# CMaNGOS AntiCheat - Configuration file # +############################################ + +Enable = 0 + +Movement.SpeedHack.Enable = 0 +Movement.BadFallReset.Enable = 0 + +Antispam.Enable = 0 + +Warden.Enable = 0 diff --git a/runner/config/mangosd.conf b/runner/config/mangosd.conf index ba436c0..bea1074 100644 --- a/runner/config/mangosd.conf +++ b/runner/config/mangosd.conf @@ -1,3 +1,6 @@ +################################## +# CMaNGOS - Configuration file # +################################## ################################################################################################################### # diff --git a/runner/entrypoint.sh b/runner/entrypoint.sh index 3e05115..8131c58 100755 --- a/runner/entrypoint.sh +++ b/runner/entrypoint.sh @@ -5,7 +5,39 @@ set -e # Utils: # -function _replace_conf() +function echoerr() +{ + echo ${@} >&2 +} + +function success() +{ + echo -e "\e[32m${1}\e[0m" +} +function info() +{ + echo -e "\e[36m${1}\e[0m" +} +function warning() +{ + if [[ "${2}" == "--underline" ]] + then + echo -e "\e[4;33m${1}\e[0m" + else + echo -e "\e[33m${1}\e[0m" + fi +} +function error() +{ + if [[ "${2}" == "--underline" ]] + then + echo -e "\e[4;31m${1}\e[0m" + else + echo -e "\e[31m${1}\e[0m" + fi +} + +function replace_conf() { local SEARCH_FOR="${1}" local REPLACE_WITH="${2}" @@ -13,7 +45,7 @@ function _replace_conf() sed -i "/^${SEARCH_FOR}/c\\${SEARCH_FOR} = ${REPLACE_WITH}" "${FILENAME}" } -function _merge_confs() +function merge_confs() { local FILENAME="${1}" local CONFIG_FILE="${2}" @@ -27,7 +59,7 @@ function _merge_confs() local SEARCH_FOR="$(echo "${PROPERTY}" | cut -d '=' -f 1 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" local REPLACE_WITH="$(echo "${PROPERTY}" | cut -d '=' -f 2- | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - _replace_conf "${SEARCH_FOR}" "${REPLACE_WITH}" "${FILENAME}" + replace_conf "${SEARCH_FOR}" "${REPLACE_WITH}" "${FILENAME}" fi done < "${CONFIG_FILE}" @@ -35,35 +67,61 @@ function _merge_confs() # Sub-functions: # -function compose_mangosd_conf() +function compose_generic_conf_file() +{ + local FILENAME="${1}" + + if [[ ! -f "/opt/mangos/conf/${FILENAME}" ]] + then + return + fi + + cd "${MANGOS_DIR}/etc" + + if [[ ! -f "${FILENAME}.dist" ]] + then + echoerr "" + echoerr -e " $(error "ERROR!" --underline)" + echoerr -e " $(error "└") The file \"$(info "${FILENAME}.dist")\" you're trying to" + echoerr -e " compose the configuration from doesn't exist." + + exit 2 + fi + + cp "${FILENAME}.dist" "${FILENAME}" + + merge_confs "${FILENAME}" "/opt/mangos/conf/${FILENAME}" +} + +function compose_mangosd_conf_file() { local MANGOS_DBCONN="${MANGOS_DBHOST};${MANGOS_DBPORT};${MANGOS_DBUSER};${MANGOS_DBPASS}" cd "${MANGOS_DIR}/etc" cp mangosd.conf.dist mangosd.conf - _replace_conf "LoginDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_REALMD_DBNAME}\"" mangosd.conf - _replace_conf "WorldDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_WORLD_DBNAME}\"" mangosd.conf - _replace_conf "CharacterDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_CHARACTERS_DBNAME}\"" mangosd.conf - _replace_conf "LogsDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_LOGS_DBNAME}\"" mangosd.conf + replace_conf "LoginDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_REALMD_DBNAME}\"" mangosd.conf + replace_conf "WorldDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_WORLD_DBNAME}\"" mangosd.conf + replace_conf "CharacterDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_CHARACTERS_DBNAME}\"" mangosd.conf + replace_conf "LogsDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_LOGS_DBNAME}\"" mangosd.conf if [[ -f "/opt/mangos/conf/mangosd.conf" ]] then - _merge_confs mangosd.conf "/opt/mangos/conf/mangosd.conf" + merge_confs mangosd.conf "/opt/mangos/conf/mangosd.conf" fi } -function compose_realmd_conf() +function compose_realmd_conf_file() { local MANGOS_DBCONN="${MANGOS_DBHOST};${MANGOS_DBPORT};${MANGOS_DBUSER};${MANGOS_DBPASS}" cd "${MANGOS_DIR}/etc" cp realmd.conf.dist realmd.conf - _replace_conf "LoginDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_REALMD_DBNAME}\"" realmd.conf + replace_conf "LoginDatabaseInfo" "\"${MANGOS_DBCONN};${MANGOS_REALMD_DBNAME}\"" realmd.conf if [[ -f "/opt/mangos/conf/realmd.conf" ]] then - _merge_confs realmd.conf "/opt/mangos/conf/realmd.conf" + merge_confs realmd.conf "/opt/mangos/conf/realmd.conf" fi } @@ -86,8 +144,12 @@ function init_runner() { set_timezone - compose_mangosd_conf - compose_realmd_conf + compose_mangosd_conf_file + compose_realmd_conf_file + + compose_generic_conf_file "ahbot.conf" + compose_generic_conf_file "aiplayerbot.conf" + compose_generic_conf_file "anticheat.conf" } function run_mangosd() diff --git a/runner/run.sh b/runner/run.sh index 7976b65..05673c3 100755 --- a/runner/run.sh +++ b/runner/run.sh @@ -7,8 +7,10 @@ readonly BASE_DIR="$(realpath "$(dirname "${0}")/..")" source "${BASE_DIR}/.env" readonly NAME="cmangos-runner" -readonly IMAGE="ghcr.io/byloth/cmangos/${WOW_VERSION}" -readonly VERSION="latest" +# readonly IMAGE="ghcr.io/byloth/cmangos/${WOW_VERSION}" +# readonly VERSION="latest" +readonly IMAGE="byloth/cmangos-${WOW_VERSION}" +readonly VERSION="develop" readonly DATA_VOLUME="cmangos_mangosd_data" readonly NETWORK="cmangos_default"