Outils pour utilisateurs

Outils du site


en:suckerserv:auth

Ceci est une ancienne révision du document !


Auth with SuckerServ-v5

Because Authserver isn't included anymore in SuckerServ-v5, you'll need to checkout the suckerserv-v3 repository, or use MasterLua (new Master/Auth server, not described here):

svn co http://suckerserv.googlecode.com/svn/branches/suckerserv-v3
cd suckerserv-v3

Dependencies

If you want to use a MySQL Database, you'll need :

  • a working MySQL server, with a dedicated database and user for the authserver.
  • the MySQL-Client header (mysql.h), commonly libmysqlclient-dev package.

With SQLite3

All requiered dependencies are shipped with SuckerServ

With a text database

No dependencies requiered

Compile and Install authserver's binary

Compiling Authserver

chmod +x compile.sh
./compile.sh

Configuration

Authserver

With SQLite3

Edit the conf/authserver.conf file, and remove the # at the beginning of this line:

#use_sqlite_database "./db"

Add a # at the beginning of this one:

use_text_database "./log/auths.txt"

With MySQL

Edit the conf/authserver.conf file, and remove the # at the beginning of this line:

#use_mysql_database "hostname" "port" "database" "username" "password" "install_db"

Set correctly the hostname (localhost by default), the port (3306 by default), the database, the username, the password and remove “install_db” if the database schemas and triggers are already installed into the database.
Add a # at the beginning of this one:

use_text_database "./log/auths.txt"

SuckerServ

Auth.lua

Add an auth.lua file in the conf/ directory of your SuckerServ installation if there's not one already, with the following :

auth.lua
auth.directory.server{
    id = "suckerserv",
    hostname = "localhost",
    port = 28787
}
 
auth.directory.domain{
    id = "suckerserv",
    server = "suckerserv"
}
 
auth.directory.domain{
    id = "suckerserv:master",
    server = "suckerserv"
}
 
auth.directory.domain{
    id = "suckerserv:admin",
    server = "suckerserv"
}

Server.conf

Add the following in your server.conf, replacing content of domains variables by what you set above:

server.conf
###############################################################################
# Authkey configuration for Name protection & Admin
###############################################################################
 
admin_domains "suckerserv:admin"            # Domain for admin
invadmin_domains "suckerserv:admin"         # Same
auto_invadmin_domains "suckerserv:admin"    # Same, if you want to be auto-invadmin at connection
 
master_domains "suckerserv:master"          # Domain for master
invmaster_domains "suckerserv:master"       # Same
auto_invmaster_domains "suckerserv:master"  # Same, if you want to be auto-invadmin at connection
 
name_reservation_domain "suckerserv"        # Domain for name protect
auth_domains "suckerserv"                   # Domain for privileges with new authserver
 
module "auth/name"                          # Module for name protect
module "auth/invmaster"                     # Module for auto-invmaster
module "auth/invadmin"                      # Module for auto-invadmin
#module "auth/privileges"                   # New privileges module to set inv-master/admin with new authserver. Disable auth/invadmin and auth/invmaster before enabling this 

Using authserver

With MySQL

Run once the authserver, and then remove the install_db in your authserver.conf

Run it

To launch the authserver, just do:

./bin/authserver start

In the suckerserv-v3 directory

Adding domains

./bin/authserver manage domain add "suckerserv" case_insensitive
./bin/authserver manage domain add "suckerserv:master" case_insensitive
./bin/authserver manage domain add "suckerserv:admin" case_insensitive

Adding users

Before adding users, you have to add domains, described before.
To add an user for name protection, firstly generate a pair of keys:

./bin/utils/keygen

Then copy the output. The first line is the private key, the one that you have to give to the user.
The user add something like this:

authkey "the_user" "private_key" "suckerserv"

in his auth.cfg
The second line is the public_key, you have to add it in the database:

./bin/authserver manage user add "the_user" "suckerserv" "public_key"

Now same for master, but replace the domain by your master domain:
The master add this in his auth.cfg

authkey "the_admin" "private_key" "suckerserv:master"

And in the server:

./bin/authserver manage user add "the_user" "suckerserv:master" "public_key"

And same for admin, but replace the domain by your admin domain:
The admin add this in his auth.cfg

authkey "the_admin" "private_key" "suckerserv:admin"

And in the server:

./bin/authserver manage user add "the_user" "suckerserv:admin" "public_key"

Remember, an authkey is unique, so don't loose it, and create one for each user.

Restart the authserver

After adding an authkey, you have to restart the authserver:

./bin/authserver stop
./bin/authserver start

In-Game

Now, all admins (added in the previous section) should be set automatically to invadmin, and all masters to invmaster.
And all users must have their authkey for the server doesn't change their name.
And all stats are recorded into single name, even changing it or IP, if you keep the authkey.

en/suckerserv/auth.1401488848.txt.gz · Dernière modification : 2014/10/26 22:28 (modification externe)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki