Difference between revisions of "Server"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Debian)
m (some cleanup)
Line 1: Line 1:
<p>Here I'm going to write simple guide for setting up server for KAG on Linux. My knowledge maybe isn't superior but it's sufficient to help you out. This guide will be growing gradually over time. (I assume you have at least basic knowledge about it.) --[[User:Furai|Furai]] 22:00, 15 September 2011 (UTC)</p>
+
Here I'm going to write simple guide for setting up server for KAG on Linux. My knowledge maybe isn't superior but it's sufficient to help you out. This guide will be growing gradually over time. (I assume you have at least basic knowledge about it.) --[[User:Furai|Furai]] 22:00, 15 September 2011 (UTC)
 +
 
 
==Debian==
 
==Debian==
<p>To begin with you need to from [http://kag2d.com/download download server files] (linux server). You can unpack it locally (it's in tar.gz format so only thing you need to do is to unpack it twice, assuming you're using windows) on your machine and upload it to your server via FTP/SFTP using programmes like WinSCP, FileZilla, etc.</p>
+
 
<p>Alternatively you can upload this file without unpacking it locally and the unpack it on your server via SSH issuing command: <br />
+
To begin with you need to download the [http://kag2d.com/download server files] (linux server). You can unpack it locally (it's in "tar.gz" format so only thing you need to do is to unpack it twice, assuming you're using Windows) on your machine and upload it to your server via FTP/SFTP using programmes like "WinSCP", "FileZilla", etc.<br />
<code>tar -xzvf kag*tar.gz kag</code></p>
+
Alternatively you can upload this file without unpacking it locally and the unpack it on your server via SSH issuing this command:
<p>(I've used asterisk at and of file cause it will change overtime, supply there exact file name.)</p>
+
 
Next step is to make executable these files:<br />
+
<code><font size=3>
<code>
+
tar -xzvf kag*tar.gz kag
 +
</font></code>
 +
 
 +
(I've used asterisk at and of file cause it will change overtime, supply there exact file name.)
 +
<p>Next step is to make these files executable:<br />
 +
 
 +
<code><font size=3>
 
KAG<br />
 
KAG<br />
 
dedicatedserver.sh
 
dedicatedserver.sh
</code><br />
+
</font></code></p>
<p>To do this issue in main KAG folder following commands:<br />
+
 
<code>
+
<p>To do this issue in main KAG folder the following commands:<br />
 +
 
 +
<code><font size=3>
 
chmod +x KAG<br />
 
chmod +x KAG<br />
chmod +x dedicatedserver.sh</code></p>
+
chmod +x dedicatedserver.sh
<p>Assuming you've edited all [[Server#Configuration|configuration files]] to your liking, only thing that left to do is running your server.<br />
+
</font></code></p>
<code>./dedicatedserver.sh</code></p>
+
 
<p>As you can see all output from server is going straight onto your screen. You can use some multiplexer e.g. GNU Screen, nohup, etc. I'll cover in detail how to run it later. For now you can issue following command:<br />
+
<p>Assuming you've edited all [[Server#Configuration|configuration files]] to your liking, only thing that left to do is running your server:<br />
<code>./dedicatedserver.sh > /dev/null</code><br />
+
 
It will output "everything" to "nowhere". It's temporary solution.
+
<code><font size=3>
</p>
+
./dedicatedserver.sh
 +
</font></code></p>
 +
 
 +
<p>As you can see all the output from the server is going straight onto your screen. You can use some multiplexer e.g. "GNU Screen", "nohup", etc. I'll cover in detail how to run it later. For now you can issue the following command:<br />
 +
 
 +
<code><font size=3>
 +
./dedicatedserver.sh > /dev/null
 +
</font></code></p>
 +
 
 +
It will output "everything" to "nowhere". It's a temporary solution.
 +
 
 
===Known issues===
 
===Known issues===
<p>If you're using x64 version on Debian then you may need to install 32-bit libraries.<br />
+
 
<code>apt-get install ia32-libs</code></p>
+
<p>If you're using the x64-version of Debian then you may need to install 32-bit libraries.<br />
 +
 
 +
<code>
 +
apt-get install ia32-libs
 +
</code></p>
  
 
==Configuration==
 
==Configuration==
 +
 
===dedicated_autoconfig.gm===
 
===dedicated_autoconfig.gm===
<p>When you edit this file you need to take closer look at these lines (comments are from MM himself, I've tweaked it here and there to make it more clear):  
+
 
<pre>global m_width = 600; // Map generator width
+
<p>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):
 +
 +
<pre>
 +
global m_width = 600; // Map generator width
 
global m_height = 250; // Map generator height
 
global m_height = 250; // Map generator height
 
global m_seed = 0; // Map generator seed. Pick a random number.
 
global m_seed = 0; // Map generator seed. Pick a random number.
Line 47: Line 74:
 
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server
 
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server
 
global sv_name = `KAG game`; // Sets the server name displayed in server browser.
 
global sv_name = `KAG game`; // Sets the server name displayed in server browser.
global sv_info = ``; // Sets the server info displayed in server browser. If you want it multi-line simply move text to new line with enter.</pre>
+
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.
 +
</pre></p>
  
</p>
 
 
===dedicated_autostart.gm===
 
===dedicated_autostart.gm===
<p><pre>LoadRules("Rules/CTF/gamemode.cfg");
+
 
 +
<p><pre>
 +
LoadRules("Rules/CTF/gamemode.cfg");
 
LoadMapCycle( "Scripts/mapcycle.cfg" );
 
LoadMapCycle( "Scripts/mapcycle.cfg" );
 
LoadMap( "" );
 
LoadMap( "" );
 
</pre>
 
</pre>
This file is very important. If you want to change rules for your server - then you must edit first line to contain path to rules set which you want to use. <br />
+
 
Mapcycle is the best option to use. You can leave it blan and put in LoadMap path to map you want to use on your server (24/7) instead of having nice mapcycle.
+
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. <br />
</p>
+
Just leave it like that if you want your server to automatically change the map after a match is finished. But if you want to have one map all the time instead of a nice mapcycle remove the path from "LoadMapCycle" and use "LoadMap".</p>
 +
 
 
===mapcycle.cfg===
 
===mapcycle.cfg===
<p>
+
 
<pre># KAG mapcycle;
+
<p><pre>
 +
# KAG mapcycle;
 
# put map generator files, png files here, or script files
 
# put map generator files, png files here, or script files
 
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;
 
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;
  
mapcycle = Maps/generator_ctf_mountain.cfg;</pre>
+
mapcycle = Maps/generator_ctf_mountain.cfg;
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.
+
</pre>
</p>
+
 
 +
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.</p>
 +
 
 
===Generator.cfg===
 
===Generator.cfg===
 +
 
<p>I use here general name for generator configuration file, you can name it however you like.<br />
 
<p>I use here general name for generator configuration file, you can name it however you like.<br />
Genarator uses libnoise library. You can read tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].
+
Generator uses libnoise library. You can read a tutorial about how to use it [http://libnoise.sourceforge.net/tutorials/tutorial4.html here].</p>
</p>
+

Revision as of 01:58, 16 September 2011

Here I'm going to write simple guide for setting up server for KAG on Linux. My knowledge maybe isn't superior but it's sufficient to help you out. This guide will be growing gradually over time. (I assume you have at least basic knowledge about it.) --Furai 22:00, 15 September 2011 (UTC)

Debian

To begin with you need to download the server files (linux server). You can unpack it locally (it's in "tar.gz" format so only thing you need to do is to unpack it twice, assuming you're using Windows) on your machine and upload it to your server via FTP/SFTP using programmes like "WinSCP", "FileZilla", etc.
Alternatively you can upload this file without unpacking it locally and the unpack it on your server via SSH issuing this command:

tar -xzvf kag*tar.gz kag

(I've used asterisk at and of file cause it will change overtime, supply there exact file name.)

Next step is to make these files executable:
KAG
dedicatedserver.sh

To do this issue in main KAG folder the following commands:
chmod +x KAG
chmod +x dedicatedserver.sh

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

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

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

Known issues

If you're using the x64-version of Debian then you may need to install 32-bit libraries.
apt-get install ia32-libs

Configuration

dedicated_autoconfig.gm

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

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

dedicated_autostart.gm

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

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

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

mapcycle.cfg

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

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

Generator.cfg

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