Jump to content


- - - - -

Lap Records In The Gpl Menue "best Laps"


  • Please log in to reply
5 replies to this topic

#1 Mc Wolf

Mc Wolf

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 86 posts

Posted May 22 2019 - 12:22 AM

Hello,

I can't transfer my best laps records, to the new GPL version with scroll menu ?
I don't mean the original 11 GPL tracks, which are saved in the Player.ini, but I mean the Addon tracks.
For this I always used Martin Granberg's Replay analizer. These are accepted by the GPL Rank, but not displayed in the new GPL best laps menu, because there is a 10-digit code in front of the time.

I take an original track, then I have both values

For example :
Papyrus original player.ini
[ kyalami ]
braP = 1269559912 80.505997

MG Replay analizer
[Kyalami]
braP = 937513966 80,506

Can anyone help me?

Edited by Mc Wolf, May 22 2019 - 12:24 AM.


#2 webfoot

webfoot

    Denny Hulme

  • Supporter
  • PipPipPipPipPipPipPipPipPipPip
  • 240 posts
  • Gender:Male
  • Location:Birmingham England
  • Interests:.
  • Sim interest:GPL

Posted May 22 2019 - 12:47 PM

For the player.ini, I think the 10 digit code is the date and time, in the format of number of seconds since 1st January 1970.  Or something like that.

Assuming the replay analyser is the same......

So 1269559912 is some time in April 2010 and 937513966 is sometime in August 1999.

#3 Mc Wolf

Mc Wolf

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 86 posts

Posted May 24 2019 - 01:35 PM

Thanks,
I've now taken a 10-digit fantasy number. The numbers created by the Replay Analyzer are only 9 digits, that didn't work. Unfortunately now all times are from 11.9.94, there was no GPL yet. Can you break down the 10-digit number exactly ?
Then I could take the dates from my replays and convert it.

#4 webfoot

webfoot

    Denny Hulme

  • Supporter
  • PipPipPipPipPipPipPipPipPipPip
  • 240 posts
  • Gender:Male
  • Location:Birmingham England
  • Interests:.
  • Sim interest:GPL

Posted May 25 2019 - 03:29 AM

So Replay Analyser must be using a different value/calculation.  The player.ini 10 digit number the number of seconds since 1st January 1970.  To convert the number to a date is just a calculation.  

Try this Excel spreadsheet.  It converts a date into a 10 digit number (and also the reverse if you need it).

Attached File  GPL Best Laps Date Calculator.7z   7.73K   3 downloads

#5 Saiph

Saiph

    Drives 4 Team BDS

  • Supporter
  • PipPipPipPipPipPipPipPipPipPip
  • 1,967 posts
  • Gender:Male
  • Location:Aylesbury, UK
  • Interests:Computer gaming (esp. sims, strategy, RPG), real ale, live music, motor sports, boring the NSA/GCHQ to death.
  • Sim interest:GPL

Posted May 25 2019 - 03:34 AM

As webfoot said, the 10-digit number is a system date format (sometimes referred to as "sysdate" or "time_t" format) which represents the number of seconds since midnight, Jan 1 1970. To convert to and from sysdate format you need some kind of converter utility or spreadsheet function. In my GPLStats laptime listing program, the C++ code looks like this:
//-----------------------------------------------------------------------------------------------
// This function takes a "time_t" system date/time field (for example a file modified date/time),
// and returns a formatted date/time string, "dayname DD/MM/YY HH:MM".
//
string ShowDate( const time_t tInput )
{
stringstream s;
const string DayAbbrev[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
const struct tm* DateTime = localtime( &tInput );
s << DayAbbrev[ DateTime->tm_wday ] << " ";
s << setw(2) << setfill('0') << DateTime->tm_mday;
s << "/"; 
s << setw(2) << setfill('0') << DateTime->tm_mon + 1;
s << "/";
s << setw(2) << setfill('0') << DateTime->tm_year % 100 << " ";
s << setw(2) << setfill('0') << DateTime->tm_hour << ":";
s << setw(2) << setfill('0') << DateTime->tm_min;
return s.str();
}

....where the value "tInput" is the sysdate number from the player.ini file, and the string "s" is the human-readable date and time for the lap record. The C library function 'localtime' actually performs the conversion.

I've never needed to convert from a readable date to sysdate format, so I'm afraid I'm not exactly sure how to do it, but I'm 100% certain that there are functions in the standard C++ library, and also in Excel, to allow someone to do that. It's just a question of finding them.

Edited by Saiph, May 25 2019 - 03:44 AM.


#6 Mc Wolf

Mc Wolf

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 86 posts

Posted May 25 2019 - 07:07 AM

Thank you Webfoot & Salph, I will try it out




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Sim Racing Links