Difference between revisions of "ServerAdministration"

From The Battle for Wesnoth Wiki
m (Available commands)
 
(36 intermediate revisions by 12 users not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
The Wesnoth server, wesnothd provides a simple interface for administering the server from within the game itself.
+
The Wesnoth server, [[wesnothd]] provides a simple interface for administering the server from within the game itself.
  
To issue an administrative command to the server, you must be connected to the server using Wesnoth, and in the lobby. Any text you type into the chat box that begins with '/query ' will be considered an administrative command instead of a normal chat message. It will not be relayed to other users, but instead treated as a command by the server.
+
To issue an administrative command to the server, you must be connected to the server using Wesnoth, and in the lobby. Any text you type into the chat box that '''begins with '/query ' (or '/q ')''' will be considered an administrative command instead of a normal chat message. It will not be relayed to other users, but instead treated as a command by the server.
  
 
Most commands are not accessible to normal users. They are only accessible once you have authenticated yourself to the server as an administrator. The way to authenticate yourself as an administrator is to use the command,
 
Most commands are not accessible to normal users. They are only accessible once you have authenticated yourself to the server as an administrator. The way to authenticate yourself as an administrator is to use the command,
  
'''/query <password>'''
+
'''/query admin <password>'''
  
where <password> is the administrative password to the server. The administrative password is specified as the passwd attribute in wesnothd.cfg. By convention, it will generally start with 'admin ' followed by the actual password, so the usual syntax to authenticate yourself is,
+
where <password> is the administrative password to the server. The administrative password is specified as the passwd attribute in wesnothd.cfg. Naturally the password for a server should be kept a secret. One danger is that if you forget to type '/query ' at the start of a command you may accidentally type the password in a chat message, and let all users on the server know it. If you do this, then notify an administrator who has access to the box as soon as possible, so they can reset the password in wesnothd.cfg. We may provide features to prevent this kind of accident in future versions.
  
'''/query admin <passwd>'''
+
A message from the server should tell you that you have successfully authenticated yourself as an administrator. The server will recognize you as an administrator until the next time you log out of the server. If the server has support for accounts it may also remember and authenticate you automatically as an administrator next time.
 +
 
 +
== Available commands ==
 +
 
 +
Note: Moderators of the official Wesnoth servers can utilize these commands [[ServerAdministration_FromIRC|via IRC]].
  
Naturally the password for a server should be kept a secret. One danger is that if you forget to type '/query ' at the start of a command you may accidentally type the password in a chat message, and let all users on the server know it. If you do this, then notify an administrator who has access to the box as soon as possible, so they can reset the password in wesnothd.cfg. We may provide features to prevent this kind of accident in future versions.
 
  
A message from the server should tell you that you have successfully authenticated yourself as an administrator. The server will recognize you as an administrator until the next time you log out of the server.
+
'''/query report <message>''': sends a message to all moderators which also gets logged in case none is on. You can use this to report abuse, rule violations, etc. (available to non-administrators, duh)
  
== Available commands ==
+
'''/query games''': shows how many games have ended in various ways. (available to non-administrators)
  
'''/query metrics''': this command will show a simple metrics report of how the server has been performing. (available to non-administrators)
+
'''/query metrics''': shows a simple metrics report of how the server has been performing. (available to non-administrators)
  
 
'''/query netstats''': shows some network stats. (available to non-administrators)
 
'''/query netstats''': shows some network stats. (available to non-administrators)
 +
 +
'''/query stats''': shows the current number of users and games. (available to non-administrators)
  
 
'''/query wml''': shows stats about WML documents and their current memory consumption. (available to non-administrators)
 
'''/query wml''': shows stats about WML documents and their current memory consumption. (available to non-administrators)
  
'''/query status [<nickmask>]''': this command will show you a list of users (matching the nickmask) connected to the server, with IP addresses, and how long they have been connected. Note that IP addresses of users are not available to non-administrators, and should be treated as confidential. When used as a non-administrator it just returns the entry of the user.
+
'''/query status [<nickname mask>]''': this command will show you a list of users (matching the nickname mask) connected to the server, with IP addresses, and how long they have been connected. Note that IP addresses of users are not available to non-administrators, and should be treated as confidential. When used as a non-administrator it just returns the entry of the user.
  
 
'''/query motd [<message>]''': this command sets the message of the day that appears as the first message users get when they log on to the server. Without argument it returns the current motd. (available to non-administrators)
 
'''/query motd [<message>]''': this command sets the message of the day that appears as the first message users get when they log on to the server. Without argument it returns the current motd. (available to non-administrators)
Line 33: Line 38:
 
'''/query lobbymsg <message>''': this command will relay the message 'message' to all users in the lobby of the server. The message will appear to come from 'server', so you should write your name as part of the message if it is necessary to show who it comes from.
 
'''/query lobbymsg <message>''': this command will relay the message 'message' to all users in the lobby of the server. The message will appear to come from 'server', so you should write your name as part of the message if it is necessary to show who it comes from.
  
'''/query kick <mask>''': this command will disconnect the user matching the given nick or ip mask from the server.
+
'''/query pm &lt;nick&gt; <message>''': sends a private message to a user. Sender name will be visible to receiver.
  
'''/query ban <mask> [<time>] [<reason>]''': this command will make the server refuse connections from users matching the given ip mask or the ips of users matching the nick mask. When banning by nick mask already existing bans will not be overwritten. When banning by ip mask existing bans (and their reason!) will be overwritten so you can change the reason for a ban that way. Time is only in 1.5 server. Either time or reason is required when banning.
+
'''/query clones''': shows a list of all users that have the same IP address as another one.
  
'''/query bans''': shows a list of currently banned ip masks and the reasons for the bans.
+
'''/query kick <mask> [<reason>]''': this command will disconnect the user matching the given nickname or ip mask from the server.
  
'''/query kban <mask> [<time>] [<reason>]''': this command is equivalent to 'kick <mask>' 'ban <mask> [<reason>]' -- i.e. bans the users matching the ip mask or the ips of users matching the nick mask and disconnects them all in one go. The most common way to ban someone from the server. Time is only in 1.5 server. Either time or reason is required when banning.
+
'''/query ban <mask> &lt;time&gt; <reason>''': this command will make the server refuse connections from users matching the given IP mask or the IPs of users matching the nickname mask. Existing bans (and their reason!) will be overwritten so you can change the reason for a ban by adding it again.
  
'''/query unban <ipmask>''': this command removes the specified ip mask from the ban list.
+
'''/query gban <mask> <group> &lt;time&gt; <reason>''': this command will make a ban that belongs to a group. They function just like ordinary bans but only the group name is mentioned in the ban listing.
  
 +
'''/query bans''': shows a list of currently banned IP masks and the reasons for the bans.
  
Masks are arguments that can contain wildcards ('*' and '?'). '*' matches any number of characters (including none), and '?' any one character. Ip masks are masks that contain at least one '.'.
+
'''/query kban <mask> &lt;time&gt; <reason>''': this command is equivalent to 'kick <mask>' 'ban <mask> &lt;time&gt; <reason>' -- i.e. bans the users matching the IP mask or the IPs of users matching the nickname mask and disconnects them all in one go. The most common way to ban someone from the server.
  
Time parameter is used set length of ban. Simple example is 2D12h means 2 days and 12 hours. Modifiers are s=seconds, m=minutes, h=hours, D=days, M=months and Y=years. Server also supports keywords for time like LONG, MEDIUM and SHORT but none is set yet.
+
'''/query unban <ipmask>''': this command removes the specified IP mask from the ban list. To unban a user, unban the corresponding IP address.
 +
 
 +
'''/query ungban <group>''': this command removes all bans in the group.
 +
 
 +
'''/query searchlog <mask> (or /q sl <mask>)''': this returns the IP a nickname matching the mask has used or the nicknames that used a matching IP. Unlike status this searches the IP log.
 +
 
 +
'''/query deny_unregistered_login [yes|no]''': If set to yes the server will refuse to let unregistered users log in. Without an argument the current setting is displayed. There is an alias 'dul' for convenience.
 +
 
 +
'''/query stopgame <nick> [<reason>]''': Stops the game <nick> is in, forcing all players and observers back to the lobby.
 +
 
 +
 
 +
Masks are arguments that can contain wildcards ('*' and '?'). '*' matches any number of characters (including none), and '?' any one character. IP masks are masks that contain at least one '.'.
 +
 
 +
The time parameter is used to set the time when a ban expires. A simple example is 2D12h which means after 2 days and 12 hours the ban gets removed. Modifiers are: s=seconds, m=minutes, h=hours, D=days, M=months and Y=years (case doesn't actually matter except for minutes (m) and months (M); also you can write the modifiers (partially) out as in 2days12hours). Permanent bans can be set with 'permanent' or '0' as the time argument. We can also set shortcuts like LONG, MEDIUM and SHORT for common ban lengths but none is set yet.
  
 
== Future extensions ==
 
== Future extensions ==
Line 52: Line 71:
 
The current administrative interface is fairly primitive. We plan to provide some further extensions in the future, such as,
 
The current administrative interface is fairly primitive. We plan to provide some further extensions in the future, such as,
  
'''/query mute <nick>''': makes it so that any messages sent by the user with the given nick will not be received by any other user on the server unless they share an IP address with 'nick'. Any games created by 'nick' will likewise not be seen by other users. 'nick' may observe games but will not appear in the observer list, and players of the game will not see any messages they type.
+
'''/query mute <nickname>''': makes it so that any messages sent by the user with the given nickname will not be received by any other user on the server unless they share an IP address with 'nickname'. Any games created by 'nickname' will likewise not be seen by other users. 'nickname' may observe games but will not appear in the observer list, and players of the game will not see any messages they type.
 +
 
 +
== See Also ==
 +
* [[CommandMode]]
 +
* [[DebugMode]]
 +
* [[ChatCommands]]
 +
* [[ServerAdministration_FromIRC|Server Administration via IRC]]
  
 
[[Category:Troubleshooting and Bugs]]
 
[[Category:Troubleshooting and Bugs]]
 +
[[Category:Server Documentation]]

Latest revision as of 22:00, 23 November 2019

Overview

The Wesnoth server, wesnothd provides a simple interface for administering the server from within the game itself.

To issue an administrative command to the server, you must be connected to the server using Wesnoth, and in the lobby. Any text you type into the chat box that begins with '/query ' (or '/q ') will be considered an administrative command instead of a normal chat message. It will not be relayed to other users, but instead treated as a command by the server.

Most commands are not accessible to normal users. They are only accessible once you have authenticated yourself to the server as an administrator. The way to authenticate yourself as an administrator is to use the command,

/query admin <password>

where <password> is the administrative password to the server. The administrative password is specified as the passwd attribute in wesnothd.cfg. Naturally the password for a server should be kept a secret. One danger is that if you forget to type '/query ' at the start of a command you may accidentally type the password in a chat message, and let all users on the server know it. If you do this, then notify an administrator who has access to the box as soon as possible, so they can reset the password in wesnothd.cfg. We may provide features to prevent this kind of accident in future versions.

A message from the server should tell you that you have successfully authenticated yourself as an administrator. The server will recognize you as an administrator until the next time you log out of the server. If the server has support for accounts it may also remember and authenticate you automatically as an administrator next time.

Available commands

Note: Moderators of the official Wesnoth servers can utilize these commands via IRC.


/query report <message>: sends a message to all moderators which also gets logged in case none is on. You can use this to report abuse, rule violations, etc. (available to non-administrators, duh)

/query games: shows how many games have ended in various ways. (available to non-administrators)

/query metrics: shows a simple metrics report of how the server has been performing. (available to non-administrators)

/query netstats: shows some network stats. (available to non-administrators)

/query stats: shows the current number of users and games. (available to non-administrators)

/query wml: shows stats about WML documents and their current memory consumption. (available to non-administrators)

/query status [<nickname mask>]: this command will show you a list of users (matching the nickname mask) connected to the server, with IP addresses, and how long they have been connected. Note that IP addresses of users are not available to non-administrators, and should be treated as confidential. When used as a non-administrator it just returns the entry of the user.

/query motd [<message>]: this command sets the message of the day that appears as the first message users get when they log on to the server. Without argument it returns the current motd. (available to non-administrators)

/query msg <message>: this command will relay the message 'message' to all users on the server, even if they are in a game. The message will appear to come from 'server', so you should write your name as part of the message if it is necessary to show who it comes from.

/query lobbymsg <message>: this command will relay the message 'message' to all users in the lobby of the server. The message will appear to come from 'server', so you should write your name as part of the message if it is necessary to show who it comes from.

/query pm <nick> <message>: sends a private message to a user. Sender name will be visible to receiver.

/query clones: shows a list of all users that have the same IP address as another one.

/query kick <mask> [<reason>]: this command will disconnect the user matching the given nickname or ip mask from the server.

/query ban <mask> <time> <reason>: this command will make the server refuse connections from users matching the given IP mask or the IPs of users matching the nickname mask. Existing bans (and their reason!) will be overwritten so you can change the reason for a ban by adding it again.

/query gban <mask> <group> <time> <reason>: this command will make a ban that belongs to a group. They function just like ordinary bans but only the group name is mentioned in the ban listing.

/query bans: shows a list of currently banned IP masks and the reasons for the bans.

/query kban <mask> <time> <reason>: this command is equivalent to 'kick <mask>' 'ban <mask> <time> <reason>' -- i.e. bans the users matching the IP mask or the IPs of users matching the nickname mask and disconnects them all in one go. The most common way to ban someone from the server.

/query unban <ipmask>: this command removes the specified IP mask from the ban list. To unban a user, unban the corresponding IP address.

/query ungban <group>: this command removes all bans in the group.

/query searchlog <mask> (or /q sl <mask>): this returns the IP a nickname matching the mask has used or the nicknames that used a matching IP. Unlike status this searches the IP log.

/query deny_unregistered_login [yes|no]: If set to yes the server will refuse to let unregistered users log in. Without an argument the current setting is displayed. There is an alias 'dul' for convenience.

/query stopgame <nick> [<reason>]: Stops the game <nick> is in, forcing all players and observers back to the lobby.


Masks are arguments that can contain wildcards ('*' and '?'). '*' matches any number of characters (including none), and '?' any one character. IP masks are masks that contain at least one '.'.

The time parameter is used to set the time when a ban expires. A simple example is 2D12h which means after 2 days and 12 hours the ban gets removed. Modifiers are: s=seconds, m=minutes, h=hours, D=days, M=months and Y=years (case doesn't actually matter except for minutes (m) and months (M); also you can write the modifiers (partially) out as in 2days12hours). Permanent bans can be set with 'permanent' or '0' as the time argument. We can also set shortcuts like LONG, MEDIUM and SHORT for common ban lengths but none is set yet.

Future extensions

The current administrative interface is fairly primitive. We plan to provide some further extensions in the future, such as,

/query mute <nickname>: makes it so that any messages sent by the user with the given nickname will not be received by any other user on the server unless they share an IP address with 'nickname'. Any games created by 'nickname' will likewise not be seen by other users. 'nickname' may observe games but will not appear in the observer list, and players of the game will not see any messages they type.

See Also

This page was last edited on 23 November 2019, at 22:00.