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/Makefile b/Makefile index aa11657..8935796 100644 --- a/Makefile +++ b/Makefile @@ -22,13 +22,22 @@ clone-wiki: clone-windows-website: @git clone https://github.com/Open-RSC/Website.git - + clone-windows-game: @git clone https://github.com/Open-RSC/Game.git - + clone-windows-wiki: @git clone https://github.com/Open-RSC/Wiki.git Website/Wiki - + +pull-game: + @cd Game && git pull + +pull-website: + @cd Website && git pull + +pull-wiki: + @cd Website/Wiki && git pull + pull-game-windows: @cd Game && git reset HEAD --hard && git pull diff --git a/README.md b/README.md index f0029e8..6359b79 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,22 @@ Choices: ___ +## Operating systems supported + +* Windows 7 x64 + +* Windows 10 x64 + +* Mac OS X High Sierra + +* Ubuntu Linux 18.04 x64 + +* Fedora Linux 28 x64 + +* CentOS 7 x64 + +___ + ## Choice 1: Download the zip, extract it, and open the "Docker-Home" folder https://github.com/Open-RSC/Docker-Home/archive/master.zip 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 old mode 100644 new mode 100755 index 56b2253..e819799 --- 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-game +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/Setup_Linux_Mac.sh b/Setup_Linux_Mac.sh index 14417e7..96a68e2 100755 --- a/Setup_Linux_Mac.sh +++ b/Setup_Linux_Mac.sh @@ -23,9 +23,10 @@ if [ "$install" == "1" ]; then echo "Which operating system are you running?" echo "" echo "${RED}1${NC} - Ubuntu Linux" - echo "${RED}2${NC} - Fedora Linux" - echo "${RED}3${NC} - Mac OS" - echo "${RED}4${NC} - Other" + echo "${RED}2${NC} - Fedora 28 Linux" + echo "${RED}3${NC} - CentOS 7 Linux" + echo "${RED}4${NC} - Mac OS High Sierra" + echo "${RED}5${NC} - Other" echo "" read os @@ -62,6 +63,11 @@ if [ "$install" == "1" ]; then fi # UBUNTU Version <=================================================== + echo "" + echo "" + echo "Verifying the basics are installed." + echo "" + sudo apt update && sudo apt install unzip git build-essential apt-transport-https ca-certificates curl software-properties-common -y echo "" echo "" echo "Do you have Docker installed?" @@ -75,7 +81,6 @@ if [ "$install" == "1" ]; then if [ "$docker" == "1" ]; then echo "Attempting to install Docker now" echo "" - sudo apt update && sudo apt install git build-essential apt-transport-https ca-certificates curl software-properties-common -y curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $vers stable" sudo apt update && sudo apt install docker-ce docker-compose -y @@ -104,10 +109,20 @@ if [ "$install" == "1" ]; then # Fedora OS ===================================================> elif [ "$os" == "2" ]; then - su -c 'yum update && yum install git' echo "" echo "" - echo "Do you have Java OpenJDK installed already?" + echo "Verifying the basics are installed." + echo "" + sudo dnf -y update && sudo dnf -y upgrade && sudo dnf -y install screen make unzip git ca-certificates curl yum-utils device-mapper-persistent-data lvm2 + echo "" + echo "" + echo "Permitting default game port 53595/tcp through the firewall." + firewall-cmd --permanent --add-port=53595/tcp + echo "" + firewall-cmd --reload + echo "" + echo "" + echo "Do you have Java OpenJDK and Apache Ant installed already?" echo "" echo "${RED}1${NC} - Install for me!" echo "${RED}2${NC} - Im all set" @@ -116,8 +131,7 @@ if [ "$install" == "1" ]; then # Fedora Java ===================================================> if [ "$java" == "1" ]; then - su -c 'yum install alternatives' - su -c '/usr/sbin/alternatives --config java' + sudo dnf -y install ant else continue fi @@ -134,18 +148,114 @@ if [ "$install" == "1" ]; then # Fedora Docker ===================================================> if [ "$docker" == "1" ]; then + echo "Removing any old versions of Docker that might confict." + echo "" + sudo dnf -y remove docker \ + docker-client \ + docker-client-latest \ + docker-common \ + docker-latest \ + docker-latest-logrotate \ + docker-logrotate \ + docker-selinux \ + docker-engine-selinux \ + docker-engine + echo "" + echo "" echo "Attempting to install Docker now" echo "" - curl -fsSL get.docker.com -o get-docker.sh - su -c 'sh get-docker.sh' + sudo dnf -y install dnf-plugins-core + sudo dnf -y config-manager \ + --add-repo \ + https://download.docker.com/linux/fedora/docker-ce.repo + sudo dnf -y install docker-ce docker-compose + sudo systemctl start docker + sudo systemctl enable docker + sudo usermod -aG docker $USER else continue fi # Fedora Docker <=================================================== # Fedora OS <=================================================== - # Mac OS ===================================================> + # CentOS 7 OS ===================================================> elif [ "$os" == "3" ]; then + echo "" + echo "" + echo "Verifying the basics are installed." + echo "" + sudo wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64//dnf-0.6.4-2.sdl7.noarch.rpm + sudo wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/dnf-conf-0.6.4-2.sdl7.noarch.rpm + sudo wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/python-dnf-0.6.4-2.sdl7.noarch.rpm + sudo yum -y install dnf-0.6.4-2.sdl7.noarch.rpm dnf-conf-0.6.4-2.sdl7.noarch.rpm python-dnf-0.6.4-2.sdl7.noarch.rpm + sudo dnf -y update && sudo dnf -y upgrade && sudo dnf -y install screen make unzip git ca-certificates curl yum-utils device-mapper-persistent-data lvm2 + sudo yum install -y python-pip + sudo pip install --upgrade pip + sudo pip install docker-compose + sudo yum upgrade python* + echo "" + echo "" + echo "Permitting default game port 53595/tcp through the firewall." + firewall-cmd --permanent --add-port=53595/tcp + echo "" + firewall-cmd --reload + echo "" + echo "" + echo "Do you have Java OpenJDK and Apache Ant installed already?" + echo "" + echo "${RED}1${NC} - Install for me!" + echo "${RED}2${NC} - Im all set" + echo "" + read java + + # CentOS 7 Java ===================================================> + if [ "$java" == "1" ]; then + sudo dnf -y install ant + else + continue + fi + # CentOS 7 Java <=================================================== + + echo "" + echo "" + echo "Do you have Docker installed?" + echo "" + echo "${RED}1${NC} - No, install it for me!" + echo "${RED}2${NC} - Yes" + echo "" + read docker + + # CentOS 7 Docker ===================================================> + if [ "$docker" == "1" ]; then + echo "Removing any old versions of Docker that might confict." + echo "" + sudo dnf -y remove docker \ + docker-client \ + docker-client-latest \ + docker-common \ + docker-latest \ + docker-latest-logrotate \ + docker-logrotate \ + docker-selinux \ + docker-engine-selinux \ + docker-engine + echo "" + echo "" + echo "Attempting to install Docker now" + echo "" + curl -fsSL https://get.docker.com/ | sh + sudo systemctl start docker + sudo systemctl enable docker + sudo usermod -aG docker $USER + sudo dnf -y install docker-compose + else + continue + fi + # CentOS 7 Docker <=================================================== + # CentOS 7 OS <=================================================== + + # Mac OS ===================================================> + elif [ "$os" == "4" ]; then clear echo "Do you have brew installed?" echo "" @@ -161,6 +271,11 @@ if [ "$install" == "1" ]; then fi # Mac Brew <=================================================== + echo "" + echo "" + echo "Verifying the basics are installed." + echo "" + brew install unzip wget git curl echo "" echo "" echo "Do you have Java OpenJDK 8 installed already?" @@ -189,7 +304,7 @@ if [ "$install" == "1" ]; then # Mac Docker ===================================================> if [ "$docker" == "1" ]; then echo "Downloading the Docker for Mac installer" - brew install wget + echo "" wget https://download.docker.com/mac/stable/Docker.dmg hdiutil attach Docker.dmg echo "" @@ -211,7 +326,7 @@ if [ "$install" == "1" ]; then # Mac OS <=================================================== # Other OS ===================================================> - elif [ "$os" == "4" ]; then + elif [ "$os" == "5" ]; then echo "" echo "You will have to install Git manually then. Press enter to continue." echo "" @@ -289,19 +404,10 @@ if [ "$choice" == "1" ]; then echo "You have picked ${GREEN}single player RSC + PHPMyAdmin!${NC}" echo "" echo "" - echo "Checking the git repos for any recent updates." - echo "" - echo "You may now be prompted for your password so the installer has sudo access." - echo "" - cd Game && sudo git reset HEAD --hard && sudo git pull - cd .. - sudo chmod -R 777 Game - echo "" - echo "" echo "Logging into Docker Hub to get the required images." echo "You may first need to register an account at ${RED}dockerhub.com${NC}" echo "" - docker login + sudo docker login echo "" echo "" echo "Starting up the Docker containers and stopping any existing ones." @@ -339,24 +445,10 @@ elif [ "$choice" == "2" ]; then echo "You have picked ${GREEN}Game + Website + PHPMyAdmin!${NC}" echo "" echo "" - echo "Checking the git repos for any recent updates." - echo "" - echo "You may now be prompted for your password so the installer has sudo access." - echo "" - cd Game && sudo git reset HEAD --hard && sudo git pull - cd .. - sudo chmod -R 777 Game - echo "" - cd Website && sudo git reset HEAD --hard && sudo git pull - cd .. - sudo chmod -R 777 Website - sudo chmod -R 644 Website/board/config.php - echo "" - echo "" echo "Logging into Docker Hub to get the required images." echo "You may first need to register an account at ${RED}dockerhub.com${NC}" echo "" - docker login + sudo docker login echo "" echo "" echo "Starting up the Docker containers and stopping any existing ones." @@ -403,28 +495,10 @@ elif [ "$choice" == "3" ]; then echo "You have picked ${GREEN}Game + Website + PHPMyAdmin + RSC Preservation Wiki!${NC}" echo "" echo "" - echo "Checking the git repos for any recent updates." - echo "" - echo "You may now be prompted for your password so the installer has sudo access." - echo "" - cd Game && git sudo reset HEAD --hard && sudo git pull - cd .. - sudo chmod -R 777 Game - echo "" - cd Website && sudo git reset HEAD --hard && sudo git pull - cd .. - sudo chmod -R 777 Website - sudo chmod -R 644 Website/board/config.php - echo "" - cd Website/Wiki && sudo git reset HEAD --hard && sudo git pull - cd .. - sudo chmod -R 777 Website/Wiki - echo "" - echo "" echo "Logging into Docker Hub to get the required images." echo "You may first need to register an account at ${RED}dockerhub.com${NC}" echo "" - docker login + sudo docker login echo "" echo "" echo "Starting up the Docker containers and stopping any existing ones." diff --git a/Start_Single_Player_Game_Linux_Mac.sh b/Start_Single_Player_Game_Linux_Mac.sh index 6ab7bc7..3fb32ca 100755 --- a/Start_Single_Player_Game_Linux_Mac.sh +++ b/Start_Single_Player_Game_Linux_Mac.sh @@ -1,12 +1,39 @@ #!/bin/bash -sudo make pull -#Compile +# Check for any updates to the game server +echo "" +echo "Pulling recent updates from the Open-RSC Game repository." +echo "" +sudo make pull-game +echo "" +echo "" +echo "Starting any stopped Docker containers." +echo "" +sudo make start +echo "" +echo "" + +# 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..ca0d976 100644 --- a/Start_Single_Player_Game_Windows.cmd +++ b/Start_Single_Player_Game_Windows.cmd @@ -1,20 +1,35 @@ @echo off echo: -Windows\make pull +echo Pulling recent updates from the Open-RSC Game repository. +echo: +Windows\make pull-game +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 old mode 100644 new mode 100755 index f38172d..b84925c --- 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