Leaderboard

As of v1.1.0, Checkers stores all game results (win/draw/lose) in a results database file. By default, this file is a SQLite v3 file in plugins/Checkers/data/results/gameresults.db, but saving to a MySQL database is also supported - see Database Support below for more information. Checkers supports multiple views on the results database, and there are two views currently implemented: ladder (default) and league.

Viewing the Leaderboard

You can use the /chc list top <N> <view-type> command for this. <N> is the number of players to show (default: 5). view-type can be either "ladder" or "league" (default: ladder).

Some examples

List the top 5 players on the ladder:

/chc list top

List the top 20 players on the ladder:

/chc list top 20

List the top 10 players in the league:

/chc list top 10 league

Ladder View

The ladder view uses an algorithm based on the Elo rating system, whereby stronger players gain fewer points for beating weaker players, and vice versa (and a player who only draws with a much weaker player will actually lose points). In the Checkers system, all new players start with 1,000 points.

As players win or lose, their rating will climb or drop accordingly.

The initial rating for all players can be changed via the configuration file:

  • ladder.initial_position

League View

The league view uses a simple system where a win is worth 2 points, a draw is worth 1 point and a loss is worth 0 points. All players start at 0, and gain points for each win or draw.

The number of points gained for a win, draw or loss can be adjusted via the configuration file:

  • league.win_points
  • league.draw_points
  • league.loss_points

Database Support

By default, all game results are stored in the SQLite v3 database plugins/Checkers/data/results/gameresults.db.

You can, if you wish, configure Checkers to store the results in a MySQL database. To do this, first set up a MySQL database and suitable user, e.g. with the following mysql commands:

mysql> create database checkers;
mysql> grant all privileges on checkers.* to 'checkers'@'%' identified by 'some-secure-password';

You may wish to use a more restrictive set of hosts than '%' - e.g. if your MySQL database is on the same host as your CraftBukkit server, than 'localhost' is sufficient. You may, of course, also wish to add access to a web server somewhere (which is the main reason for using MySQL here).

Choose a suitable user and password (default user & password are 'checkers', but you should change at least the password).

Now configure Checkers to use MySQL:

/chc set database.driver mysql
/chc set database.host <host-where-mysql-server-runs>
/chc set database.name <database-name-you-chose>
/chc set database.user <user-you-chose>
/chc set database.password <password-you-chose>

(Or edit config.yml directly, and then run /chc reload config)

You should now have a connection to the MySQL database. Try running /chc list top and check the console or server.log for error messages.


Comments

Posts Quoted:
Reply
Clear All Quotes