https://wiki.kag2d.com/api.php?action=feedcontributions&user=FliesLikeABrick&feedformat=atomKing Arthur's Gold Wiki - User contributions [en]2024-03-29T15:07:22ZUser contributionsMediaWiki 1.23.14//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-20T16:11:10Z<p>FliesLikeABrick: /* Overview */</p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
With the addition of this feature, you can also type commands directly into the server CLI. The only caveat is that the interface is not asynchronous - if any output comes from the server while you are typing your command, your input will visually be disrupted. However, your command is actually not interrupted and will work fine if you finish typing it and hit enter.<br />
<br />
'''Note:''' sv_tcpr must be enabled (as described below) for server CLI commands to work. This is because sv_tcpr enables the thread and logic which snarfs up tcp and CLI commands. As such, this also is not available on Windows<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
'''Note:''' If you enable tcpr and leave it open to the Internet, unfirewalled, you should ensure you have a complex/secure RCON password that cannot be easily guessed.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.<br />
<br />
===Safe Assumptions===<br />
The following assumptions should be safe (barring bugs and behaviors not known or understood as of this writing):<br />
* Output resulting from a command executed should always begin with the command itself being echoed back (see the example below)<br />
* Commands submitted by tcp admins, valid or invalid, will be displayed to all in-game and tcp admins so that it is possible to tell who executes what commands. This is also logged.<br />
* Commands executed at "the same time" (or close to it) will never have their outputs mixed. Commands, once they are being executed, are done so atomically. Their output should appear atomically; that is, the output should never be interrupted by another [unrelated] message appearing in the middle of a command's output.<br />
<br />
==Additional Examples==<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
[23:29:43] New TCP RCON connection: 192.168.56.1:58910<br />
[23:29:44] TCP RCON Connection from 192.168.56.1:58910 is now authenticated<br />
[23:29:47] TCP RCON command from 192.168.56.1:58910: /players<br />
[23:29:47] /players<br />
[23:29:47] List of Players ------ use RCON to get IP and hwid info<br />
[23:29:47] <br />
[23:30:29] TCP RCON Connection connection from 192.168.56.1:58910 has been closed<br />
<br />
Here is a line-by-line explanation of the above example:<br />
First a connection is opened to a server running on localhost by connecting to ip6-localhost (::1) on the server's configured game port (50311).<br />
<br />
The telnet application shows that a connection is attempted and opened. Once we are told that the connection is open, the first thing we do is type the server's rcon password, which is "asd"<br />
<br />
We are told that this connection is now authenticated (this message is sent to all tcp and in-game admins to let them know that a new connection has been authenticated)<br />
<br />
Next we see that another admin at 192.168.56.1 (remote port 58910) has connected to the tcp admin port of this server and authenticated.<br />
<br />
The user at 192.168.56.1 then executes /players. We see the output of their command which begins with the command itself being echoed. There are currently no players in this server so the list is empty.<br />
<br />
The last line tells us that the connection from 192.168.56.1 which we just saw active has been closed (likely due to the user disconnecting).<br />
<br />
<br />
<br />
==Availability==<br />
This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls. In the event that the KAG server codebase is ported to Mac or BSD, this feature should be available on them as well.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-20T16:10:41Z<p>FliesLikeABrick: /* Overview */</p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
With the addition of this feature, you can also type commands directly into the server CLI. The only caveat is that the interface is not asynchronous - if any output comes from the server while you are typing your command, your input will visually be disrupted. However, your command is actually not interrupted and will work fine if you finish typing it and hit enter.<br />
<br />
'''Note:''' sv_tcpr must be set to 1 for server CLI commands to work. This is because sv_tcpr enables the thread and logic which snarfs up tcp and CLI commands. As such, this also is not available on Windows<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
'''Note:''' If you enable tcpr and leave it open to the Internet, unfirewalled, you should ensure you have a complex/secure RCON password that cannot be easily guessed.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.<br />
<br />
===Safe Assumptions===<br />
The following assumptions should be safe (barring bugs and behaviors not known or understood as of this writing):<br />
* Output resulting from a command executed should always begin with the command itself being echoed back (see the example below)<br />
* Commands submitted by tcp admins, valid or invalid, will be displayed to all in-game and tcp admins so that it is possible to tell who executes what commands. This is also logged.<br />
* Commands executed at "the same time" (or close to it) will never have their outputs mixed. Commands, once they are being executed, are done so atomically. Their output should appear atomically; that is, the output should never be interrupted by another [unrelated] message appearing in the middle of a command's output.<br />
<br />
==Additional Examples==<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
[23:29:43] New TCP RCON connection: 192.168.56.1:58910<br />
[23:29:44] TCP RCON Connection from 192.168.56.1:58910 is now authenticated<br />
[23:29:47] TCP RCON command from 192.168.56.1:58910: /players<br />
[23:29:47] /players<br />
[23:29:47] List of Players ------ use RCON to get IP and hwid info<br />
[23:29:47] <br />
[23:30:29] TCP RCON Connection connection from 192.168.56.1:58910 has been closed<br />
<br />
Here is a line-by-line explanation of the above example:<br />
First a connection is opened to a server running on localhost by connecting to ip6-localhost (::1) on the server's configured game port (50311).<br />
<br />
The telnet application shows that a connection is attempted and opened. Once we are told that the connection is open, the first thing we do is type the server's rcon password, which is "asd"<br />
<br />
We are told that this connection is now authenticated (this message is sent to all tcp and in-game admins to let them know that a new connection has been authenticated)<br />
<br />
Next we see that another admin at 192.168.56.1 (remote port 58910) has connected to the tcp admin port of this server and authenticated.<br />
<br />
The user at 192.168.56.1 then executes /players. We see the output of their command which begins with the command itself being echoed. There are currently no players in this server so the list is empty.<br />
<br />
The last line tells us that the connection from 192.168.56.1 which we just saw active has been closed (likely due to the user disconnecting).<br />
<br />
<br />
<br />
==Availability==<br />
This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls. In the event that the KAG server codebase is ported to Mac or BSD, this feature should be available on them as well.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-19T01:44:42Z<p>FliesLikeABrick: </p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
With the addition of this feature, you can also type commands directly into the server CLI. The only caveat is that the interface is not asynchronous - if any output comes from the server while you are typing your command, your input will visually be disrupted. However, your command is actually not interrupted and will work fine if you finish typing it and hit enter.<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
'''Note:''' If you enable tcpr and leave it open to the Internet, unfirewalled, you should ensure you have a complex/secure RCON password that cannot be easily guessed.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.<br />
<br />
===Safe Assumptions===<br />
The following assumptions should be safe (barring bugs and behaviors not known or understood as of this writing):<br />
* Output resulting from a command executed should always begin with the command itself being echoed back (see the example below)<br />
* Commands submitted by tcp admins, valid or invalid, will be displayed to all in-game and tcp admins so that it is possible to tell who executes what commands. This is also logged.<br />
* Commands executed at "the same time" (or close to it) will never have their outputs mixed. Commands, once they are being executed, are done so atomically. Their output should appear atomically; that is, the output should never be interrupted by another [unrelated] message appearing in the middle of a command's output.<br />
<br />
==Additional Examples==<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
[23:29:43] New TCP RCON connection: 192.168.56.1:58910<br />
[23:29:44] TCP RCON Connection from 192.168.56.1:58910 is now authenticated<br />
[23:29:47] TCP RCON command from 192.168.56.1:58910: /players<br />
[23:29:47] /players<br />
[23:29:47] List of Players ------ use RCON to get IP and hwid info<br />
[23:29:47] <br />
[23:30:29] TCP RCON Connection connection from 192.168.56.1:58910 has been closed<br />
<br />
Here is a line-by-line explanation of the above example:<br />
First a connection is opened to a server running on localhost by connecting to ip6-localhost (::1) on the server's configured game port (50311).<br />
<br />
The telnet application shows that a connection is attempted and opened. Once we are told that the connection is open, the first thing we do is type the server's rcon password, which is "asd"<br />
<br />
We are told that this connection is now authenticated (this message is sent to all tcp and in-game admins to let them know that a new connection has been authenticated)<br />
<br />
Next we see that another admin at 192.168.56.1 (remote port 58910) has connected to the tcp admin port of this server and authenticated.<br />
<br />
The user at 192.168.56.1 then executes /players. We see the output of their command which begins with the command itself being echoed. There are currently no players in this server so the list is empty.<br />
<br />
The last line tells us that the connection from 192.168.56.1 which we just saw active has been closed (likely due to the user disconnecting).<br />
<br />
<br />
<br />
==Availability==<br />
This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls. In the event that the KAG server codebase is ported to Mac or BSD, this feature should be available on them as well.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-18T16:26:27Z<p>FliesLikeABrick: /* Overview */</p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
With the addition of this feature, you can also type commands directly into the server CLI. The only caveat is that the interface is not asynchronous - if any output comes from the server while you are typing your command, your input will visually be disrupted. However, your command is actually not interrupted and will work fine if you finish typing it and hit enter.<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.<br />
<br />
===Safe Assumptions===<br />
The following assumptions should be safe (barring bugs and behaviors not known or understood as of this writing):<br />
* Output resulting from a command executed should always begin with the command itself being echoed back (see the example below)<br />
* Commands submitted by tcp admins, valid or invalid, will be displayed to all in-game and tcp admins so that it is possible to tell who executes what commands. This is also logged.<br />
* Commands executed at "the same time" (or close to it) will never have their outputs mixed. Commands, once they are being executed, are done so atomically. Their output should appear atomically; that is, the output should never be interrupted by another [unrelated] message appearing in the middle of a command's output.<br />
<br />
==Additional Examples==<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
[23:29:43] New TCP RCON connection: 192.168.56.1:58910<br />
[23:29:44] TCP RCON Connection from 192.168.56.1:58910 is now authenticated<br />
[23:29:47] TCP RCON command from 192.168.56.1:58910: /players<br />
[23:29:47] /players<br />
[23:29:47] List of Players ------ use RCON to get IP and hwid info<br />
[23:29:47] <br />
[23:30:29] TCP RCON Connection connection from 192.168.56.1:58910 has been closed<br />
<br />
Here is a line-by-line explanation of the above example:<br />
First a connection is opened to a server running on localhost by connecting to ip6-localhost (::1) on the server's configured game port (50311).<br />
<br />
The telnet application shows that a connection is attempted and opened. Once we are told that the connection is open, the first thing we do is type the server's rcon password, which is "asd"<br />
<br />
We are told that this connection is now authenticated (this message is sent to all tcp and in-game admins to let them know that a new connection has been authenticated)<br />
<br />
Next we see that another admin at 192.168.56.1 (remote port 58910) has connected to the tcp admin port of this server and authenticated.<br />
<br />
The user at 192.168.56.1 then executes /players. We see the output of their command which begins with the command itself being echoed. There are currently no players in this server so the list is empty.<br />
<br />
The last line tells us that the connection from 192.168.56.1 which we just saw active has been closed (likely due to the user disconnecting).<br />
<br />
<br />
<br />
==Availability==<br />
This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls. In the event that the KAG server codebase is ported to Mac or BSD, this feature should be available on them as well.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-18T04:26:58Z<p>FliesLikeABrick: </p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.<br />
<br />
===Safe Assumptions===<br />
The following assumptions should be safe (barring bugs and behaviors not known or understood as of this writing):<br />
* Output resulting from a command executed should always begin with the command itself being echoed back (see the example below)<br />
* Commands submitted by tcp admins, valid or invalid, will be displayed to all in-game and tcp admins so that it is possible to tell who executes what commands. This is also logged.<br />
* Commands executed at "the same time" (or close to it) will never have their outputs mixed. Commands, once they are being executed, are done so atomically. Their output should appear atomically; that is, the output should never be interrupted by another [unrelated] message appearing in the middle of a command's output.<br />
<br />
==Additional Examples==<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
[23:29:43] New TCP RCON connection: 192.168.56.1:58910<br />
[23:29:44] TCP RCON Connection from 192.168.56.1:58910 is now authenticated<br />
[23:29:47] TCP RCON command from 192.168.56.1:58910: /players<br />
[23:29:47] /players<br />
[23:29:47] List of Players ------ use RCON to get IP and hwid info<br />
[23:29:47] <br />
[23:30:29] TCP RCON Connection connection from 192.168.56.1:58910 has been closed<br />
<br />
Here is a line-by-line explanation of the above example:<br />
First a connection is opened to a server running on localhost by connecting to ip6-localhost (::1) on the server's configured game port (50311).<br />
<br />
The telnet application shows that a connection is attempted and opened. Once we are told that the connection is open, the first thing we do is type the server's rcon password, which is "asd"<br />
<br />
We are told that this connection is now authenticated (this message is sent to all tcp and in-game admins to let them know that a new connection has been authenticated)<br />
<br />
Next we see that another admin at 192.168.56.1 (remote port 58910) has connected to the tcp admin port of this server and authenticated.<br />
<br />
The user at 192.168.56.1 then executes /players. We see the output of their command which begins with the command itself being echoed. There are currently no players in this server so the list is empty.<br />
<br />
The last line tells us that the connection from 192.168.56.1 which we just saw active has been closed (likely due to the user disconnecting).<br />
<br />
<br />
<br />
==Availability==<br />
This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls. In the event that the KAG server codebase is ported to Mac or BSD, this feature should be available on them as well.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-18T04:16:52Z<p>FliesLikeABrick: /* Availability */</p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.<br />
<br />
==Availability==<br />
This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls. In the event that the KAG server codebase is ported to Mac or BSD, this feature should be available on them as well.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-18T04:16:22Z<p>FliesLikeABrick: </p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.<br />
<br />
==Availability==<br />
This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Remote_AdministrationRemote Administration2012-11-18T04:13:50Z<p>FliesLikeABrick: Created page with "==Overview== As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. Thi..."</p>
<hr />
<div>==Overview==<br />
As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.<br />
<br />
==Configuration==<br />
<br />
This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).<br />
<br />
When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.<br />
<br />
==Protocol==<br />
Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.<br />
<br />
If the password is incorrect, the server will close the connection.<br />
<br />
If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.<br />
<br />
ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311<br />
Trying ::1...<br />
Connected to ::1.<br />
Escape character is '^]'.<br />
asd<br />
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated<br />
<br />
After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.<br />
<br />
Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.</div>FliesLikeABrick//wiki.kag2d.com/wiki/ServerServer2012-11-18T04:06:20Z<p>FliesLikeABrick: /* Ports */</p>
<hr />
<div>{{Build<br />
|Version = 548<br />
}}<br />
<p>This page is for the set up of the default KAG Server and then configuring it. For minimum requirements, installation, managing stability and configuration this is the right page.</p><br />
=Server Requirements=<br />
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.<br />
<br />
'''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.'''<br />
==Dedicated Servers==<br />
===Software===<br />
*The KAG server can run on almost all OS Linux, Windows, or Mac.<br />
*The recommended operating system is Linux, specifically Debian.<br />
===Lowest Hardware===<br />
*RAM: At least 128MB<br />
*CPU: At least 1 core clocked @ 1Ghz<br />
===Recommended Hardware===<br />
*RAM: 512MB<br />
*CPU: 2 cores clocked @ 2Ghz<br />
===Network===<br />
*Internet Connection speed per player scales with the number of players:<br />
*Upload to each player: (number of players - 1) * 0.3 kb/s<br />
*Download from each player: 0.5kb/s<br />
===Ports===<br />
*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 in UDP.<br />
{|border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
|<br />
! scope="col" style="background:#efefef;" | Description<br />
! scope="col" style="background:#efefef;" | Modifiable?<br />
! scope="col" style="background:#efefef;" | Firewall Tolerant?<br />
|-<br />
! scope="row" style="background:#efefef;" | 50301/udp<br />
|Used to listen for game connections.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#E83131;"|no<br />
|-<br />
! scope="row" style="background:#efefef;" | 50301/tcp<br />
|Used to listen for [[Remote Administration|remote admin (tcp rcon)]] connections.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#E83131;"|no<br />
|-<br />
! scope="row" style="background:#efefef;" | 50328/udp<br />
|Used to communicate with clients.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 80/tcp<br />
|Used for autoupdates<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 443/tcp<br />
|Used for API (server list, auth, minimaps, etc) server communication<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
|}<br />
<br />
==Residential Connections==<br />
<p>For those hosting on residential internet connections:</p><br />
* Make sure that your computer has at least the above specifications.<br />
*Keep in mind that many ISPs forbid running any kind of server, including a KAG server, they may block certain ports and dynamically assign IP addresses. <br />
=Installation=<br />
==Port Forwarding==<br />
===Router===<br />
<p>As said before KAG Servers require various ports to be open for it to run properly. If you are using a router, it most likely has its own firewall. Unfortunately since there are many router manufacturers, its almost impossible for a universal guide that would offer step-by-step instructions on how to set up these 'port forwards'. Please consult your router manufacturer's website for more precise information on how to accomplish this.</p><br />
===Windows Firewall===<br />
<p>If you are running a Windows OS this is most likely active on your computer blocking certain ports . The following steps were done on a Windows 7 computer but other Windows OS should be nearly identical.<br />
#Go to Control Panel and open the Security and Security tab.<br />
#Click on "Windows Firewall".<br />
#Click on "Advanced settings" on the left hand side column.<br />
#Right click on the "Inbound Rules" button, in the left hand side column, and select "New Rule..."<br />
#Select "Port" and click "Next".<br />
#Type in the port you wish to allow (they are found above) and click "Next".<br />
#Select "Allow this connection and click "Next"<br />
#(Recommended) Select "Domain", "Private" and "Public"<br />
#Type in a Name and click "Finish.<br />
#Repeat steps 4-9 for all the ports<br />
===Mac Firewall===<br />
#Download Portmap: http://www.macupdate.com/app/mac/27342/port-map/<br />
#Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].<br />
#Launch Portmap.<br />
#Open the required ports.<br />
===Antivirus Firewall===<br />
Like Windows Firewall, if you have an antivirus it most always has a firewall. Unfortunately since there are many antivirus products on the market, its almost impossible for a universal guide that would offer step-by-step instructions on how to set up these 'port forwards'. Please consult your antivirus brand's website for more precise information on how to accomplish this.</p><br />
==Linux Install==<br />
<p>This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the <code>ia32-libs</code> package must be installed.</p><br />
<p><br />
# '''Do this step if you have a 64-bit OS.''' Install <code>ia32-libs</code>: <br /> <pre>apt-get install ia32-libs</pre> <br />
# Download the server: <br /> <pre>wget http://dl.kag2d.com/kag-linux32-dedicated-latest.tar.gz</pre><br />
# Next, decompress the archive. <br /> <pre>tar -zxf kag-linux32-dedicated-latest.tar.gz</pre><br />
# Change to the new directory: <br /> <pre>cd kag-linux32-dedicated</pre><br />
# Run your server: <br /> <pre>./KAGdedi</pre><br /><br />
#Your default KAG Server is now running.<br />
</p><br />
==Windows Install==<br />
<p><br />
# First, download the server: http://kag2d.com/en/download <br /> <br />
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].<br />
# Open the folder the archive was extracted into.<br />
# Run your server by running <code>dedicatedserver.bat</code>.<br /><br />
#Your default KAG Server is now running.<br />
</p><br />
<br />
==Mac Install==<br />
<P>Due to their similarities, the installation instructions for Linux should apply for Macs, though Mac does not currently have a dedicated server option.<br />
If that doesn't work try this:</P><br />
#Download Trelawney's Dedicated OSX Server: http://dl.dropbox.com/u/23114384/kag/osx_dedicated.zip<br />
#Make sure that KAG is in your applications folder.<br />
#Next, decompress osx_dedicated.zip. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip]. Then lanch it.<br />
#It will says "Make sure to edit dedicated_autoconfig.gm" and a copy of KAG launches. <br />
#Your default KAG Server is now running.<br />
=Managing Instability=<br />
<p>As Alpha software, the KAG server in certain builds is very unstable. Build are sometimes crash prone but it varies from release to release due to new features mixed with bug fixes. As such, it is recommended practice to 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.</p><br />
==Keep-alive Scripts==<br />
===Linux/Mac===<br />
<p>Trelawney's Keepalive Script, <code>dedi.sh</code>, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].<br /><br />
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use <code> nano -w dedi.sh </code>.)<br /><br />
Once created, be sure to make the script executable with <code>chmod +x dedi.sh</code>.</p><br />
<pre><br />
#!/bin/bash<br />
echo "Running KAG dedicated server"<br />
echo "TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123"<br />
mv KAGdedi.tmp KAGdedi<br />
chmod +x KAGdedi<br />
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do<br />
echo "KAG server running"<br />
sleep 5<br />
done<br />
</pre><br />
<p>To use, run the script: <code>./dedi.sh</code> instead of the usual <code>./KAGdedi</code></p><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
===Windows===<br />
<p>The Beaz's Keepalive Script, <code>dedi.bat</code>, 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 <code>dedi.bat</code>.</p><br />
<pre><br />
@ECHO off<br />
<br />
:restart<br />
echo (%time%) Server Started - close this window to prevent restart.<br />
<br />
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm<br />
<br />
echo (%time%) WARNING: Server closed or crashed, restarting.<br />
<br />
goto restart<br />
</pre><br />
<p>To make it work on Windows Vista or 7 you need to disable Windows Error Reporting. To do so:<br />
*Run regedit.exe <br />
*Modify HKCU\Software\Microsoft\Windows\Windows Error Reporting\DontShowUI entry with value 1</p><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
==Daily Server Restarts==<br />
<p>If a KAG server is running in a keepalive script, a scheduled task that kills the server once a day is, effectively, a daily restart because the keepalive script will automatically restart the server.</p><br />
===Linux/Mac - Cronjob===<br />
<p>This script will kill all instances of KAGdedi at 3 AM.</p><br />
<p><br />
# Use <code>crontab -e</code> to create a new cronjob. This will open your default text editor.<br />
# In the text editor, type:<pre>0 3 * * * pkill -1 KAGdedi</pre><br />
# Close editor. Cronjob installed!</p><br />
===Windows - Task Scheduler===<br />
"Needs info"<br />
<br />
==Checking for Updates==<br />
So far there is not a public script to restart a server when an update is available, but the following logic should be able to be combined with a restart script above to restart a server once an update is available.<br />
<br />
<pre>curl -s http://update.kag2d.com/linux32-dedicated-release/App/version.txt | head -n1 | cut -d ' ' -f2<br />
1337154874-636-6e12e0f833b0</pre><br />
<br />
When that string (the 2nd whitespace-delimited element of the first line of that URL) changes, an update is available. The first number is the unix timestamp of the build, the 2nd is the code revision, the 3rd is a hex identifier used internally by the developers. You should be able to just monitor for a change. You could also use logic involving watching the first two parts of the string to see if they increment, but the format of this string may change in the future.<br />
<br />
=Configuration=<br />
<p>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 or by using a Configuration Tool. Of the two, a tool is far the fastest and easiest method, yet manual returns greater results.</p><br />
==JackD's/Maqq's Tool==<br />
===Windows GUI===<br />
Requirements:<br />
*NET Framework 2.0 or higher<br />
Installation:<br />
#Download the tool: http://dl.dropbox.com/u/65858755/KAGServerConfigTool/KAG_Server_Config_Tool.zip<br />
#Extract it and copy the contents into your KAG Servers root folder (e.g. C:\KAG).<br />
#Run KAGServer.exe <br />
#On first start you should go to the "Help" tab and select "Check for updates" to make sure you are using the newest version of the tool.<br />
#Once the update has finished, follow the GUI's instructions and run the server.<br />
===Linux/Mac GUI===<br />
Requirements:<br />
*Mono 2.10.8<br />
Installation:<br />
#Download the tool: http://dl.dropbox.com/u/65858755/KAGServerConfigTool/KAG_Server_Config_Tool.zip<br />
#Extract it and copy the contents into your KAG Servers root folder<br />
#Change to the directory in the console, e.g.:<pre>cd kag_linux</pre><br />
#Make it executable: <pre>chmod +x ./RunKAGServerCT.sh</pre><br />
#Start the app executing the RunKAGServerCT.sh script on a terminal window:<pre> ./RunKAGServerCT.sh</pre><br />
#On first start you should go to the "Help" tab and select "Check for updates" to make sure you are using the newest version of the tool.<br />
#Once the update has finished, follow the GUI's instructions and run the server.<br />
==Manual==<br />
<p>'''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 ([https://forum.kag2d.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-25-12-2011.1128/ In-game moderators (AKA Royal Guard)] & [https://forum.kag2d.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ & Public Policy]) so you can make an informed decision.'''</p><br />
<p>If you decide you don't want guards to moderate on your server, ''please ensure they are turned off'' in your dedicated_autoconfig.gm file like this:</p><br />
===dedicated_autoconfig.gm===<br />
<br />
<p>Of the many modifiable variables, these are some of the most important:<br />
<br />
<pre><br />
global m_width = 600; // Map generator width. Affects RAM usage.<br />
global m_height = 250; // Map generator height. Affects RAM usage.<br />
global m_seed = 0; // Map generator seed. Pick a random number.<br />
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.<br />
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.<br />
global g_vote_time = 60; // How long (in seconds) does the voting take place.<br />
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.<br />
global sv_maxplayers = 16; // Maximum number of players allowed ingame.<br />
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.<br />
global sv_password = ``; // Sets the server password.<br />
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.<br />
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.<br />
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).<br />
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.<br />
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.<br />
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.<br />
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.<br />
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.<br />
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server<br />
global sv_name = `KAG game`; // Sets the server name displayed in server browser.<br />
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.<br />
</pre></p><br />
<br />
===dedicated_autostart.gm===<br />
<br />
<p><pre><br />
// autostart on dedicated server launch<br />
<br />
<br />
//set autostartswitch to:<br />
// 0 for CTF <br />
// 1 for TDM<br />
// 2 for Sandbox<br />
// 3 for Zombies<br />
// 4 for RTDM<br />
// 10 for TEST<br />
<br />
global autostartswitch = 0;<br />
<br />
newWorld( "" );<br />
switchGameState(0);<br />
<br />
startServer(); <br />
<br />
if (autostartswitch == 0) //ctf<br />
{<br />
LoadRules("Rules/CTF/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded CTF default config`);<br />
}<br />
else if (autostartswitch == 1) //tdm<br />
{<br />
LoadRules("Rules/TDM/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 2) //sandbox<br />
{<br />
LoadRules("Rules/Sandbox/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 3) //zombies (GOLD ONLY)<br />
{<br />
LoadRules("Rules/Zombie_Survival/gamemode.cfg");<br />
LoadMapCycle( "Rules/Zombie_Survival/ZombieMapCycle.cfg" );<br />
LoadMap( "" );<br />
<br />
print(`Loaded zombies default config : server now in GOLD MODE`);<br />
} else if (autostartswitch == 4) //rtdm<br />
{<br />
LoadRules("Rules/RTDM/gamemode.cfg");<br />
LoadMapCycle( "Rules/RTDM/RTDMMapCycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded RTDM default config`);<br />
}else<br />
if (autostartswitch == 10) //test<br />
{<br />
LoadRules("Rules/TEST/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TEST default config`);<br />
}<br />
<br />
print(`Config finished loading from Scripts/Server/dedicated_autostart.gm`);<br />
<br />
</pre><br />
<br />
This file is very important. If you want to change rules for your server then you have to edit the global autostartswitch variable. <br /><br />
For an individual Rule there is the the number 10. If you want to make a Zombie Survival Server or any modded Server you need to make your server for Gold users only ( see dedicated_autoconfig.gm)</p><br />
<br />
===mapcycle.cfg===<br />
<br />
<p><pre><br />
#KAG mapcycle;<br />
# put map generator files, png files here, or script files<br />
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;<br />
<br />
mapcycle = Maps/generator_ctf_mountain.cfg;<br />
</pre><br />
<br />
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.</p><br />
===Remote Control===<br />
<p>A server can be controlled in-game. While connected to the server, press the HOME key to open the console. A full list of available rcon commands can be found [[Commands|here]]. In order to remote control a server however you must be set as an administrator in the servers configuration files. The system KAG uses for this is found bellow.</p><br />
<br />
===[[Security Levels]]===<br />
{{:Security_Levels}}<br />
<br />
[[Security_Levels|''Read more...'']]<br />
<br />
==Blacklisting & Whitelisting==<br />
<p>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.</p><br />
<p>The contents of the file <code>securitysetup.cfg</code> in <code>kagServer/Base/Security</code> (where kagServer is the path to the kagServer's directory) should look something like this:</p><br />
<pre><br />
# Security setup<br />
<br />
# Set to 1 to allow only the names in the whitelist or 0 to disallow the names in the blacklist<br />
whitelist_active = 0<br />
whitelist_file = Security/whitelist.cfg<br />
blacklist_file = Security/blacklist.cfg<br />
<br />
# Path to file where security levels are defined<br />
seclevs_file = Security/seclevs.cfg<br />
<br />
</pre><br />
<p>Note: The whitelist overrides the blacklist if enabled.</p><br />
<br />
===Whitelist===<br />
<p>If you are using the whitelist, then at the path specified in whitelist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Whitelist format: name; anothername; yetanothername;<br />
whitelist =<br />
name;<br />
anothername;<br />
yetanothername;<br />
</pre><br />
<p>Simply add usernames in this way to allow only those players access to the server.</p><br />
<br />
===Blacklist===<br />
<p>If you are using the blacklist, then at the path specified in blacklist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Blacklist format: name; IP; expiration time and date h:m:s:d:M:y; reason;<br />
# IP of 0.0.0.0 means no IP is banned, and the user is just banned by username.<br />
# Blank username means no user is banned for that entry and it's just by IP.<br />
# The time is in C++ struct tm format except for the year, which is human readable. Get relative times from /listbans on the console. <br />
# eg: 10:30:0:31:11:2050 is 10:30 AM on the 31st of December 2050AD<br />
<br />
blacklist =<br />
name1; 0.0.0.0; 10:30:0:31:11:2050; Banned;<br />
name2; 12.34.45.78; 10:30:0:31:11:2050; Banned;<br />
</pre><br />
<p>Simply add player details in the format described to ban them from the server. Alternatively, just use the ban menus or rcon commands in game to ban users.<br />
Note that January is the 0th month</p><br />
<br />
<br />
<br />
<br />
[[Category:Server]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/ServerServer2012-11-18T04:03:46Z<p>FliesLikeABrick: /* Ports */</p>
<hr />
<div>{{Build<br />
|Version = 548<br />
}}<br />
<p>This page is for the set up of the default KAG Server and then configuring it. For minimum requirements, installation, managing stability and configuration this is the right page.</p><br />
=Server Requirements=<br />
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.<br />
<br />
'''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.'''<br />
==Dedicated Servers==<br />
===Software===<br />
*The KAG server can run on almost all OS Linux, Windows, or Mac.<br />
*The recommended operating system is Linux, specifically Debian.<br />
===Lowest Hardware===<br />
*RAM: At least 128MB<br />
*CPU: At least 1 core clocked @ 1Ghz<br />
===Recommended Hardware===<br />
*RAM: 512MB<br />
*CPU: 2 cores clocked @ 2Ghz<br />
===Network===<br />
*Internet Connection speed per player scales with the number of players:<br />
*Upload to each player: (number of players - 1) * 0.3 kb/s<br />
*Download from each player: 0.5kb/s<br />
===Ports===<br />
*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 in UDP.<br />
{|border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
|<br />
! scope="col" style="background:#efefef;" | Description<br />
! scope="col" style="background:#efefef;" | Modifiable?<br />
! scope="col" style="background:#efefef;" | Firewall Tolerant?<br />
|-<br />
! scope="row" style="background:#efefef;" | 50301/udp<br />
|Used to listen for game connections.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#E83131;"|no<br />
|-<br />
! scope="row" style="background:#efefef;" | 50301/tcp<br />
|Used to listen for remote admin (tcp rcon) connections.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#E83131;"|no<br />
|-<br />
! scope="row" style="background:#efefef;" | 50328/udp<br />
|Used to communicate with clients.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 80/tcp<br />
|Used for autoupdates<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 443/tcp<br />
|Used for API (server list, auth, minimaps, etc) server communication<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
|}<br />
<br />
==Residential Connections==<br />
<p>For those hosting on residential internet connections:</p><br />
* Make sure that your computer has at least the above specifications.<br />
*Keep in mind that many ISPs forbid running any kind of server, including a KAG server, they may block certain ports and dynamically assign IP addresses. <br />
=Installation=<br />
==Port Forwarding==<br />
===Router===<br />
<p>As said before KAG Servers require various ports to be open for it to run properly. If you are using a router, it most likely has its own firewall. Unfortunately since there are many router manufacturers, its almost impossible for a universal guide that would offer step-by-step instructions on how to set up these 'port forwards'. Please consult your router manufacturer's website for more precise information on how to accomplish this.</p><br />
===Windows Firewall===<br />
<p>If you are running a Windows OS this is most likely active on your computer blocking certain ports . The following steps were done on a Windows 7 computer but other Windows OS should be nearly identical.<br />
#Go to Control Panel and open the Security and Security tab.<br />
#Click on "Windows Firewall".<br />
#Click on "Advanced settings" on the left hand side column.<br />
#Right click on the "Inbound Rules" button, in the left hand side column, and select "New Rule..."<br />
#Select "Port" and click "Next".<br />
#Type in the port you wish to allow (they are found above) and click "Next".<br />
#Select "Allow this connection and click "Next"<br />
#(Recommended) Select "Domain", "Private" and "Public"<br />
#Type in a Name and click "Finish.<br />
#Repeat steps 4-9 for all the ports<br />
===Mac Firewall===<br />
#Download Portmap: http://www.macupdate.com/app/mac/27342/port-map/<br />
#Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].<br />
#Launch Portmap.<br />
#Open the required ports.<br />
===Antivirus Firewall===<br />
Like Windows Firewall, if you have an antivirus it most always has a firewall. Unfortunately since there are many antivirus products on the market, its almost impossible for a universal guide that would offer step-by-step instructions on how to set up these 'port forwards'. Please consult your antivirus brand's website for more precise information on how to accomplish this.</p><br />
==Linux Install==<br />
<p>This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the <code>ia32-libs</code> package must be installed.</p><br />
<p><br />
# '''Do this step if you have a 64-bit OS.''' Install <code>ia32-libs</code>: <br /> <pre>apt-get install ia32-libs</pre> <br />
# Download the server: <br /> <pre>wget http://dl.kag2d.com/kag-linux32-dedicated-latest.tar.gz</pre><br />
# Next, decompress the archive. <br /> <pre>tar -zxf kag-linux32-dedicated-latest.tar.gz</pre><br />
# Change to the new directory: <br /> <pre>cd kag-linux32-dedicated</pre><br />
# Run your server: <br /> <pre>./KAGdedi</pre><br /><br />
#Your default KAG Server is now running.<br />
</p><br />
==Windows Install==<br />
<p><br />
# First, download the server: http://kag2d.com/en/download <br /> <br />
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].<br />
# Open the folder the archive was extracted into.<br />
# Run your server by running <code>dedicatedserver.bat</code>.<br /><br />
#Your default KAG Server is now running.<br />
</p><br />
<br />
==Mac Install==<br />
<P>Due to their similarities, the installation instructions for Linux should apply for Macs, though Mac does not currently have a dedicated server option.<br />
If that doesn't work try this:</P><br />
#Download Trelawney's Dedicated OSX Server: http://dl.dropbox.com/u/23114384/kag/osx_dedicated.zip<br />
#Make sure that KAG is in your applications folder.<br />
#Next, decompress osx_dedicated.zip. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip]. Then lanch it.<br />
#It will says "Make sure to edit dedicated_autoconfig.gm" and a copy of KAG launches. <br />
#Your default KAG Server is now running.<br />
=Managing Instability=<br />
<p>As Alpha software, the KAG server in certain builds is very unstable. Build are sometimes crash prone but it varies from release to release due to new features mixed with bug fixes. As such, it is recommended practice to 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.</p><br />
==Keep-alive Scripts==<br />
===Linux/Mac===<br />
<p>Trelawney's Keepalive Script, <code>dedi.sh</code>, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].<br /><br />
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use <code> nano -w dedi.sh </code>.)<br /><br />
Once created, be sure to make the script executable with <code>chmod +x dedi.sh</code>.</p><br />
<pre><br />
#!/bin/bash<br />
echo "Running KAG dedicated server"<br />
echo "TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123"<br />
mv KAGdedi.tmp KAGdedi<br />
chmod +x KAGdedi<br />
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do<br />
echo "KAG server running"<br />
sleep 5<br />
done<br />
</pre><br />
<p>To use, run the script: <code>./dedi.sh</code> instead of the usual <code>./KAGdedi</code></p><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
===Windows===<br />
<p>The Beaz's Keepalive Script, <code>dedi.bat</code>, 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 <code>dedi.bat</code>.</p><br />
<pre><br />
@ECHO off<br />
<br />
:restart<br />
echo (%time%) Server Started - close this window to prevent restart.<br />
<br />
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm<br />
<br />
echo (%time%) WARNING: Server closed or crashed, restarting.<br />
<br />
goto restart<br />
</pre><br />
<p>To make it work on Windows Vista or 7 you need to disable Windows Error Reporting. To do so:<br />
*Run regedit.exe <br />
*Modify HKCU\Software\Microsoft\Windows\Windows Error Reporting\DontShowUI entry with value 1</p><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
==Daily Server Restarts==<br />
<p>If a KAG server is running in a keepalive script, a scheduled task that kills the server once a day is, effectively, a daily restart because the keepalive script will automatically restart the server.</p><br />
===Linux/Mac - Cronjob===<br />
<p>This script will kill all instances of KAGdedi at 3 AM.</p><br />
<p><br />
# Use <code>crontab -e</code> to create a new cronjob. This will open your default text editor.<br />
# In the text editor, type:<pre>0 3 * * * pkill -1 KAGdedi</pre><br />
# Close editor. Cronjob installed!</p><br />
===Windows - Task Scheduler===<br />
"Needs info"<br />
<br />
==Checking for Updates==<br />
So far there is not a public script to restart a server when an update is available, but the following logic should be able to be combined with a restart script above to restart a server once an update is available.<br />
<br />
<pre>curl -s http://update.kag2d.com/linux32-dedicated-release/App/version.txt | head -n1 | cut -d ' ' -f2<br />
1337154874-636-6e12e0f833b0</pre><br />
<br />
When that string (the 2nd whitespace-delimited element of the first line of that URL) changes, an update is available. The first number is the unix timestamp of the build, the 2nd is the code revision, the 3rd is a hex identifier used internally by the developers. You should be able to just monitor for a change. You could also use logic involving watching the first two parts of the string to see if they increment, but the format of this string may change in the future.<br />
<br />
=Configuration=<br />
<p>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 or by using a Configuration Tool. Of the two, a tool is far the fastest and easiest method, yet manual returns greater results.</p><br />
==JackD's/Maqq's Tool==<br />
===Windows GUI===<br />
Requirements:<br />
*NET Framework 2.0 or higher<br />
Installation:<br />
#Download the tool: http://dl.dropbox.com/u/65858755/KAGServerConfigTool/KAG_Server_Config_Tool.zip<br />
#Extract it and copy the contents into your KAG Servers root folder (e.g. C:\KAG).<br />
#Run KAGServer.exe <br />
#On first start you should go to the "Help" tab and select "Check for updates" to make sure you are using the newest version of the tool.<br />
#Once the update has finished, follow the GUI's instructions and run the server.<br />
===Linux/Mac GUI===<br />
Requirements:<br />
*Mono 2.10.8<br />
Installation:<br />
#Download the tool: http://dl.dropbox.com/u/65858755/KAGServerConfigTool/KAG_Server_Config_Tool.zip<br />
#Extract it and copy the contents into your KAG Servers root folder<br />
#Change to the directory in the console, e.g.:<pre>cd kag_linux</pre><br />
#Make it executable: <pre>chmod +x ./RunKAGServerCT.sh</pre><br />
#Start the app executing the RunKAGServerCT.sh script on a terminal window:<pre> ./RunKAGServerCT.sh</pre><br />
#On first start you should go to the "Help" tab and select "Check for updates" to make sure you are using the newest version of the tool.<br />
#Once the update has finished, follow the GUI's instructions and run the server.<br />
==Manual==<br />
<p>'''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 ([https://forum.kag2d.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-25-12-2011.1128/ In-game moderators (AKA Royal Guard)] & [https://forum.kag2d.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ & Public Policy]) so you can make an informed decision.'''</p><br />
<p>If you decide you don't want guards to moderate on your server, ''please ensure they are turned off'' in your dedicated_autoconfig.gm file like this:</p><br />
===dedicated_autoconfig.gm===<br />
<br />
<p>Of the many modifiable variables, these are some of the most important:<br />
<br />
<pre><br />
global m_width = 600; // Map generator width. Affects RAM usage.<br />
global m_height = 250; // Map generator height. Affects RAM usage.<br />
global m_seed = 0; // Map generator seed. Pick a random number.<br />
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.<br />
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.<br />
global g_vote_time = 60; // How long (in seconds) does the voting take place.<br />
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.<br />
global sv_maxplayers = 16; // Maximum number of players allowed ingame.<br />
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.<br />
global sv_password = ``; // Sets the server password.<br />
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.<br />
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.<br />
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).<br />
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.<br />
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.<br />
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.<br />
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.<br />
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.<br />
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server<br />
global sv_name = `KAG game`; // Sets the server name displayed in server browser.<br />
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.<br />
</pre></p><br />
<br />
===dedicated_autostart.gm===<br />
<br />
<p><pre><br />
// autostart on dedicated server launch<br />
<br />
<br />
//set autostartswitch to:<br />
// 0 for CTF <br />
// 1 for TDM<br />
// 2 for Sandbox<br />
// 3 for Zombies<br />
// 4 for RTDM<br />
// 10 for TEST<br />
<br />
global autostartswitch = 0;<br />
<br />
newWorld( "" );<br />
switchGameState(0);<br />
<br />
startServer(); <br />
<br />
if (autostartswitch == 0) //ctf<br />
{<br />
LoadRules("Rules/CTF/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded CTF default config`);<br />
}<br />
else if (autostartswitch == 1) //tdm<br />
{<br />
LoadRules("Rules/TDM/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 2) //sandbox<br />
{<br />
LoadRules("Rules/Sandbox/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 3) //zombies (GOLD ONLY)<br />
{<br />
LoadRules("Rules/Zombie_Survival/gamemode.cfg");<br />
LoadMapCycle( "Rules/Zombie_Survival/ZombieMapCycle.cfg" );<br />
LoadMap( "" );<br />
<br />
print(`Loaded zombies default config : server now in GOLD MODE`);<br />
} else if (autostartswitch == 4) //rtdm<br />
{<br />
LoadRules("Rules/RTDM/gamemode.cfg");<br />
LoadMapCycle( "Rules/RTDM/RTDMMapCycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded RTDM default config`);<br />
}else<br />
if (autostartswitch == 10) //test<br />
{<br />
LoadRules("Rules/TEST/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TEST default config`);<br />
}<br />
<br />
print(`Config finished loading from Scripts/Server/dedicated_autostart.gm`);<br />
<br />
</pre><br />
<br />
This file is very important. If you want to change rules for your server then you have to edit the global autostartswitch variable. <br /><br />
For an individual Rule there is the the number 10. If you want to make a Zombie Survival Server or any modded Server you need to make your server for Gold users only ( see dedicated_autoconfig.gm)</p><br />
<br />
===mapcycle.cfg===<br />
<br />
<p><pre><br />
#KAG mapcycle;<br />
# put map generator files, png files here, or script files<br />
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;<br />
<br />
mapcycle = Maps/generator_ctf_mountain.cfg;<br />
</pre><br />
<br />
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.</p><br />
===Remote Control===<br />
<p>A server can be controlled in-game. While connected to the server, press the HOME key to open the console. A full list of available rcon commands can be found [[Commands|here]]. In order to remote control a server however you must be set as an administrator in the servers configuration files. The system KAG uses for this is found bellow.</p><br />
<br />
===[[Security Levels]]===<br />
{{:Security_Levels}}<br />
<br />
[[Security_Levels|''Read more...'']]<br />
<br />
==Blacklisting & Whitelisting==<br />
<p>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.</p><br />
<p>The contents of the file <code>securitysetup.cfg</code> in <code>kagServer/Base/Security</code> (where kagServer is the path to the kagServer's directory) should look something like this:</p><br />
<pre><br />
# Security setup<br />
<br />
# Set to 1 to allow only the names in the whitelist or 0 to disallow the names in the blacklist<br />
whitelist_active = 0<br />
whitelist_file = Security/whitelist.cfg<br />
blacklist_file = Security/blacklist.cfg<br />
<br />
# Path to file where security levels are defined<br />
seclevs_file = Security/seclevs.cfg<br />
<br />
</pre><br />
<p>Note: The whitelist overrides the blacklist if enabled.</p><br />
<br />
===Whitelist===<br />
<p>If you are using the whitelist, then at the path specified in whitelist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Whitelist format: name; anothername; yetanothername;<br />
whitelist =<br />
name;<br />
anothername;<br />
yetanothername;<br />
</pre><br />
<p>Simply add usernames in this way to allow only those players access to the server.</p><br />
<br />
===Blacklist===<br />
<p>If you are using the blacklist, then at the path specified in blacklist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Blacklist format: name; IP; expiration time and date h:m:s:d:M:y; reason;<br />
# IP of 0.0.0.0 means no IP is banned, and the user is just banned by username.<br />
# Blank username means no user is banned for that entry and it's just by IP.<br />
# The time is in C++ struct tm format except for the year, which is human readable. Get relative times from /listbans on the console. <br />
# eg: 10:30:0:31:11:2050 is 10:30 AM on the 31st of December 2050AD<br />
<br />
blacklist =<br />
name1; 0.0.0.0; 10:30:0:31:11:2050; Banned;<br />
name2; 12.34.45.78; 10:30:0:31:11:2050; Banned;<br />
</pre><br />
<p>Simply add player details in the format described to ban them from the server. Alternatively, just use the ban menus or rcon commands in game to ban users.<br />
Note that January is the 0th month</p><br />
<br />
<br />
<br />
<br />
[[Category:Server]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/File:Screen_shot_2011-06-02_at_12.10.33_PM.pngFile:Screen shot 2011-06-02 at 12.10.33 PM.png2012-09-28T20:55:36Z<p>FliesLikeABrick: </p>
<hr />
<div></div>FliesLikeABrick//wiki.kag2d.com/wiki/File:Screen_shot_2011-06-23_at_1.49.27_PM.pngFile:Screen shot 2011-06-23 at 1.49.27 PM.png2012-09-28T20:49:16Z<p>FliesLikeABrick: </p>
<hr />
<div></div>FliesLikeABrick//wiki.kag2d.com/wiki/Client_Not_UpdatingClient Not Updating2012-09-27T03:03:56Z<p>FliesLikeABrick: </p>
<hr />
<div>If your client is not updating (the build number does not match that which you know to be recent):<br />
* '''DO THIS FIRST:''' Open up your KAG directory (probably c:\KAG or c:\Users\youruser\KAG) and e-mail (as attachments) your Logs/system.txt and Logs/app.txt files to ryan@u13.net (FliesLikeABrick). He is working on understanding why so many people are having update problems and '''NEED THESE FILES'''<br />
* Copy Logs/app.txt somewhere (yes, copy it somewhere, don't just open it - this is so you don't lose the current file the next time you run KAG). Open it up and look at the first 20 lines or so for the error relating to autoupdate. You can post your app.txt log file on the Help forum and someone can help you figure out what is wrong. <br />
* A quick possible fix is to delete App/version.txt and restart KAG<br />
* (Windows only) If your KAG is installed inside c:\Program Files\ or you installed it from Desura, this is possibly a permissions problem. Try installing KAG from the homepage download into the default location (It will install inside your profile under c:\Users\*)<br />
<br />
[[Category:Troubleshooting]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Client_Not_UpdatingClient Not Updating2012-09-27T02:40:29Z<p>FliesLikeABrick: </p>
<hr />
<div>If your client is not updating (the build number does not match that which you know to be recent):<br />
* Copy Logs/app.txt somewhere (yes, copy it somewhere, don't just open it - this is so you don't lose the current file the next time you run KAG). Open it up and look at the first 20 lines or so for the error relating to autoupdate. You can post your app.txt log file on the Help forum and someone can help you figure out what is wrong. '''E-mail this file to FliesLikeABrick: ryan@u13.net''' so that he can find and fix any bugs in the autoupdater that might be causing this problem<br />
* A quick possible fix is to delete App/version.txt and restart KAG<br />
* (Windows only) If your KAG is installed inside c:\Program Files\ or you installed it from Desura, this is possibly a permissions problem. Try installing KAG from the homepage download into the default location (It will install inside your profile under c:\Users\*)<br />
<br />
[[Category:Troubleshooting]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Client_Not_UpdatingClient Not Updating2012-09-19T20:21:40Z<p>FliesLikeABrick: Created page with "If your client is not updating (the build number does not match that which you know to be recent): * Copy Logs/app.txt somewhere (yes, copy it somewhere, don't just open it - thi..."</p>
<hr />
<div>If your client is not updating (the build number does not match that which you know to be recent):<br />
* Copy Logs/app.txt somewhere (yes, copy it somewhere, don't just open it - this is so you don't lose the current file the next time you run KAG). Open it up and look at the first 20 lines or so for the error relating to autoupdate. You can post your app.txt log file on the Help forum and someone can help you figure out what is wrong<br />
* A quick possible fix is to delete App/version.txt and restart KAG<br />
* (Windows only) If your KAG is installed inside c:\Program Files\ or you installed it from Desura, this is possibly a permissions problem. Try installing KAG from the homepage download into the default location (It will install inside your profile under c:\Users\*)</div>FliesLikeABrick//wiki.kag2d.com/wiki/No_ServersNo Servers2012-09-19T20:19:39Z<p>FliesLikeABrick: </p>
<hr />
<div>If no servers show up in your server list, check the following:<br />
<br />
* Verify that you do not have 'Beginner' selected in the upper server sort selection<br />
* Verify that your client is up to date. The build number in the lower right corner of your client (or in the title of the window) should match the latest build release post on http://devlog.kag2d.com<br />
* If your client is not updating, see [[Client Not Updating]]<br />
<br />
<br />
If you still can not figure it out, post your App/version.txt and Logs/app.txt on the KAG Help forum and one of the devs or other community members will help you find the solution.<br />
<br />
Verify in the first few lines of Logs/app.txt that you have the correct (release) version of the client. The version.txt URL shown should say *32-client-release/ in it. If it says client-test, that is likely your problem. Reinstall KAG from the homepage.</div>FliesLikeABrick//wiki.kag2d.com/wiki/No_ServersNo Servers2012-09-19T20:14:38Z<p>FliesLikeABrick: Created page with "If no servers show up in your server list, check the following: * Verify that you do not have 'Beginner' selected in the upper server sort selection * Verify that your client is..."</p>
<hr />
<div>If no servers show up in your server list, check the following:<br />
<br />
* Verify that you do not have 'Beginner' selected in the upper server sort selection<br />
* Verify that your client is up to date. The build number in the lower right corner of your client (or in the title of the window) should match the latest build release post on http://devlog.kag2d.com<br />
* If your client is not updating, see [[Client Not Updating]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Known_issuesKnown issues2012-09-19T20:13:21Z<p>FliesLikeABrick: </p>
<hr />
<div>{{Needs Content}}<br />
{{Build<br />
|Version = old<br />
}}<br />
Close as many unnecessary programs as possible if you experience crashes at the start of KAG. For further support report your problems at the [https://forum.kag2d.com/forums/help/ forum].<br />
<br />
==Software incompatibilities==<br />
* There's an incompatibility with [http://www.mumble.com Mumble] at the moment. Currently, the only way is to disable Mumble's overlay (configuration -> overlay category -> uncheck Activate Overlay).<br />
<br />
==Ingame problems==<br />
* You may not be able to chat ingame if you're using some Latin or other foreign keyboard layout. Change the layout to "English" to fix this.<br />
* If the cursor of the builder (white square) is out of place, try running the game in fullscreen-mode ([ESC] --> Settings --> Video --> Fullscreen).<br />
* If you get stuck inside the terrain and are unable to suicide, disconnect from the server and join again or drink poison ([Backspace]) to suicide.<br />
* Blocks can't be destroyed sometimes.<br />
* Screenshots captured with [F4] will show weird wispy white clouds. These "clouds" are accidentally saved in the alpha channel. Just save the screenshots in "jpg"-format or open them with any program that doesn't support alpha channel, like Paint.<br />
* [[No Servers]] show up in your server list<br />
* [[Client Not Updating]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/ServerServer2012-09-08T00:32:55Z<p>FliesLikeABrick: /* Checking for Updates */</p>
<hr />
<div>{{Build<br />
|Version = 458<br />
}}<br />
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.<br />
<br />
'''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.'''<br />
=Features=<br />
*All servers are added to the official server list to be seen by anybody who chooses the "Pick a Server" option in-game.<br />
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.<br />
*Servers can be password protected. (This is separate from the RCON password.)<br />
=Requirements=<br />
==Hardware==<br />
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.<br />
==Software==<br />
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.<br />
==Network==<br />
<p>The KAG server isn't designed to work on computers without an Internet connection. It is, however, [https://forum.kag2d.com/index.php?threads/lan-no-internet-server.4135/ still possible] to run it without one.</p><br />
<p>The KAG server uses four ports:<br />
{|border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
|<br />
! scope="col" style="background:#efefef;" | Description<br />
! scope="col" style="background:#efefef;" | Modifiable?<br />
! scope="col" style="background:#efefef;" | Firewall Tolerant?<br />
|-<br />
! scope="row" style="background:#efefef;" | 50301/udp<br />
|Used to listen for connections.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#E83131;"|no<br />
|-<br />
! scope="row" style="background:#efefef;" | 50328/udp<br />
|Used to communicate with clients.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 80/tcp<br />
|Used for autoupdates<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 443/tcp<br />
|Used for API (server list, auth, minimaps, etc) server communication<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
<br />
|}<br />
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 in UDP.</p><p><br />
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.</p><br />
===Hosting on Residential Connections===<br />
<p>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. <br />
*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.)<br />
*[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.</p><br />
<br />
=Installation=<br />
==Linux==<br />
<p>This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the <code>ia32-libs</code> package must be installed.</p><br />
<p><br />
# First, download the server: <br /> <pre>wget http://dl.kag2d.com/kag-linux32-dedicated-latest.tar.gz</pre><br />
# Next, decompress the archive. <br /> <pre>tar -zxf kag-linux32-dedicated-latest.tar.gz</pre><br />
# Change to the new directory: <br /> <pre>cd kag-linux32-dedicated</pre><br />
# [[Server#Configuration|Configure]] your server.<br />
# Run your server: <br /> <pre>./KAGdedi</pre><br />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.<br />
</p><br />
<br />
==Windows==<br />
<p><br />
# First, download the server: http://kag2d.com/en/download <br /> Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.<br />
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].<br />
# Open the folder the archive was extracted into.<br />
# [[Server#Configuration|Configure]] your server.<br />
# Run your server by clicking <code>dedicatedserver.bat</code>.<br />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.<br />
</p><br />
<br />
==Mac==<br />
Due to their similarities, the installation instructions for Linux should apply for Macs, though Mac does not currently have a dedicated server option.<br />
<br />
<br />
If that doesn't work try this:<br />
<br />
What you will need:<br />
<br />
1. Portmap: http://www.macupdate.com/app/mac/27342/port-map/<br />
<br />
2. Trelawney's Dedicated OSX Server: http://dl.dropbox.com/u/23114384/kag/osx_dedicated.zip<br />
<br />
3. You will not need the Linux dedicated server<br />
<br />
Part 1:<br />
<br />
1. Make sure that KAG is in your applications folder. This should be default for most users<br />
<br />
2. Make a copy of KAG by right clicking it and selecting "Duplicate"<br />
<br />
3. Right click on the original KAG and select "Show Package Contents"<br />
<br />
4. Follow the folders to the "Scripts" folder via Contents>MacOS>Base>Scripts<br />
<br />
5. Open the "Scripts" folder and right click on the "dedicated_autoconfig.gm" file and open with textedit<br />
<br />
6. Configure your server be sure not to miss the "sv_name" and "sv_info". Make sure the "sv_ip" is set to 0<br />
<br />
7. Make sure the "sv_port" is equal to 50302. The default 50301 did not work for me<br />
<br />
8. Save this file<br />
<br />
Part 2:<br />
<br />
1. Unzip Portmap and launch it<br />
<br />
2. Open the following ports on both UDP and TCP:<br />
<br />
i. 443<br />
<br />
ii. 80<br />
<br />
iii. 50301<br />
<br />
iv. 50302<br />
<br />
v. 50328<br />
<br />
vi. 25565<br />
<br />
<br />
All of these ports probably aren't necessary but it worked for me so that's what I'm suggesting. All the ports should have a green light. If they are yellow or red PM me or post in this thread and I might be able to help.<br />
<br />
Part 3:<br />
<br />
1. Unzip osx_dedicated and launch it<br />
<br />
2. You should come to a point where it says "Make sure to edit dedicated_autoconfig.gm" and a copy of KAG launches. This is not an error or a freeze! This confused me a lot but this is what is supposed to happen.<br />
<br />
3. Go back to your Applications folder and launch the Kag Copy not the original. You should see your server in the browser.<br />
<br />
=Configuration=<br />
<p>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.</p><br />
<p>'''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 ([https://forum.kag2d.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-25-12-2011.1128/ In-game moderators (AKA Royal Guard)] & [https://forum.kag2d.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ & Public Policy]) so you can make an informed decision.'''</p><br />
<p>If you decide you don't want guards to moderate on your server, ''please ensure they are turned off'' in your dedicated_autoconfig.gm file like this:<br />
<br />
<font size=2><pre><br />
global sv_allow_globals_mods = 0;<br />
</pre></font></p><br />
==Manual Configuration==<br />
Of the many editable configuration files that the KAG server depends upon, most customization is done in the <code>dedicated_autoconfig.gm</code>, <code>dedicated_autostart.gm</code>, <code>mapcycle.cfg</code>, and <code>*-generator.cfg</code> files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.<br />
===dedicated_autoconfig.gm===<br />
<br />
<p>Of the many modifiable variables, these are some of the most important:<br />
<br />
<pre><br />
global m_width = 600; // Map generator width. Affects RAM usage.<br />
global m_height = 250; // Map generator height. Affects RAM usage.<br />
global m_seed = 0; // Map generator seed. Pick a random number.<br />
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.<br />
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.<br />
global g_vote_time = 60; // How long (in seconds) does the voting take place.<br />
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.<br />
global sv_maxplayers = 16; // Maximum number of players allowed ingame.<br />
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.<br />
global sv_password = ``; // Sets the server password.<br />
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.<br />
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.<br />
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).<br />
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.<br />
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.<br />
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.<br />
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.<br />
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.<br />
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server<br />
global sv_name = `KAG game`; // Sets the server name displayed in server browser.<br />
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.<br />
</pre></p><br />
<br />
===dedicated_autostart.gm===<br />
<br />
<p><pre><br />
// autostart on dedicated server launch<br />
<br />
<br />
//set autostartswitch to:<br />
// 0 for CTF <br />
// 1 for TDM<br />
// 2 for Sandbox<br />
// 3 for Zombies<br />
// 4 for RTDM<br />
// 10 for TEST<br />
<br />
global autostartswitch = 0;<br />
<br />
newWorld( "" );<br />
switchGameState(0);<br />
<br />
startServer(); <br />
<br />
if (autostartswitch == 0) //ctf<br />
{<br />
LoadRules("Rules/CTF/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded CTF default config`);<br />
}<br />
else if (autostartswitch == 1) //tdm<br />
{<br />
LoadRules("Rules/TDM/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 2) //sandbox<br />
{<br />
LoadRules("Rules/Sandbox/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 3) //zombies (GOLD ONLY)<br />
{<br />
LoadRules("Rules/Zombie_Survival/gamemode.cfg");<br />
LoadMapCycle( "Rules/Zombie_Survival/ZombieMapCycle.cfg" );<br />
LoadMap( "" );<br />
<br />
print(`Loaded zombies default config : server now in GOLD MODE`);<br />
} else if (autostartswitch == 4) //rtdm<br />
{<br />
LoadRules("Rules/RTDM/gamemode.cfg");<br />
LoadMapCycle( "Rules/RTDM/RTDMMapCycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded RTDM default config`);<br />
}else<br />
if (autostartswitch == 10) //test<br />
{<br />
LoadRules("Rules/TEST/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TEST default config`);<br />
}<br />
<br />
print(`Config finished loading from Scripts/Server/dedicated_autostart.gm`);<br />
<br />
</pre><br />
<br />
This file is very important. If you want to change rules for your server then you have to edit the global autostartswitch variable. <br /><br />
For an individual Rule there is the the number 10. If you want to make a Zombie Survival Server or any modded Server you need to make your server for Gold users only ( see dedicated_autoconfig.gm)</p><br />
<br />
===mapcycle.cfg===<br />
<br />
<p><pre><br />
#KAG mapcycle;<br />
# put map generator files, png files here, or script files<br />
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;<br />
<br />
mapcycle = Maps/generator_ctf_mountain.cfg;<br />
</pre><br />
<br />
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.</p><br />
<br />
===*-generator.cfg===<br />
<p>Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html "libnoise"-library].</p><br />
<br />
==Maqq's Server Configuration Tool==<br />
<p>Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:</p><br />
<p><br />
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).<br />
*In Windows, run KAGServer.exe and follow the onscreen instructions.<br />
*In linux, make it executable via <code>chmod +x sconfig.py</code> and run with <code>./sconfig.py</code> . Daemonisation tools applicable to dedicatedserver.sh (''screen, tmux, nohup'' etc) still useable with this program</p><br />
===Reusing Generated Configs===<br />
<p>These commands reuse the generated configuration files:[https://forum.kag2d.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]</p><br />
<p><br />
*If you're using linux, type this in the console:<br />
<pre>./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm</pre><br />
<br />
*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:<br />
<pre>KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm</pre><br />
</p><br />
<br />
===Download Maqq's Server Config Tool===<br />
<p><br />
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe<br />
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)<br />
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py</p><br />
<br />
=Remote Control=<br />
<p>A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing "/rcon /login password", 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 "/rcon". For example, to use the /list command, type. "/rcon /list".</p><br />
<p>A full list of available rcon commands can be found [[Commands|here]].</p><br />
<br />
=[[Security Levels]]=<br />
{{:Security_Levels}}<br />
<br />
[[Security_Levels|''Read more...'']]<br />
<br />
=Blacklisting & Whitelisting=<br />
<p>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.</p><br />
==How to Create a Blacklist or Whitelist==<br />
<p>The contents of the file <code>securitysetup.cfg</code> in <code>kagServer/Base/Security</code> (where kagServer is the path to the kagServer's directory) should look something like this:</p><br />
<pre><br />
# Security setup<br />
<br />
# Set to 1 to allow only the names in the whitelist or 0 to disallow the names in the blacklist<br />
whitelist_active = 0<br />
whitelist_file = Security/whitelist.cfg<br />
blacklist_file = Security/blacklist.cfg<br />
<br />
# Path to file where security levels are defined<br />
seclevs_file = Security/seclevs.cfg<br />
<br />
</pre><br />
<p>Note: The whitelist overrides the blacklist if enabled.</p><br />
<br />
===Whitelist===<br />
<p>If you are using the whitelist, then at the path specified in whitelist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Whitelist format: name; anothername; yetanothername;<br />
whitelist =<br />
name;<br />
anothername;<br />
yetanothername;<br />
</pre><br />
<p>Simply add usernames in this way to allow only those players access to the server.</p><br />
<br />
===Blacklist===<br />
<p>If you are using the blacklist, then at the path specified in blacklist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Blacklist format: name; IP; expiration time and date h:m:s:d:M:y; reason;<br />
# IP of 0.0.0.0 means no IP is banned, and the user is just banned by username.<br />
# Blank username means no user is banned for that entry and it's just by IP.<br />
# The time is in C++ struct tm format except for the year, which is human readable. Get relative times from /listbans on the console. <br />
# eg: 10:30:0:31:11:2050 is 10:30 AM on the 31st of December 2050AD<br />
<br />
blacklist =<br />
name1; 0.0.0.0; 10:30:0:31:11:2050; Banned;<br />
name2; 12.34.45.78; 10:30:0:31:11:2050; Banned;<br />
</pre><br />
<p>Simply add player details in the format described to ban them from the server. Alternatively, just use the ban menus or rcon commands in game to ban users.<br />
Note that January is the 0th month</p><br />
<br />
=Managing Instability=<br />
<p>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 (build 360+ has been much more stable, but it varies from release to release due to new features mixed with bug fixes). 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.)</p><br />
==Trelawney's Keepalive Script for Linux==<br />
<p>This script, <code>dedi.sh</code>, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].<br /><br />
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use <code> nano -w dedi.sh </code>.)<br /><br />
Once created, be sure to make the script executable with <code>chmod +x dedi.sh</code>.</p><br />
<pre><br />
#!/bin/bash<br />
echo "Running KAG dedicated server"<br />
echo "TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123"<br />
mv KAGdedi.tmp KAGdedi<br />
chmod +x KAGdedi<br />
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do<br />
echo "KAG server running"<br />
sleep 5<br />
done<br />
</pre><br />
<p>To use, run the script: <code>./dedi.sh</code></p><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
==The Beaz's Keepalive Script for Windows==<br />
<p>This script, <code>dedi.bat</code>, 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 <code>dedi.bat</code>.<br />
</p><p>To make it work on Windows Vista or 7 you need to disable Windows Error Reporting. To do so open regedit.exe and and (or modify) DWORD HKLM or HKCU\Software\Microsoft\Windows\Windows Error Reporting\DontShowUI entry with value 1</p><br />
<pre><br />
@ECHO off<br />
<br />
:restart<br />
echo (%time%) Server Started - close this window to prevent restart.<br />
<br />
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm<br />
<br />
echo (%time%) WARNING: Server closed or crashed, restarting.<br />
<br />
goto restart<br />
</pre><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
==Daily Server Restarts==<br />
<p>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.</p><br />
===For Linux - Cronjob===<br />
<p>This script will kill all instances of KAGdedi at 3 AM.</p><br />
<p><br />
# Use <code>crontab -e</code> to create a new cronjob. This will open your default text editor.<br />
# In the text editor, type:<pre>0 3 * * * pkill -1 KAGdedi</pre><br />
# Close editor. Cronjob installed!<br />
</p><br />
<br />
=Checking for Updates=<br />
<br />
So far there is not a public script to restart a server when an update is available, but the following logic should be able to be combined with a restart script above to restart a server once an update is available.<br />
<br />
<pre>nova-dhcp-host111:~ ryan$ curl -s http://update.kag2d.com/linux32-dedicated-release/App/version.txt | head -n1 | cut -d ' ' -f2<br />
1337154874-636-6e12e0f833b0<br />
nova-dhcp-host111:~ ryan$</pre><br />
<br />
When that string (the 2nd whitespace-delimited element of the first line of that URL) changes, an update is available. The first number is the unix timestamp of the build, the 2nd is the code revision, the 3rd is a hex identifier used internally by the developers. You should be able to just monitor for a change. You could also use logic involving watching the first two parts of the string to see if they increment, but the format of this string may change in the future -- tl;dr: it is best to just watch if the string changes, don't try to parse it.<br />
<br />
[[Category:Server]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_OverviewAPI Overview2012-09-07T00:05:29Z<p>FliesLikeABrick: /* Caching */</p>
<hr />
<div>[[Category:API]]<br />
<br />
King Arthur's Gold has an [http://en.wikipedia.org/wiki/Application_programming_interface API] under development. This page and others on the kagwiki will serve as official documentation for how to use this API.<br />
<br />
The API is planned to be 100% RESTful and uses JSON for all responses. HTTP request verbs and response codes are used appropriately and should be obeyed.<br />
<br />
The API is/will be used for the following:<br />
* Client authentication (both when the client opens and when joining a server)<br />
* Server registration in the master list<br />
* Client retrieval of the server list and server details<br />
* Retrieving a forum member's [[Avatar URL]]<br />
<br />
Future uses:<br />
* Third party retrieval of forum and KAG account profile information (avatars, signatures, etc)<br />
* Querying for KAG account status (gold/not activated/banned)<br />
* Sekrit features to be determined/announced<br />
<br />
<br />
Some of the features documented here are intended for internal use by components of KAG only. They may technically be usable by third party applications and sites, however their use is discouraged for various reasons. Documented features which fall into this category will have warnings posted.<br />
<br />
<br />
Documentation here may currently include API features which are not fully implemented. Pages will generally indicate the implementation status of features (In order of least to most complete: Planned, Under Development, Partial Implementation, Completed, Mature)<br />
<br />
<br />
In general, requests are answered with appropriate HTTP status codes. Responses may also include a 'statusMessage' and '[[statusSubCode]]' to further detail certain failures. A 'message' is a human-readable error message which can be used by a client as rudimentary output to display to a user. A '[[statusSubCode]]' is almost like an ENUM - so that programmatic decisions can be made by clients about what to do in certain situations. For example, a 403 may be because access is forbidden to an object based on permissions, because the account used for authentication is not active, or because the account used for auth is banned. The formermost is very straightforward so no 'statusMessage' and 'statusSubCode' is included. The latter two would be sent with a 'statusMessage' and 'statusSubCode'. The 'message' contents are not intended to be consumed programmatically and therefore are not documented in detail. The statusSubCode values are further documented, see [[statusSubCode]]<br />
<br />
== Authentication ==<br />
Some requests require authentication, which is provided via HTTP Basic Authentication. You can refer to [http://www.ietf.org/rfc/rfc2617.txt RFC 2617 Section 2] for details about how to form an Authentication header for Basic auth. Here is a pseudo-Python example of a valid Authorization header:<br />
authorization = "Authorization: Basic %s" % base64.b64encode("%s:%s"%username,password)<br />
<br />
== Caching and Other Best Practices ==<br />
Guidelines for caching API resources can be found at [[API Caching Guidelines]]. Other important points:<br />
* Please attempt to query the API over IPv6 when available. You should ask your ISP(s) about IPv6 deployment/accesss, for more information read [https://forum.kag2d.com/threads/a-brief-discussion-about-ipv6.6431|This forum thread by FliesLikeABrick]. The reasoning for this is that the KAG datacenter space is very constrained on IPv4 address space, whereas we have near infinite IPv6 address space available. This makes it easier to scale the API for IPv6 query load than IPv4, since we can add IPv6-only nodes to the API load balancing<br />
* The API may be rate limited in the future for unauthenticated API calls. There is currently no way to register for higher API query rates (something like an "API key" that grants you higher limits), therefore all uses are unauthenticated. If rate limiting is implemented, it will be based on queries per connection and queries per IP address (most likely per hour)<br />
* When at all possible, re-use your connections to the API! This means using libcurl or similar when available. Re-using existing connections will allow you higher query rates/volumes as the initial SSL handshake is one of the most expensive parts of the API for us to scale. Re-using your connections to the API will also increase your performance significantly, especially if you are far away from the API servers (network-wise on the Internet)<br />
* Please set a User-Agent string in your HTTP requests. We need to be able to identify who is responsible for which traffic so that we can contact you in case we see broken calls, abuse, or some kind of bug/flood/etc. Ideally the UA string would indicate something like what site it is being used on (or what person/company), and/or contact information for the tool being used. Like if you have a control panel website or similar using this, it would be good to say "Foo Bar KAG Server Rentals Control Panel/<URL>". It is up to you (the 3rd party API consumer) to decide what level of information is necessary/responsible.<br />
<br />
<br />
To view a full list of API-related pages, see [[:Category:API]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_OverviewAPI Overview2012-09-07T00:02:34Z<p>FliesLikeABrick: /* Caching */</p>
<hr />
<div>[[Category:API]]<br />
<br />
King Arthur's Gold has an [http://en.wikipedia.org/wiki/Application_programming_interface API] under development. This page and others on the kagwiki will serve as official documentation for how to use this API.<br />
<br />
The API is planned to be 100% RESTful and uses JSON for all responses. HTTP request verbs and response codes are used appropriately and should be obeyed.<br />
<br />
The API is/will be used for the following:<br />
* Client authentication (both when the client opens and when joining a server)<br />
* Server registration in the master list<br />
* Client retrieval of the server list and server details<br />
* Retrieving a forum member's [[Avatar URL]]<br />
<br />
Future uses:<br />
* Third party retrieval of forum and KAG account profile information (avatars, signatures, etc)<br />
* Querying for KAG account status (gold/not activated/banned)<br />
* Sekrit features to be determined/announced<br />
<br />
<br />
Some of the features documented here are intended for internal use by components of KAG only. They may technically be usable by third party applications and sites, however their use is discouraged for various reasons. Documented features which fall into this category will have warnings posted.<br />
<br />
<br />
Documentation here may currently include API features which are not fully implemented. Pages will generally indicate the implementation status of features (In order of least to most complete: Planned, Under Development, Partial Implementation, Completed, Mature)<br />
<br />
<br />
In general, requests are answered with appropriate HTTP status codes. Responses may also include a 'statusMessage' and '[[statusSubCode]]' to further detail certain failures. A 'message' is a human-readable error message which can be used by a client as rudimentary output to display to a user. A '[[statusSubCode]]' is almost like an ENUM - so that programmatic decisions can be made by clients about what to do in certain situations. For example, a 403 may be because access is forbidden to an object based on permissions, because the account used for authentication is not active, or because the account used for auth is banned. The formermost is very straightforward so no 'statusMessage' and 'statusSubCode' is included. The latter two would be sent with a 'statusMessage' and 'statusSubCode'. The 'message' contents are not intended to be consumed programmatically and therefore are not documented in detail. The statusSubCode values are further documented, see [[statusSubCode]]<br />
<br />
== Authentication ==<br />
Some requests require authentication, which is provided via HTTP Basic Authentication. You can refer to [http://www.ietf.org/rfc/rfc2617.txt RFC 2617 Section 2] for details about how to form an Authentication header for Basic auth. Here is a pseudo-Python example of a valid Authorization header:<br />
authorization = "Authorization: Basic %s" % base64.b64encode("%s:%s"%username,password)<br />
<br />
== Caching ==<br />
Guidelines for caching API resources can be found at [[API Caching Guidelines]]. Other important points:<br />
* Please attempt to query the API over IPv6 when available. You should ask your ISP(s) about IPv6 deployment/accesss, for more information read [https://forum.kag2d.com/threads/a-brief-discussion-about-ipv6.6431|This forum thread by FliesLikeABrick]. The reasoning for this is that the KAG datacenter space is very constrained on IPv4 address space, whereas we have near infinite IPv6 address space available. This makes it easier to scale the API for IPv6 query load than IPv4, since we can add IPv6-only nodes to the API load balancing<br />
* The API may be rate limited in the future for unauthenticated API calls. There is currently no way to register for higher API query rates (something like an "API key" that grants you higher limits), therefore all uses are unauthenticated. If rate limiting is implemented, it will be based on queries per connection and queries per IP address (most likely per hour)<br />
* When at all possible, re-use your connections to the API! This means using libcurl or similar when available. Re-using existing connections will allow you higher query rates/volumes as the initial SSL handshake is one of the most expensive parts of the API for us to scale. Re-using your connections to the API will also increase your performance significantly, especially if you are far away from the API servers (network-wise on the Internet)<br />
<br />
<br />
To view a full list of API-related pages, see [[:Category:API]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_Caching_GuidelinesAPI Caching Guidelines2012-09-06T13:59:20Z<p>FliesLikeABrick: </p>
<hr />
<div>Resources on the API should be cached as follows when Expires: headers are not present. You should write your code to use the Expires: and other cache control headers when they are available, but fall back to these recommendations otherwise:<br />
* '''/server/.../status''': 30 seconds<br />
* '''/servers''': 5 minutes<br />
* '''/player/.../info''': 5 minutes<br />
* '''/player/.../status''': 30 seconds<br />
<br />
You are of course welcome to cache these resources for longer, depending on the sensitivity of your application and users to stale data.<br />
<br />
Expires, Last-Modified and Cache-Control headers will be added for all resources as the developers have time to add them.<br />
<br />
Caching is not mandatory, but is strongly recommended as a best practice if you are using the API in a website. Without it, you risk hitting per-IP-Address rate limits and running into other load-related problems. Plus, the more you cache (within reason), the more you're being a good netizen and helping prevent our servers from catching on fire!<br />
<br />
As always, if you have any questions, concerns, comments or feature requests, please visit the [https://forum.kag2d.com/forums/community-dev-corner.57/|Community Dev Corner Forums]<br />
<br />
[[Category:API]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_Caching_GuidelinesAPI Caching Guidelines2012-09-06T13:58:17Z<p>FliesLikeABrick: </p>
<hr />
<div>Resources on the API should be cached as follows when Expires: headers are not present. You should write your code to use the Expires: and other cache control headers when they are available, but fall back to these recommendations otherwise:<br />
* '''/server/.../status''': 30 seconds<br />
* '''/servers''': 5 minutes<br />
* '''/player/.../info''': 5 minutes<br />
* '''/player/.../status''': 30 seconds<br />
<br />
You are of course welcome to cache these resources for longer, depending on the sensitivity of your application and users to stale data.<br />
<br />
Expires, Last-Modified and Cache-Control headers will be added for all resources as the developers have time to add them.<br />
<br />
Caching is not mandatory, but is strongly recommended as a best practice if you are using the API in a website. Without it, you risk hitting per-IP-Address rate limits and running into other load-related problems. Plus, the more you cache (within reason), the more you're being a good netizen and helping prevent our servers from catching on fire!<br />
<br />
As always, if you have any questions, concerns, comments or feature requests, please visit the [Community Dev Corner Forums|https://forum.kag2d.com/forums/community-dev-corner.57/] <br />
<br />
[[Category:API]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_Caching_GuidelinesAPI Caching Guidelines2012-09-06T04:43:33Z<p>FliesLikeABrick: Created page with "Resources on the API should be cached as follows when Expires: headers are not present."</p>
<hr />
<div>Resources on the API should be cached as follows when Expires: headers are not present.</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_OverviewAPI Overview2012-09-06T04:42:43Z<p>FliesLikeABrick: /* Caching */</p>
<hr />
<div>[[Category:API]]<br />
<br />
King Arthur's Gold has an [http://en.wikipedia.org/wiki/Application_programming_interface API] under development. This page and others on the kagwiki will serve as official documentation for how to use this API.<br />
<br />
The API is planned to be 100% RESTful and uses JSON for all responses. HTTP request verbs and response codes are used appropriately and should be obeyed.<br />
<br />
The API is/will be used for the following:<br />
* Client authentication (both when the client opens and when joining a server)<br />
* Server registration in the master list<br />
* Client retrieval of the server list and server details<br />
* Retrieving a forum member's [[Avatar URL]]<br />
<br />
Future uses:<br />
* Third party retrieval of forum and KAG account profile information (avatars, signatures, etc)<br />
* Querying for KAG account status (gold/not activated/banned)<br />
* Sekrit features to be determined/announced<br />
<br />
<br />
Some of the features documented here are intended for internal use by components of KAG only. They may technically be usable by third party applications and sites, however their use is discouraged for various reasons. Documented features which fall into this category will have warnings posted.<br />
<br />
<br />
Documentation here may currently include API features which are not fully implemented. Pages will generally indicate the implementation status of features (In order of least to most complete: Planned, Under Development, Partial Implementation, Completed, Mature)<br />
<br />
<br />
In general, requests are answered with appropriate HTTP status codes. Responses may also include a 'statusMessage' and '[[statusSubCode]]' to further detail certain failures. A 'message' is a human-readable error message which can be used by a client as rudimentary output to display to a user. A '[[statusSubCode]]' is almost like an ENUM - so that programmatic decisions can be made by clients about what to do in certain situations. For example, a 403 may be because access is forbidden to an object based on permissions, because the account used for authentication is not active, or because the account used for auth is banned. The formermost is very straightforward so no 'statusMessage' and 'statusSubCode' is included. The latter two would be sent with a 'statusMessage' and 'statusSubCode'. The 'message' contents are not intended to be consumed programmatically and therefore are not documented in detail. The statusSubCode values are further documented, see [[statusSubCode]]<br />
<br />
== Authentication ==<br />
Some requests require authentication, which is provided via HTTP Basic Authentication. You can refer to [http://www.ietf.org/rfc/rfc2617.txt RFC 2617 Section 2] for details about how to form an Authentication header for Basic auth. Here is a pseudo-Python example of a valid Authorization header:<br />
authorization = "Authorization: Basic %s" % base64.b64encode("%s:%s"%username,password)<br />
<br />
== Caching ==<br />
Guidelines for caching API resources can be found at [[API Caching Guidelines]]. Other important points:<br />
* Please attempt to query the API over IPv6 when available. You should ask your ISP(s) about IPv6 deployment/accesss, for more information read [https://forum.kag2d.com/threads/a-brief-discussion-about-ipv6.6431|This forum thread by FliesLikeABrick]. The reasoning for this is that the KAG datacenter space is very constrained on IPv4 address space, whereas we have near infinite IPv6 address space available. This makes it easier to scale the API for IPv6 query load than IPv4, since we can add IPv6-only nodes to the API load balancing<br />
* The API may be rate limited in the future for unauthenticated API calls. There is currently no way to register for higher API load, therefore all uses are unauthenticated. If rate limiting is implemented, it will be based on queries per connection and queries per IP address (most likely per hour)<br />
* When at all possible, re-use your connections to the API! This means using libcurl or similar when available. Re-using existing connections will allow you higher query rates/volumes as the initial SSL handshake is one of the most expensive parts of the API for us to scale. Re-using your connections to the API will also increase your performance significantly, especially if you are far away from the API servers (network-wise on the Internet)<br />
<br />
<br />
To view a full list of API-related pages, see [[:Category:API]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_OverviewAPI Overview2012-09-06T04:42:04Z<p>FliesLikeABrick: </p>
<hr />
<div>[[Category:API]]<br />
<br />
King Arthur's Gold has an [http://en.wikipedia.org/wiki/Application_programming_interface API] under development. This page and others on the kagwiki will serve as official documentation for how to use this API.<br />
<br />
The API is planned to be 100% RESTful and uses JSON for all responses. HTTP request verbs and response codes are used appropriately and should be obeyed.<br />
<br />
The API is/will be used for the following:<br />
* Client authentication (both when the client opens and when joining a server)<br />
* Server registration in the master list<br />
* Client retrieval of the server list and server details<br />
* Retrieving a forum member's [[Avatar URL]]<br />
<br />
Future uses:<br />
* Third party retrieval of forum and KAG account profile information (avatars, signatures, etc)<br />
* Querying for KAG account status (gold/not activated/banned)<br />
* Sekrit features to be determined/announced<br />
<br />
<br />
Some of the features documented here are intended for internal use by components of KAG only. They may technically be usable by third party applications and sites, however their use is discouraged for various reasons. Documented features which fall into this category will have warnings posted.<br />
<br />
<br />
Documentation here may currently include API features which are not fully implemented. Pages will generally indicate the implementation status of features (In order of least to most complete: Planned, Under Development, Partial Implementation, Completed, Mature)<br />
<br />
<br />
In general, requests are answered with appropriate HTTP status codes. Responses may also include a 'statusMessage' and '[[statusSubCode]]' to further detail certain failures. A 'message' is a human-readable error message which can be used by a client as rudimentary output to display to a user. A '[[statusSubCode]]' is almost like an ENUM - so that programmatic decisions can be made by clients about what to do in certain situations. For example, a 403 may be because access is forbidden to an object based on permissions, because the account used for authentication is not active, or because the account used for auth is banned. The formermost is very straightforward so no 'statusMessage' and 'statusSubCode' is included. The latter two would be sent with a 'statusMessage' and 'statusSubCode'. The 'message' contents are not intended to be consumed programmatically and therefore are not documented in detail. The statusSubCode values are further documented, see [[statusSubCode]]<br />
<br />
== Authentication ==<br />
Some requests require authentication, which is provided via HTTP Basic Authentication. You can refer to [http://www.ietf.org/rfc/rfc2617.txt RFC 2617 Section 2] for details about how to form an Authentication header for Basic auth. Here is a pseudo-Python example of a valid Authorization header:<br />
authorization = "Authorization: Basic %s" % base64.b64encode("%s:%s"%username,password)<br />
<br />
== Caching ==<br />
Guidelines for caching API resources can be found at [[API Caching Guidelines]]. Other important points:<br />
- Please attempt to query the API over IPv6 when available. You should ask your ISP(s) about IPv6 deployment/accesss, for more information read [https://forum.kag2d.com/threads/a-brief-discussion-about-ipv6.6431|This forum thread by FliesLikeABrick]. The reasoning for this is that the KAG datacenter space is very constrained on IPv4 address space, whereas we have near infinite IPv6 address space available. This makes it easier to scale the API for IPv6 query load than IPv4, since we can add IPv6-only nodes to the API load balancing<br />
- The API may be rate limited in the future for unauthenticated API calls. There is currently no way to register for higher API load, therefore all uses are unauthenticated. If rate limiting is implemented, it will be based on queries per connection and queries per IP address (most likely per hour)<br />
- When at all possible, re-use your connections to the API! This means using libcurl or similar when available. Re-using existing connections will allow you higher query rates/volumes as the initial SSL handshake is one of the most expensive parts of the API for us to scale. Re-using your connections to the API will also increase your performance significantly, especially if you are far away from the API servers (network-wise on the Internet)<br />
<br />
<br />
To view a full list of API-related pages, see [[:Category:API]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Validate_TokenValidate Token2012-09-03T17:37:19Z<p>FliesLikeABrick: </p>
<hr />
<div>[[Category:API]]<br />
<br />
<br />
'''Implementation Status:''' [[API_Implementation_Statuses#Implemented|Implemented]]<br/><br />
'''URI:''' https://api.kag2d.com/player/$PLAYER/token/$TOKEN<br/><br />
'''HTTP Verbs Supported:''' GET<br/><br />
'''Response Type:''' JSON dictionary<br/><br />
'''HTTP Auth Required:''' No<br/><br />
<br />
== Request Details ==<br />
This resource is the validation of the token provided. Tokens are only allowed to be validated once, and they expire very shortly after they are created (subject to change, but assume on the order of 15-45 seconds). The response will be a boolean true if the token provided is valid (unused, unaltered, unexpired), false in all other cases. '''Currently the API returns HTTP 404 when a token has already been used or expired'''; please be sure to handle this or the playerTokenVerification key appropriately as this design is not 100% final yet.<br />
<br />
== Successful Response ==<br />
<br />
{"playerTokenVerification": true}<br />
<br />
<br />
This response may contain additional information in the future (such as player info and/or additional SSO response information if there is a SSO implementation in the future)<br />
<br />
== Error Conditions ==<br />
<br />
No error conditions are known/documented right now, as they would likely just end up as a 'false' token validation.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Validate_TokenValidate Token2012-09-03T17:36:25Z<p>FliesLikeABrick: </p>
<hr />
<div>[[Category:API]]<br />
<br />
<br />
'''Implementation Status:''' [[API_Implementation_Statuses#Implemented|Implemented]]<br/><br />
'''URI:''' https://api.kag2d.com/player/$PLAYER/token/$TOKEN<br/><br />
'''HTTP Verbs Supported:''' GET<br/><br />
'''Response Type:''' JSON dictionary<br/><br />
'''HTTP Auth Required:''' No<br/><br />
<br />
== Request Details ==<br />
This resource is the validation of the token provided. Tokens are only allowed to be validated once, and they expire very shortly after they are created (subject to change, but assume on the order of 15-45 seconds). The response will be a boolean true if the token provided is valid (unused, unaltered, unexpired), false in all other cases.<br />
<br />
== Successful Response ==<br />
<br />
{"playerTokenVerification": true}<br />
<br />
<br />
This response may contain additional information in the future (such as player info and/or additional SSO response information if there is a SSO implementation in the future)<br />
<br />
== Error Conditions ==<br />
<br />
No error conditions are known/documented right now, as they would likely just end up as a 'false' token validation.</div>FliesLikeABrick//wiki.kag2d.com/wiki/Server_Status_(API)Server Status (API)2012-08-31T17:14:17Z<p>FliesLikeABrick: </p>
<hr />
<div>'''Implementation Status:''' [[API_Implementation_Statuses#Implemented|Implemented]]<br/><br />
'''URI:''' https://api.kag2d.com/server/ip/IPADDRESS/port/PORT/status<br/><br />
'''HTTP Verbs Supported:''' GET<br/><br />
'''Response Type:''' JSON dictionary<br/><br />
'''HTTP Auth Required:''' No<br/><br />
<br />
IPADDRESS is the IPv4 or IPv6 address of the server, PORT is the game port.<br />
<br />
Current structure:<br />
* (int) DNcycle: Whether or not the server has the day/night cycle enabled. 0/1 represent boolean. Should always be present.<br />
* (int) DNState: The current daylight/night state. Values are 0-255. Should always be present.<br />
* (int) currentPlayers: The current number of players in the server. Should always be present.<br />
* (string) description: The description of the server (e.g. sv_description). Currently does not exceed 144 characters but may be more in the future. Should always be present.<br />
* (string) firstSeen: ISO 9075 date format indicating when the API first recorded this server. See [[Server Addresses (API)]]. <br />
**'''Note:''' This is likely soon going to be replaced with a HTTP header. Not sure which one yet.<br />
* (string) gameMode: string representing the game mode. See [[gameMode (API)]]. Should always be present.<br />
* (int) gameState: 0/1 representing boolean. 0 means the game is in warmup/build time, 1 means the game is running. Should always be present.<br />
* (int) gold: 0/1 representing boolean. 0 is not gold, 1 is gold only. Should always be present.<br />
* (string) lastUpdate: when the API last updated this server. <br />
** '''Note:''' This is very soon going to be replaced with a HTTP Last-Modified header, so please check for that and use it instead if it is present.<br />
* (int) mapH: The height of the current map, in tiles. Should always be present.<br />
* (int) mapW: The width of the current map, in tiles. If this and mapH are both zero, it likely means a map is not loaded/generated yet. Should always be present.<br />
* (int) maxPlayers: The player limit currently set on this server. Should always be present.<br />
* (int) password: 0/1 representing boolean. 0 is no password, 1 means a password is required to enter the server. Should always be present.<br />
* (array) playerList: a list of players in the server as of the lastUpdate/Last-Modified time. Each player in the list is actually a dictionary, the username can be found in the "username" key. Additional keys will likely be added in the future.<br />
** '''Note:''' This is going to be changing to an object type as players have extra data associated with them. Should always be present. '''<br />
** '''Note:''' The number of items in this list is not guaranteed to match currentPlayers<br />
* (string) serverIPv6Address: The IPv6 address of the server. Not always present as most servers are IPv4-only. See [[IPv6]] and [[Server Addresses (API)]]. serverIPv6Address or serverIPv4Address will always be present.<br />
* (string) serveriPv4Address: The IPv4 address of the server. Not always present (there will eventually be IPv6-only servers). See [[Server Addresses (API)]]. serverIPv6Address or serverIPv4Address will always be present.<br />
* (string) serverName: The name of the server.<br />
* (int) serverPort: The port of the server.<br />
<br />
Additional keys will be added in the future, possibly to the top level dictionary as well as the serverStatus dictionary. Do not write code which will fail if additional keys are present. Do not write code which will break/crash if one of the above attributes is missing.<br />
<br />
<br />
==Examples==<br />
<br />
'''https://api.kag2d.com/server/ip/96.44.143.42/port/50301/status :'''<br />
{<br />
"serverStatus": {<br />
"DNCycle": 1, <br />
"DNState": 0, <br />
"build": 489, <br />
"connectable": 1, <br />
"currentPlayers": 12, <br />
"description": "If you enjoy, consider donating, and get a reward! Go to our thread in the server subforum on forum.kag2d.com for more info", <br />
"firstSeen": "2012-07-10 18:26:44", <br />
"gameMode": "Capture the Flag!", <br />
"gameState": 1, <br />
"gold": 1, <br />
"lastUpdate": "2012-08-31 17:12:05", <br />
"mapH": 100, <br />
"mapW": 300, <br />
"maxPlayers": 32, <br />
"maxSpectatorPlayers": 0, <br />
"password": 0, <br />
"playerList": [<br />
{<br />
"username": "gabriel7080"<br />
}, <br />
{<br />
"username": "paquinn"<br />
}, <br />
{<br />
"username": "Zolpy"<br />
}, <br />
{<br />
"username": "Lucas"<br />
}, <br />
{<br />
"username": "builderdude1"<br />
}, <br />
{<br />
"username": "Maverick"<br />
}, <br />
{<br />
"username": "UnnamedPlayer"<br />
}, <br />
{<br />
"username": "LostPix"<br />
}, <br />
{<br />
"username": "Dantedeathhermit"<br />
}, <br />
{<br />
"username": "bkcat"<br />
}, <br />
{<br />
"username": "mgakg"<br />
}, <br />
{<br />
"username": "drworld"<br />
}<br />
], <br />
"reservedPlayers": 0, <br />
"serverIPv4Address": "96.44.143.42", <br />
"serverName": "Official MOLE Server, 32 slot CTF, TX", <br />
"serverPort": 50301, <br />
"spectatorPlayers": 0<br />
}<br />
}<br />
<br><br />
'''https://api.kag2d.com/server/ip/2400:c400::113:212:96:217/port/50301/status :'''<br />
{<br />
"serverStatus": {<br />
"DNCycle": 0, <br />
"DNState": 0, <br />
"build": 458, <br />
"connectable": 1, <br />
"currentPlayers": 0, <br />
"description": "Managed by Lavalord. (Foxodi blame One and Chesse for the name)", <br />
"firstSeen": "2012-07-15 01:40:53", <br />
"gameMode": "Capture the Flag!", <br />
"gameState": 1, <br />
"gold": 0, <br />
"lastUpdate": "2012-08-04 00:42:15", <br />
"mapH": 150, <br />
"mapW": 200, <br />
"maxPlayers": 24, <br />
"maxSpectatorPlayers": 0, <br />
"password": 1, <br />
"playerList": [], <br />
"reservedPlayers": 0, <br />
"serverIPv4Address": "113.212.96.217", <br />
"serverIPv6Address": "2400:c400::113:212:96:217", <br />
"serverName": "CW server", <br />
"serverPort": 50301, <br />
"spectatorPlayers": 0<br />
}<br />
}<br />
<br><br />
'''https://api.kag2d.com/server/ip/67.23.118.185/port/50314/status :'''<br />
{<br />
"serverStatus": {<br />
"DNCycle": 1, <br />
"DNState": 0, <br />
"build": 488, <br />
"connectable": 1, <br />
"currentPlayers": 0, <br />
"description": "Basic FullCTF with unit counters, hosted in the eastern US (Reston, VA)", <br />
"firstSeen": "2012-07-10 18:26:49", <br />
"gameMode": "Capture the Flag!", <br />
"gameState": 1, <br />
"gold": 1, <br />
"lastUpdate": "2012-08-31 17:14:03", <br />
"mapH": 128, <br />
"mapW": 200, <br />
"maxPlayers": 48, <br />
"maxSpectatorPlayers": 0, <br />
"password": 0, <br />
"playerList": [], <br />
"reservedPlayers": 0, <br />
"serverIPv4Address": "67.23.118.185", <br />
"serverIPv6Address": "2607:fd50:1:91b0::c411", <br />
"serverName": "U13 USEast 48 slot FullCTF Gold", <br />
"serverPort": 50314, <br />
"spectatorPlayers": 0<br />
}<br />
}<br />
<br />
[[Category:API]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Validate_TokenValidate Token2012-08-29T20:28:32Z<p>FliesLikeABrick: /* Successful Response */</p>
<hr />
<div>[[Category:API]]<br />
<br />
<br />
'''Implementation Status:''' [[API_Implementation_Statuses#Implemented|Implemented]]<br/><br />
'''URI:''' https://api.kag2d.com/player/$PLAYER/token/verification/$TOKEN<br/><br />
'''HTTP Verbs Supported:''' GET<br/><br />
'''Response Type:''' JSON dictionary<br/><br />
'''HTTP Auth Required:''' No<br/><br />
<br />
== Request Details ==<br />
This resource is the validation of the token provided. Tokens are only allowed to be validated once, and they expire very shortly after they are created (subject to change, but assume on the order of 15-45 seconds). The response will be a boolean true if the token provided is valid (unused, unaltered, unexpired), false in all other cases.<br />
<br />
== Successful Response ==<br />
<br />
{"playerTokenVerification": true}<br />
<br />
<br />
This response may contain additional information in the future (such as player info and/or additional SSO response information if there is a SSO implementation in the future)<br />
<br />
== Error Conditions ==<br />
<br />
No error conditions are known/documented right now, as they would likely just end up as a 'false' token validation.</div>FliesLikeABrick//wiki.kag2d.com/wiki/RoleRole2012-08-29T17:58:23Z<p>FliesLikeABrick: </p>
<hr />
<div>Players have a 'role' associated with them. This role is used to differentiate between regular players, guards and administrators/KAG team members.<br />
<br />
There are a few extra roles which aren't used very often, here are the major ones:<br><br />
'''0:''' Normal player account<br><br />
'''1:''' KAG dev/team member <br><br />
'''2:''' KAG Guard<br><br />
'''3:''' Unsure, only test accounts seem to have this. Probably should be treated as KAG staff (subject to change)<br><br />
'''4:''' KAG team member ("admin" level, more or less the same as type 1)<br><br />
'''5:''' KAG tester <br><br />
<br />
As described above, roles 3 and 5 are not really used but may be used in the future. If that happens, this page will be updated appropriately.<br />
<br />
Here is the enum used in the C++ APIClient::APIPlayer struct<br />
<br />
<nowiki><br />
enum{<br />
role_user = 0,<br />
role_super = 1,<br />
role_police = 2,<br />
role_mod = 3,<br />
role_admin = 4,<br />
role_tester = 5<br />
};</nowiki></div>FliesLikeABrick//wiki.kag2d.com/wiki/MediaWiki:Geshi.cssMediaWiki:Geshi.css2012-08-23T15:47:47Z<p>FliesLikeABrick: </p>
<hr />
<div>/* CSS placed here will be applied to GeSHi syntax highlighting */<br />
<br />
<br />
div.mw-geshi {<br />
padding: 1em; <br />
margin: 1em 0; <br />
border: 1px dashed #2f6fab;<br />
background-color: #f9f9f9;<br />
font-size: 12px<br />
}</div>FliesLikeABrick//wiki.kag2d.com/wiki/MediaWiki:Geshi.cssMediaWiki:Geshi.css2012-08-23T15:47:19Z<p>FliesLikeABrick: </p>
<hr />
<div>/* CSS placed here will be applied to GeSHi syntax highlighting */<br />
<br />
<br />
div.mw-geshi {<br />
padding: 1em; <br />
margin: 1em 0; <br />
border: 1px dashed #2f6fab;<br />
background-color: #f9f9f9;<br />
font-size: 15px<br />
}</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_TroubleshootingAPI Troubleshooting2012-08-22T19:19:07Z<p>FliesLikeABrick: /* SSL Connect Error */</p>
<hr />
<div>This page is a guide to solving API connectivity and usage problems including authentication problems in-game, server-related API errors, API maintenance/downtime, and server browser issues.<br />
<br />
<br />
<br />
== In-game Authentication Problems ==<br />
=== SSL Connect Error ===<br />
This error cause is unknown at the moment, but please check the following things. If you find a cause of this problem, please e-mail support at thd dot vg. Please state that you had the error "SSL Connect Error" when authenticating and state how you solved it.<br />
<br />
Check the following:<br />
# That the date and time on your computer are correct<br />
# That you can ping api.kag2d.com<br />
# Visit https://api.kag2d.com in a browser and verify that you see the textual "Welcome to the KAG API..." message<br />
<br />
== KAG Server Errors ==<br />
<br />
== Developer API Usage ==</div>FliesLikeABrick//wiki.kag2d.com/wiki/API_TroubleshootingAPI Troubleshooting2012-08-22T19:17:57Z<p>FliesLikeABrick: Created page with "This page is a guide to solving API connectivity and usage problems including authentication problems in-game, server-related API errors, API maintenance/downtime, and server bro..."</p>
<hr />
<div>This page is a guide to solving API connectivity and usage problems including authentication problems in-game, server-related API errors, API maintenance/downtime, and server browser issues.<br />
<br />
<br />
<br />
== In-game Authentication Problems ==<br />
=== SSL Connect Error ===<br />
This error cause is unknown at the moment, but please check the following things. If you find a cause of this problem, please e-mail support at thd dot vg. Please state that you had the error "SSL Connect Error" when authenticating and state how you solved it.<br />
<br />
Check the following:<br />
1) That the date and time on your computer are correct<br />
2) That you can ping api.kag2d.com<br />
3) Visit https://api.kag2d.com in a browser and verify that you see the textual "Welcome to the KAG API..." message<br />
<br />
== KAG Server Errors ==<br />
<br />
== Developer API Usage ==</div>FliesLikeABrick//wiki.kag2d.com/wiki/MediaWiki:Geshi.cssMediaWiki:Geshi.css2012-08-15T14:43:33Z<p>FliesLikeABrick: Created page with "/* CSS placed here will be applied to GeSHi syntax highlighting */ div.mw-geshi { padding: 1em; margin: 1em 0; border: 1px dashed #2f6fab; background-color: #f9f9f9; }"</p>
<hr />
<div>/* CSS placed here will be applied to GeSHi syntax highlighting */<br />
<br />
<br />
div.mw-geshi {<br />
padding: 1em; <br />
margin: 1em 0; <br />
border: 1px dashed #2f6fab;<br />
background-color: #f9f9f9;<br />
}</div>FliesLikeABrick//wiki.kag2d.com/wiki/ScriptingScripting2012-08-12T15:09:30Z<p>FliesLikeABrick: Created page with "stub page for scripting documentation"</p>
<hr />
<div>stub page for scripting documentation</div>FliesLikeABrick//wiki.kag2d.com/wiki/ServerServer2012-07-30T09:50:28Z<p>FliesLikeABrick: /* Network */</p>
<hr />
<div>{{Build<br />
|Version = 458<br />
}}<br />
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.<br />
<br />
'''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.'''<br />
=Features=<br />
*All servers are added to the official server list to be seen by anybody who chooses the "Pick a Server" option in-game.<br />
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.<br />
*Servers can be password protected. (This is separate from the RCON password.)<br />
=Requirements=<br />
==Hardware==<br />
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.<br />
==Software==<br />
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.<br />
==Network==<br />
<p>The KAG server isn't designed to work on computers without an Internet connection. It is, however, [https://forum.kag2d.com/index.php?threads/lan-no-internet-server.4135/ still possible] to run it without one.</p><br />
<p>The KAG server uses five ports:<br />
{|border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
|<br />
! scope="col" style="background:#efefef;" | Description<br />
! scope="col" style="background:#efefef;" | Modifiable?<br />
! scope="col" style="background:#efefef;" | Firewall Tolerant?<br />
|-<br />
! scope="row" style="background:#efefef;" | 50301/udp<br />
|Used to listen for connections.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#E83131;"|no<br />
|-<br />
! scope="row" style="background:#efefef;" | 50328/udp<br />
|Used to communicate with clients.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 80/tcp<br />
|Used for autoupdates<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 443/tcp<br />
|Used for API (server list, auth, minimaps, etc) server communication<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
<br />
|}<br />
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 in UDP.</p><p><br />
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.</p><br />
===Hosting on Residential Connections===<br />
<p>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. <br />
*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.)<br />
*[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.</p><br />
<br />
=Installation=<br />
==Linux==<br />
<p>This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the <code>ia32-libs</code> package must be installed.</p><br />
<p><br />
# First, download the server: <br /> <pre>wget http://kag2d.com/en/download/kag_linux.tar.gz</pre><br />
# Next, decompress the archive. <br /> <pre>tar -zxf kag_linux.tar.gz</pre><br />
# Change to the new directory: <br /> <pre>cd kag_linux</pre><br />
# [[Server#Configuration|Configure]] your server.<br />
# Run your server: <br /> <pre>./KAGdedi</pre><br />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.<br />
</p><br />
<br />
==Windows==<br />
<p><br />
# First, download the server: http://kag2d.com/en/download <br /> Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.<br />
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].<br />
# Open the folder the archive was extracted into.<br />
# [[Server#Configuration|Configure]] your server.<br />
# Run your server by clicking <code>dedicatedserver.bat</code>.<br />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.<br />
</p><br />
<br />
==Mac==<br />
Due to their similarities, the installation instructions for Linux should apply for Macs, though Mac does not currently have a dedicated server option.<br />
<br />
=Configuration=<br />
<p>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.</p><br />
<p>'''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 ([https://forum.kag2d.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-25-12-2011.1128/ In-game moderators (AKA Royal Guard)] & [https://forum.kag2d.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ & Public Policy]) so you can make an informed decision.'''</p><br />
<p>If you decide you don't want guards to moderate on your server, ''please ensure they are turned off'' in your dedicated_autoconfig.gm file like this:<br />
<br />
<font size=2><pre><br />
global sv_allow_globals_mods = 0;<br />
</pre></font></p><br />
==Manual Configuration==<br />
Of the many editable configuration files that the KAG server depends upon, most customization is done in the <code>dedicated_autoconfig.gm</code>, <code>dedicated_autostart.gm</code>, <code>mapcycle.cfg</code>, and <code>*-generator.cfg</code> files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.<br />
===dedicated_autoconfig.gm===<br />
<br />
<p>Of the many modifiable variables, these are some of the most important:<br />
<br />
<pre><br />
global m_width = 600; // Map generator width. Affects RAM usage.<br />
global m_height = 250; // Map generator height. Affects RAM usage.<br />
global m_seed = 0; // Map generator seed. Pick a random number.<br />
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.<br />
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.<br />
global g_vote_time = 60; // How long (in seconds) does the voting take place.<br />
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.<br />
global sv_maxplayers = 16; // Maximum number of players allowed ingame.<br />
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.<br />
global sv_password = ``; // Sets the server password.<br />
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.<br />
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.<br />
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).<br />
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.<br />
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.<br />
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.<br />
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.<br />
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.<br />
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server<br />
global sv_name = `KAG game`; // Sets the server name displayed in server browser.<br />
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.<br />
</pre></p><br />
<br />
===dedicated_autostart.gm===<br />
<br />
<p><pre><br />
// autostart on dedicated server launch<br />
<br />
<br />
//set autostartswitch to:<br />
// 0 for CTF <br />
// 1 for TDM<br />
// 2 for Sandbox<br />
// 3 for Zombies<br />
// 4 for RTDM<br />
// 10 for TEST<br />
<br />
global autostartswitch = 0;<br />
<br />
newWorld( "" );<br />
switchGameState(0);<br />
<br />
startServer(); <br />
<br />
if (autostartswitch == 0) //ctf<br />
{<br />
LoadRules("Rules/CTF/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded CTF default config`);<br />
}<br />
else if (autostartswitch == 1) //tdm<br />
{<br />
LoadRules("Rules/TDM/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 2) //sandbox<br />
{<br />
LoadRules("Rules/Sandbox/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 3) //zombies (GOLD ONLY)<br />
{<br />
LoadRules("Rules/Zombie_Survival/gamemode.cfg");<br />
LoadMapCycle( "Rules/Zombie_Survival/ZombieMapCycle.cfg" );<br />
LoadMap( "" );<br />
<br />
print(`Loaded zombies default config : server now in GOLD MODE`);<br />
} else if (autostartswitch == 4) //rtdm<br />
{<br />
LoadRules("Rules/RTDM/gamemode.cfg");<br />
LoadMapCycle( "Rules/RTDM/RTDMMapCycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded RTDM default config`);<br />
}else<br />
if (autostartswitch == 10) //test<br />
{<br />
LoadRules("Rules/TEST/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TEST default config`);<br />
}<br />
<br />
print(`Config finished loading from Scripts/Server/dedicated_autostart.gm`);<br />
<br />
</pre><br />
<br />
This file is very important. If you want to change rules for your server then you have to edit the global autostartswitch variable. <br /><br />
For an individual Rule there is the the number 10. If you want to make a Zombie Survival Server or any modded Server you need to make your server for Gold users only ( see dedicated_autoconfig.gm)</p><br />
<br />
===mapcycle.cfg===<br />
<br />
<p><pre><br />
#KAG mapcycle;<br />
# put map generator files, png files here, or script files<br />
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;<br />
<br />
mapcycle = Maps/generator_ctf_mountain.cfg;<br />
</pre><br />
<br />
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.</p><br />
<br />
===*-generator.cfg===<br />
<p>Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html "libnoise"-library].</p><br />
<br />
==Maqq's Server Configuration Tool==<br />
<p>Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:</p><br />
<p><br />
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).<br />
*In Windows, run KAGServer.exe and follow the onscreen instructions.<br />
*In linux, make it executable via <code>chmod +x sconfig.py</code> and run with <code>./sconfig.py</code> . Daemonisation tools applicable to dedicatedserver.sh (''screen, tmux, nohup'' etc) still useable with this program</p><br />
===Reusing Generated Configs===<br />
<p>These commands reuse the generated configuration files:[https://forum.kag2d.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]</p><br />
<p><br />
*If you're using linux, type this in the console:<br />
<pre>./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm</pre><br />
<br />
*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:<br />
<pre>KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm</pre><br />
</p><br />
<br />
===Download Maqq's Server Config Tool===<br />
<p><br />
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe<br />
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)<br />
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py</p><br />
<br />
=Remote Control=<br />
<p>A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing "/rcon /login password", 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 "/rcon". For example, to use the /list command, type. "/rcon /list".</p><br />
<p>A full list of available rcon commands can be found [[Commands|here]].</p><br />
<br />
=[[Security Levels]]=<br />
{{:Security_Levels}}<br />
<br />
[[Security_Levels|''Read more...'']]<br />
<br />
=Blacklisting & Whitelisting=<br />
<p>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.</p><br />
==How to Create a Blacklist or Whitelist==<br />
<p>The contents of the file <code>securitysetup.cfg</code> in <code>kagServer/Base/Security</code> (where kagServer is the path to the kagServer's directory) should look something like this:</p><br />
<pre><br />
# Security setup<br />
<br />
# Set to 1 to allow only the names in the whitelist or 0 to disallow the names in the blacklist<br />
whitelist_active = 0<br />
whitelist_file = Security/whitelist.cfg<br />
blacklist_file = Security/blacklist.cfg<br />
<br />
# Path to file where security levels are defined<br />
seclevs_file = Security/seclevs.cfg<br />
<br />
</pre><br />
<p>Note: The whitelist overrides the blacklist if enabled.</p><br />
<br />
===Whitelist===<br />
<p>If you are using the whitelist, then at the path specified in whitelist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Whitelist format: name; anothername; yetanothername;<br />
whitelist =<br />
name;<br />
anothername;<br />
yetanothername;<br />
</pre><br />
<p>Simply add usernames in this way to allow only those players access to the server.</p><br />
<br />
===Blacklist===<br />
<p>If you are using the blacklist, then at the path specified in blacklist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Blacklist format: name; IP; expiration time and date h:m:s:d:M:y; reason;<br />
# IP of 0.0.0.0 means no IP is banned, and the user is just banned by username.<br />
# Blank username means no user is banned for that entry and it's just by IP.<br />
# The time is in C++ struct tm format except for the year, which is human readable. Get relative times from /listbans on the console. <br />
# eg: 10:30:0:31:11:2050 is 10:30 AM on the 31st of December 2050AD<br />
<br />
blacklist =<br />
name1; 0.0.0.0; 10:30:0:31:11:2050; Banned;<br />
name2; 12.34.45.78; 10:30:0:31:11:2050; Banned;<br />
</pre><br />
<p>Simply add player details in the format described to ban them from the server. Alternatively, just use the ban menus or rcon commands in game to ban users.<br />
Note that January is the 0th month</p><br />
<br />
=Managing Instability=<br />
<p>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 (build 360+ has been much more stable, but it varies from release to release due to new features mixed with bug fixes). 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.)</p><br />
==Trelawney's Keepalive Script for Linux==<br />
<p>This script, <code>dedi.sh</code>, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].<br /><br />
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use <code> nano -w dedi.sh </code>.)<br /><br />
Once created, be sure to make the script executable with <code>chmod +x dedi.sh</code>.</p><br />
<pre><br />
#!/bin/bash<br />
echo "Running KAG dedicated server"<br />
echo "TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123"<br />
mv KAGdedi.tmp KAGdedi<br />
chmod +x KAGdedi<br />
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do<br />
echo "KAG server running"<br />
sleep 5<br />
done<br />
</pre><br />
<p>To use, run the script: <code>./dedi.sh</code></p><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
==The Beaz's Keepalive Script for Windows==<br />
<p>This script, <code>dedi.bat</code>, 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 <code>dedi.bat</code>.</p><br />
<pre><br />
@ECHO off<br />
<br />
:restart<br />
echo (%time%) Server Started - close this window to prevent restart.<br />
<br />
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm<br />
<br />
echo (%time%) WARNING: Server closed or crashed, restarting.<br />
<br />
goto restart<br />
</pre><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
==Daily Server Restarts==<br />
<p>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.</p><br />
===For Linux - Cronjob===<br />
<p>This script will kill all instances of KAGdedi at 3 AM.</p><br />
<p><br />
# Use <code>crontab -e</code> to create a new cronjob. This will open your default text editor.<br />
# In the text editor, type:<pre>0 3 * * * pkill -1 KAGdedi</pre><br />
# Close editor. Cronjob installed!<br />
</p><br />
<br />
=Checking for Updates=<br />
<br />
So far there is not a public script to restart a server when an update is available, but the following logic should be able to be combined with a restart script above to restart a server once an update is available.<br />
<br />
<pre>nova-dhcp-host111:~ ryan$ curl -s http://update.kag2d.com/kag_linux/App/version.txt | head -n1 | cut -d ' ' -f2<br />
1337154874-636-6e12e0f833b0<br />
nova-dhcp-host111:~ ryan$</pre><br />
<br />
When that string (the 2nd whitespace-delimited element of the first line of that URL) changes, an update is available. The first number is the unix timestamp of the build, the 2nd is the code revision, the 3rd is a hex identifier used internally by the developers. You should be able to just monitor for a change. You could also use logic involving watching the first two parts of the string to see if they increment, but the format of this string may change in the future -- tl;dr: it is best to just watch if the string changes, don't try to parse it.<br />
<br />
[[Category:Server]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/ServerServer2012-07-30T09:49:39Z<p>FliesLikeABrick: </p>
<hr />
<div>{{Build<br />
|Version = 458<br />
}}<br />
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.<br />
<br />
'''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.'''<br />
=Features=<br />
*All servers are added to the official server list to be seen by anybody who chooses the "Pick a Server" option in-game.<br />
*Servers can be remotely controlled in game by anybody with the server's Remote Control (RCON) password.<br />
*Servers can be password protected. (This is separate from the RCON password.)<br />
=Requirements=<br />
==Hardware==<br />
The hardware requirements for a KAG server are minimal. If a computer can run the full KAG game, it can run the KAG server.<br />
==Software==<br />
The KAG server can run on Linux, Windows, or Mac. The recommended operating system is Linux, specifically Debian.<br />
==Network==<br />
<p>The KAG server isn't designed to work on computers without an Internet connection. It is, however, [https://forum.kag2d.com/index.php?threads/lan-no-internet-server.4135/ still possible] to run it without one.</p><br />
<p>The KAG server uses five ports:<br />
{|border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
|<br />
! scope="col" style="background:#efefef;" | Description<br />
! scope="col" style="background:#efefef;" | Modifiable?<br />
! scope="col" style="background:#efefef;" | Firewall Tolerant?<br />
|-<br />
! scope="row" style="background:#efefef;" | 50301/udp<br />
|Used to listen for connections.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#E83131;"|no<br />
|-<br />
! scope="row" style="background:#efefef;" | 50328/udp<br />
|Used to communicate with clients.<br />
!scope="row" style="background:#31E831;"|yes<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 80/tcp<br />
|Used for autoupdates<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
|-<br />
! scope="row" style="background:#efefef;" | 443/tcp<br />
|Used for future API ("new master") communication<br />
!scope="row" style="background:#E83131;"|no<br />
!scope="row" style="background:#31E831;"|yes<br />
<br />
|}<br />
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 in UDP.</p><p><br />
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.</p><br />
===Hosting on Residential Connections===<br />
<p>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. <br />
*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.)<br />
*[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.</p><br />
<br />
=Installation=<br />
==Linux==<br />
<p>This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the <code>ia32-libs</code> package must be installed.</p><br />
<p><br />
# First, download the server: <br /> <pre>wget http://kag2d.com/en/download/kag_linux.tar.gz</pre><br />
# Next, decompress the archive. <br /> <pre>tar -zxf kag_linux.tar.gz</pre><br />
# Change to the new directory: <br /> <pre>cd kag_linux</pre><br />
# [[Server#Configuration|Configure]] your server.<br />
# Run your server: <br /> <pre>./KAGdedi</pre><br />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.<br />
</p><br />
<br />
==Windows==<br />
<p><br />
# First, download the server: http://kag2d.com/en/download <br /> Note: The downloads page only lists a linux server. Even though the server is intended to run on Linux, it will run on Windows.<br />
# Next, decompress the archive. This can be done with many different programs, including [http://peazip.sourceforge.net/ PeaZip].<br />
# Open the folder the archive was extracted into.<br />
# [[Server#Configuration|Configure]] your server.<br />
# Run your server by clicking <code>dedicatedserver.bat</code>.<br />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.<br />
</p><br />
<br />
==Mac==<br />
Due to their similarities, the installation instructions for Linux should apply for Macs, though Mac does not currently have a dedicated server option.<br />
<br />
=Configuration=<br />
<p>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.</p><br />
<p>'''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 ([https://forum.kag2d.com/index.php?threads/in-game-moderators-aka-royal-guard-updated-25-12-2011.1128/ In-game moderators (AKA Royal Guard)] & [https://forum.kag2d.com/index.php?threads/the-royal-guard-frequently-asked-questions-public-policy.1714/ The Royal Guard - FAQ & Public Policy]) so you can make an informed decision.'''</p><br />
<p>If you decide you don't want guards to moderate on your server, ''please ensure they are turned off'' in your dedicated_autoconfig.gm file like this:<br />
<br />
<font size=2><pre><br />
global sv_allow_globals_mods = 0;<br />
</pre></font></p><br />
==Manual Configuration==<br />
Of the many editable configuration files that the KAG server depends upon, most customization is done in the <code>dedicated_autoconfig.gm</code>, <code>dedicated_autostart.gm</code>, <code>mapcycle.cfg</code>, and <code>*-generator.cfg</code> files. These are all in the kagServer/Base/Scripts directory, where kagServer is the directory the server was extracted into.<br />
===dedicated_autoconfig.gm===<br />
<br />
<p>Of the many modifiable variables, these are some of the most important:<br />
<br />
<pre><br />
global m_width = 600; // Map generator width. Affects RAM usage.<br />
global m_height = 250; // Map generator height. Affects RAM usage.<br />
global m_seed = 0; // Map generator seed. Pick a random number.<br />
global g_kickvote_percent = 33; // Percentage of players needed for a kick vote to pass.<br />
global g_mapvote_percent = 51; // Percentage of team players needed for a map vote to pass.<br />
global g_vote_time = 60; // How long (in seconds) does the voting take place.<br />
global g_kickvote_bantime = 30; // How long (in minutes) is the player banned after a kick vote.<br />
global sv_maxplayers = 16; // Maximum number of players allowed ingame.<br />
global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.<br />
global sv_password = ``; // Sets the server password.<br />
global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.<br />
global sv_require_auth = 1; // If set to 1 server checks client authentication via master server.<br />
global sv_gold_only = 0; // If set to 1 only premium account players can join (aka Gold Server).<br />
global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.<br />
global sv_deltapos_modifier = 1; // Controls the threshold for delta packet updating. Value higher than 1 will reduce bandwidth, lower increase.<br />
global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.<br />
global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.<br />
global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.<br />
global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server<br />
global sv_name = `KAG game`; // Sets the server name displayed in server browser.<br />
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.<br />
</pre></p><br />
<br />
===dedicated_autostart.gm===<br />
<br />
<p><pre><br />
// autostart on dedicated server launch<br />
<br />
<br />
//set autostartswitch to:<br />
// 0 for CTF <br />
// 1 for TDM<br />
// 2 for Sandbox<br />
// 3 for Zombies<br />
// 4 for RTDM<br />
// 10 for TEST<br />
<br />
global autostartswitch = 0;<br />
<br />
newWorld( "" );<br />
switchGameState(0);<br />
<br />
startServer(); <br />
<br />
if (autostartswitch == 0) //ctf<br />
{<br />
LoadRules("Rules/CTF/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded CTF default config`);<br />
}<br />
else if (autostartswitch == 1) //tdm<br />
{<br />
LoadRules("Rules/TDM/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 2) //sandbox<br />
{<br />
LoadRules("Rules/Sandbox/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TDM default config`);<br />
}<br />
else if (autostartswitch == 3) //zombies (GOLD ONLY)<br />
{<br />
LoadRules("Rules/Zombie_Survival/gamemode.cfg");<br />
LoadMapCycle( "Rules/Zombie_Survival/ZombieMapCycle.cfg" );<br />
LoadMap( "" );<br />
<br />
print(`Loaded zombies default config : server now in GOLD MODE`);<br />
} else if (autostartswitch == 4) //rtdm<br />
{<br />
LoadRules("Rules/RTDM/gamemode.cfg");<br />
LoadMapCycle( "Rules/RTDM/RTDMMapCycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded RTDM default config`);<br />
}else<br />
if (autostartswitch == 10) //test<br />
{<br />
LoadRules("Rules/TEST/gamemode.cfg");<br />
LoadMapCycle( "Scripts/mapcycle.cfg" );<br />
LoadMap( "" );<br />
print(`Loaded TEST default config`);<br />
}<br />
<br />
print(`Config finished loading from Scripts/Server/dedicated_autostart.gm`);<br />
<br />
</pre><br />
<br />
This file is very important. If you want to change rules for your server then you have to edit the global autostartswitch variable. <br /><br />
For an individual Rule there is the the number 10. If you want to make a Zombie Survival Server or any modded Server you need to make your server for Gold users only ( see dedicated_autoconfig.gm)</p><br />
<br />
===mapcycle.cfg===<br />
<br />
<p><pre><br />
#KAG mapcycle;<br />
# put map generator files, png files here, or script files<br />
# eg. mapcycle = Maps/example1.png; Maps/example2.png; Maps/generator_flat.cfg; Maps/swordfight.gm;<br />
<br />
mapcycle = Maps/generator_ctf_mountain.cfg;<br />
</pre><br />
<br />
You must separate paths to files with semicolons. Allowed files are generators, script files and maps in png format.</p><br />
<br />
===*-generator.cfg===<br />
<p>Generators use [http://libnoise.sourceforge.net/tutorials/tutorial4.html "libnoise"-library].</p><br />
<br />
==Maqq's Server Configuration Tool==<br />
<p>Maqq's command-line interface server configuration tool provides an interactive way of setting up a server:</p><br />
<p><br />
Download in the root KAG directory (C:\KAG or /kag_linux , in windows and linux respectively).<br />
*In Windows, run KAGServer.exe and follow the onscreen instructions.<br />
*In linux, make it executable via <code>chmod +x sconfig.py</code> and run with <code>./sconfig.py</code> . Daemonisation tools applicable to dedicatedserver.sh (''screen, tmux, nohup'' etc) still useable with this program</p><br />
===Reusing Generated Configs===<br />
<p>These commands reuse the generated configuration files:[https://forum.kag2d.com/index.php?threads/maqqs-cli-server-configuration-tool.3121/#post-67046 ]</p><br />
<p><br />
*If you're using linux, type this in the console:<br />
<pre>./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm</pre><br />
<br />
*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:<br />
<pre>KAG autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm</pre><br />
</p><br />
<br />
===Download Maqq's Server Config Tool===<br />
<p><br />
*Windows (GUI): http://dl.dropbox.com/u/51067730/kag/KAGServer.exe<br />
*Windows (CLI): http://dl.dropbox.com/u/51067730/KAGServer.exe (has python included)<br />
*Linux/OSX (CLI-only): http://213.152.176.254/mirror/sconfig.py</p><br />
<br />
=Remote Control=<br />
<p>A server can be controlled in-game. While connected to the server, press the HOME key to open the console. Typing "/rcon /login password", 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 "/rcon". For example, to use the /list command, type. "/rcon /list".</p><br />
<p>A full list of available rcon commands can be found [[Commands|here]].</p><br />
<br />
=[[Security Levels]]=<br />
{{:Security_Levels}}<br />
<br />
[[Security_Levels|''Read more...'']]<br />
<br />
=Blacklisting & Whitelisting=<br />
<p>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.</p><br />
==How to Create a Blacklist or Whitelist==<br />
<p>The contents of the file <code>securitysetup.cfg</code> in <code>kagServer/Base/Security</code> (where kagServer is the path to the kagServer's directory) should look something like this:</p><br />
<pre><br />
# Security setup<br />
<br />
# Set to 1 to allow only the names in the whitelist or 0 to disallow the names in the blacklist<br />
whitelist_active = 0<br />
whitelist_file = Security/whitelist.cfg<br />
blacklist_file = Security/blacklist.cfg<br />
<br />
# Path to file where security levels are defined<br />
seclevs_file = Security/seclevs.cfg<br />
<br />
</pre><br />
<p>Note: The whitelist overrides the blacklist if enabled.</p><br />
<br />
===Whitelist===<br />
<p>If you are using the whitelist, then at the path specified in whitelist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Whitelist format: name; anothername; yetanothername;<br />
whitelist =<br />
name;<br />
anothername;<br />
yetanothername;<br />
</pre><br />
<p>Simply add usernames in this way to allow only those players access to the server.</p><br />
<br />
===Blacklist===<br />
<p>If you are using the blacklist, then at the path specified in blacklist_file you can create a file that looks something like this:</p><br />
<pre><br />
# Blacklist format: name; IP; expiration time and date h:m:s:d:M:y; reason;<br />
# IP of 0.0.0.0 means no IP is banned, and the user is just banned by username.<br />
# Blank username means no user is banned for that entry and it's just by IP.<br />
# The time is in C++ struct tm format except for the year, which is human readable. Get relative times from /listbans on the console. <br />
# eg: 10:30:0:31:11:2050 is 10:30 AM on the 31st of December 2050AD<br />
<br />
blacklist =<br />
name1; 0.0.0.0; 10:30:0:31:11:2050; Banned;<br />
name2; 12.34.45.78; 10:30:0:31:11:2050; Banned;<br />
</pre><br />
<p>Simply add player details in the format described to ban them from the server. Alternatively, just use the ban menus or rcon commands in game to ban users.<br />
Note that January is the 0th month</p><br />
<br />
=Managing Instability=<br />
<p>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 (build 360+ has been much more stable, but it varies from release to release due to new features mixed with bug fixes). 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.)</p><br />
==Trelawney's Keepalive Script for Linux==<br />
<p>This script, <code>dedi.sh</code>, will restart the KAG server 5 seconds after it crashes. Download it [http://dl.dropbox.com/u/23114384/files/dedi.sh here].<br /><br />
If retyping/using copy and paste, make sure word wrapping is turned off in you text editor. (In nano, use <code> nano -w dedi.sh </code>.)<br /><br />
Once created, be sure to make the script executable with <code>chmod +x dedi.sh</code>.</p><br />
<pre><br />
#!/bin/bash<br />
echo "Running KAG dedicated server"<br />
echo "TO SET IP/PORT/SLOTS/PASSWORD ADD THESE COMMAND PARAMS: ip 127.0.0.1 port 50213 slots 32 password pass123"<br />
mv KAGdedi.tmp KAGdedi<br />
chmod +x KAGdedi<br />
until ./KAGdedi nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm; do<br />
echo "KAG server running"<br />
sleep 5<br />
done<br />
</pre><br />
<p>To use, run the script: <code>./dedi.sh</code></p><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
./KAGdedi autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
<br />
==The Beaz's Keepalive Script for Windows==<br />
<p>This script, <code>dedi.bat</code>, 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 <code>dedi.bat</code>.</p><br />
<pre><br />
@ECHO off<br />
<br />
:restart<br />
echo (%time%) Server Started - close this window to prevent restart.<br />
<br />
start /wait KAG.exe nolauncher autostart Scripts/dedicated_autostart.gm autoconfig Scripts/dedicated_autoconfig.gm<br />
<br />
echo (%time%) WARNING: Server closed or crashed, restarting.<br />
<br />
goto restart<br />
</pre><br />
===Adapting for Maqq's Configuration Tool===<br />
<p>To use a configuration generated by Maqq's Configuration Tool, replace line 6 in the above script with: <br />
<pre><br />
start /wait KAG.exe nolauncher autostart Scripts/custom_autostart.gm autoconfig Scripts/custom_autoconfig.gm<br />
</pre><br />
</p><br />
==Daily Server Restarts==<br />
<p>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.</p><br />
===For Linux - Cronjob===<br />
<p>This script will kill all instances of KAGdedi at 3 AM.</p><br />
<p><br />
# Use <code>crontab -e</code> to create a new cronjob. This will open your default text editor.<br />
# In the text editor, type:<pre>0 3 * * * pkill -1 KAGdedi</pre><br />
# Close editor. Cronjob installed!<br />
</p><br />
<br />
=Checking for Updates=<br />
<br />
So far there is not a public script to restart a server when an update is available, but the following logic should be able to be combined with a restart script above to restart a server once an update is available.<br />
<br />
<pre>nova-dhcp-host111:~ ryan$ curl -s http://update.kag2d.com/kag_linux/App/version.txt | head -n1 | cut -d ' ' -f2<br />
1337154874-636-6e12e0f833b0<br />
nova-dhcp-host111:~ ryan$</pre><br />
<br />
When that string (the 2nd whitespace-delimited element of the first line of that URL) changes, an update is available. The first number is the unix timestamp of the build, the 2nd is the code revision, the 3rd is a hex identifier used internally by the developers. You should be able to just monitor for a change. You could also use logic involving watching the first two parts of the string to see if they increment, but the format of this string may change in the future -- tl;dr: it is best to just watch if the string changes, don't try to parse it.<br />
<br />
[[Category:Server]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Autojoin_From_BrowserAutojoin From Browser2012-06-19T20:37:20Z<p>FliesLikeABrick: </p>
<hr />
<div>Windows will launch KAG from in a web browser when encountering a kag://<IP/hostame>:port/[password] link<br />
<br />
The client (all OSes) can also be launched to autojoin with the following [[Command Line Arguments|Command Line Argument]]:<br />
kag.exe join kag://outcry.u13.net:50314/<br />
<br />
If the server had a password, it would go after the /. <br />
<br />
Important points:<br />
A trailing slash '''is necessary''' when there is '''no password'''. If there '''is a password''' it goes at the end with '''no trailing slash''' after the password<br />
<br />
This should be added for mac "soon"<br />
<br />
== Not using Windows? ==<br />
On Linux, <br />
gconftool --set --type=string /desktop/gnome/url-handlers/kag/command '/path/to/kag/binary/KAG join "%s"'<br />
<br />
You can also manually edit your browser's config to enable kag:// support using the information above. More details will be added to this article later<br />
<br />
For Opera:<br />
Go to Settings -> Preferences -> Advanced -> Programs. Click Add, then chose Open with other application and paste "C:\kag\KAG.exe" there (or whatever is your KAG location) and paste "-join %1" in Parameters<br />
<br />
Firefox cannot be directly edited, it only uses the system-wide configuration</div>FliesLikeABrick//wiki.kag2d.com/wiki/Autojoin_From_BrowserAutojoin From Browser2012-06-19T20:37:05Z<p>FliesLikeABrick: </p>
<hr />
<div>Windows will launch KAG from in a web browser when encountering a kag://<IP/hostame>:port/[password] link<br />
<br />
The client (all OSes) can also be launched to autojoin with the following [[Command Line Arguments|Command Line Argument]]:<br />
kag.exe join kag://outcry.u13.net:50314/<br />
<br />
If the server had a password, it would go after the /. <br />
<br />
Important points:<br />
A trailing slash '''is necessary''' when there is '''no password'''. If there '''is a password''' it goes at the end with '''no trailing slash'''<br />
<br />
This should be added for mac "soon"<br />
<br />
== Not using Windows? ==<br />
On Linux, <br />
gconftool --set --type=string /desktop/gnome/url-handlers/kag/command '/path/to/kag/binary/KAG join "%s"'<br />
<br />
You can also manually edit your browser's config to enable kag:// support using the information above. More details will be added to this article later<br />
<br />
For Opera:<br />
Go to Settings -> Preferences -> Advanced -> Programs. Click Add, then chose Open with other application and paste "C:\kag\KAG.exe" there (or whatever is your KAG location) and paste "-join %1" in Parameters<br />
<br />
Firefox cannot be directly edited, it only uses the system-wide configuration</div>FliesLikeABrick//wiki.kag2d.com/wiki/Autojoin_On_Client_StartAutojoin On Client Start2012-06-19T20:36:12Z<p>FliesLikeABrick: </p>
<hr />
<div>You can have KAG automatically join a server when starting it from the command line or a 3rd party application (or by having a custom .lnk/shortcut file on your desktop or wherever)<br />
<br />
Example<br />
KAG.exe join outcry.u13.net:50314 [password]<br />
<br />
On Windows, kag:// can also be used to launch KAG right into a server from a browser<br />
kag://outcry.u13.net:50314[/password]<br />
<br />
Note that this currently only works if the username and password are remembered by the client so that it can automatically log in<br />
<br />
<br />
==See Also==<br />
* [[Autojoin From Browser]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Autojoin_From_BrowserAutojoin From Browser2012-06-19T20:35:53Z<p>FliesLikeABrick: moved Client Autojoin to Autojoin From Browser</p>
<hr />
<div>Windows will launch KAG from in a web browser when encountering a kag://<IP/hostame>:port/[password] link<br />
<br />
The client (all OSes) can also be launched to autojoin with the following [[Command Line Arguments|Command Line Argument]]:<br />
kag.exe join kag://outcry.u13.net:50314/<br />
<br />
If the server had a password, it would go after the /. <br />
<br />
Important points:<br />
A trailing slash '''is necessary''' when there is '''no password'''. If there '''is a password''' it goes at the end with '''no trailing slash'''<br />
<br />
<br />
For Non-Windows:<br />
You can manually edit your browser's config to enable kag:// support using the information above. More details will be added to this article later<br />
<br />
For Opera:<br />
Go to Settings -> Preferences -> Advanced -> Programs. Click Add, then chose Open with other application and paste "C:\kag\KAG.exe" there (or whatever is your KAG location) and paste "-join %1" in Parameters</div>FliesLikeABrick//wiki.kag2d.com/wiki/Client_AutojoinClient Autojoin2012-06-19T20:35:53Z<p>FliesLikeABrick: moved Client Autojoin to Autojoin From Browser</p>
<hr />
<div>#REDIRECT [[Autojoin From Browser]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Autojoin_On_Client_StartAutojoin On Client Start2012-06-19T20:35:29Z<p>FliesLikeABrick: </p>
<hr />
<div>You can have KAG automatically join a server when starting it from the command line or a 3rd party application (or by having a custom .lnk/shortcut file on your desktop or wherever)<br />
<br />
Example<br />
KAG.exe join outcry.u13.net:50314 [password]<br />
<br />
On Windows, kag:// can also be used to launch KAG right into a server from a browser<br />
kag://outcry.u13.net:50314[/password]<br />
<br />
Note that this currently only works if the username and password are remembered by the client so that it can automatically log in<br />
<br />
<br />
==See Also==<br />
* [[Browser Autojoin]]</div>FliesLikeABrick//wiki.kag2d.com/wiki/Autojoin_From_BrowserAutojoin From Browser2012-06-16T14:26:46Z<p>FliesLikeABrick: </p>
<hr />
<div>Windows will launch KAG from in a web browser when encountering a kag://<IP/hostame>:port/[password] link<br />
<br />
The client (all OSes) can also be launched to autojoin with the following [[Command Line Arguments|Command Line Argument]]:<br />
kag.exe join kag://outcry.u13.net:50314/<br />
<br />
If the server had a password, it would go after the /. <br />
<br />
Important points:<br />
A trailing slash '''is necessary''' when there is '''no password'''. If there '''is a password''' it goes at the end with '''no trailing slash'''<br />
<br />
<br />
For Non-Windows:<br />
You can manually edit your browser's config to enable kag:// support using the information above. More details will be added to this article later</div>FliesLikeABrick//wiki.kag2d.com/wiki/Autojoin_From_BrowserAutojoin From Browser2012-06-16T14:22:30Z<p>FliesLikeABrick: Created page with "Windows will launch KAG from in a web browser when encountering a kag://<IP/hostame>:port/[password] link The client (all OSes) can also be launched to autojoin with the followi..."</p>
<hr />
<div>Windows will launch KAG from in a web browser when encountering a kag://<IP/hostame>:port/[password] link<br />
<br />
The client (all OSes) can also be launched to autojoin with the following [[Command Line Arguments|Command Line Argument]]:<br />
kag.exe join kag://outcry.u13.net:50314/<br />
<br />
If the server had a password, it would go after the /. <br />
<br />
Important points:<br />
A trailing slash '''is necessary''' when there is '''no password'''. If there '''is a password''' it goes at the end with '''no trailing slash'''</div>FliesLikeABrick//wiki.kag2d.com/wiki/Command_Line_ArgumentsCommand Line Arguments2012-06-16T14:19:08Z<p>FliesLikeABrick: </p>
<hr />
<div><br />
join/-join - specify a kag://host:port/[password] to [[Client Autojoin|autojoin]] (client only)<br><br />
noautoudpate - don't autoupdate<br><br />
nolauncher - no launcher<br><br />
<br />
There are more, this page will be updated<br></div>FliesLikeABrick//wiki.kag2d.com/wiki/Command_Line_ArgumentsCommand Line Arguments2012-06-16T14:18:36Z<p>FliesLikeABrick: Created page with " join/-join - specify a kag://host:port/[password] to Client Autojoin noautoudpate - don't autoupdate nolauncher - no launcher There are more, this page will be up..."</p>
<hr />
<div><br />
<br />
join/-join - specify a kag://host:port/[password] to [[auotjoin|Client Autojoin]]<br />
noautoudpate - don't autoupdate<br />
nolauncher - no launcher<br />
<br />
There are more, this page will be updated</div>FliesLikeABrick//wiki.kag2d.com/wiki/Player_Status_(API)Player Status (API)2012-06-16T12:17:03Z<p>FliesLikeABrick: </p>
<hr />
<div>Example call:<br />
<br />
https://api.kag2d.com/player/FliesLikeABrick/status<br />
<br />
Example output:<br />
<br />
{<br />
"playerStatus": {<br />
"action": 2, <br />
"lastUpdate": "2012-06-15 17:38:29", <br />
"server": {<br />
"serverIPv4Address": "204.152.222.197", <br />
"serverIPv6Address": "2607:fcd0:1337:29::2", <br />
"serverPort": 50301<br />
}<br />
}<br />
}<br />
<br />
'''Note''' that this may contain additional keys besides playerStatus in the future, and that playerStatus may contain additional keys.<br />
<br />
'''Note''' that the lastUpdate key will be removed and instead a Last-Modified header will be used shortly - please write code that checks for one or the other if you use this call right now.<br />
<br />
Player actions are:<br><br />
0: logged into client or ("opened game")<br><br />
1: joined server<br><br />
2: playing on server<br><br />
3: left server<br><br />
<br />
<br />
<br />
You can then make a subsequent call to [[Server Status (API)]] to get the server information, since you now have the server addresses and ports. You should dynamically select serverIPv4Address or serverIPv6Address when constructing the call for [[Server Status (API)]] since not all servers will have both (and future servers may be IPv6-only!)</div>FliesLikeABrick