Page 1 of 1
Work in Progress: UT2004 Stats Signature
Posted: Thu 17. Mar 2016, 15:54
by N4rkoT1k
Hi fellow UT-lovers,
I used some of my spare time to program a tool that reads data of specific players from
http://ut2004stats.epicgames.com/ and inserts them into a database.
The target is to create .png files to use as signature banners, something like the player banners of
https://www.gametracker.com/ but with specific player data. This will be a tricky part since I have not yet done something like this before.
I am currently working on getting all the information of a player from 'ut2004stats' (not just specific ones like right now).
Furthermore I want to add rankings for all data types, e.g. leaders for vehicles.
The performance of the data-reading process is also improvable..
Perhaps the tool has to be divided into two parts in the future:
1. "Scanner" that permanently loops through the players to get their information and generates updated .png files on a server
2. "Presenter" that displays all data. This might be a website but I am not sure yet...
To me this is a "fun" project which I don´t know if I will ever finish it or if it ever will be useful to someone
Let me know what you guys think!

Re: Work in Progress: UT2004 Stats Signature
Posted: Thu 17. Mar 2016, 17:20
by Butze
N4rkoT1k mit php kannst du doch auch ne webseite auslesen und mit pregmatch die tabelle filtern.
Mit den Daten kannst du dann Bilder generieren. (Name, Score usw. wie bei gametracker)
Code: Select all
$url = 'http://ut2004stats.epicgames.com/playerstats.php?player=xxxxdeine playerid';
$quelltext = @file_get_contents($url);
$regex = "/<table.*?>(.*?)<\/table>/smi";
$regextr = "/<tr.*?>(.*?)<\/tr>/smi";
preg_match_all ($regex, $quelltext, $match);
usw und sofort..
Wenn ich am Wochenende Zeit habe, dann kann ich mal ein php script basteln..
Gollum the headhunter

Re: Work in Progress: UT2004 Stats Signature
Posted: Thu 17. Mar 2016, 18:46
by N4rkoT1k
Yes it would also work with PHP

The Code for this part looks something like this now (Language: C#):
Code: Select all
webBrowser.Navigate("http://ut2004stats.epicgames.com/playerstats.php?lang=en&player=" + lngID);
HtmlElementCollection tables = webBrowser.Document.GetElementsByTagName("table");
// Ermittelte Tabellen durchlaufen
foreach (HtmlElement table in tables)
{
}
Takes like 1-2 seconds for the whole reading and writing process per player
There should be libraries for PHP or C# to draw images. Will need to look that up soon.
I guess I will go on using C# for this. Maybe the website is going be PHP..
It´s already nice to see some rankings for these 19 players.
Golly has a shit ton of playtime but the maniac of us seems to be Alfred072176:
Re: Work in Progress: UT2004 Stats Signature
Posted: Fri 18. Mar 2016, 16:10
by Butze
N4rkoT1k wrote:
There should be libraries for PHP or C# to draw images.
You can generate images with text... in php
Do you know captchas? its exactly the same thing.
http://php.net/manual/de/ref.image.php
http://www.phpforkids.com/php/php-gd-li ... riting.php
Demo
Code: Select all
<?php
//Set the Content Type
header('Content-type: image/jpeg');
// Create Image From Existing File
$jpg_image = imagecreatefromjpeg('sunset.jpg');
// Allocate A Color For The Text
$white = imagecolorallocate($jpg_image, 255, 255, 255);
// Set Path to Font File
$font_path = 'font.TTF';
// Set Text to Be Printed On Image
$text = "This is a sunset!";
// Print Text On Image
imagettftext($jpg_image, 25, 0, 75, 300, $white, $font_path, $text);
// Send Image to Browser
imagejpeg($jpg_image);
// Clear Memory
imagedestroy($jpg_image);
?>
Re: Work in Progress: UT2004 Stats Signature
Posted: Fri 18. Mar 2016, 20:08
by N4rkoT1k
Haha this is actually pretty fun
First try to give it a shot
Re: Work in Progress: UT2004 Stats Signature
Posted: Mon 21. Mar 2016, 13:26
by N4rkoT1k
A little update on this:
- I am now getting all the information that is shown on a specific player-site
- Entered more players to the list => 36 Players at this point to get more data
- With this info I was able to create statistics that already exceed the info of 'ut2004stats':
Re: Work in Progress: UT2004 Stats Signature
Posted: Mon 21. Mar 2016, 13:31
by N4rkoT1k
Here some onslaught stats of golly, rotten and alfred:
Re: Work in Progress: UT2004 Stats Signature
Posted: Wed 23. Mar 2016, 15:55
by N4rkoT1k
Another update:
- Entered more players to the list => 64 Players at this point to get even more data
- Added support for entering multiple EpicGames-IDs to a single player. The "Scanner" gets all data of these EpicGames-IDs. I am currently trying to create merged stats from all these datasets of a player e.g. hours played, frags, deaths, ONS statistic etc
Re: Work in Progress: UT2004 Stats Signature
Posted: Wed 23. Mar 2016, 16:29
by Miauz55555
More than one ID with the same name means a forgotten password/ lost .ini or it's an other person who set this name for the epic stats too.
Nice work N4rkoT1k btw.
Re: Work in Progress: UT2004 Stats Signature
Posted: Thu 24. Mar 2016, 09:15
by Wormbo
I think a different CD key also leads to a new global stats ID. The components are CD key hash, stats name and stats password, but I don't know what the masterserver acually does with them to generate your global stats ID.