The online racing simulator
mpRes - race statistics web script
(58 posts, started )
Please feel free to grab the update to V2.05 (see top post) for Rockingham support Wink
V2.06 (0.6M-Support)
See first post for V2.06.
This includes support for LFS 0.6K9 and above (0.6M) and also new path-files for the Kyoto fix.
#28 - troy
Anybody got this to run with nginx? I'm having trouble with the png generation for the track layouts. Getting this error:

Warning: unpack(): Type i: not enough input, need 4, have 0 in /mnt/storage/www/mpres/includes/functions.php on line 482

Any idea what may be causing this?
interesting ... is that happening with all tracks or only specific ones?
#30 - troy
Mh, I do seem to get different errors. Tried with some CL21 replays and got this now on Aston:

Warning: Invalid argument supplied for foreach() in /mnt/storage/www/mpres/includes/functions.php on line 487

Warning: Cannot modify header information - headers already sent by (output started at /mnt/storage/www/mpres/includes/functions.php:487) in /mnt/storage/www/mpres/tpl/header.tpl.php on line 12

Another CL21 replay on Blackwood and I get the same error I posted in my last reply.

edit: Sent PM with some more infos.
See first post for new update (2.07) to fix the broken suport for replays with layout data ...

@troy: still trying to find what the reason for your problem is ...
#32 - troy
I guess it's something to do with my mcgyver setup Big grin I was hoping some other nginx users may have gotten this to run already and may be willing to share some tips.
Nginx has nothing to do with this IMHO.
I got it working for an event and there were no errors at all.
#34 - troy
Good to know, I'll look into potential troublemakers then thanks.
I have error similiar to what Troy wrote a few posts above. In spoiler because long text:

Spoiler - click to revealWarning: unpack(): Invalid format type / in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/bodydata.php on line 50

Warning: unpack(): Invalid format type / in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/bodydata.php on line 50

Warning: unpack(): Invalid format type / in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/bodydata.php on line 50

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Invalid argument supplied for foreach() in /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/postprocess.php on line 328

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w013d945/abnl.racemore.de/mpres/includes/readmpr/bodydata.php:50) in /www/htdocs/w013d945/abnl.racemore.de/mpres/tpl/header.tpl.php on line 12

Was this qualy replay:
http://abnl.racemore.de/mpres/league/S3/2/R03/q/
Beside that error at top of page, stats seem okay.
race replay is normal: http://abnl.racemore.de/mpres/league/S3/2/R03/r/
Maybe something went wrong during qualy, because after the time was up I could not see the results-table in LFS. Think others had same problem.
Also when race was started, grid was in randomized order and had to be set manually.
Maybe that is a hint..
And we got another incrementation in mpr-version ...
For the moment here comes a small hotfix (see attachment)
I did not test this, a closer look on this will NOT come before the weekend!
THIS FIX DOES NOT INCLUDE THE TRACK UPDATES!!!
Attached files
mpres_207-HF_LFS0.6R.zip - 1.1 KB - 793 views
great, thanks.
after copying the file to server it instantly worked. (did not even need to do the ?force_load url thing)

---
also with this replay of a 24h race lots of things went wrong:
http://abnl.racemore.de/mpres/league/DOP24h/1/R01/r/
It looks like only the starting drivers of a team are listed. (plus possibly first drivers after rejoin from garage)
Quote from Gutholz :also with this replay of a 24h race lots of things went wrong:
http://abnl.racemore.de/mpres/league/DOP24h/1/R01/r/
It looks like only the starting drivers of a team are listed. (plus possibly first drivers after rejoin from garage)

You need to create a TOCdata file and turn on TOC in event definitions.
(replayname.tocdata is a file with the teams' numbers, cars and lineups)
Hello,

I've been using this mpRes for about year and a half. Thank you for this! Smile

However, recently I have faced two problems. My website which uses mpRes is (I'm using version 2.07): https://tulokset.srtfinland.com/

1) My first problem is that, I tried to edit the .htaccess-file, so that it would always use https:// as a part of URL instead of http:// - however, it doesn't recognize any stylesheets after doing that.

This is what I added into my .htaccess-file.


RewriteEngine On
RewriteCond %{HTTP_HOST} ^tulokset.srtfinland.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.tulokset.srtfinland.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://tulokset.srtfinland.com/$1 [R=301,L]

Additionally, I have changed $headlink in config.inc.php-file from http://tulokset.srtfinland.com into https://tulokset.srtfinland.com

I can fix this by removing changes I made, but obviously, it will then use HTTP as a protocol instead of HTTPS.

2) A bigger problem I have, is that for some reason, the driver/player names from every qualifying/sprint race/main race have just disappeared. Everything else is displayed though. What is interesting though, is that the names are displaying in graphs. Although, viewing graphs is not possible at the moment until my first problem has been fixed.

By the way, I have a small suggestion related to mpRes: could it be possible to define certain races to use TOC-data? What do I mean, is that I've organized some races where we have switched drivers during pit stops. But the problem is that, I've been organizing series, where only on some races we have switched drivers, not in all races on that series. And what this results is that results are not displayed properly either in all races where we switched drivers or in all races where we didn't switch drivers.

So what I would to get in mpRes, is that in .mprdiff-file, we could define that is TOC-data required in this race/have we switched drivers during pit stops.

PS: If you want, I can give you that Finnish translation we're using on that site so that you can add that in future versions of mpRes Smile
See first post for update to v2.08 (Version 0.6R including new Blackwood)


Well, for the https thing, I'll have to take a look into it, as I practically never used this.
About the names problem: Did that also appear when you changed from http to https or did you change anything else that might have caused this?

For the tocdata ... actually I have myself always found this strict way of handling this very awful. I'll have a look into that for the next update, but that will take a little while, as I'm currently quite busy finishing my PhD ... but I'll keep this noted, promise!

And finally for the finnish translation: Yes, please, I always appreciate input Wink


cheers,
AV
Quote from avetere :See first post for update to v2.08 (Version 0.6R including new Blackwood)

I updated into v2.08, just making sure that it didn't fix that name-problem.

Quote :About the names problem: Did that also appear when you changed from http to https or did you change anything else that might have caused this?

I now removed my changes related changing http to https, so that mpRes looks normally fine other than missing those names.

Actually, I noticed this probably about a week or two earlier, before I changed that http to https. I inspected the code and it seems like that the links for LFSWorld-accounts are still there, the only thing that is gone is the linked driver name.

There is one thing that could be a possible reason for this. I noticed that I don't have very much space on my webserver (in fact, I only have like 15 MB remaining). So it could be possible, that the lack of remaining space removes/hides driver names.

I don't remember changing any PHP-files in mpRes. The one file I did edit however, is the one that displays available languages (because I needed to add Finnish language there as well). But I remember that even after I edited that file, it worked properly for like few months.

Quote :And finally for the finnish translation: Yes, please, I always appreciate input Wink

URL for Finnish translation file (it seems like I can't attach .ini-files here): http://www.paste.fi/file/14865172398591 - I used UTF-8 as an encoding, just to let you know in case it's not displaying properly Smile

PS: Am I the only one whose mpRes's graphs look terrible in Firefox? I've attached a screenshot which compares the graphs in Chrome (window on the left side of the picture) and Firefox (window on the right side of the picture). In Chrome, graphs are looking as they should look. (I tested this with IE as well, it displayed them properly)
Attached images
mpRes_Graph_Comprasion.png
Firefox graphs look ok here ...

for the names issue:

please have a look into functions.php (includes/functions.php) at lines 128-130 and replace:
Quote :function namecolored($name) {
return stripslashes(preg_replace("/(\^([0-9]))+([^\^]*((\^\^)+[^\^]*)*)/e",'"<span style=\"color:".getColorCode($2).";\">$3</span>"',htmlspecialchars($name)));
}

with:
Quote :function namecolored($name) {
return stripslashes(preg_replace("/(\^([0-9]))+([^\^]*((\^\^)+[^\^]*)*)/",'$3',htmlspecialchars($name)));
}

This should remove all color-coding from the names. Let's see if that shows you some name at least. If that's the case, the old function seems to be not compatible with your system. Can you tell me, what version of php you have installed on your server?
Quote from avetere :for the names issue:

please have a look into functions.php (includes/functions.php) at lines 128-130 and replace:

This should remove all color-coding from the names. Let's see if that shows you some name at least. If that's the case, the old function seems to be not compatible with your system. Can you tell me, what version of php you have installed on your server?

I made that edit into that file. Now, it seems that every name is now showed (albeit without colors).

That php-version in my server is 5.6.

EDIT: Here's lines 127-136 from my functions.php.

<?php 
### get colored names for html-output ###
#function namecolored($name) {
#    return stripslashes(preg_replace("/(\^([0-9]))+([^\^]*((\^\^)+[^\^]*)*)/e",'"<span style=\"color:".getColorCode($2).";\">$3</span>"',htmlspecialchars($name)));
#}
function namecolored($name) {
    return 
stripslashes(preg_replace("/(\^([0-9]))+([^\^]*((\^\^)+[^\^]*)*)/",'$3',htmlspecialchars($name)));
}
#function namecolored($name) {
#    return stripslashes(preg_replace("/\^([0-9])(.[^\^]*)/e",'"<span style=\"color:".getColorCode($1).";\">$2</span>"',htmlspecialchars($name)));
#}
?>

Ah, now I see what happened ...

In case you run PHP >= 5.5 please change namecolored function to:

<?php 
### get colored names for html-output ###
function namecolored($name) {
    return 
stripslashes(preg_replace_callback("/(\^([0-9]))+([^\^]*((\^\^)+[^\^]*)*)/",function($m) {return '<span style="color:'.getColorCode($m[2]).';">'.$m[3].'</span>';},htmlspecialchars($name)));
}
?>

I'll check for backwards compatibility and then have that included into next release
Thanks! Now those names are visible as they should be Smile
Hi,

I'm having two issues in my mpRes-site: http://tulokset.srtfinland.com

I'm having these problems in the most recent races: I'm using this race as an example: http://tulokset.srtfinland.com/league/SEIII/2017/R03/r/

1) In the most recent races, graphs are not displayed. Going into the URL where the graph image should be located just returns HTTP ERROR 500. URL for grpahs: http://tulokset.srtfinland.com/league/SEIII/2017/R03/r/graphs/

2) I need to update that race's results via .mprdiff-file. But when I try to force load the results via password, it also returns HTTP ERROR 500. URL to force load results: http://tulokset.srtfinland.com/league/SEIII/2017/R03/r/?force_load=turhakoittaajuhavoittaa

However, as I said, I'm having these issues only in the most recent races (only in races which were driven in 2017)
Hm ... this is a bit weird. To be honest, I don't see ANY graphs on your installation. But I also do not get the 500 error either.
However, I did a quick recheck on my server (running php 5.6.11) using your replay and it does work for me: http://mpres.de/single/TST/1/r3/

So my first questions are:
- Did you change any parts of the script just before this happened? (maybe the .htaccess?)
- Did your php version change?
Quote from avetere :Hm ... this is a bit weird. To be honest, I don't see ANY graphs on your installation. But I also do not get the 500 error either.
However, I did a quick recheck on my server (running php 5.6.11) using your replay and it does work for me: http://mpres.de/single/TST/1/r3/

So my first questions are:
- Did you change any parts of the script just before this happened? (maybe the .htaccess?)
- Did your php version change?

Well this is interesting, somehow my php-version changed from 5.6 to 7.0. I now changed it back to 5.6 and it works fine at the moment.

However, I noticed that it seems like you cannot use .mprdiff-file to alter AI-drivers results. I have a .mprdiff-file of this specific race as well where I have several AI-drivers in section player handling. After I force load those results, nothing changes.
So graphs do not work anymore on php7 .. good to know Wink

For the AI drivers:
Try to put 'AIBOTdummyname' directly before the AI ingame name (INCLUDING color coding) ... which gives something like 'AIBOTdummyname^6Spr^2ite ^7- Traceur'
Maybe I should remove the colorcoding from the next version, though ... never actually thought about people really would use AI drivers with this Smile

mpRes - race statistics web script
(58 posts, started )
FGED GREDG RDFGDR GSFDG