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

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

  1. Copy the servinit.cfg example template from doc\examples to the root Red Eclipse directory (copy to the same directory as redeclipse_server.bat).
  2. Edit these files with a text editor as appropriate, see Configuration Files for more.
  3. 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.

  1. 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/
    
  2. Edit these files in the homedir as appropriate.
  3. 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.

  1. Copy the servinit.cfg example template located in doc/examples either to your homedir:
    cp doc/examples/servinit.cfg ~/.redeclipse/
    

    or to the root Red Eclipse directory:

    cp doc/examples/servinit.cfg .
    
  2. Edit these files as appropriate.
  3. 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:

  1. Create a new config file in your Red Eclipse home directory, such as macserver.cfg.
    1. You can add any server settings you want to this file, just like you would inside servinit.cfg, but without the sv_ prefix, and with:
      servertype 3
      

      This line allows the server to register with the master server, and thus show up in the master list.

  2. Save this file to your Red Eclipse home directory.
  3. 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:

  1. https://github.com/TheAssassin/redeclipse-docker
  2. 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

Connection Settings

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.

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

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.

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).