Documentation - Server How To
WARNING: Before setting up a public server you should read the Multiplayer Guidelines, which governs how you may and may not use the master server. Be warned that modifications to the source code must be approved, and servers must honour the “auth” system. No if’s, but’s, or maybe’s.
More on Servers
- Server HTTPS - Enabling HTTPS and TLS certificates for your server’s Web API.
- Administration Guide - How to manage and moderate a server.
- Privilege Levels - The privileges players can have, and giving them on your own server.
- Game Filters - Limiting the modes and mutators players can vote for and the server rotates through.
System Requirements
Hosting one or more Red Eclipse servers on your system will require a decent bandwith (20-30 Kb/s down and ~10 Kb/s up per player/ bot), but use very few compute resources, such as RAM or CPU power. Therefore, no system requirements are specified, a server should run on any supported operating system. A Red Eclipse can even be run on a Raspberry Pi if so desired, though it is advisable to have a little more compute power to avoid lagspikes on player join.
Quickstart
Using the server shipped with Red Eclipse
Windows
- Copy the servinit.cfg example template from
doc\examplesto the root Red Eclipse directory (copy to the same directory asredeclipse_server.bat). - Edit these files with a text editor as appropriate, see Configuration Files for more.
- Start the server by executing
redeclipse_server.bat.
GNU/Linux
Installed
This is normally the case if you installed Red Eclipse via your package manager, or using the “system-install” make target.
- Copy the servinit.cfg example template from
/usr/share/doc/redeclipse/examples/to your homedir (~/.redeclipse/by default), using:cp /usr/share/doc/redeclipse/examples/servinit.cfg ~/.redeclipse/ - Edit these files in the homedir as appropriate.
- Start the server via:
redeclipse-server
From Unpacked Tarball
This is the case if you are running Red Eclipse directly from the unpacked release archive.
- Copy the servinit.cfg example template located in
doc/exampleseither to your homedir:cp doc/examples/servinit.cfg ~/.redeclipse/or to the root Red Eclipse directory:
cp doc/examples/servinit.cfg . - Edit these files as appropriate.
- Start the server via:
./redeclipse_server.sh
macOS
There is currently no dedicated server launcher for macOS, yet it is possible to host a non-dedicated server via running the client binary in server mode. To set this up, follow these steps:
- Create a new config file in your Red Eclipse home directory, such as
macserver.cfg.- You can add any server settings you want to this file, just like you would inside
servinit.cfg, but without thesv_prefix, and with:servertype 3This line allows the server to register with the master server, and thus show up in the master list.
- You can add any server settings you want to this file, just like you would inside
- Save this file to your Red Eclipse home directory.
- Start an offline game and run the following in the console:
exec "macserver.cfg"
If all goes well, your client will connect to the master server and register itself, and will then show up in the master list. Note that the client must remain running the whole time you want the server online.
Using Docker
Currently there are two different Docker images, it’s up to you which one you choose. For installation and configuration steps follow their respective guides:
- https://github.com/TheAssassin/redeclipse-docker
- https://hub.docker.com/r/iceflower/redeclipse-server
Configuration Files
The configuration files are written in CubeScript; lines starting with // are ignored. If you want to configure a setting, remove the // in front of it and change its value.
servinit.cfg
servinit.cfg contains the configuration settings for a Red Eclipse server. Settings defined in servinit.cfg become the server’s defaults, and using resetvars restores those defaults.
Admin Password
- The admin password can (and should!) be set using:
adminpass "yourpassword" - To claim Admin, join your server, open the console, and type:
/setpriv yourpasswordOnly give your
adminpassto people you trust and deem responsible to manage your server! They can do just about anything to your server after claiming admin!
Connection Settings
- To customize the port used by the server, uncomment the
serverportline and change the port number as desired. For example:serverport 10000 - You may also specify which address your server binds to by uncommenting the
serveripline and changing the address as desired. For example:serverip 127.0.0.1Remember these settings in case you need to configure port forwarding.
Web API
Servers also expose an HTTP/WebSocket Web API (configured via webport, webip, webpass, and TLS options in servinit.cfg). See Server HTTPS for configuring HTTPS certificates and TLS settings.
Server Visibility and Access
You can control the visibility and/or accessibility of your server to the public.
- For a private server that does not register with the master server (and therefore does not show up on the public server list), you can use:
servertype 1 - For a private server that DOES show on the public server list, but requires a password to join, simply set the serverpass variable.
serverpass "password_to_connect"Note however that this is NOT the same as adminpass, and will NOT allow those connected to claim admin.
Access Restrictions
You can change the “openness” of your server; i.e., allowing anyone to claim local moderator privileges (/setpriv 1), and/or preventing mastermode from being changed. Although usually unnecessary, these settings are convenient for public co-op editing servers. These restrictions may be modified with the sv_serveropen variable:
| Type | Description |
|---|---|
| 0 | Very open — allows any master mode (0..3), and privilege claims (/setpriv 1) are auto-approved when no moderator+ is present |
| 1 | Open only — allows only mastermode 0 (open); privilege claims (/setpriv 1) are auto-approved |
| 2 | Co-op edit friendly — allows open (0), veto (1), and locked (2) master modes, with privilege claims auto-approved |
| 3 | Default setting — allows open (0) or veto (1); privileges require an account or adminpass |
Server Customization
- For information on how to limit modes and mutators please see Game Filters
- For an example
servinit.cfgconfiguration see doc/examples/servinit.cfg - For information on server and game variables, see the server variables and the rest of the variables
Forwarding Ports
Public servers need port forwarding (and firewall rules) configured for the game ports, plus the Web API port if direct HTTP/HTTPS connections are desired.
Important: Whatever game port you choose to forward, you must also forward that port plus one (UDP). For example, with the default port 28801, forward both 28801 and 28802 UDP.
- If your server is behind a router you may need to open ports in your router’s settings.
- To open ports go to your router’s setup menu. This is usually done by opening your web browser and typing
http://192.168.1.1orhttp://192.168.0.1in the address bar. - Find the section of your router’s menu that lists connected devices and determine the internal IP address of the computer hosting the server.
- Note: if your server becomes unconnectable, check that this internal address has not changed.
- Create a port forwarding / virtual server rule opening UDP ports
28801–28802(or your chosenserverportandserverport + 1), and TCP port28888(if exposing the Web API directly), forwarding them to the server’s internal IP.
Default Ports
| Type | Port |
|---|---|
| Connections | 28801 UDP |
| Queries | 28802 UDP |
| Web API | 28888 TCP |
For more information on port forwarding, including instructions specific to your router, visit PortForward.com.
Advanced Setup
Multiple Servers
This does not apply to servers running with Docker.
To run multiple servers from the same install, create a separate directory for the second server’s configuration (for example ~/second), place a custom servinit.cfg inside it (with its own serverport and httpserverport), and pass -h$HOME/second when launching redeclipse_server.sh (or edit APP_OPTIONS="-h$HOME/second" in a copy of the launcher script). Note that each server will also automatically increment httpserverport up to httpserverportrange times if port 28888 is already in use.
Using auth to grant permissions
Red Eclipse supports a global permissions and identification system called “auth” that can be used to grant players permission to use commands on your server. In servinit.cfg, place a line such as:
addlocalop <authname> <privilege>
The <authname> is that player’s account handle (authkey). The <privilege> argument can be a, m, or s, standing for administrator, moderator, or supporter respectively. To customize which level each action requires, configure the lock variables (sv_{mode, maps, vars, vote, spec, team, kick, allow, ban, mute, limit, except, veto, edit, spawn, spawnedit, master, flood, demo, crc, iphost, overflow, teamkill, connect, message, setinfo}lock and sv_teambalancelock).