Difference between revisions of "Server"

From King Arthur's Gold Wiki
Jump to: navigation, search
m (Maqq's Server Configuration Tool)
(Configuration)
Line 66: Line 66:
  
 
==Configuration==
 
==Configuration==
 
+
'''A ''vital'' consideration for your server is whether you will allow global moderators (a.k.a. "[[guards]]"). Please read the opening posts in these threads ([http://kagforum.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-25-12-2011.1128/ In-game moderators (AKA Royal Guard)] & [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ & Public Policy]) so you can make an informed decision.'''
'''Note: Following configuration files are common in both windows and linux servers; they ''must'' be edited for your server to work.'''
+
 
+
 
+
'''Additional note: A ''vital'' consideration for your server is whether you will allow global moderators (a.k.a. "[[guards]]"). Please read the opening posts in these threads ([http://kagforum.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-25-12-2011.1128/ In-game moderators (AKA Royal Guard)] & [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ & Public Policy]) so you can make an informed decision.'''
+
  
 
<p>If you decide you don't want guards to moderate on your server, ''please ensure they are turned off'' in your dedicated_autoconfig.gm file like this:
 
<p>If you decide you don't want guards to moderate on your server, ''please ensure they are turned off'' in your dedicated_autoconfig.gm file like this:

Revision as of 00:23, 22 February 2012

This page might not be up-to-date (build Not Up-to-date).

A simple guide for hosting a KAG server on Linux and Windows. This guide will be growing gradually over time.
Currently the suggested operating system for hosting a KAG server is Linux.

Linux

In this example we use the Debian distribution. For other distributions, please modify accordingly.

To begin with you need to download the server files (linux server). You can unpack it locally (it's in "tar.gz" format so only thing you need to do is to unpack it twice, assuming you're using Windows) on your machine and upload it to your server via FTP/SFTP using programmes like "WinSCP", "FileZilla", etc.
. Otherwise, and via SSH type: wget http://kag2d.com/downloads/kag_linux.tar.gz to download from the kag2d.com website.

To decompress type: tar zxf kag_linux.tar.gz change into kag_linux directory by: cd kag_linux

Assuming you've edited all configuration files to your liking, only thing that left to do is running your server:
./KAGdedi

As you can see all the output from the server is going straight onto your screen. You can use some multiplexer e.g. "GNU Screen", "nohup", etc. I'll cover in detail how to run it later. For now you can issue the following command:
./dedicatedserver.sh > /dev/null

It will output "everything" to "nowhere". It's a temporary solution.

If you are using SSH and you want the server to keep running after you close the SSH connection use this command:
nohup dedicatedserver.sh &


How to restart the server:
If you wish to restart the server this is simple type top then find the PID then type kill <PID of the KAG service>


64bit Kernel

If you're using a 64bit kernel then you need to install additional 32-bit libraries.
apt-get install ia32-libs

If you're not sure which kernel you're running, type:
uname -m
This will either return i686 (32bit) or x86_64 (64bit).

Windows

Locate "dedicatedserver.bat" in the root directory of your KAG installation (default location: C:\KAG).

Edit the files mentioned in the following section (Configuration) (default location: C:\KAG\Base\Scripts\ etc).

Once you're done editing the configuration files to match your server's needs, double click on the batchfile (dedicatedserver.bat) to run.

Configuration

A vital consideration for your server is whether you will allow global moderators (a.k.a. "guards"). Please read the opening posts in these threads (In-game moderators (AKA Royal Guard) & The Royal Guard - FAQ & Public Policy) so you can make an informed decision.

If you decide you don't want guards to moderate on your server, please ensure they are turned off in your dedicated_autoconfig.gm file like this:

global sv_allow_globals_mods = 0

dedicated_autoconfig.gm

When you edit this file you need to take a closer look at these lines (comments are from MM himself, I've tweaked it here and there to make it more clear):

global m_width = 600; // Map generator width. Affects RAM usage.
global m_height = 250; // Map generator height. Affects RAM usage.
global m_seed = 0; // Map generator seed. Pick a random number.
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.
global g_vote_time = 60; // How long (in seconds) does the voting take place.
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.
global sv_maxplayers = 16; // Maximum number of players allowed ingame.
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.
global sv_password = ``; // Sets the server password.
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server
global sv_name = `KAG game`; // Sets the server name displayed in server browser.
global sv_info = ``; // Sets the server info displayed in server browser. If you want it multi-line simply move text to new line with enter.

dedicated_autostart.gm

LoadRules("Rules/CTF/gamemode.cfg");
LoadMapCycle( "Scripts/mapcycle.cfg" );
LoadMap( "" );

This file is very important. If you want to change rules for your server then you have to edit the first line to contain the path to the config-file which you want to use.

Just leave it like that if you want your server to automatically change the map after a match is finished. But if you want to have one map all the time instead of a nice mapcycle remove the path from "LoadMapCycle" and use "LoadMap".

mapcycle.cfg

#KAG mapcycle;
# put map generator files, png files here, or script files
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;

mapcycle = Maps/generator_ctf_mountain.cfg;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.

Generator.cfg

I use here general name for generator configuration file, you can name it however you like.
Generator uses "libnoise"-library. You can read a tutorial about how to use it here.

Maqq's Server Configuration Tool

Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:

Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).

  • In Windows, run KAGServer.exe and follow the onscreen instructions.
  • In linux, make it executable via chmod +x sconfig.py and run with ./sconfig.py . Daemonisation tools applicable to dedicatedserver.sh (screen, tmux, nohup etc) still useable with this programme
Reusing Generated Configs

These commands reuse the generated configuration files:[1]

  • If you're using linux, type this in the console:

./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm

  • If you're using windows, you should consider using the [GUI version], it lets you save the configuration into a file, but if you want to use the CLI version, type this in the command prompt:

KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm

Download Maqq's Server Config Tool