боты, русификация, подключение ИИ

This commit is contained in:
2026-07-31 19:45:21 +04:00
parent 85adbe19da
commit b5c0a8a27a
118 changed files with 2928 additions and 482 deletions
+43 -1
View File
@@ -108,6 +108,16 @@ FORCE_PLAYERBOTS="${FORCE_PLAYERBOTS:-${ACORE_PLAYERBOTS_FORCE:-0}}"
: "${ACORE_PLAYERBOTS_ENABLED:=1}"
: "${ACORE_PLAYERBOTS_RUSSIAN_NAMES:=1}"
: "${ACORE_PLAYERBOTS_RANDOM_BOT_TALK:=1}"
: "${ACORE_PLAYERBOTS_AI_ENABLED:=0}"
: "${ACORE_PLAYERBOTS_AI_COMMANDS_ENABLED:=1}"
: "${ACORE_PLAYERBOTS_AI_AVAILABLE_FOR_ALL:=1}"
: "${ACORE_PLAYERBOTS_AI_BRIDGE_HOST:=playerbots-ai}"
: "${ACORE_PLAYERBOTS_AI_BRIDGE_PORT:=8080}"
: "${ACORE_PLAYERBOTS_AI_BRIDGE_PATH:=/v1/chat}"
: "${ACORE_PLAYERBOTS_AI_PLAYER_COOLDOWN_SECONDS:=8}"
: "${ACORE_PLAYERBOTS_AI_MAX_QUEUED_REQUESTS:=32}"
: "${ACORE_PLAYERBOTS_AI_MAX_REPLY_CHARACTERS:=240}"
: "${ACORE_PLAYERBOTS_AI_DEBUG:=0}"
: "${ACORE_PLAYERBOTS_RANDOM_BOT_AUTOLOGIN:=${AC_AI_PLAYERBOT_RANDOM_BOT_AUTOLOGIN:-0}}"
: "${ACORE_PLAYERBOTS_MIN_RANDOM_BOTS:=0}"
: "${ACORE_PLAYERBOTS_MAX_RANDOM_BOTS:=0}"
@@ -363,6 +373,8 @@ sync_module_dists() {
"$MODULES_ETC_DIR/mod_learnspells.conf.dist"
sync_file "$ROOT_DIR/modules/mod-playerbots/conf/playerbots.conf.dist" \
"$MODULES_ETC_DIR/playerbots.conf.dist"
sync_file "$ROOT_DIR/modules/mod-playerbots-ai/conf/mod_playerbots_ai.conf.dist" \
"$MODULES_ETC_DIR/mod_playerbots_ai.conf.dist"
sync_file "$ROOT_DIR/modules/mod-gamemodes/conf/mod_gamemodes.conf.dist" \
"$MODULES_ETC_DIR/mod_gamemodes.conf.dist"
sync_file "$ROOT_DIR/modules/mod-quest-loot-party/conf/mod-quest-loot-party.conf.dist" \
@@ -530,11 +542,19 @@ write_playerbots_conf() {
return
fi
local random_bot_talk="$ACORE_PLAYERBOTS_RANDOM_BOT_TALK"
if [[ "$ACORE_PLAYERBOTS_AI_ENABLED" == "1" ]]; then
# RandomBotTalk consumes public chat packets inside every bot and can
# send a delayed stock reply even when the legacy channel parser is
# bypassed by mod-playerbots-ai.
random_bot_talk=0
fi
write_file "$MODULES_ETC_DIR/playerbots.conf.dist" <<EOF
# Managed by ./setup-modules.sh
AiPlayerbot.Enabled = ${ACORE_PLAYERBOTS_ENABLED}
AiPlayerbot.UseRussianNames = ${ACORE_PLAYERBOTS_RUSSIAN_NAMES}
AiPlayerbot.RandomBotTalk = ${ACORE_PLAYERBOTS_RANDOM_BOT_TALK}
AiPlayerbot.RandomBotTalk = ${random_bot_talk}
AiPlayerbot.RandomBotAutologin = ${ACORE_PLAYERBOTS_RANDOM_BOT_AUTOLOGIN}
AiPlayerbot.MinRandomBots = ${ACORE_PLAYERBOTS_MIN_RANDOM_BOTS}
AiPlayerbot.MaxRandomBots = ${ACORE_PLAYERBOTS_MAX_RANDOM_BOTS}
@@ -567,6 +587,27 @@ AiPlayerbot.BotCheats = "${ACORE_PLAYERBOTS_BOT_CHEATS}"
EOF
}
write_playerbots_ai_conf() {
if [[ ! -f "$ROOT_DIR/modules/mod-playerbots-ai/conf/mod_playerbots_ai.conf.dist" ]]; then
log "skip playerbots AI: module config source not found"
return
fi
write_file "$MODULES_ETC_DIR/mod_playerbots_ai.conf.dist" <<EOF
# Managed by ./setup-modules.sh
PlayerbotsAI.Enabled = ${ACORE_PLAYERBOTS_AI_ENABLED}
PlayerbotsAI.CommandsEnabled = ${ACORE_PLAYERBOTS_AI_COMMANDS_ENABLED}
PlayerbotsAI.AvailableForAll = ${ACORE_PLAYERBOTS_AI_AVAILABLE_FOR_ALL}
PlayerbotsAI.BridgeHost = ${ACORE_PLAYERBOTS_AI_BRIDGE_HOST}
PlayerbotsAI.BridgePort = ${ACORE_PLAYERBOTS_AI_BRIDGE_PORT}
PlayerbotsAI.BridgePath = ${ACORE_PLAYERBOTS_AI_BRIDGE_PATH}
PlayerbotsAI.PlayerCooldownSeconds = ${ACORE_PLAYERBOTS_AI_PLAYER_COOLDOWN_SECONDS}
PlayerbotsAI.MaxQueuedRequests = ${ACORE_PLAYERBOTS_AI_MAX_QUEUED_REQUESTS}
PlayerbotsAI.MaxReplyCharacters = ${ACORE_PLAYERBOTS_AI_MAX_REPLY_CHARACTERS}
PlayerbotsAI.Debug = ${ACORE_PLAYERBOTS_AI_DEBUG}
EOF
}
configure_worldserver() {
ensure_world_conf
@@ -669,6 +710,7 @@ main() {
write_learnspells_conf
write_gamemodes_conf
write_playerbots_conf
write_playerbots_ai_conf
import_local_lua_module_sql
import_gamemodes_sql