[REL] rFactor2 Log Analyzer ver. 2. With offline and league Championship Manager

Can you explain how to use this?
Where need i add theses files?

QUOTE="Nibo, post: 945597, member: 23919"]Updated to 2.058.6
  • Added jsonp call at live/get_server_data_jsonp to get Live Timing server/driver data with cross-domain ajax request from your other server (may be used to create live servers/tracks/drivers widget). Data is updated once in 5 seconds, I do not recommend to request it more frequently.
    Code:
    $.ajax({
       url: 'http://your-r2la-address:port/live/get_server_data_jsonp',
       type: 'GET',
       dataType: 'jsonp',
       crossDomain: true,
       data: {},
       success: function (data, textStatus, xhr) {
           console.log(data);
       },
       error: function (xhr, textStatus, errorThrown) {
           console.log(errorThrown);
       }
    });

    Returned data object structure is:
    Code:
    server_names_list: ['Server Name1', 'Server Name2', ...],
    server_data: {
       "Server Name1": {
           session: session code (0=testday 1-4=practice 5-8=qual 9=warmup 10-13=race),
           track_name: "Track Name",
           vehicles: [
               {best_lap_time: lap time in seconds,
               driver_name: "Driver Name1",
               vehicle_class: "Vehicle Class1",
               vehicle_name: "Vehicle Name1"},
               { ... },
           ]},
       "Server Name2": { ... },
    }
[/QUOTE]
 
You will need to add that JS code ($.ajax(...) call) to your site page, then use returned "data" object to show data on your page. You will need to know some JS for this. Make short poll function to get data at some interval, like this:
Code:
var short_poll = function () {
$.ajax(
...
success: function (data, textStatus, xhr) {
      console.log(data);
      // show data
      setTimeout(short_poll, 5000)
   },
);
short_poll();
 
... then use returned "data" object to show data on your page. You will need to know some JS for this. Make short poll function to get data at some interval, like this:
Code:
var short_poll = function () {
$.ajax(
...
success: function (data, textStatus, xhr) {
      console.log(data);
      // show data
      setTimeout(short_poll, 5000)
   },
);
short_poll();


I copied the ($.ajax(...) call) on an empty page (live.html) i don't understand next?
Can you help me?
 
Here is a full working example. Shows server list and driver-car for each server. Substitute "http://xxx.xxx.xxx.xxx:xxxx" with your r2la IP and port. Insert it into your page where you want it, style it with css, use JS to show data differently if you need.
HTML:
<div id="servers_widget">
    <div id="servers_list"></div>
</div>


<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
var short_poll = function () {
$.ajax({
    url: 'http://xxx.xxx.xxx.xxx:xxxx/live/get_server_data_jsonp',
    type: 'GET',
    dataType: 'jsonp',
    crossDomain: true,
    data: {},
    success: function (data, textStatus, xhr) {
        //console.log(data);
        $('#servers_list').empty();
        if (data) {
            if (data.server_names_list.length > 0) {
                $.each(data.server_names_list, function(index, value) {
                    $('#servers_list').append($('<div id="server_'+index+'"></div>'));
                    $('#server_'+index).append($("<div>"+value+"</div>"));
                    $('#server_'+index).append($("<div>"+data.server_data[value]['track_name']+"</div>"));
                    $('#server_'+index).append($('<div id="vehicles_'+index+'"></div>'));
                    $.each(data.server_data[value]['vehicles'], function(index2, value2) {
                        $('#vehicles_'+index).append($("<div><span>"+(index2+1).toString()+". "+value2['driver_name']+" - "+value2['vehicle_name']+"</span></div>"));
                    });
                });
            }
        }
        setTimeout(short_poll, 5000)
    },
    error: function (xhr, textStatus, errorThrown) {
        console.log(errorThrown);
    }
});
}
short_poll();
</script>
 
One more question, SORRY ;-)

Why did i not see the hotlap from Yves (show pictures)
 

Attachments

  • 1.PNG
    1.PNG
    94 KB · Views: 479
  • 2.PNG
    2.PNG
    117 KB · Views: 369
  • 3.PNG
    3.PNG
    89.6 KB · Views: 386
  • 4.PNG
    4.PNG
    95.2 KB · Views: 543
Hi,
Now with 2.058.6, can say that are ok:
  • Added "Last race with result" and "Team standings" options for "Default page" in Championship.
  • Added "Points for consistency" to Championships points system. Top N drivers from "Average deviation from drivers fastest lap" table will recieve this bonus.
  • Added jsonp call at live/get_server_data_jsonp to get Live Timing server/driver data with cross-domain ajax request from your other server (may be used to create live servers/tracks/drivers widget). Data is updated once in 5 seconds, I do not recommend to request it more frequently.
I think there is an issue with "Copy" button to race columns: in fact it is not to copy the teams from the previous race, but to assign the teams to drivers as done at first time. Because actually when a driver has not done a race, in r2la, he can not be assigned to a team for that race, so if he is available the next race, when using the current copy button, he will be not assigned to any team.
 
I think that's the limitation that I will have to leave like that. Its like you said, if driver is not in a race, then its not possible to assign any data to him at that race.
 
There is no point deduction options, only bonus points for fastest lap etc.
I think, for what you want you have use the Manual Points Override feature.
points.JPG

If you want to deduct 2 points from someone all you do is type "2" into the box under "Manual" that corresponds to the person.
Tick the box to the right then click the big blue Apply Manual Points Override.
If you have to adjust the whole field, enter the numbers then tick the box next to Manual up the top. That will select everyone with only one click.
Any adjustments to points in championship races already run will automatically be adjusted to the standings table.
 
helyesadi, I don't really understand what "Point deduction feature" is. Maybe you can describe it more. If its to remove/correct points from "sum" values of championship table, then better use existing individual race points correction for this as ADSTA wrote. I can not promise that I will make a system to edit overall championship points, it will not be very easy.
 
I was thinking of a championship table.
The point correction is good, but if you do not score a point, then I have to deduction in a completely different race.

No problem, I just asked. Anyway, the program is very good :)
 
@Nibo
In Driver Stats of a Championship, what defines a Hat trick and a Grand Slam?

I've gone all :confused: trying to work it out.
So before I got :mad: I thought I would ask you.
 
Thanks @wrxxy
I've got 1 driver with one hat trick and another driver with 2 hat tricks and 1 grand slam.
What you wrote above matches the hat tricks for them.

Grand Slam though?
I thought it might be win 4 races but there are two drivers who have won 4 races each.
 
Back
Top