====== Games - Quake - Setup a local QuakeJS server - Setup a Local QuakeJS Server ======
===== Install curl =====
sudo apt install curl
----
===== Add the node.js repo =====
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
**NOTE:** Ignore the warning message.
* Quake is very old.
{{:games:quake:setup_a_local_quakejs_server:quake_-_node.js_-_depreciation_notice.png?600|}}
----
===== Install additional tools needed to setup the server =====
sudo apt install git nodejs npm
----
===== Clone the updated QuakeJS git repository =====
This includes the ioq3 repository sub-module.
Change directory to the home directory:
cd ~
**NOTE:** This is to ensure that the home directory is being used.
----
==== Clone the updated QuakeJS git repository ====
git clone --recurse-submodules https://github.com/begleysm/quakejs.git
or
==== Clone the original QuakeJS git repository ====
git clone --recurse-submodules https://github.com/inolen/quakejs.git
Move into the newly created quakejs directory:
cd quakejs
Install the necessary node.js packages:
npm install
**NOTE:** Accept the warnings about deprecated packages and vulnerabilities.
----
===== Download BASE3Q files =====
Run the server for the 1st time by executing the following command.
node build/ioq3ded.js +set fs_game baseq3 +set dedicated 1
**NOTE:** 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, the line **ignoring setsockopt command** will be shown.
* Quit by hitting **CTRL+C**.
----
===== Download additional CPMA files (Optional) =====
node build/ioq3ded.js +set fs_game cpma +set dedicated 1
**NOTE:** This will download files.
* When the download is complete, the line **ignoring setsockopt command** should be seen.
* Again hit **CTRL+C** to quit.
----
===== Edit the baseq3 server config file =====
Edit or Create **base/baseq3/server.cfg**.
seta sv_hostname "QuakeJS Server"
seta sv_maxclients 12
seta g_motd "Welcome to the Local baseq3 QuakeJS Server"
seta g_quadfactor 3
seta g_gametype 0
seta timelimit 15
seta fraglimit 25
seta g_weaponrespawn 3
seta g_inactivity 3000
seta g_forcerespawn 0
seta rconpassword "quakejs"
set d1 "map q3dm7 ; set nextmap vstr d2"
set d2 "map q3dm17 ; set nextmap vstr d1"
vstr d1
**NOTE:** Pay special attention to **seta sv_hostname**, **seta g_motd**, and especially **seta rconpassword**.
* **seta rconpassword**: Change the password if required!
----
===== Edit the cpma server config file (Optional) =====
Edit or Create **base/cpma/server.cfg**.
seta sv_hostname "QuakeJS Server"
seta sv_maxclients 12
seta g_motd "Welcome to the Local cpma QuakeJS Server"
seta g_quadfactor 3
seta g_gametype 0
seta timelimit 15
seta fraglimit 25
seta g_weaponrespawn 3
seta g_inactivity 3000
seta g_forcerespawn 0
seta rconpassword "quakejs"
set d1 "map q3dm7 ; set nextmap vstr d2"
set d2 "map q3dm17 ; set nextmap vstr d1"
vstr d1
**NOTE:** Pay special attention to **seta sv_hostname**, **seta g_motd**, and especially **seta rconpassword**.
* **seta rconpassword**: Change the password if required!
----
===== Move /root/quakejs to /home/quake =====
The quake server needs to run as a non-root user.
Therefore the quakejs directory will be placed under the **quake** user created earlier.
cp -R /root/quakejs /home/quake
----
===== Set Permissions =====
Set permissions to belong to the **quake** user created earlier.
chown -R quake:quake /home/quake/quakejs
----
===== Test =====
cd ~/quakejs
node build/ioq3ded.js +set fs_game baseq3 set dedicated 1 +exec server.cfg
**NOTE:** The final line with say something like **Hitch warning: 5584 msec frame time**.
* This is normal.
* Press **CTRL-C** to quit.
* The Content Server and Play Page is still required to be setup.
----
Continue [[Games:Quake:Setup a local QuakeJS server:Setup a Local Content Server|Setup a Local Content Server]]