Holding Nuts - open source poker game client and server texas hold em

Forum

You are not logged in.

Announcement

New registrations have been disabled due to massive spamming.

#1 2009-09-11 02:46:39

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Player ranking system

We are currently implementing and testing a simple and lightweight player ranking system.

The official HoldingNuts game-server is already running a development snapshot which makes this feature available (and works with current client version 0.0.5). The system uses the client's generated UUID to identify the player and stores its score in a database. You can view the ranking on this website.

For the next release the HoldingNuts client will ask on its first start whether the user wants to generate a UUID or not. If you don't want to participate in the ranking (may it be privacy concerns - although no private data is stored), you need to unset the UUID in your settings (however, the client reconnect feature won't work without it!).

New Gentoo SVN snapshot ebuild
If you're using Gentoo Linux you might be interested in our holdingnuts snapshot ebuild, which allows conveniently building a snapshot from our SVN repository.

Offline

 

#2 2009-10-02 10:46:37

bigbudz
New member
Registered: 2009-09-30
Posts: 3

Re: Player ranking system

Is it possible to get a copy of the server snapshot and website code for testing?!?

I'm running a server for our local players here in Northern Ireland and the feedback I'm getting is that a leaderboard on our website would make things a lot more interesting.

If not, when do you expect to release the next server version?!?

Thanks,
Kieran

Offline

 

#3 2009-10-03 13:22:23

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

Hi Kieran,

you can always compile the sources on your own. The so-called trunk of our source-code repository contains the latest version. If you're unable to compile, contact me via email and I'll send you an (unsupported) binary of the latest server.

About the website code: I recently released some of our website code for the statistics in the forum. But the code for the ranking system is somewhat dependent on our whole website (and I don't like to disclose the current php-code (for security reasons). However, it's quite simple code. Here's the idea behind it:

Code:

$db_file = '/home/holdingnuts/.holdingnuts/server.db';
$dbh = new PDO("sqlite:$db_file");
$sql = 'SELECT uuid,name,gamecount,ranking,t_lastgame 
		FROM players 
		ORDER BY ranking DESC, t_lastgame DESC, gamecount DESC';
foreach ($dbh->query($sql) as $pstat)
	print_r($pstat);

The server (development version, trunk) writes the ranking into a SQLite database file. This file is read by PHP's Data-Object layer using a trivial SQL query.

Hope this helps you for the start.

Offline

 

#4 2010-02-03 21:27:55

ericabarnet
New member
Registered: 2010-01-27
Posts: 2

Re: Player ranking system

Big thanks for useful info!


<please do not spam in the signature>

Offline

 

#5 2010-06-07 21:33:22

rascalli
Member
Registered: 2010-06-07
Posts: 6

Re: Player ranking system

Can some one help me , as i have no idea how to make a stats page with this & the other code on the forum.

Tx

Offline

 

#6 2010-06-08 00:19:55

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

rascalli wrote:

Can some one help me , as i have no idea how to make a stats page with this & the other code on the forum.

Do you want to build a stats-page OR a ranking-page? For stats-page this is the wrong code; have a look at this one.

You'll need a running holdingnuts-server, a webserver running PHP and customizing the mentioned script.

Does that help?

Offline

 

#7 2010-06-08 06:49:28

rascalli
Member
Registered: 2010-06-07
Posts: 6

Re: Player ranking system

I would like a ranking system like you have here : http://www.holdingnuts.net/ranking
Would be only like 20 members, as it's for some friends overseas



but unfortunately I have much idea about code & php

So I tried the php in : http://www.holdingnuts.net/forum/viewto … d=130#p130
But that does nothing for me .. and I had no idea what to do with the "code" that is posted there

So hopefully you can help

Offline

 

#8 2010-06-08 19:22:00

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

rascalli wrote:

So I tried the php in : http://www.holdingnuts.net/forum/viewto … d=130#p130
But that does nothing for me .. and I had no idea what to do with the "code" that is posted there

This is the code for displaying simple server stats (top-right corner on main-page of this website).

What you need is:
- An own running holdingnuts game-server. The ranking-system isn't included in release 0.0.5 but in current trunk (development-version). So this might be a problem, as there are no prebuilt-binaries. Either you try to compile your own or contact me via mail
- A webserver with PHP (which runs on the same host as the game-server!)
- The PHP code-snippet in THIS thread. You might need to customize some things (e.g. path of the sqlite3 database file).

Please have understanding that this all isn't that easy to setup, but the ranking-system isn't (yet) an official feature of the server. The main purpose was to have a simple ranking for our game-server.

Offline

 

#9 2010-06-08 21:08:24

rascalli
Member
Registered: 2010-06-07
Posts: 6

Re: Player ranking system

I have compiled the source from latest svn & it is running
Webserver is also set-u with php.

What do I do with the PHP-code snippet in THIS thread, where do I place it ?

Offline

 

#10 2010-06-08 23:05:07

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

rascalli wrote:

What do I do with the PHP-code snippet in THIS thread, where do I place it ?

It depends on your setup. Lets say:
- you're using a UNIX-like OS (e.g. Linux)
- you're running the game-server (compiled from trunk and with sqlite3-feature) as user "holdingnuts" -> this means that the database-file is stored in /home/holdingnuts/.holdingnuts/server.db  (by default)
- your webserver-root is /var/www -> copy the code snippet to a text file and name it /var/www/ranking.php
- you might need to enable sqlite3 support for PHP as well

Code:

$db_file = '/home/holdingnuts/.holdingnuts/server.db';

$dbh = new PDO("sqlite:$db_file");
$sql = 'SELECT uuid,name,gamecount,ranking,t_lastgame 
		FROM players 
		ORDER BY ranking DESC, t_lastgame DESC, gamecount DESC';

foreach ($dbh->query($sql) as $pstat)
{
	// DO SOMETHING USEFUL WITH EACH ENTRY HERE
	print_r($pstat);

	// echo $pstat['ranking'];

	// uuid is the identifier
	// name is the nickname
	// gamecount is the number of games the player was involved
	// ranking is the current ranking
	// t_lastgame is the date of the last game played
}

This example code intentionally doesn't include error-/exception-handling and doesn't include cosmetics used on our site in order to keep things simple. Of course you need to customize this script to actually display the ranking.

Code:

foreach ($dbh->query($sql) as $pstat)
{
	echo "Player " . $pstat['name'] . " has ranking " . $pstat['ranking'] . " and has played " . $pstat['gamecount'] . " games.";
}

Hope this helps.

Last edited by datag (2010-06-08 23:24:24)

Offline

 

#11 2010-06-09 07:50:54

rascalli
Member
Registered: 2010-06-07
Posts: 6

Re: Player ranking system

Tx for the help , but unfortunately somewhere i do something totally wrong.
As it does not work for me , might be because I am just a noob with linux ;-)

I guess I need to wait till this is included
Any idea on a time line ?

Offline

 

#12 2010-06-10 17:40:42

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

rascalli wrote:

Tx for the help , but unfortunately somewhere i do something totally wrong.
As it does not work for me , might be because I am just a noob with linux ;-)

What exactly is the problem/error?

rascalli wrote:

I guess I need to wait till this is included
Any idea on a time line ?

Well, at the moment there isn't any development in progress and there is no schedule for a next release. Maybe another dev will be working on this again, but nothing's sure.

Offline

 

#13 2010-06-12 22:29:40

rascalli
Member
Registered: 2010-06-07
Posts: 6

Re: Player ranking system

Well basicly I have no idea what to do to make a page that shows stats/ranking from the players.

The database is in : /home/holdingnuts/

But how to make a webpage that reads into that and converts it to statistics ?

Offline

 

#14 2010-06-12 22:56:53

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

rascalli wrote:

But how to make a webpage that reads into that and converts it to statistics ?

Just copy&paste this code into a file "ranking.php" and place it into your www-root.

Code:

<?php

$db_file = '/home/holdingnuts/.holdingnuts/server.db';

$dbh = new PDO("sqlite:$db_file");
$sql = "SELECT
          uuid,name,gamecount,ranking,t_lastgame 
	FROM
	  players 
	WHERE 
	  name NOT LIKE '__unknown__' 
	ORDER BY
	  ranking DESC, t_lastgame DESC, gamecount DESC";
?>


<table border="1">
 <thead>
  <tr>
   <th>Name</th>
   <th>Games played</th>
   <th>Ranking</th>
  </tr>
 </thead>
 <tbody>

<?php foreach ($dbh->query($sql) as $pstat) : ?>

  <tr>
   <td><?php echo htmlentities($pstat['name']); ?></td>
   <td><?php echo $pstat['gamecount']; ?></td>
   <td><?php echo $pstat['ranking']; ?></td>
  </tr>

<?php endforeach; ?>

 </tbody>
</table>

Offline

 

#15 2010-06-13 00:43:59

rascalli
Member
Registered: 2010-06-07
Posts: 6

Re: Player ranking system

You're the best .. tx .. that did it

Offline

 

#16 2010-07-22 15:42:27

r5isc
Member
Registered: 2010-07-22
Posts: 6

Re: Player ranking system

someone build me please client and server for windows with ranking system and send me an e-mail.
r5i.alexey@yandex.ru
thanks

Offline

 

#17 2010-07-22 17:22:20

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

There's a Windows build of revision 750 for the server (including ranking-support):
http://download.holdingnuts.net/builds/ … -win32.zip

You can use the released 0.0.5 client with this one.

Please note that this is not a release and there's no support for it.

Offline

 

#18 2010-07-22 18:49:38

r5isc
Member
Registered: 2010-07-22
Posts: 6

Re: Player ranking system

Thank you!

Offline

 

#19 2010-07-22 19:21:47

r5isc
Member
Registered: 2010-07-22
Posts: 6

Re: Player ranking system

Error opening database sad
How to fix?

Offline

 

#20 2010-07-22 21:13:06

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

r5isc wrote:

Error opening database sad
How to fix?

Some more information would be helpful. I tested the build on Windows XP and Windows 7. You need to extract all files (the *.dll files need to be in the same directory).

And you need write access to the %APPDATA%\HoldingNuts directory.

Last edited by datag (2010-07-22 21:16:22)

Offline

 

#21 2010-07-22 22:09:23

r5isc
Member
Registered: 2010-07-22
Posts: 6

Re: Player ranking system

I have a Windows 2003 Server.
Perhaps because of this error?

At home computer everything works ...

Last edited by r5isc (2010-07-22 22:11:31)

Offline

 

#22 2010-07-22 22:29:17

datag
Developer
From: Germany/Bavaria
Registered: 2009-03-22
Posts: 119
Website

Re: Player ranking system

r5isc wrote:

I have a Windows 2003 Server.
Perhaps because of this error?

At home computer everything works ...

I'm not sure. You could try to run holdingnuts-server.exe from the command-line.

Assumption: You extracted the contents of the ZIP to C:\

Code:

> C:
> cd \holdingnuts-server-r750-win32
> mkdir config
> holdingnuts-server.exe -c config

Offline

 

#23 2010-07-22 22:40:18

r5isc
Member
Registered: 2010-07-22
Posts: 6

Re: Player ranking system

Thank you all running!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB

Site Notice | Privacy Policy