Changes

Jump to: navigation, search
no edit summary
Below I'm going to break it down step by step
'''<pre style="color: orange">NOTE: There are 2 version of this guide below. The "Simpler Method" uses my forked quakejs repo which includes all of the necessary file modifications already done. The "Original Method" shows how to get eveything setup starting with Inolen's original quakejs QuakeJS repo</pre>'''
'''<pre style="color: red">NOTE: This guide assumes your local server's hostname is "quakejs"</pre>'''
 
=The Simpler Method=
The instructions below show you have to setup a Local QuakeJS server using my updated [https://github.com/begleysm/quakejs forked repo]. This will save you time because I've aleady created and modified all the files you'd need to do if using Inolen's [https://github.com/inolen/quakejs original repo]. If you'd prefer to work from Inolen's original repo and make all of the file modifications yourself jump to [[The Original Method]]
 
==Prepare your Machine==
#Make sure our system is up to date before we start by running <pre>sudo apt update</pre> and <pre>sudo apt upgrade</pre>
#Create a dedicated user to run our server with <pre>sudo adduser quake</pre>
#Temporarily give quake sudo access to make setup easier (we'll remove it later) by running <pre>sudo usermod -aG sudo quake</pre>
#Switch to our new '''quake''' user and start in his home directory by running <pre>su - quake</pre>
 
==Setup a Local QuakeJS Server==
#Install curl by running <pre>sudo apt install curl</pre>
#Add the repo for [https://nodejs.org/en/ node.js] by running <pre>curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -</pre>
#Install the tools we need to setup our server by running <pre>sudo apt install git nodejs</pre>
#Make sure we're in our home directory by running <pre>cd ~</pre>
#Clone my updated QuakeJS git repository (along with the ioq3 repository sub-module) by running <pre>git clone --recurse-submodules https://github.com/begleysm/quakejs.git</pre>
#Move into the newly created ''quakejs'' directory by running <pre>cd quakejs</pre>
#Install the necessary node.js packages by running <pre>npm install</pre> You'll see some warnings about deprecated packages and vulnerabilities. You'll have to just accept it and move on. QuakeJS is from 2013/2014.
#To download BASE3Q files, run the server for the 1st time by executing the following command. Hold down '''enter''' to get through the EULA, agree to the EULA by hitting '''y''' and game files will be downloaded. Once all files have been downloaded (you'll see the line '''ignoring setsockopt command''') quit the server by hitting '''Ctrl+C'''<pre>node build/ioq3ded.js +set fs_game baseq3 +set dedicated 1</pre>
#Optionally run the following command to download additional CPMA files. Again hit '''Ctrl+C''' to quit the server once all files have been downloaded (you'll see the line '''ignoring setsockopt command''') <pre>node build/ioq3ded.js +set fs_game cpma +set dedicated 1</pre>
#Edit the baseq3 server config file by running the following command <pre>nano base/baseq3/server.cfg</pre> Pay special attention to '''seta sv_hostname''', '''seta g_motd''', and especially '''seta rconpassword'''
#Optionally edit the cpma server config file by running the following command <pre>nano base/cpma/server.cfg</pre> Pay special attention to '''seta sv_hostname''', '''seta g_motd''', and especially '''seta rconpassword'''
#You can test (or run) your server with the following command, but the isn't much point until we setup the Content Server and Play Page. <pre>node build/ioq3ded.js +set fs_game baseq3 set dedicated 1 +exec server.cfg</pre>
 
==Setup a Local Content Server==
#Setup a webserver to host our content and install jq to help with downloading assets by running <pre>sudo apt install apache2 jq</pre>
#change directories to where our web files are hosted by running <pre>cd /var/www/html/</pre>
#Delete the default index.html that comes with Apache2 by running <pre>sudo rm /var/www/html/index.html</pre>
#Copy the Local Content Server and Play Page files from the ''quakejs'' folder to ''/var/www/html'' by running <pre>sudo cp /home/quake/quakejs/html/* /var/www/html/</pre>
#Run the ''get_assets.sh'' to grab all of the assets from http://content.quakejs.com and put them where they can be accessed by clients. (Technically you already downloaded a couple of the files earlier but they aren't named quite right and we'll download everything from the "official" content server in one go to simplify things). <pre>sudo bash /var/www/html/get_assets.sh</pre> This will put all of the asset files where they need to go in ''/var/www/html/assets''.
 
==Setup a Local Play Page==
#If you didn't already install Apache2 for the content server, do it now by running <pre>sudo apt install apache2</pre>
#If you didn't already do it, delete the default index.html that comes with Apache2 by running <pre>sudo rm /var/www/html/index.html</pre>
#If you didn't already do it, copy the Local Content Server and Play Page files from the ''quakejs'' folder to ''/var/www/html'' by running <pre>sudo cp /home/quake/quakejs/html/* /var/www/html/</pre>
 
At this point you can visit http://quakejs/ and it will download a couple files to your browser from your local content server and connect to your server (if it is running, which it isn't if you're following this guide).
 
Run the server manually by running <pre>cd /home/quake/quakejs&#10;node build/ioq3ded.js +set fs_game baseq3 set dedicated 1 +exec server.cfg</pre> or finish off this guide to create a service that you can start with <pre>sudo systemctl start quakejs</pre> and that will auto start on boot.
 
==Finalize the Setup==
#Configure Debian to autorun our server on boot
##Install ''[http://software.clapper.org/daemonize/ daemonize]'' (for use in our init.d script) by running <pre>sudo apt install daemonize</pre>
##Copy the service script to where it goes by running <pre>cp /home/quake/quakejs/init.d/quakejs /etc/init.d/quakejs</pre>
##Enable it by running <pre>sudo update-rc.d quakejs defaults</pre>
##You can test this by running <pre>sudo systemctl start quakejs</pre> and/or rebooting your machine by running <pre>sudo reboot</pre>
#Lastly we need to remove ''sudo'' privileges from user ''quake''
##Get back to our original sudo user (not ''quake'') by running the following command which undoes ''su - quake'' <pre>exit</pre>
##Remove ''quake'' from the ''sudo'' group by running <pre>sudo gpasswd -d quake sudo</pre>
 
That's it! Whenever your ''quakejs'' server boots up it will automatically start the ''quakejs'' game server and Apache2 webserver. When a computer on your LAN visits http://quakejs/ they'll automatically download the files they need from http://quakejs/assets/ and then connect to the QuakeJS server at quakejs:27960.
 
Get a few friends together, have them point their browsers to http://quakejs/ and start fragging!
 
=The Orginal Method=
The instructions below show you have to setup a Local QuakeJS server using Inolen's Original [https://github.com/inolen/quakejs QuakeJS repo]. You'll have to make a few modifications to some files in order to get it running locally. If you'd like to download the project from my [https://github.com/begleysm/quakejs forked repo] instead, with the modifications already having been done for you, then jump to [[The Simpler Method]].
==Prepare your Machine==
#change directories to where our web files are hosted by running <pre>cd /var/www/html/</pre>
#Download a script that I wrote to simplify getting the assets from http://content.quakejs.com by Running <pre>sudo wget https://steamforge.net/files/quakejs/get_assets.sh</pre>
#Make the script executable by running <pre>sudo chmod +x /var/www/html/get_assets.sh</pre>#Run the script to grab all of the assets from http://content.quakejs.com and put them where they can be accessed by clients. (Technically you already downloaded a couple of the files earlier but they aren't named quite right and we'll download everything from the "official" content server in one go to simplify things). <pre>sudo bash /var/www/html/get_assets.sh</pre> This will put all of the asset files where they need to go in ''/var/ww/html/assets''.#Optionally remove get_assets.sh by running <pre>sudo rm /var/www/html/get_assets.sh</pre>
==Setup a Local Play Page==

Navigation menu