<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.kag2d.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.kag2d.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=EchoLynx</id>
		<title>King Arthur's Gold Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.kag2d.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=EchoLynx"/>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Special:Contributions/EchoLynx"/>
		<updated>2026-04-14T19:05:47Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.14</generator>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T19:22:44Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Fixed Numbering Error&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server isn't designed to work on computers without an Internet connection. It is, however, [http://kagforum.com/index.php?threads/lan-no-internet-server.4135/ still possible] to run it without one.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=2&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*In linux, make it executable via &amp;lt;code&amp;gt;chmod +x sconfig.py&amp;lt;/code&amp;gt; and run with  &amp;lt;code&amp;gt;./sconfig.py&amp;lt;/code&amp;gt; . Daemonisation tools applicable to dedicatedserver.sh (''screen, tmux, nohup'' etc) still useable with this program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
&amp;lt;pre&amp;gt;./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
&amp;lt;pre&amp;gt;KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==Daily Server Restarts==&lt;br /&gt;
&amp;lt;p&amp;gt;If a KAG server is running in a keepalive script, a scheduled task/cronjob that kills the server once a day is, effectively, a daily restart because the keepalive script will automatically restart the server.&amp;lt;/p&amp;gt;&lt;br /&gt;
===For Linux - Cronjob===&lt;br /&gt;
&amp;lt;p&amp;gt;This script will kill all instances of KAGdedi at 3 AM.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# Use &amp;lt;code&amp;gt;crontab -e&amp;lt;/code&amp;gt; to create a new cronjob. This will open your default text editor.&lt;br /&gt;
# In the text editor, type:&amp;lt;pre&amp;gt;0 3 * * * pkill -1 KAGdedi&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Close editor. Cronjob installed!&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T19:15:14Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Added section on daily server restarts and creating a cronjob.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server isn't designed to work on computers without an Internet connection. It is, however, [http://kagforum.com/index.php?threads/lan-no-internet-server.4135/ still possible] to run it without one.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=2&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*In linux, make it executable via &amp;lt;code&amp;gt;chmod +x sconfig.py&amp;lt;/code&amp;gt; and run with  &amp;lt;code&amp;gt;./sconfig.py&amp;lt;/code&amp;gt; . Daemonisation tools applicable to dedicatedserver.sh (''screen, tmux, nohup'' etc) still useable with this program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
&amp;lt;pre&amp;gt;./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
&amp;lt;pre&amp;gt;KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==Daily Server Restarts==&lt;br /&gt;
&amp;lt;p&amp;gt;If a KAG server is running in a keepalive script, a scheduled task/cronjob that kills the server once a day is, effectively, a daily restart because the keepalive script will automatically restart the server.&amp;lt;/p&amp;gt;&lt;br /&gt;
===For Linux - Cronjob===&lt;br /&gt;
&amp;lt;p&amp;gt;This script will kill all instances of KAGdedi at 3 AM.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# Use &amp;lt;code&amp;gt;crontab -e&amp;lt;/code&amp;gt; to create a new cronjob. This will open your default text editor.&lt;br /&gt;
# In the text editor, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;0 3 * * * pkill -1 KAGdedi&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Close editor. Cronjob installed!&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:57:11Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Added note about internet connection requirement.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server isn't designed to work on computers without an Internet connection. It is, however, [http://kagforum.com/index.php?threads/lan-no-internet-server.4135/ still possible] to run it without one.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=2&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*In linux, make it executable via &amp;lt;code&amp;gt;chmod +x sconfig.py&amp;lt;/code&amp;gt; and run with  &amp;lt;code&amp;gt;./sconfig.py&amp;lt;/code&amp;gt; . Daemonisation tools applicable to dedicatedserver.sh (''screen, tmux, nohup'' etc) still useable with this program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
&amp;lt;pre&amp;gt;./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
&amp;lt;pre&amp;gt;KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:52:38Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Changed text style for consistency.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=2&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*In linux, make it executable via &amp;lt;code&amp;gt;chmod +x sconfig.py&amp;lt;/code&amp;gt; and run with  &amp;lt;code&amp;gt;./sconfig.py&amp;lt;/code&amp;gt; . Daemonisation tools applicable to dedicatedserver.sh (''screen, tmux, nohup'' etc) still useable with this program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
&amp;lt;pre&amp;gt;./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
&amp;lt;pre&amp;gt;KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:51:47Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Changed text formatting for consistency.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=2&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
&amp;lt;pre&amp;gt;./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
&amp;lt;pre&amp;gt;KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:50:08Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Added Semicolon, Reduced Font Size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=2&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:48:42Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Reduced Font Size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:48:18Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Reduced Font Size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:47:31Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Reduced Font Size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:34:51Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Fixed &amp;lt;br /&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.)&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:34:20Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Closed Parenthesis&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;)&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T18:33:49Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Finished Managing Instability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
&amp;lt;p&amp;gt;As Alpha software frequently is, the KAG server is very unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice run the server in a keepalive script, which will restart it whenever it crashes. (In addition, many people restart their server once a day, during the hours of least usage, to help decrease the risk of a crash while the server is being played upon.)&amp;lt;/p&amp;gt;&lt;br /&gt;
==Trelawny's Keepalive Script for Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.sh&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].&amp;lt;br /&amp;gt;&lt;br /&gt;
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use &amp;lt;code&amp;gt; nano -w dedi.sh &amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Once created, be sure to make the script executable with &amp;lt;code&amp;gt;chmod +x dedi.sh&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
echo &amp;quot;Running KAG dedicated server&amp;quot;&lt;br /&gt;
echo &amp;quot;TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123&amp;quot;&lt;br /&gt;
mv KAGdedi.tmp KAGdedi&lt;br /&gt;
chmod +x KAGdedi&lt;br /&gt;
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do&lt;br /&gt;
        echo &amp;quot;KAG server running&amp;quot;&lt;br /&gt;
        sleep 5&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To use, run the script: &amp;lt;code&amp;gt;./dedi.sh&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==The Beaz's Keepalive Script for Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;This script, &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;, will restart the KAG server 5 seconds after it crashes. To use, create a text file, paste/type in the script below, and save it as &amp;lt;code&amp;gt;dedi.bat&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO off&lt;br /&gt;
 &lt;br /&gt;
:restart&lt;br /&gt;
echo (%time%) Server Started - close this window to prevent restart.&lt;br /&gt;
 &lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm&lt;br /&gt;
 &lt;br /&gt;
echo (%time%) WARNING: Server closed or crashed, restarting.&lt;br /&gt;
 &lt;br /&gt;
goto restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Adapting for Maqq's Configuration Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T16:58:03Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;br /&gt;
=Managing Instability=&lt;br /&gt;
As Alpha software frequently is, the KAG server is highly unstable. Recent builds have been especially prone to crashing whenever left running for more than 24 hours. As such, it is recommended practice to run the server in a keepalive script, which will restart it whenever it crashes.&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T04:56:53Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Added Blacklisting &amp;amp; Whitelisting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
=Blacklisting &amp;amp; Whitelisting=&lt;br /&gt;
&amp;lt;p&amp;gt;A player blacklists is the list of players who are not allowed to play on a given server. A whitelist is the inverse of a blacklist; if enabled, only those on the whitelist will be allowed to play.&amp;lt;/p&amp;gt;&lt;br /&gt;
==How to Create a Blacklist or Whitelist==&lt;br /&gt;
&amp;lt;p&amp;gt;Create the following file and save it as &amp;lt;code&amp;gt;securitysetup.cfg&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;kagServer/Base/Scripts&amp;lt;/code&amp;gt;, where kagServer is the path to the kagServer's directory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# set this to 1 to allow only the names in whitelist&lt;br /&gt;
    whitelist_active = 0;&lt;br /&gt;
    whitelist = name1; name2;&lt;br /&gt;
# set this to 1 to ban the names in blacklist&lt;br /&gt;
    blacklist_active = 0;&lt;br /&gt;
    blacklist = name1; name2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note: The whitelist overrides the blacklist.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T04:00:54Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.'''&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Talk:Server</id>
		<title>Talk:Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Talk:Server"/>
				<updated>2012-02-22T03:19:31Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* I don't have much time to sit and format it nicely. I'll just write down what I know about setting up server. --[[User:Furai|Furai]] 20:52, 15 September 2011 (UTC)&lt;br /&gt;
* I'm done for today. Feel free to leave here any comments, suggestions. --[[User:Furai|Furai]] 22:31, 15 September 2011 (UTC)&lt;br /&gt;
** Did some small cleanup. --[[User:Illu|Illu]] 23:59, 15 September 2011 (UTC)&lt;br /&gt;
* This needs a major update!!! It is not even close to what is written in the readme.txt!&lt;br /&gt;
&lt;br /&gt;
* Overhauled entire page. --[[User:EchoLynx|EchoLynx]] 20:52, 21 February 2012 (EST)&lt;br /&gt;
* Added RCON commands from server readme.--[[User:EchoLynx|EchoLynx]] 22:19, 21 February 2012 (EST)&lt;br /&gt;
* Does a KAG server need an internet connection? (Can it run on a local network only?) --[[User:EchoLynx|EchoLynx]] 22:19, 21 February 2012 (EST)&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T03:17:53Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;br /&gt;
=Remote Control=&lt;br /&gt;
&amp;lt;p&amp;gt;A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing &amp;quot;/rcon password&amp;quot;, where password is the RCON password set by sv_rconpassword, will allow the current user to send commands to the server. These commands must be prefixed by &amp;quot;/rcon&amp;quot;. For example, to use the /list command, type. &amp;quot;/rcon /list&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
==Remote Server Commands==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
\list - list all commands and variables&amp;lt;br /&amp;gt;&lt;br /&gt;
\kick [playername] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickid [id] [minutes]&amp;lt;br /&amp;gt;&lt;br /&gt;
\kickhost [host] [minutes] - kicks and/or bans host (host number can be found in logs when player joins)&amp;lt;br /&amp;gt;&lt;br /&gt;
\unbanhost [host] \unban; \unbanhost; \unbanhid commands&amp;lt;br /&amp;gt;&lt;br /&gt;
\swapid [player id] - swaps the players team&amp;lt;br /&amp;gt;&lt;br /&gt;
\players&amp;lt;br /&amp;gt;&lt;br /&gt;
\restartmap&amp;lt;br /&amp;gt;&lt;br /&gt;
\loadmap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\savemap [name]&amp;lt;br /&amp;gt;&lt;br /&gt;
\msg [text]&amp;lt;br /&amp;gt;&lt;br /&gt;
\rcon [password]&amp;lt;br /&amp;gt;&lt;br /&gt;
addBotX - addBotX( team, class, name ); eg. addBotX( 1, 0, `St. John` );&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Royal_Guard</id>
		<title>Royal Guard</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Royal_Guard"/>
				<updated>2012-02-22T02:47:11Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;The Royal Guard (also known as global moderators) is a group of players who have the extra responsibility of ensuring a fair and enjoyable play experience on most public and gold servers. They are hand picked by the KAG development team. A current list of guards can be found [http://kagforum.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-08-02-2012.1128/ here].&amp;lt;/p&amp;gt;&lt;br /&gt;
=Privileges of the Guard=&lt;br /&gt;
A member of the Royal Guard, when logged into a server that acknowledges their authority, will have administrative privileges on that server. They can be identified by the green color of their name. (Unfortunately, they cannot be distinguished from normal Administrators - people who own/run a given server.)&lt;br /&gt;
=Appeals=&lt;br /&gt;
Players banned by Guards can appeal their ban on the [http://kagforum.com/index.php?threads/ban-appeals.1713/ appeals thread].&lt;br /&gt;
=Becoming a Guard=&lt;br /&gt;
New guards are selected behind closed doors. There is no defined path to becoming a guard.  Players who become active members of the KAG community are most likely to be selected, although new guards are only selected if the player population becomes more than the existing Guard can handle.&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Royal_Guard</id>
		<title>Royal Guard</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Royal_Guard"/>
				<updated>2012-02-22T02:30:45Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Guard Powers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;The Royal Guard (also known as global moderators) is a group of players who have the extra responsibility of ensuring a fair and enjoyable play experience on most public and gold servers. They are hand picked by the KAG development team. A current list of guards can be found [http://kagforum.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-08-02-2012.1128/ here].&amp;lt;/p&amp;gt;&lt;br /&gt;
=Privileges of the Guard=&lt;br /&gt;
A member of the Royal Guard, when logged into a server that acknowledges their authority, will have administrative privileges on that server. They can be identified by the green color of their name. (Unfortunately, they cannot be distinguished from normal Administrators - people who own/run a given server.)&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Royal_Guard</id>
		<title>Royal Guard</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Royal_Guard"/>
				<updated>2012-02-22T02:30:21Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;The Royal Guard (also known as global moderators) is a group of players who have the extra responsibility of ensuring a fair and enjoyable play experience on most public and gold servers. They are hand picked by the KAG development team. A current list of guards can be found [http://kagforum.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-08-02-2012.1128/ here].&amp;lt;/p&amp;gt;&lt;br /&gt;
=Guard Powers=&lt;br /&gt;
A member of the Royal Guard, when logged into a server that acknowledges their authority, will have administrative privileges on that server. They can be identified by the green color of their name. (Unfortunately, they cannot be distinguished from normal Administrators - people who own/run a given server.)&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Royal_Guard</id>
		<title>Royal Guard</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Royal_Guard"/>
				<updated>2012-02-22T02:25:41Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;The Royal Guard (also known as global moderators) is a group of players who have the extra responsibility of ensuring a fair and enjoyable play experience on most public and gold servers. They are hand picked by the KAG development team. A current list of guards can be found [http://kagforum.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-08-02-2012.1128/ here].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A guard can usually be identified in-game, by their green colored name (although a server's administrator will be green also). If you need help - feel free to ask them questions, as guards are encouraged to be friendly and helpful members of the KAG community. The current roster of Royal Guards can be found here.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Royal_Guard</id>
		<title>Royal Guard</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Royal_Guard"/>
				<updated>2012-02-22T02:24:26Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: Created page with &amp;quot;The Royal Guard (also known as global moderators) is a group of players who have the extra responsibility of ensuring a fair and enjoyable play experience on most public and gold...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Royal Guard (also known as global moderators) is a group of players who have the extra responsibility of ensuring a fair and enjoyable play experience on most public and gold servers. They are hand picked by the KAG development team. A current list of guards can be found [http://kagforum.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-08-02-2012.1128/ here]&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:20:00Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:19:43Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. (The default port is 50301.) Note that domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:18:52Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Hosting on Residential Connections */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To complicate hosting a server, they may block certain ports and dynamically assign IP addresses. &lt;br /&gt;
*It is highly unlikely that they would block the ports used by the KAG server. (A local router's firewall is most likely the culprit for connectivity issues when hosting on a residential connection.)&lt;br /&gt;
*[http://ip4.me This] site displays the IP address of the current visitor. It can be used to determine the currently assigned public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:13:27Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Generator.cfg */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To discourage this, they may block certain ports and dynamically assign an IP addresses. It is highly unlikely that they would block the ports used by the KAG server, and [http://ip4.me this] site displays the IP address of the current visitor.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===*-generator.cfg===&lt;br /&gt;
&amp;lt;p&amp;gt;Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html  &amp;quot;libnoise&amp;quot;-library].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:11:20Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
===Hosting on Residential Connections===&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on residential internet connections, keep in mind that many ISPs forbid running any kind of server, including a KAG server. To discourage this, they may block certain ports and dynamically assign an IP addresses. It is highly unlikely that they would block the ports used by the KAG server, and [http://ip4.me this] site displays the IP address of the current visitor.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:05:43Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on a residential internet connection, keep in mind that your ISP may or may not tolerate running as server. Most ISPs will dynamically assign an IP address. Use [http://ip4.me this] site to find your public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:05:12Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For those hosting on a residential internet connection, keep in mind that your ISP may or may not tolerate running as server. Most ISPs will dynamically assign an IP address. Use [http://ipv4.me this] site to find your public IP address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T02:00:32Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;br /&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T01:59:59Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;br /&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;To connect, either find it in the server list or connect directly using the IPaddress:PortNumber format. Domain names will not work in place of the IP address.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Talk:Server</id>
		<title>Talk:Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Talk:Server"/>
				<updated>2012-02-22T01:52:06Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* I don't have much time to sit and format it nicely. I'll just write down what I know about setting up server. --[[User:Furai|Furai]] 20:52, 15 September 2011 (UTC)&lt;br /&gt;
* I'm done for today. Feel free to leave here any comments, suggestions. --[[User:Furai|Furai]] 22:31, 15 September 2011 (UTC)&lt;br /&gt;
** Did some small cleanup. --[[User:Illu|Illu]] 23:59, 15 September 2011 (UTC)&lt;br /&gt;
* This needs a major update!!! It is not even close to what is written in the readme.txt!&lt;br /&gt;
&lt;br /&gt;
* Overhauled entire page. --[[User:EchoLynx|EchoLynx]] 20:52, 21 February 2012 (EST)&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T01:50:02Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = 281&lt;br /&gt;
}}&lt;br /&gt;
The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;br /&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-22T01:44:06Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The King Arthur's Gold Server is a relatively lightweight, 32-bit command line application. Freely distributed, this program allows anybody with an internet connection and a computer to host their own King Arthur's Gold server.&lt;br /&gt;
&lt;br /&gt;
Note: There is very little official documentation for the KAG server. As a result, the majority of this document was created from observation, trial and error. Use at your own risk.&lt;br /&gt;
=Features=&lt;br /&gt;
*All servers are added to the official server list to be seen by anybody who chooses the &amp;quot;Pick a Server&amp;quot; option in-game.&lt;br /&gt;
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.&lt;br /&gt;
*Servers can be password protected. (This is separate from the RCON password.)&lt;br /&gt;
=Requirements=&lt;br /&gt;
==Hardware==&lt;br /&gt;
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.&lt;br /&gt;
==Software==&lt;br /&gt;
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.&lt;br /&gt;
==Network==&lt;br /&gt;
The KAG server uses three ports. &lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Modifiable?&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | Firewall Tolerant?&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50301&lt;br /&gt;
|Used to listen for connections.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 50328&lt;br /&gt;
|Used to communicate with clients.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#efefef;&amp;quot; | 51308&lt;br /&gt;
|Used to communicate with the master server.&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#E83131;&amp;quot;|no&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; style=&amp;quot;background:#31E831;&amp;quot;|yes&lt;br /&gt;
|}&lt;br /&gt;
Firewall tolerant means that a typical connection-oriented ([http://en.wikipedia.org/wiki/Stateful_firewall SPI]) firewall will allow that port through. Depending on the firewall, all ports may need to be forwarded.&amp;lt;br /&amp;gt;&lt;br /&gt;
The internet connection is typically the bottleneck that determines the number of users a server can support. Hosting more users than a connection can support will cause a high ping time and significant lag.&lt;br /&gt;
=Installation=&lt;br /&gt;
==Linux==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the &amp;lt;code&amp;gt;ia32-libs&amp;lt;/code&amp;gt; package must be installed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;wget http://kag2d.com/downloads/kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Next, decompress the archive. &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;tar -zxf kag_linux.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Change to the new directory: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;cd kag_linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server: &amp;lt;br /&amp;gt; &amp;lt;pre&amp;gt;./dedicatedserver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==Windows==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
# First, download the server: http://kag2d.com/downloads/ &amp;lt;br /&amp;gt; Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.&lt;br /&gt;
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].&lt;br /&gt;
# Open the folder the archive was extracted into.&lt;br /&gt;
# [[Server#Configuration|Configure]] your server.&lt;br /&gt;
# Run your server by clicking &amp;lt;code&amp;gt;dedicatedserver.bat&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
==Mac==&lt;br /&gt;
Due to their similarities, the installation instructions for Linux should apply for Macs.&lt;br /&gt;
=Configuration=&lt;br /&gt;
&amp;lt;p&amp;gt;The KAG server is configured using text files.  Customizing a KAG server installation involves modifying the variables in these files. There are two ways to do this: manually and using Maqq's Configuration Tool. Of the two, Maqq's Tool is by far the fastest and easiest method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;'''One of the most important decisions a server administrator must make is whether or not to allow the [[Royal Guard]] to police their server. 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
==Manual Configuration==&lt;br /&gt;
Of the many editable configuration files that the KAG server depends upon, most customization is done in the &amp;lt;code&amp;gt;dedicated_autoconfig.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dedicated_autostart.gm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mapcycle.cfg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;*-generator.cfg&amp;lt;/code&amp;gt; files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Of the many modifiable variables, these are some of the most important:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
==Maqq's Server Configuration Tool==&lt;br /&gt;
&amp;lt;p&amp;gt;Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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 program&amp;lt;/p&amp;gt;&lt;br /&gt;
===Reusing Generated Configs===&lt;br /&gt;
&amp;lt;p&amp;gt;These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
===Download Maqq's Server Config Tool===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-21T23:24:47Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* 64bit Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = Not Up-to-date &lt;br /&gt;
}}&lt;br /&gt;
A simple guide for hosting a KAG server on Linux and Windows. This guide will be growing gradually over time.&amp;lt;br /&amp;gt;&lt;br /&gt;
Currently the ''suggested'' operating system for hosting a KAG server is Linux.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
''In this example we use the Debian distribution. For other distributions, please modify accordingly.''&lt;br /&gt;
&lt;br /&gt;
To begin with you need to download the [http://kag2d.com/download server files] (linux server). You can unpack it locally (it's in &amp;quot;tar.gz&amp;quot; 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 &amp;quot;WinSCP&amp;quot;, &amp;quot;FileZilla&amp;quot;, etc.&amp;lt;br /&amp;gt;.&lt;br /&gt;
Otherwise, and via SSH type: ''wget http://kag2d.com/downloads/kag_linux.tar.gz'' to download from the kag2d.com website.&lt;br /&gt;
&lt;br /&gt;
To decompress type:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
tar zxf kag_linux.tar.gz&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
change into kag_linux  directory by:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd kag_linux&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Assuming you've edited all [[Server#Configuration|configuration files]] to your liking, only thing that left to do is running your server:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./KAGdedi&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;As you can see all the output from the server is going straight onto your screen. You can use some multiplexer e.g. &amp;quot;GNU Screen&amp;quot;, &amp;quot;nohup&amp;quot;, etc. I'll cover in detail how to run it later. For now you can issue the following command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./dedicatedserver.sh &amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will output &amp;quot;everything&amp;quot; to &amp;quot;nowhere&amp;quot;. It's a temporary solution.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you are using SSH and you want the server to keep running after you close the SSH connection use this command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
nohup dedicatedserver.sh &amp;amp;&lt;br /&gt;
&amp;lt;/code&amp;gt; &amp;lt;/p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
How to restart the server:&amp;lt;br /&amp;gt;&lt;br /&gt;
If you wish to restart the server this is simple type top then find the PID then type kill &amp;lt;PID of the KAG service&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===64bit Kernel===&lt;br /&gt;
&amp;lt;p&amp;gt;If you're using a 64bit kernel then you need to install additional 32-bit libraries.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
apt-get install ia32-libs&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're not sure which kernel you're running, type:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
uname -m&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will either return ''i686'' (32bit) or ''x86_64'' (64bit).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
Locate &amp;quot;dedicatedserver.bat&amp;quot; in the root directory of your KAG installation (default location: C:\KAG). &lt;br /&gt;
&lt;br /&gt;
Edit the files mentioned in the following section  ([[Server#Configuration|Configuration]]) (default location: C:\KAG\Base\Scripts\ etc).&lt;br /&gt;
&lt;br /&gt;
Once you're done editing the configuration files to match your server's needs, double click on the batchfile (dedicatedserver.bat) to run.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
'''A ''vital'' consideration for your server is whether you will allow global moderators (a.k.a. &amp;quot;[[guards]]&amp;quot;). 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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):&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Maqq's Server Configuration Tool===&lt;br /&gt;
Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&lt;br /&gt;
&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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&lt;br /&gt;
;Reusing Generated Configs&lt;br /&gt;
&lt;br /&gt;
These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&lt;br /&gt;
&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download Maqq's Server Config Tool==&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-21T23:24:25Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* 64bit Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = Not Up-to-date &lt;br /&gt;
}}&lt;br /&gt;
A simple guide for hosting a KAG server on Linux and Windows. This guide will be growing gradually over time.&amp;lt;br /&amp;gt;&lt;br /&gt;
Currently the ''suggested'' operating system for hosting a KAG server is Linux.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
''In this example we use the Debian distribution. For other distributions, please modify accordingly.''&lt;br /&gt;
&lt;br /&gt;
To begin with you need to download the [http://kag2d.com/download server files] (linux server). You can unpack it locally (it's in &amp;quot;tar.gz&amp;quot; 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 &amp;quot;WinSCP&amp;quot;, &amp;quot;FileZilla&amp;quot;, etc.&amp;lt;br /&amp;gt;.&lt;br /&gt;
Otherwise, and via SSH type: ''wget http://kag2d.com/downloads/kag_linux.tar.gz'' to download from the kag2d.com website.&lt;br /&gt;
&lt;br /&gt;
To decompress type:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
tar zxf kag_linux.tar.gz&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
change into kag_linux  directory by:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd kag_linux&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Assuming you've edited all [[Server#Configuration|configuration files]] to your liking, only thing that left to do is running your server:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./KAGdedi&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;As you can see all the output from the server is going straight onto your screen. You can use some multiplexer e.g. &amp;quot;GNU Screen&amp;quot;, &amp;quot;nohup&amp;quot;, etc. I'll cover in detail how to run it later. For now you can issue the following command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./dedicatedserver.sh &amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will output &amp;quot;everything&amp;quot; to &amp;quot;nowhere&amp;quot;. It's a temporary solution.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you are using SSH and you want the server to keep running after you close the SSH connection use this command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
nohup dedicatedserver.sh &amp;amp;&lt;br /&gt;
&amp;lt;/code&amp;gt; &amp;lt;/p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
How to restart the server:&amp;lt;br /&amp;gt;&lt;br /&gt;
If you wish to restart the server this is simple type top then find the PID then type kill &amp;lt;PID of the KAG service&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=64bit Kernel=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're using a 64bit kernel then you need to install additional 32-bit libraries.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
apt-get install ia32-libs&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're not sure which kernel you're running, type:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
uname -m&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will either return ''i686'' (32bit) or ''x86_64'' (64bit).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
Locate &amp;quot;dedicatedserver.bat&amp;quot; in the root directory of your KAG installation (default location: C:\KAG). &lt;br /&gt;
&lt;br /&gt;
Edit the files mentioned in the following section  ([[Server#Configuration|Configuration]]) (default location: C:\KAG\Base\Scripts\ etc).&lt;br /&gt;
&lt;br /&gt;
Once you're done editing the configuration files to match your server's needs, double click on the batchfile (dedicatedserver.bat) to run.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
'''A ''vital'' consideration for your server is whether you will allow global moderators (a.k.a. &amp;quot;[[guards]]&amp;quot;). 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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):&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Maqq's Server Configuration Tool===&lt;br /&gt;
Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&lt;br /&gt;
&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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&lt;br /&gt;
;Reusing Generated Configs&lt;br /&gt;
&lt;br /&gt;
These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&lt;br /&gt;
&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download Maqq's Server Config Tool==&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-21T23:23:20Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = Not Up-to-date &lt;br /&gt;
}}&lt;br /&gt;
A simple guide for hosting a KAG server on Linux and Windows. This guide will be growing gradually over time.&amp;lt;br /&amp;gt;&lt;br /&gt;
Currently the ''suggested'' operating system for hosting a KAG server is Linux.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
''In this example we use the Debian distribution. For other distributions, please modify accordingly.''&lt;br /&gt;
&lt;br /&gt;
To begin with you need to download the [http://kag2d.com/download server files] (linux server). You can unpack it locally (it's in &amp;quot;tar.gz&amp;quot; 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 &amp;quot;WinSCP&amp;quot;, &amp;quot;FileZilla&amp;quot;, etc.&amp;lt;br /&amp;gt;.&lt;br /&gt;
Otherwise, and via SSH type: ''wget http://kag2d.com/downloads/kag_linux.tar.gz'' to download from the kag2d.com website.&lt;br /&gt;
&lt;br /&gt;
To decompress type:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
tar zxf kag_linux.tar.gz&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
change into kag_linux  directory by:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd kag_linux&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Assuming you've edited all [[Server#Configuration|configuration files]] to your liking, only thing that left to do is running your server:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./KAGdedi&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;As you can see all the output from the server is going straight onto your screen. You can use some multiplexer e.g. &amp;quot;GNU Screen&amp;quot;, &amp;quot;nohup&amp;quot;, etc. I'll cover in detail how to run it later. For now you can issue the following command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./dedicatedserver.sh &amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will output &amp;quot;everything&amp;quot; to &amp;quot;nowhere&amp;quot;. It's a temporary solution.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you are using SSH and you want the server to keep running after you close the SSH connection use this command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
nohup dedicatedserver.sh &amp;amp;&lt;br /&gt;
&amp;lt;/code&amp;gt; &amp;lt;/p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
How to restart the server:&amp;lt;br /&amp;gt;&lt;br /&gt;
If you wish to restart the server this is simple type top then find the PID then type kill &amp;lt;PID of the KAG service&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===64bit Kernel===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're using a 64bit kernel then you need to install additional 32-bit libraries.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
apt-get install ia32-libs&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're not sure which kernel you're running, type:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
uname -m&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will either return ''i686'' (32bit) or ''x86_64'' (64bit).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
Locate &amp;quot;dedicatedserver.bat&amp;quot; in the root directory of your KAG installation (default location: C:\KAG). &lt;br /&gt;
&lt;br /&gt;
Edit the files mentioned in the following section  ([[Server#Configuration|Configuration]]) (default location: C:\KAG\Base\Scripts\ etc).&lt;br /&gt;
&lt;br /&gt;
Once you're done editing the configuration files to match your server's needs, double click on the batchfile (dedicatedserver.bat) to run.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
'''A ''vital'' consideration for your server is whether you will allow global moderators (a.k.a. &amp;quot;[[guards]]&amp;quot;). 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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):&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Maqq's Server Configuration Tool===&lt;br /&gt;
Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&lt;br /&gt;
&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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&lt;br /&gt;
;Reusing Generated Configs&lt;br /&gt;
&lt;br /&gt;
These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&lt;br /&gt;
&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download Maqq's Server Config Tool==&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-20T22:06:28Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Maqq's Server Configuration Tool */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = Not Up-to-date &lt;br /&gt;
}}&lt;br /&gt;
A simple guide for hosting a KAG server on Linux and Windows. This guide will be growing gradually over time.&amp;lt;br /&amp;gt;&lt;br /&gt;
Currently the ''suggested'' operating system for hosting a KAG server is Linux.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
''In this example we use the Debian distribution. For other distributions, please modify accordingly.''&lt;br /&gt;
&lt;br /&gt;
To begin with you need to download the [http://kag2d.com/download server files] (linux server). You can unpack it locally (it's in &amp;quot;tar.gz&amp;quot; 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 &amp;quot;WinSCP&amp;quot;, &amp;quot;FileZilla&amp;quot;, etc.&amp;lt;br /&amp;gt;.&lt;br /&gt;
Otherwise, and via SSH type: ''wget http://kag2d.com/downloads/kag_linux.tar.gz'' to download from the kag2d.com website.&lt;br /&gt;
&lt;br /&gt;
To decompress type:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
tar zxf kag_linux.tar.gz&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
change into kag_linux  directory by:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd kag_linux&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Assuming you've edited all [[Server#Configuration|configuration files]] to your liking, only thing that left to do is running your server:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./KAGdedi&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;As you can see all the output from the server is going straight onto your screen. You can use some multiplexer e.g. &amp;quot;GNU Screen&amp;quot;, &amp;quot;nohup&amp;quot;, etc. I'll cover in detail how to run it later. For now you can issue the following command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./dedicatedserver.sh &amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will output &amp;quot;everything&amp;quot; to &amp;quot;nowhere&amp;quot;. It's a temporary solution.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you are using SSH and you want the server to keep running after you close the SSH connection use this command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
nohup dedicatedserver.sh &amp;amp;&lt;br /&gt;
&amp;lt;/code&amp;gt; &amp;lt;/p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
How to restart the server:&amp;lt;br /&amp;gt;&lt;br /&gt;
If you wish to restart the server this is simple type top then find the PID then type kill &amp;lt;PID of the KAG service&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===64bit Kernel===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're using a 64bit kernel then you need to install additional 32-bit libraries.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
apt-get install ia32-libs&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're not sure which kernel you're running, type:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
uname -m&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will either return ''i686'' (32bit) or ''x86_64'' (64bit).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
Locate &amp;quot;dedicatedserver.bat&amp;quot; in the root directory of your KAG installation (default location: C:\KAG). &lt;br /&gt;
&lt;br /&gt;
Edit the files mentioned in the following section  ([[Server#Configuration|Configuration]]) (default location: C:\KAG\Base\Scripts\ etc).&lt;br /&gt;
&lt;br /&gt;
Once you're done editing the configuration files to match your server's needs, double click on the batchfile (dedicatedserver.bat) to run.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
'''Note: Following configuration files are common in both windows and linux servers; they ''must'' be edited for your server to work.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional note: A ''vital'' consideration for your server is whether you will allow global moderators (a.k.a. &amp;quot;[[guards]]&amp;quot;). 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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):&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Maqq's Server Configuration Tool===&lt;br /&gt;
Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&lt;br /&gt;
&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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&lt;br /&gt;
;Reusing Generated Configs&lt;br /&gt;
&lt;br /&gt;
These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&lt;br /&gt;
&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download Maqq's Server Config Tool==&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/Server</id>
		<title>Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/Server"/>
				<updated>2012-02-20T22:06:02Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: /* Maqq's CLI Server Configuration tool */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build&lt;br /&gt;
|Version = Not Up-to-date &lt;br /&gt;
}}&lt;br /&gt;
A simple guide for hosting a KAG server on Linux and Windows. This guide will be growing gradually over time.&amp;lt;br /&amp;gt;&lt;br /&gt;
Currently the ''suggested'' operating system for hosting a KAG server is Linux.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
''In this example we use the Debian distribution. For other distributions, please modify accordingly.''&lt;br /&gt;
&lt;br /&gt;
To begin with you need to download the [http://kag2d.com/download server files] (linux server). You can unpack it locally (it's in &amp;quot;tar.gz&amp;quot; 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 &amp;quot;WinSCP&amp;quot;, &amp;quot;FileZilla&amp;quot;, etc.&amp;lt;br /&amp;gt;.&lt;br /&gt;
Otherwise, and via SSH type: ''wget http://kag2d.com/downloads/kag_linux.tar.gz'' to download from the kag2d.com website.&lt;br /&gt;
&lt;br /&gt;
To decompress type:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
tar zxf kag_linux.tar.gz&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
change into kag_linux  directory by:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd kag_linux&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Assuming you've edited all [[Server#Configuration|configuration files]] to your liking, only thing that left to do is running your server:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./KAGdedi&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;As you can see all the output from the server is going straight onto your screen. You can use some multiplexer e.g. &amp;quot;GNU Screen&amp;quot;, &amp;quot;nohup&amp;quot;, etc. I'll cover in detail how to run it later. For now you can issue the following command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./dedicatedserver.sh &amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will output &amp;quot;everything&amp;quot; to &amp;quot;nowhere&amp;quot;. It's a temporary solution.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you are using SSH and you want the server to keep running after you close the SSH connection use this command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
nohup dedicatedserver.sh &amp;amp;&lt;br /&gt;
&amp;lt;/code&amp;gt; &amp;lt;/p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
How to restart the server:&amp;lt;br /&amp;gt;&lt;br /&gt;
If you wish to restart the server this is simple type top then find the PID then type kill &amp;lt;PID of the KAG service&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===64bit Kernel===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're using a 64bit kernel then you need to install additional 32-bit libraries.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
apt-get install ia32-libs&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you're not sure which kernel you're running, type:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
uname -m&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will either return ''i686'' (32bit) or ''x86_64'' (64bit).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
Locate &amp;quot;dedicatedserver.bat&amp;quot; in the root directory of your KAG installation (default location: C:\KAG). &lt;br /&gt;
&lt;br /&gt;
Edit the files mentioned in the following section  ([[Server#Configuration|Configuration]]) (default location: C:\KAG\Base\Scripts\ etc).&lt;br /&gt;
&lt;br /&gt;
Once you're done editing the configuration files to match your server's needs, double click on the batchfile (dedicatedserver.bat) to run.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
'''Note: Following configuration files are common in both windows and linux servers; they ''must'' be edited for your server to work.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional note: A ''vital'' consideration for your server is whether you will allow global moderators (a.k.a. &amp;quot;[[guards]]&amp;quot;). 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)] &amp;amp; [http://kagforum.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ &amp;amp; Public Policy]) so you can make an informed decision.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global sv_allow_globals_mods = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autoconfig.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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):&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
global m_width = 600; // Map generator width. Affects RAM usage.&lt;br /&gt;
global m_height = 250; // Map generator height. Affects RAM usage.&lt;br /&gt;
global m_seed = 0; // Map generator seed. Pick a random number.&lt;br /&gt;
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.&lt;br /&gt;
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.&lt;br /&gt;
global g_vote_time = 60; // How long (in seconds) does the voting take place.&lt;br /&gt;
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.&lt;br /&gt;
global sv_maxplayers = 16; // Maximum number of players allowed ingame.&lt;br /&gt;
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.&lt;br /&gt;
global sv_password = ``; // Sets the server password.&lt;br /&gt;
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.&lt;br /&gt;
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.&lt;br /&gt;
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).&lt;br /&gt;
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.&lt;br /&gt;
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.&lt;br /&gt;
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.&lt;br /&gt;
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.&lt;br /&gt;
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.&lt;br /&gt;
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server&lt;br /&gt;
global sv_name = `KAG game`; // Sets the server name displayed in server browser.&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dedicated_autostart.gm===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadRules(&amp;quot;Rules/CTF/gamemode.cfg&amp;quot;);&lt;br /&gt;
LoadMapCycle( &amp;quot;Scripts/mapcycle.cfg&amp;quot; );&lt;br /&gt;
LoadMap( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;br /&amp;gt;&lt;br /&gt;
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 &amp;quot;LoadMapCycle&amp;quot; and use &amp;quot;LoadMap&amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===mapcycle.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;font size=3&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#KAG mapcycle;&lt;br /&gt;
# put map generator files, png files here, or script files&lt;br /&gt;
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;&lt;br /&gt;
&lt;br /&gt;
mapcycle = Maps/generator_ctf_mountain.cfg;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generator.cfg===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;I use here general name for generator configuration file, you can name it however you like.&amp;lt;br /&amp;gt;&lt;br /&gt;
Generator uses &amp;quot;libnoise&amp;quot;-library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Maqq's Server Configuration Tool===&lt;br /&gt;
Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:&lt;br /&gt;
&lt;br /&gt;
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).&lt;br /&gt;
*In Windows, run KAGServer.exe and follow the onscreen instructions.&lt;br /&gt;
*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&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
;Reusing Generated Configs&lt;br /&gt;
&lt;br /&gt;
These commands reuse the generated configuration files:[http://kagforum.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]&lt;br /&gt;
&lt;br /&gt;
*If you're using linux, type this in the console:&lt;br /&gt;
''./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&lt;br /&gt;
*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:&lt;br /&gt;
''KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm''&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==Download Maqq's Server Config Tool==&lt;br /&gt;
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe&lt;br /&gt;
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)&lt;br /&gt;
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	<entry>
		<id>//wiki.kag2d.com/wiki/User:EchoLynx</id>
		<title>User:EchoLynx</title>
		<link rel="alternate" type="text/html" href="https://wiki.kag2d.com/wiki/User:EchoLynx"/>
				<updated>2012-02-20T21:38:18Z</updated>
		
		<summary type="html">&lt;p&gt;EchoLynx: http://EchoLynx.com&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://EchoLynx.com&lt;br /&gt;
I have been running a KAG server since 20FEB2012.&lt;/div&gt;</summary>
		<author><name>EchoLynx</name></author>	</entry>

	</feed>