From bf3e60632bd7d420b431f321e6ec5704351b04a0 Mon Sep 17 00:00:00 2001 From: Marwolf Date: Mon, 16 Jul 2018 17:34:04 -0400 Subject: [PATCH] Script cleanup --- Backup_Game_Databases_Linux_Mac.sh | 3 +++ Backup_Game_Databases_Windows.cmd | 2 ++ Clone_Game_Website_Wiki_Windows.cmd | 7 +++++ Clone_Game_Website_Windows.cmd | 5 ++++ Clone_Game_Windows.cmd | 2 ++ Delete_Local_Repos_Linux_Mac.sh | 4 +++ Delete_Local_Repos_Windows.cmd | 2 ++ Import_Databases_Linux_Mac.sh | 15 ++++++++++- Import_Databases_Windows.cmd | 10 +++++++ Restore_Game_Database_Backup_Linux_Mac.sh | 4 +++ Restore_Game_Database_Backup_Windows.cmd | 2 ++ Run_Production_Linux_Game_Server.sh | 25 +++++++++++++++-- Start_Single_Player_Game_Linux_Mac.sh | 33 ++++++++++++++++++++--- Start_Single_Player_Game_Windows.cmd | 15 +++++++++++ Stop_Game_Linux_Mac.sh | 6 +++++ Stop_Game_Windows.cmd | 4 +++ ant_launcher.sh | 14 +++------- 17 files changed, 136 insertions(+), 17 deletions(-) diff --git a/Backup_Game_Databases_Linux_Mac.sh b/Backup_Game_Databases_Linux_Mac.sh index 93caef9..59e66b9 100755 --- a/Backup_Game_Databases_Linux_Mac.sh +++ b/Backup_Game_Databases_Linux_Mac.sh @@ -1,3 +1,6 @@ #!/bin/bash +echo "Backing up all databases." +echo "" sudo make backup +echo "" diff --git a/Backup_Game_Databases_Windows.cmd b/Backup_Game_Databases_Windows.cmd index 43174b9..49aa6d2 100644 --- a/Backup_Game_Databases_Windows.cmd +++ b/Backup_Game_Databases_Windows.cmd @@ -1,5 +1,7 @@ @echo off echo: +echo Backing up all databases. +echo: Windows\make backup-windows echo: pause diff --git a/Clone_Game_Website_Wiki_Windows.cmd b/Clone_Game_Website_Wiki_Windows.cmd index 837e753..bb813cc 100644 --- a/Clone_Game_Website_Wiki_Windows.cmd +++ b/Clone_Game_Website_Wiki_Windows.cmd @@ -1,9 +1,16 @@ @echo off echo: +echo Cloning the game repository. Windows\make clone-windows-game echo: +echo: +echo Cloning the website repository. +echo: Windows\make clone-windows-website echo: +echo: +echo Cloning the wiki repository. +echo: Windows\make clone-windows-wiki echo: pause diff --git a/Clone_Game_Website_Windows.cmd b/Clone_Game_Website_Windows.cmd index 2b48aca..8858776 100644 --- a/Clone_Game_Website_Windows.cmd +++ b/Clone_Game_Website_Windows.cmd @@ -1,7 +1,12 @@ @echo off echo: +echo Cloning the game repository. +echo: Windows\make clone-windows-game echo: +echo: +echo Cloning the website repository. +echo: Windows\make clone-windows-website echo: pause diff --git a/Clone_Game_Windows.cmd b/Clone_Game_Windows.cmd index 0e33774..9215cfa 100644 --- a/Clone_Game_Windows.cmd +++ b/Clone_Game_Windows.cmd @@ -1,5 +1,7 @@ @echo off echo: +echo Cloning the game repository. +echo: Windows\make clone-windows-game echo: pause diff --git a/Delete_Local_Repos_Linux_Mac.sh b/Delete_Local_Repos_Linux_Mac.sh index fd68560..69cd819 100755 --- a/Delete_Local_Repos_Linux_Mac.sh +++ b/Delete_Local_Repos_Linux_Mac.sh @@ -1,3 +1,7 @@ #!/bin/bash +echo "" +echo "Deleting local repositories." +echo "" sudo make flush +echo "" diff --git a/Delete_Local_Repos_Windows.cmd b/Delete_Local_Repos_Windows.cmd index f3e101f..077292a 100644 --- a/Delete_Local_Repos_Windows.cmd +++ b/Delete_Local_Repos_Windows.cmd @@ -1,5 +1,7 @@ @echo off echo: +echo Deleting local repositories. +echo: Windows\make flush-windows echo: echo: diff --git a/Import_Databases_Linux_Mac.sh b/Import_Databases_Linux_Mac.sh index 4ae583c..d07add6 100755 --- a/Import_Databases_Linux_Mac.sh +++ b/Import_Databases_Linux_Mac.sh @@ -1,4 +1,17 @@ #!/bin/bash -sudo make import +echo "" +echo "Attempting to import (or overwrite) the game database." +echo "" +sudo make import-game +echo "" +echo "" +echo "Attempting to import (or overwrite) the website database." +echo "" +sudo make import-website +echo "" +echo "" +echo "Attempting to import (or overwrite) the wiki database." +echo "" sudo make import-wiki +echo "" diff --git a/Import_Databases_Windows.cmd b/Import_Databases_Windows.cmd index 5244608..33f2ced 100644 --- a/Import_Databases_Windows.cmd +++ b/Import_Databases_Windows.cmd @@ -1,7 +1,17 @@ @echo off echo: +echo Attempting to import (or overwrite) the game database. +echo: Windows\make import-windows-game +echo: +echo: +echo Attempting to import (or overwrite) the website database. +echo: Windows\make import-windows-website +echo: +echo: +echo Attempting to import (or overwrite) the wiki database. +echo: Windows\make import-windows-wiki echo: pause diff --git a/Restore_Game_Database_Backup_Linux_Mac.sh b/Restore_Game_Database_Backup_Linux_Mac.sh index 57d7283..722b794 100755 --- a/Restore_Game_Database_Backup_Linux_Mac.sh +++ b/Restore_Game_Database_Backup_Linux_Mac.sh @@ -1,3 +1,7 @@ #!/bin/bash +echo "" +echo "Restoring game databases from backup." +echo "" sudo make restore +echo "" diff --git a/Restore_Game_Database_Backup_Windows.cmd b/Restore_Game_Database_Backup_Windows.cmd index c30ef5b..a618b24 100644 --- a/Restore_Game_Database_Backup_Windows.cmd +++ b/Restore_Game_Database_Backup_Windows.cmd @@ -1,5 +1,7 @@ @echo off echo: +echo Restoring game databases from backup. +echo: Windows\make restore-windows echo: pause diff --git a/Run_Production_Linux_Game_Server.sh b/Run_Production_Linux_Game_Server.sh index 56b2253..b31d508 100644 --- a/Run_Production_Linux_Game_Server.sh +++ b/Run_Production_Linux_Game_Server.sh @@ -1,5 +1,26 @@ #!/bin/bash -echo "Launching in a new window. Type 'screen -r' to view the live server screen." -echo "Use CTRL + A + D to detach the live server screen." + +# Check for any updates to the game server +echo "Pulling recent updates from the Open-RSC Game repository." +echo "" +echo "" +sudo make pull +echo "" +echo "" + +# Compile the game server +echo "Compiling the game server." +echo "" +echo "" +sudo Ant/bin/ant -f Game/server/build.xml compile +echo "" +echo "" + +# Run the game server in a detached screen +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/Start_Single_Player_Game_Linux_Mac.sh b/Start_Single_Player_Game_Linux_Mac.sh index 6ab7bc7..13d40e6 100755 --- a/Start_Single_Player_Game_Linux_Mac.sh +++ b/Start_Single_Player_Game_Linux_Mac.sh @@ -1,12 +1,39 @@ #!/bin/bash + +# Check for any updates to the game server +echo "" +echo "Pulling recent updates from the Open-RSC Game repository." +echo "" sudo make pull +echo "" +echo "" +echo "Starting any stopped Docker containers." +echo "" +sudo make start +echo "" +echo "" -#Compile +# Compile the game server and client +echo "Compiling the game client." +echo "" sudo Ant/bin/ant -f Game/client/build.xml compile +echo "" +echo "" +echo "Compiling the game server." +echo "" sudo Ant/bin/ant -f Game/server/build.xml compile +echo "" +echo "" -#Client +# Rune the game client in a new window +echo "Launching the game client." +echo "" Ant/bin/ant -f Game/client/build.xml runclient & +echo "" +echo "" -#Server +# Run the game server in the current window +echo "Launching the game server." +echo "" Ant/bin/ant -f Game/server/build.xml runserver +echo "" diff --git a/Start_Single_Player_Game_Windows.cmd b/Start_Single_Player_Game_Windows.cmd index 2db5182..37ea4f7 100644 --- a/Start_Single_Player_Game_Windows.cmd +++ b/Start_Single_Player_Game_Windows.cmd @@ -1,20 +1,35 @@ @echo off echo: +echo Pulling recent updates from the Open-RSC Game repository. +echo: Windows\make pull echo: echo: +echo Starting any stopped Docker containers. +echo: +Windows\make start +echo: +echo: set PATH=Ant/bin echo: echo: +echo Compiling the game client. +echo: call ant -f Game/client/build.xml compile echo: echo: +echo Compiling the game server. +echo: call ant -f Game/server/build.xml compile echo: echo: +echo Starting the game client in a new window. +echo: call START "" ant -f Game/client/build.xml runclient echo: echo: +echo Starting the game server in the current window. +echo: call ant -f Game/server/build.xml runserver echo: pause diff --git a/Stop_Game_Linux_Mac.sh b/Stop_Game_Linux_Mac.sh index 040599f..4d46251 100755 --- a/Stop_Game_Linux_Mac.sh +++ b/Stop_Game_Linux_Mac.sh @@ -1,3 +1,9 @@ #!/bin/bash +echo "" +echo "Stopping the running Docker containers." +echo "" +echo "" sudo make stop +echo "" +echo "" diff --git a/Stop_Game_Windows.cmd b/Stop_Game_Windows.cmd index 410a94a..e06c26d 100644 --- a/Stop_Game_Windows.cmd +++ b/Stop_Game_Windows.cmd @@ -1,8 +1,12 @@ @echo off echo: +echo Stopping the running Docker containers. +echo: Windows\make stop echo: echo: +echo Killing any running in the background instance of the game server. +echo: tskill java /a echo: pause diff --git a/ant_launcher.sh b/ant_launcher.sh index f38172d..b84925c 100644 --- a/ant_launcher.sh +++ b/ant_launcher.sh @@ -1,17 +1,9 @@ #!/bin/bash -echo "Pulling recent updates from the Open-RSC Game repo" -sudo make pull -echo "" -echo "" -#Compile -echo "Compiling the game server" +# Run the game server echo "" -echo "" -sudo Ant/bin/ant -f Game/server/build.xml compile - -#Run game server -echo "Launching the game server" +echo "Running the game server. Press CTRL + C to shut it down or" +echo "CTRL + A + D to detached the screen so this runs in the background." echo "" echo "" Ant/bin/ant -f Game/server/build.xml runserver