This commit is contained in:
bash
2024-07-29 18:17:04 +00:00
parent 89a60b61e3
commit 47019a73e8
21 changed files with 343 additions and 279 deletions

View File

@@ -1,71 +1,71 @@
#!/bin/bash
ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
source ${ROOT_DIR}/variables.sh
##########################################################################################
# Apply realm settings
##########################################################################################
sudo mysql -u root --database="acore_auth" -e "UPDATE realmlist SET address = '${REALM_IP}' WHERE id = 1;"
sudo mysql -u root --database="acore_auth" -e "UPDATE realmlist SET name = '${REALM_NAME}' WHERE id = 1;"
echo "Realm settings updated..."
echo " "
##########################################################################################
# Apply ah-modbot settings
##########################################################################################
sudo mysql -u root --database="acore_world" -e "UPDATE mod_auctionhousebot SET minitems = ${AH_BOT_MIN_ITEMS}, maxitems = ${AH_BOT_MAX_ITEMS};"
echo "Module ah-modbot updated..."
echo " "
##########################################################################################
# reset playerbots data (enforces performance and bot levels balance)
##########################################################################################
sudo mysql -u root --database="acore_characters" < ${ROOT_DIR}/lib/clear-bots.sql
echo "Module playerbots updated..."
echo " "
##########################################################################################
# handle the tmux sessions
##########################################################################################
if tmux new-session -d -s $AUTHSERVER_SESSION; then
echo "Created authserver session: $AUTHSERVER_SESSION"
else
echo "Error when trying to create authserver session: $AUTHSERVER_SESSION"
fi
echo " "
if tmux new-session -d -s $WORLDSERVER_SESSION; then
echo "Created worldserver session: $WORLDSERVER_SESSION"
else
echo "Error when trying to create worldserver session: $WORLDSERVER_SESSION"
fi
echo " "
if tmux send-keys -t $AUTHSERVER_SESSION "$AUTHSERVER" C-m; then
echo "Executed \"$AUTHSERVER\" inside $AUTHSERVER_SESSION"
#echo "You can attach to $AUTHSERVER_SESSION and check the result using \"tmux attach -t $AUTHSERVER_SESSION\""
else
echo "Error when executing \"$AUTHSERVER\" inside $AUTHSERVER_SESSION"
fi
echo " "
if tmux send-keys -t $WORLDSERVER_SESSION "$WORLDSERVER" C-m; then
echo "Executed \"$WORLDSERVER\" inside $WORLDSERVER_SESSION"
#echo "You can attach to $WORLDSERVER_SESSION and check the result using \"tmux attach -t $WORLDSERVER_SESSION\""
else
echo "Error when executing \"$WORLDSERVER\" inside $WORLDSERVER_SESSION"
fi
echo " "
echo "###########################################################################################"
echo "# type in terminal: "
echo "# - 'wow' : for the worlds-server session"
echo "# - 'auth' : for the auth-server session"
echo "# - 'ctrl+b then d' : detach from session (if not working use ctrl-z)"
echo "# - 'stop' : the kill the world and auth -server sessions"
echo "# - 'update' :
echo "###########################################################################################"
#!/bin/bash
ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
source ${ROOT_DIR}/variables.sh
##########################################################################################
# Apply server realm configuration
##########################################################################################
source ${ROOT_DIR}/helper/update_realm_ip.sh ${REALM_IP}
source ${ROOT_DIR}/helper/update_realm_ip.sh ${REALM_NAME}
echo " "
##########################################################################################
# Apply ah-bot custom configuration
##########################################################################################
source ${ROOT_DIR}/helper/update_ahbot_config.sh ${AH_BOT_MIN_ITEMS} ${AH_BOT_MAX_ITEMS}
echo " "
##########################################################################################
# Clear playerbots account and characters (enforces performance and bot levels balance)
##########################################################################################
source ${ROOT_DIR}/helper/clear_playerbots.sh
echo " "
##########################################################################################
# handle the tmux sessions
##########################################################################################
if tmux new-session -d -s $AUTHSERVER_SESSION; then
echo "Created authserver session: $AUTHSERVER_SESSION"
else
echo "Error when trying to create authserver session: $AUTHSERVER_SESSION"
fi
echo " "
if tmux new-session -d -s $WORLDSERVER_SESSION; then
echo "Created worldserver session: $WORLDSERVER_SESSION"
else
echo "Error when trying to create worldserver session: $WORLDSERVER_SESSION"
fi
echo " "
if tmux send-keys -t $AUTHSERVER_SESSION "$AUTHSERVER" C-m; then
echo "Executed \"$AUTHSERVER\" inside $AUTHSERVER_SESSION"
#echo "You can attach to $AUTHSERVER_SESSION and check the result using \"tmux attach -t $AUTHSERVER_SESSION\""
else
echo "Error when executing \"$AUTHSERVER\" inside $AUTHSERVER_SESSION"
fi
echo " "
if tmux send-keys -t $WORLDSERVER_SESSION "$WORLDSERVER" C-m; then
echo "Executed \"$WORLDSERVER\" inside $WORLDSERVER_SESSION"
#echo "You can attach to $WORLDSERVER_SESSION and check the result using \"tmux attach -t $WORLDSERVER_SESSION\""
else
echo "Error when executing \"$WORLDSERVER\" inside $WORLDSERVER_SESSION"
fi
echo " "
echo "###########################################################################################"
echo "## After the above you can use the following commands:"
echo "### update - Updates source-code to latest version"
echo "### build - Builds the server based on source-code"
echo "### compile - Compiles the code based on the build server"
echo "### config - Applies the server configration"
echo "### start - starts auth and world in tmux sessions server"
echo "### stop - stops all sessions"
echo "### wow - logon world-server (tmux) session"
echo "### auth - logon auth-server (tmux) session"
echo "###########################################################################################"