Page 1 of 1

How to get Demos into the UTStatsDB

Posted: Sat Mar 21, 2026 11:51 am
by SkullCollector
Hi there,

some questions about the Demo Rec Files from UT2004. I Autocreate the Serverside Demos with UTCOmp.

the demos looks like this :
3-20-2026-(08-19)-DM-Morbias-2k3.demo4

I can see the setting for a demo path in the logs section, but I can't find anywhere to change the file extension. Nothing is saved in the admin file where all the settings are stored either.

Code: Select all

/* i found in the /logs.php this */ // Remove associated demo log file $demodir = $config["demodir"]; $demoext = $config["demoext"]; if (isset($matchdate) && isset($mapfile) && $demodir != "" && $demoext != "" && $matchdate && $mapfile) { if (substr($demodir, -1) != "/") $demodir.="/"; $demofile = date('md-Hi', $matchdate)."-".$mapfile.".".$demoext; $demopath = $demodir.$demofile; if (file_exists($demopath)) unlink($demopath); } }
Even if the files are transferred, they could never be deleted because the information they contain is incorrect.

That's not how the files are named, and you can't save them that way.

Is there a working version of UTStatsDB that can do this?

My version is from the download section here. V3.10
Since I'm not using a Windows version, this is the only option for me.

But the complete Windows version available for download there (V3.08) is the same. It just contains more outdated features, like get_magic_runtime, and so on.

Any Chance to get the newest official one ? I like UTStatsDB realy and i can help to improve and fix some things that not working . But with that code that i'm using here, i can't use and / or see all features working, because they are not in the Code.

I can write the code for the ADODB Layer, because i got it working here. But i don't wanna work more on when a newer Version is in your hand.

hope to here from you Panther

Regards
Skully

Re: How to get Demos into the UTStatsDB

Posted: Sat Mar 21, 2026 1:05 pm
by Panther
It looks like back in the early days of UTStatsDB before most of the configuration was put into a menu allowing multiple configs, it had:
$demodir = "./Demos/"; // Set to your demorec file path
$demoext = "demo4"; // Extension of demorec files
$demourl = "Demos/"; // Prefix to URL path of demorec directory
$demoftpserver1 = ""; // Set to the ftp server for downloading demorecs (same as with logs)
$demoftppath1 = ""; // Set to ftp path for downloading demorecs (same as with logs)

This apparently never made it into the current config menu. I'd say it's time to fix that. Send me a few (three will do) demorec files to test with, along with the associate log files.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 1:33 am
by SkullCollector
Well, these setting never seen .

But ok. I send you 3 Demos with the logfiles here.

i will make some matches and upload these files here

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 1:56 am
by SkullCollector
Here are some logs with demos.

hope you can it back into the script

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 12:20 pm
by Panther
You provided three demo recs and four logs, and the map names of the logs don't line up with the demo recs.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 12:32 pm
by Panther
Also, is there no way to improve the naming convention of the demorec files, set them to the match start time, or log the file name? The names make it difficult since it would require calculating the match length, adding that to the start time, then go looking for a file name with roughly that (poorly formated) time in the name.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 8:54 pm
by SkullCollector
Well, i'm know using the Mutator DemoRec.
this one saves it like : 0323-0436-DM-Deck17.demo4
The Logfile looks like that : Stats_7777_2026_03_23_04_36_25

Unfortunately, there is no other way to customize the filenames for the demo files.
hope that can use for the UTStatsDB.

I will attach this here so you can have look.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 9:35 pm
by Panther
That's an improvement, at least it contains most of the timestamp and would be much easier to locate. I've added configuration to the log config settings for the demorec files. I'll work on getting it to function. I don't even remember how the link is displayed, if it is at all.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 9:44 pm
by SkullCollector
Good Morning from good old Germany :-D

well, make it like the MapImage. If there a Demo File, link it under the Mapname if not than not :-D
oh, write it into the database . need a new field with varchar 100 and than put it in.
i would make it the same way with the Mapimage. If there an Image for the map, link it into the db.
Reduce the filesystem work.


By the Way : How the heck i can put a Cronjob to pull the logs and parse them into the DB ?


i can't find something about that .
i pull them manually from the Adminmenu. And that every morning. :-D
If you need a beta tester, I'm in.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 10:23 pm
by Panther
Guten Morgen.

/etc/cron.d:
*/5 * * * * apache /etc/utstatslogs >/dev/null 2>&1

/etc/utstatslogs
#!/bin/sh
rsync --rsh=/bin/ssh --remove-source-files user@server.com:/usr/local/ut/UserLogs/Stats_*.log /var/http/ut/Logs/
cd /var/http/ut
/usr/bin/php ./logs.php pass=<updatepass> nohtml

chmod +x /etc/utstatslogs

You can leave out the rsync if you don't need to download the logs from another server.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 10:27 pm
by Panther
I just checked, the code is still in place for displaying demorec links in the Match Stats page.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 11:45 pm
by SkullCollector
Guten Morgen.

/etc/cron.d:
*/5 * * * * apache /etc/utstatslogs >/dev/null 2>&1

/etc/utstatslogs
#!/bin/sh
rsync --rsh=/bin/ssh --remove-source-files user@server.com:/usr/local/ut/UserLogs/Stats_*.log /var/http/ut/Logs/
cd /var/http/ut
/usr/bin/php ./logs.php pass=<updatepass> nohtml

chmod +x /etc/utstatslogs

You can leave out the rsync if you don't need to download the logs from another server.
Hey you speak german ? Nice....

well, i try it out. Just test it and give feedback.
Thank you for the hint.

Re: How to get Demos into the UTStatsDB

Posted: Sun Mar 22, 2026 11:51 pm
by Panther
Mein Deutsch ist begrenzt.

I had help for the translation for UTStatsDB (and the Epic Games global stats).

Re: How to get Demos into the UTStatsDB

Posted: Tue Mar 24, 2026 11:52 pm
by SkullCollector
Morning,

feedback :

rsynch with ssh keys works like candy.

here is my script to pull the logfiles and the demo files from my ut server.

Code: Select all

#!/bin/sh rsync --rsh=/usr/bin/ssh --remove-source-files <user@servername>:/home/unreal/.ut2004/UserLogs/Stats_*.log /srv/www/html/ut/Logs/ rsync --rsh=/usr/bin/ssh --remove-source-files <user@servername>:/home/unreal/.ut2004/Demos/*.demo4 /srv/www/html/ut/Demos/ cd /srv/www/html/ut/Logs chmod 777 *.log chown www-data:www-data *.log cd /srv/www/html/ut/Demos chmod 777 *.demo4 chown www-data:www-data *.demo4 cd /srv/www/html/ut /usr/local/bin/php /srv/www/html/ut/admin_logs.php pass=<password> nohtml
starting this per cron hourly. Works great. Thank you for the hints with that.

Regards
Skully