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

Discussion in 'Other' started by Nibo, Apr 15, 2015.

  1. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,263
    Likes Received:
    977
    Alonsopower, that would be too complicated, too much work that I can not do right now (and highly likely never).
     
  2. ganzoni

    ganzoni Registered

    Joined:
    Jan 3, 2012
    Messages:
    36
    Likes Received:
    1
    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]
     
  3. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,263
    Likes Received:
    977
    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();
     
  4. ganzoni

    ganzoni Registered

    Joined:
    Jan 3, 2012
    Messages:
    36
    Likes Received:
    1

    I copied the ($.ajax(...) call) on an empty page (live.html) i don't understand next?
    Can you help me?
     
  5. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,263
    Likes Received:
    977
    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>
     
  6. ganzoni

    ganzoni Registered

    Joined:
    Jan 3, 2012
    Messages:
    36
    Likes Received:
    1
    One more question, SORRY ;-)

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

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      94 KB
      Views:
      372
    • 2.PNG
      2.PNG
      File size:
      117 KB
      Views:
      301
    • 3.PNG
      3.PNG
      File size:
      89.6 KB
      Views:
      308
    • 4.PNG
      4.PNG
      File size:
      95.2 KB
      Views:
      413
  7. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,263
    Likes Received:
    977
    Allowed aids - Clutch. Used aids - Clutch, Driving Line.
     
  8. ganzoni

    ganzoni Registered

    Joined:
    Jan 3, 2012
    Messages:
    36
    Likes Received:
    1
  9. knackko

    knackko Registered

    Joined:
    Oct 6, 2010
    Messages:
    142
    Likes Received:
    65
    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.
     
  10. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,263
    Likes Received:
    977
    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.
     
  11. Adam Helyes

    Adam Helyes Registered

    Joined:
    Feb 8, 2017
    Messages:
    90
    Likes Received:
    60
    Hi
    Can a Point deduction feature be requested? :p :)
    After the last race, we can only apply points deduction.

    thanks :)
     
  12. ADSTA

    ADSTA Registered

    Joined:
    Nov 19, 2011
    Messages:
    2,013
    Likes Received:
    1,369
    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.
     
  13. Adam Helyes

    Adam Helyes Registered

    Joined:
    Feb 8, 2017
    Messages:
    90
    Likes Received:
    60
    I did it as you wrote it. But I asked if there was a better solution. It would seem not yet.
    Thanks.
     
  14. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,263
    Likes Received:
    977
    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.
     
    Adam Helyes likes this.
  15. Adam Helyes

    Adam Helyes Registered

    Joined:
    Feb 8, 2017
    Messages:
    90
    Likes Received:
    60
    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 :)
     
  16. ADSTA

    ADSTA Registered

    Joined:
    Nov 19, 2011
    Messages:
    2,013
    Likes Received:
    1,369
    @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.
     
  17. wrxxy

    wrxxy Registered

    Joined:
    May 17, 2012
    Messages:
    345
    Likes Received:
    102
    qualify 1st , fastest lap, win race.........
     
    ADSTA likes this.
  18. ADSTA

    ADSTA Registered

    Joined:
    Nov 19, 2011
    Messages:
    2,013
    Likes Received:
    1,369
    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.
     
  19. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,263
    Likes Received:
    977
    HatTrick: Win, Pole, Fastest Lap.
    GrandSlam: HatTrick + Led all laps in this race.
     
    ADSTA likes this.
  20. ADSTA

    ADSTA Registered

    Joined:
    Nov 19, 2011
    Messages:
    2,013
    Likes Received:
    1,369
    Thanks Nibo, that matches the stats.
     

Share This Page