Setup a server

From Coop wiki
Jump to navigation Jump to search

The following page contains instructions about setting up a server for Windows and Linux, additionally there is also information about configuration options and common issues.

Server binaries

Stable The latest stable server binaries can be downloaded from the official website's downloads page.

Beta Beta versions generally contain newer features but might be unstable, to view the latest beta builds browse to the jobs page.

Windows

  1. Download the latest server binaries and unzip them to a folder somewhere on your machine.
  2. Double-click gtaserver.core.exe and wait for the server to start.
    You know the server started when you see in your console "Starting server main loop, ready to accept connections."
  3. Press CTRL + C to gracefully shutdown the server and browse to the created "Configuration" folder.
  4. Edit the configuration to your liking and start the server again.

Editing the configuration

  1. To change the server settings go into the "Configuration" folder, there will be a file called "serverSettings.xml".
  2. Open the file with an text editor of your choice (for e.g. Notepad or Notepad++).
  3. Change the settings to your desire, explanations for the settings are further down on the page. Make sure that the the lines look like the following:
    <Example>example</Example>
  4. Make sure you have the XML syntax right, common mistakes include:
    <Password />example <Password />example<Password> <Password />example</Password>
    But it should be as
    <Password>example</Password>
  5. Save the file and start your server again to apply the changes.

Linux

These instructions have been tested with Ubuntu on Windows (Windows Subsystem for Linux), they may differ for other distros.

Requirements

  • libunwind8 (might be missing on some distros apt-get install libunwind8)
  • unzip, wget utilities

Installation

  1. Browse to the latest server binaries page above and copy the download url, next open the terminal and type wget (download url).
  2. Unzip all files to preferred location e.g. /home/gtacoop/server.
  3. Grant the execute permission to the server executable (chmod +x gtaserver.core)
  4. Execute the server binary by typing ./gtaserver.core.
  5. Use ^C to shutdown the server again and browse to the "Configuration" folder.
  6. Edit the configuration to your liking and start the server again.

Linux.png

Configuration

serverSettings.xml This file contains all server settings e.g. server port, max clients, servername.

groups.xml This file contains all your groups and their permissions, modify this file to change or add groups.

Groups

The groups configuration will contain all groups inside the <Groups> node, every group is marked as <Group> and contains 2 inner nodes. <Name> (the name of the group) and <Permissions> (all the permissions the group has).

Permissions are prefixed by a type which is either 'command', 'permission', or 'group'.

command This will give the user permission to a command.
permission This will give the user a custom permission which can be used for example by plugins.
group This will adopt all the permissions from another group.

Server settings

Port The port the server will listen on, the port is used together with the ip address to connect to your server. (default: 4499)
MaxClients The max amount of clients (players) which can join the server. (default: 16)
GamemodeName The gamemode which will be used by the server, note this must be a valid gamemode binary else it will reset to default. (default: none)
ServerName The name of your server which will show up in the server browser.
Password The password required to connect to your server. (default: empty)
PrimaryMasterServer The 'master server' used to announce to the server browser. (it's recommended to leave this default)
AnnounceSelf Whenever the server should announce to the 'master server' to show up in the server browser. (default: true)
AllowNicknames Whenever the server allows player chosen nicknames, else defaulted to player names. (default: true)
AllowOutdatedClients If the server should allow people to connect using an outdated version of the mod. (default: false)
DebugMode Enabling this will show extra debug information for developers or testing. (default: false)
Motd The message shown to a user whenever they join the server, leaving this empty will not send anything.
UseGroups This enables the server default permission/authentication system which allows users to /register and /login and set groups (default: true)
ServerPlugins A list of all plugins the server should load from the Plugins/ folder.

<ServerPlugins>
  <string>yourplugin</string>
</ServerPlugins>

Default

<?xml version="1.0"?>
<ServerConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ServerVariables />
  <Port>4499</Port>
  <MaxClients>16</MaxClients>
  <GamemodeName>none</GamemodeName>
  <ServerName>GTACoOp Server</ServerName>
  <Password />
  <PrimaryMasterServer>https://master.gtacoop.com/</PrimaryMasterServer>
  <BackupMasterServer>http://clan-banderos.de/gta/</BackupMasterServer>
  <AnnounceSelf>true</AnnounceSelf>
  <AllowNicknames>true</AllowNicknames>
  <AllowOutdatedClients>false</AllowOutdatedClients>
  <DebugMode>false</DebugMode>
  <Motd>Welcome to this GTA CooP server!</Motd>
  <UseGroups>true</UseGroups>
  <ServerPlugins />
</ServerConfiguration>

Connecting

To have people connect to your server they need to be able to reach it somehow, by the power of the internet this can be done in multiple ways.

LAN

When all players are connected to the same network they are able to connect to the local ip address of the host, to find this open the command prompt on the host computer and type ipconfig after pressing enter look for "IPv4 Address" under your Ethernet or Wireless adapter. (note on Linux ipconfig doesn't exist try ifconfig instead)

Port forwarding

To have people being able to connect from your WAN ip you need to forward that port in your router. Note forwarding ports is different for every router manufacturer, so you will have to look up yourself where to find it in your router settings.

  1. Login to your router and browse to the 'Port forwarding' page.
  2. Open up the port set in your "serverSettings.xml" file (default: 4499), make sure you forward it to your local ip address (see LAN above) and protocol has to be UDP.
  3. Give players your WAN ip, easiest way to find this is by googling "what is my ip address".

Note if you use a setup with multiple routers or modems you need to forward it on every router until your PC.

Hamachi (or similar VPN providers)

  1. Create a network with a name and password of your choice.
  2. Your friends will have to join your network.
  3. Let your friend copy your IPv4 address they can do this by right-clicking on you and then "Copy IPv4 address".

Common issues

  • If you are get "error: libunwind.so:8: cannot open shared object file" make sure you have installed all requirements.
  • The error "System.InvalidOperationException: There is an error in XML document" indicates there's a syntax error in your server configuration, delete the files to restore the orginal.