diff --git a/Backup_Game_Databases_Linux_Mac.sh b/Linux_Backup_Databases.sh similarity index 100% rename from Backup_Game_Databases_Linux_Mac.sh rename to Linux_Backup_Databases.sh diff --git a/Linux_Fetch_Updates_Production.sh b/Linux_Fetch_Updates_Production.sh new file mode 100755 index 0000000..39bbf97 --- /dev/null +++ b/Linux_Fetch_Updates_Production.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +source .env + +# Check for any updates to the game server +cd Game +echo "Pulling recent updates from the Open-RSC Game repository." +echo "" +echo "" +sudo git pull +echo "" +echo "" + +echo "" +echo "" +echo "Do you need to do manual file editing for the website domain and SQL user/pass?" +echo "" +echo "${RED}1${NC} - Yes, lets begin." +echo "${RED}2${NC} - Im all set" +echo "" +echo "Which of the above do you wish to do? Type the choice number and press enter." +echo "" +echo "" +read edit + +if [ "$edit" == "1" ]; then +echo "" +echo "" +echo "(Use Ctrl + X to save each file when done editing) - Press enter when ready." +read next +sudo nano .env +sudo nano client/src/org/openrsc/client/Config.java +sudo nano Launcher/src/Main.java +sudo nano server/config/config.xml +echo "" +echo "" +echo "File edits complete. Restarting Docker containers." +echo "" +sudo make stop +sudo make start +fi + +if [ "$edit" == "2" ]; then +echo "" +echo "Moving on..." +echo "" +echo "" +fi + +#cd ../ +#touch new_md5sum.txt +#tar -cf - Game | md5sum | grep -o '^[a-zA-Z0-9]*' > new_md5sum.txt +#cd Game + +#if [ "(cat current_md5sum.txt)" == "(cat new_md5sum.txt)" ]; then +# Echo "No file changes have been detected since last run." +#else + # Compile server + echo "Compiling the game server." + echo "" + echo "" + sudo ant -f "server/build.xml" compile + echo "" + echo "" + + # Compile client + echo "Compiling the game client." + echo "" + sudo ant -f "client/build.xml" compile + echo "" + echo "" + echo "Compressing jar into zip" + echo "" + cd client + sudo zip -r "client.zip" "Open_RSC_Client.jar" + cd ../ + echo "" + echo "" + echo "Copying result to Website/downloads/" + echo "" + yes | sudo cp -rf "client/client.zip" "../Website/downloads/" + sudo rm "client/client.zip" + echo "" + echo "" + + # Compile launcher + echo "Compiling the game launcher." + echo "" + sudo ant -f "Launcher/build.xml" jar + echo "" + echo "" + echo "Copying result to Website/downloads/" + echo "" + yes | sudo cp -rf "Launcher/dist/Open_RSC_Launcher.jar" "../Website/downloads/" + echo "" + echo "" + + # Cache + echo "Copying Game/client/cache.zip to Website/downloads/" + yes | sudo cp -rf "client/cache.zip" "../Website/downloads/" + + # MD5sum client.zip and cache.zip > hashes.txt + cd ../ + sudo rm Website/downloads/hashes.txt + md5sum Website/downloads/client.zip | grep ^[a-zA-Z0-9]* | awk '{print "client="$1}' | sudo tee -a Website/downloads/hashes.txt + md5sum Website/downloads/cache.zip | grep ^[a-zA-Z0-9]* | awk '{print "cache="$1}' | sudo tee -a Website/downloads/hashes.txt + + # Replace the openrsc_config database with a fresh version + echo "" + echo "" + echo "Importing fresh openrsc_config.sql database." + echo "" + sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"$MYSQL_ROOT_USER" -p"$MYSQL_ROOT_PASSWORD" < Game/Databases/openrsc_config.sql 2>/dev/null +#fi + +# Run the game server in a detached screen +echo "" +echo "" +echo "Launching the game server in a new screen." +echo "" +echo "Type 'screen -r' to access the game server screen." +echo "Use CTRL + A + D to detach the live server screen so it runs in the background." +echo "" +echo "" +cd Game/server +screen -dmS name ./ant_launcher.sh +#cd ../../ +#touch current_md5sum.txt +#tar -cf - Game | md5sum | grep -o '^[a-zA-Z0-9]*' > current_md5sum.txt diff --git a/Setup_Linux_Mac.sh b/Linux_Installer.sh similarity index 99% rename from Setup_Linux_Mac.sh rename to Linux_Installer.sh index 99ebcfb..76609b8 100755 --- a/Setup_Linux_Mac.sh +++ b/Linux_Installer.sh @@ -565,7 +565,6 @@ elif [ "$choice" == "2" ]; then sudo nano .env sudo nano Game/client/src/org/openrsc/client/Config.java sudo nano Game/Launcher/src/Main.java - sudo nano Run_Production_Linux_Game_Server.sh sudo nano Game/server/config/config.xml echo "" echo "" diff --git a/Restore_Game_Database_Backup_Linux_Mac.sh b/Linux_Restore_Databases.sh similarity index 100% rename from Restore_Game_Database_Backup_Linux_Mac.sh rename to Linux_Restore_Databases.sh diff --git a/Linux_Run_Production_Server.sh b/Linux_Run_Production_Server.sh new file mode 100755 index 0000000..2a87136 --- /dev/null +++ b/Linux_Run_Production_Server.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Run the game server in a detached screen +echo "" +echo "" +echo "Launching the game server in a new screen." +echo "" +echo "Type 'screen -r' to access the game server screen." +echo "Use CTRL + A + D to detach the live server screen so it runs in the background." +echo "" +echo "" +cd Game/server +screen -dmS name ./ant_launcher.sh diff --git a/Start_Single_Player_Game_Linux_Mac.sh b/Linux_Single_Player.sh similarity index 95% rename from Start_Single_Player_Game_Linux_Mac.sh rename to Linux_Single_Player.sh index a151aa7..2e6b42e 100755 --- a/Start_Single_Player_Game_Linux_Mac.sh +++ b/Linux_Single_Player.sh @@ -1,5 +1,7 @@ #!/bin/bash +source .env + # Check for any updates to the game server echo "" echo "Pulling recent updates from the Open-RSC Game repository." @@ -49,7 +51,7 @@ if git diff --name-only | grep -o '[a-zA-Z0-9]*.sql' > /dev/null; then #Import fresh version of config database echo "Importing a fresh openrsc_config.sql database." echo "" - sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"root" -p"root" < Game/Databases/openrsc_config.sql 2>/dev/null + sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"$MYSQL_ROOT_USER" -p"$MYSQL_ROOT_PASSWORD" < Game/Databases/openrsc_config.sql 2>/dev/null echo "" echo "" diff --git a/Makefile b/Makefile index fa506a6..d1c8d06 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ include .env MYSQL_DUMPS_DIR=./data/db start: - docker-compose --file docker-compose.yml up --force-recreate --remove-orphans -d + docker-compose --file docker-compose.yml up -d start-single-player: docker-compose --file docker-compose-single-player.yml up -d diff --git a/Run_Production_Linux_Game_Server.sh b/Run_Production_Linux_Game_Server.sh deleted file mode 100755 index d5977dd..0000000 --- a/Run_Production_Linux_Game_Server.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -# Check for any updates to the game server -echo "Pulling recent updates from the Open-RSC Game repository." -echo "" -echo "" -sudo make pull-game -echo "" -echo "" - -# Compile the game server -echo "Compiling the game server." -echo "" -echo "" -#sudo ant -f Game/server/build.xml compile -sudo gradle -b Game/server/build.gradle compile -echo "" -echo "" - -# Client -echo "Compiling the game client." -echo "" -#sudo ant -f "Game/client/build.xml" compile -sudo gradle -b Game/client/build.gradle compile -echo "" -echo "" -echo "Compressing jar into zip" -echo "" -cd Game/client -sudo zip -r "client.zip" "Open_RSC_Client.jar" -cd ../../ -echo "" -echo "" -echo "Copying result to Website/downloads/" -echo "" -yes | sudo cp -rf "Game/client/client.zip" "Website/downloads/" -sudo rm "Game/client/client.zip" -echo "" -echo "" - -# Launcher -echo "Compiling the game launcher." -echo "" -#sudo ant -f "Game/Launcher/build.xml" jar -sudo gradle -b Game/Launcher/build.gradle jar -echo "" -echo "" -echo "Copying result to Website/downloads/" -echo "" -yes | sudo cp -rf "Game/Launcher/dist/Open_RSC_Launcher.jar" "Website/downloads/" -echo "" -echo "" - -# Cache -echo "Copying Game/client/cache.zip to Website/downloads/" -yes | sudo cp -rf "Game/client/cache.zip" "Website/downloads/" - -# MD5sum client.zip and cache.zip > hashes.txt -sudo rm Website/downloads/hashes.txt -md5sum Website/downloads/client.zip | grep ^[a-zA-Z0-9]* | awk '{print "client="$1}' | sudo tee -a Website/downloads/hashes.txt -md5sum Website/downloads/cache.zip | grep ^[a-zA-Z0-9]* | awk '{print "cache="$1}' | sudo tee -a Website/downloads/hashes.txt - -# Run the game server in a detached screen -echo "Importing fresh openrsc_config.sql database." -echo "" -sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"root" -p"root" < Game/Databases/openrsc_config.sql 2>/dev/null -echo "" -echo "" -echo "Launching the game server in a new screen." -echo "" -echo "Type 'screen -r' to access the game server screen." -echo "Use CTRL + A + D to detach the live server screen so it runs in the background." -echo "" -echo "" -screen -dmS name ./ant_launcher.sh diff --git a/Website_Certbot_HTTPS.sh b/Website_Certbot.sh similarity index 100% rename from Website_Certbot_HTTPS.sh rename to Website_Certbot.sh diff --git a/Backup_Game_Databases_Windows.cmd b/Windows_Backup_Databases.cmd similarity index 100% rename from Backup_Game_Databases_Windows.cmd rename to Windows_Backup_Databases.cmd diff --git a/Setup_Windows.cmd b/Windows_Installer.cmd similarity index 100% rename from Setup_Windows.cmd rename to Windows_Installer.cmd diff --git a/Restore_Game_Database_Backup_Windows.cmd b/Windows_Restore_Databases.cmd similarity index 100% rename from Restore_Game_Database_Backup_Windows.cmd rename to Windows_Restore_Databases.cmd diff --git a/Start_Single_Player_Game_Windows.cmd b/Windows_Single_Player.cmd similarity index 100% rename from Start_Single_Player_Game_Windows.cmd rename to Windows_Single_Player.cmd diff --git a/Stop_Game_Windows.cmd b/Windows_Stop_Game_Server.cmd similarity index 100% rename from Stop_Game_Windows.cmd rename to Windows_Stop_Game_Server.cmd diff --git a/ant_launcher.sh b/ant_launcher.sh deleted file mode 100755 index d194532..0000000 --- a/ant_launcher.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Run the game server -echo "" -echo "Running the game server. Press CTRL + C to shut it down or" -echo "CTRL + A + D to detach the screen so this continues in the background." -echo "" -echo "Console output is being saved to gameserver.log" -echo "" -cd Game/server -java -jar "Open_RSC_Server.jar" > ../../gameserver.log