Difference between revisions of "Server command line"

From X-Moto
Jump to: navigation, search
m (Reverted edits by Opofefemucu (Talk) to last revision by Nadenislamarre)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Since X-Moto 0.5.2, you can control the game server from the X-Moto game.
 
Since X-Moto 0.5.2, you can control the game server from the X-Moto game.
 +
 +
The main utility is to ban people from the server (via ip or profile name) and see some statistics about the server (traffic).
  
 
=Connexion to the console=
 
=Connexion to the console=
Line 33: Line 35:
 
Note: once an admnistrator is created, only real administrators can connect. People from localhost can't anymore be connected without an account (protect your ~/.xmoto directory so that any system user can create account directly by modifiying database files).
 
Note: once an admnistrator is created, only real administrators can connect. People from localhost can't anymore be connected without an account (protect your ~/.xmoto directory so that any system user can create account directly by modifiying database files).
  
==Commands==
+
=Commands=
 +
==help==
 +
This command lists the available commands and their syntax.
 +
This command takes no argument.
 +
 
 +
==login==
 +
This command is required to identify yourself to the game server.
 +
Use it without any argument if there is still no administrator on the server.
 +
Give your password as argument if you're an administrator of the server.
 +
$ login mypassword
 +
 
 +
==logout==
 +
This command can be used if you want to logout without closing X-Moto.
 +
This command takes no argument.
 +
 
 +
==changepassword==
 +
Use this command to change your password. When an admninistrator is created, the initial password is choosed by the admnistrator which create the account. The first thing to do for the new admnistrator is to change his password.
 +
This command takes the new password as argument
 +
$ changepassword my_new_password
 +
 
 +
==lsplayers==
 +
[[Image:Server lsplayers.png|500x500px]]
 +
 
 +
This command lists the connected players on the server.
 +
For each player, you can see his identifier (a number), his name and his ip.
 +
This command takes no argument.
 +
 
 +
==lsadmins==
 +
[[Image:Server lsadmins.png|500x500px]]
 +
 
 +
This command lists the admnistrators on the server.
 +
For each administrator, you can see his identifier (a number), and his name.
 +
This command takes no argument.
 +
 
 +
==addadmin==
 +
This command is used to add admnistrators.
 +
It takes 2 arguments : the id of the player to become an admnistrator and the password for this admnistrator.
 +
 
 +
Note: use "lsplayers" to get the identifier of the player. Identifier are used instead of profile name because it's easier and your keyboard could have not some special chars (if you want a chineese, a russian, a greek or any man with a non ascii name because an administrator)
 +
 
 +
In the following example, 0 is the identifier of the player (Nicolas in the previous screenshots) which will become admnistrator.
 +
$ addadmin 0 his_password
 +
 
 +
==rmadmin==
 +
This command is used to remove an administrator. This command takes only 1 argument : the identifier of the administrator to remove, use lsadmins to get it.
 +
$ rmadmin 2
 +
 
 +
==lsbans==
 +
This command lists the people banned on the server. For each ban, you can see its identifier (a number), the profile banned (* for all), and the ip banned (* for all). This command takes no argument.
 +
* 2: (Nicolas, *) means : anybody can connect with the profile Nicolas
 +
* 3: (*, 55.63.12.35) means : nobody can connect from the ip 55.63.12.35
 +
 
 +
==ban==
 +
This command is used to ban somebody. You can ban by ip or by profile.
 +
This commands takes 2 or 3 parameters. The first argument is the id of the player (use the command lsplayers to get this id). The 2e argument is ip or profile. You can add a 3rd argument to precise the number of days (by default 30 days are set).
 +
 
 +
ban 2 ip
 +
ban 2 profile
 +
ban 2 ip 50
 +
ban 2 ip 0
 +
 
 +
==unban==
 +
This command is used to unban somebody. It takes only 1 argument, the id of the ban (Use lsbans to get it).
 +
 
 +
==stats==
 +
This command displays some information about the server.
 +
 
 +
[[Image:Server stats.png|500x500px]]
 +
 
 +
=Extra controls=
 +
* <ctrl> l : clear the console
 +
* <ctrl> d : close the console
 +
* arrow up, arrow down : use shell history

Latest revision as of 11:20, 26 November 2010

Since X-Moto 0.5.2, you can control the game server from the X-Moto game.

The main utility is to ban people from the server (via ip or profile name) and see some statistics about the server (traffic).

Connexion to the console

Start your server

To play on the network, you need to start a server (one server for several players).

Go in options => www => server and click on "Start the server". If you don't know what is a port, choose the default one (4130).

Server start.png

Connect to the server

Once a server is started, any player on the network can connect to it (you've to know a name or an ip of the server).

Go in levels => network, put the name of the server and click on "Connect".

"localhost" means your own computer.

Server connect.png

Open the console

Once connected, you can open the console using <ctrl><alt>s keyboard sequence.

Server console.png

A banner is displayed and you get a prompt so that you can type commands.

First admin creation

Thanks to the console, you'll be able to add server administrators. At the beginning, there is no default administrator defined. Only people connected from the localhost (ip 127.0.0.1) can login without password by typing the command "login".

Note: once an admnistrator is created, only real administrators can connect. People from localhost can't anymore be connected without an account (protect your ~/.xmoto directory so that any system user can create account directly by modifiying database files).

Commands

help

This command lists the available commands and their syntax. This command takes no argument.

login

This command is required to identify yourself to the game server. Use it without any argument if there is still no administrator on the server. Give your password as argument if you're an administrator of the server.

$ login mypassword

logout

This command can be used if you want to logout without closing X-Moto. This command takes no argument.

changepassword

Use this command to change your password. When an admninistrator is created, the initial password is choosed by the admnistrator which create the account. The first thing to do for the new admnistrator is to change his password. This command takes the new password as argument

$ changepassword my_new_password

lsplayers

Server lsplayers.png

This command lists the connected players on the server. For each player, you can see his identifier (a number), his name and his ip. This command takes no argument.

lsadmins

Server lsadmins.png

This command lists the admnistrators on the server. For each administrator, you can see his identifier (a number), and his name. This command takes no argument.

addadmin

This command is used to add admnistrators. It takes 2 arguments : the id of the player to become an admnistrator and the password for this admnistrator.

Note: use "lsplayers" to get the identifier of the player. Identifier are used instead of profile name because it's easier and your keyboard could have not some special chars (if you want a chineese, a russian, a greek or any man with a non ascii name because an administrator)

In the following example, 0 is the identifier of the player (Nicolas in the previous screenshots) which will become admnistrator.

$ addadmin 0 his_password

rmadmin

This command is used to remove an administrator. This command takes only 1 argument : the identifier of the administrator to remove, use lsadmins to get it.

$ rmadmin 2

lsbans

This command lists the people banned on the server. For each ban, you can see its identifier (a number), the profile banned (* for all), and the ip banned (* for all). This command takes no argument.

  • 2: (Nicolas, *) means : anybody can connect with the profile Nicolas
  • 3: (*, 55.63.12.35) means : nobody can connect from the ip 55.63.12.35

ban

This command is used to ban somebody. You can ban by ip or by profile. This commands takes 2 or 3 parameters. The first argument is the id of the player (use the command lsplayers to get this id). The 2e argument is ip or profile. You can add a 3rd argument to precise the number of days (by default 30 days are set).

ban 2 ip
ban 2 profile
ban 2 ip 50
ban 2 ip 0

unban

This command is used to unban somebody. It takes only 1 argument, the id of the ban (Use lsbans to get it).

stats

This command displays some information about the server.

Server stats.png

Extra controls

  • <ctrl> l : clear the console
  • <ctrl> d : close the console
  • arrow up, arrow down : use shell history