Running your own server

From Open RSC
Revision as of 00:49, 17 February 2020 by Marwolf (talk | contribs) (Created page with "Obtaining a website HTTPS SSL certificate: You can buy a year of PositiveSSL HTTPS certificates for $22. Previously there was a way to use LetsEncrypt but it became a hassle w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Obtaining a website HTTPS SSL certificate: You can buy a year of PositiveSSL HTTPS certificates for $22. Previously there was a way to use LetsEncrypt but it became a hassle with too many failure lockouts that lasted a week and wasn't reliable for production use. See: https://www.namecheap.com/security/ssl-certificates/comodo/positivessl-multi-domain/

Apache Ant is used to compile the Java files.

The game client reads the contents of Cache/ip.txt and Cache/port.txt to determine what game server to connect to and fetch the configuration from.

The PC launcher always replaces the contents of the Cache folder with the official website versions that it is configured to connect to if they do not match. The PC Launcher module relies on multiple things, such as checking a file on GitLab for the launcher version, Cache folder and md5 generated text files within in the website downloads folder that a shell script is used under Deployment_Scripts to write, and will overwrite the contents of the locally downloaded Cache/ip.txt and Cache/port.txt at every launch when it checks for a md5 comparison and downloads. A better design would to not fetch the ip.txt and port.txt at all, exclude them from the md5 check, and generate them if they do not exist on PC Launcher button press instead.


The server must be running when the client is launched as the client needs to download the config from the server to configure what features it should use. Right now it does not retry if it cannot immediately connect to the game server and will crash if one is not available.

To run a single game server, simply copy a desired premade server/*.conf file, edit as desired, then rename it as local.conf. If local.conf exists, that file will always override default.conf. No edits to build.xml are needed for normal operation.

It is possible to execute multiple game servers within the same system process by editing server/build.xml ``` <target name="runserver">

       <java classname="com.openrsc.server.Server" fork="true">
           <arg value="default.conf"/>

``` with ``` <target name="runserver">

       <java classname="com.openrsc.server.Server" fork="true">
           <arg value="openrsc.conf"/>
           <arg value="rsccabbage.conf"/>

``` For some reason, ordering rsccabbage.conf before openrsc.conf results in errors from experience.