Work in Progress: UT2004 Stats Signature

Anything about UT2004 mapping, Uscripting & more
Post Reply
User avatar
N4rkoT1k
Posts: 165
Joined: Sat 24. Mar 2012, 09:48
Description: Lovin UT2004
Location: Germany

Work in Progress: UT2004 Stats Signature

Post 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! ;)
Attachments
2.png
2.png (16.42 KiB) Viewed 19637 times
1.png
1.png (58.59 KiB) Viewed 19637 times
Image
Butze
Posts: 31
Joined: Mon 17. Aug 2015, 16:22
Description: nüscht

Re: Work in Progress: UT2004 Stats Signature

Post 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 :D :machinegun:
Attachments
Image2.jpg
Image2.jpg (30.93 KiB) Viewed 19629 times
User avatar
N4rkoT1k
Posts: 165
Joined: Sat 24. Mar 2012, 09:48
Description: Lovin UT2004
Location: Germany

Re: Work in Progress: UT2004 Stats Signature

Post 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:
Attachments
3.png
3.png (54.86 KiB) Viewed 19618 times
Image
Butze
Posts: 31
Joined: Mon 17. Aug 2015, 16:22
Description: nüscht

Re: Work in Progress: UT2004 Stats Signature

Post 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
Image

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);
?> 
User avatar
N4rkoT1k
Posts: 165
Joined: Sat 24. Mar 2012, 09:48
Description: Lovin UT2004
Location: Germany

Re: Work in Progress: UT2004 Stats Signature

Post by N4rkoT1k »

Haha this is actually pretty fun :clap:
First try to give it a shot
Attachments
4.png
4.png (72.79 KiB) Viewed 19587 times
Image
User avatar
N4rkoT1k
Posts: 165
Joined: Sat 24. Mar 2012, 09:48
Description: Lovin UT2004
Location: Germany

Re: Work in Progress: UT2004 Stats Signature

Post 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':
Attachments
player_onslaught.png
player_onslaught.png (17.68 KiB) Viewed 19548 times
onslaught.png
onslaught.png (25.6 KiB) Viewed 19548 times
player.png
player.png (23.3 KiB) Viewed 19548 times
Image
User avatar
N4rkoT1k
Posts: 165
Joined: Sat 24. Mar 2012, 09:48
Description: Lovin UT2004
Location: Germany

Re: Work in Progress: UT2004 Stats Signature

Post by N4rkoT1k »

Here some onslaught stats of golly, rotten and alfred:
Attachments
alfred.png
alfred.png (20.04 KiB) Viewed 19546 times
rotten.png
rotten.png (25.54 KiB) Viewed 19546 times
golly.png
golly.png (25.89 KiB) Viewed 19546 times
Image
User avatar
N4rkoT1k
Posts: 165
Joined: Sat 24. Mar 2012, 09:48
Description: Lovin UT2004
Location: Germany

Re: Work in Progress: UT2004 Stats Signature

Post 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
Attachments
epic_ids.png
epic_ids.png (44.48 KiB) Viewed 19525 times
Image
User avatar
Miauz55555
Posts: 2051
Joined: Sun 7. Jun 2015, 23:12
Description: https://discord.gg/X4V8THM
Location: Germany
Contact:

Re: Work in Progress: UT2004 Stats Signature

Post 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.
Image
Image
User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 12:52
Description: Coding Dude

Re: Work in Progress: UT2004 Stats Signature

Post 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.
Post Reply