[WIP] Live Timing, Session Results, Track Rendering & League Management [Discontinued]

Discussion in 'Other' started by B1K3R, Apr 16, 2013.

  1. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    You're welcome :)
     
  2. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    NOTE TO THOSE INSTALLING LATEST PATCH:

    For those applying the latest patch...I forgot to add that after you install the listener, go to each server record, choose the player.json (or whatever its called) again and save as otherwise it will raise an error when started. Then close the listener, reopen it and all should be fine.


    The reason for this is that now, the player.json is not hard coded any more, but it can be any name.

    Cheers
     
    Last edited by a moderator: Dec 2, 2014
  3. GTClub_wajdi

    GTClub_wajdi Registered

    Joined:
    Feb 28, 2012
    Messages:
    3,151
    Likes Received:
    499
  4. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    Thank you for all of your hard work mate
     
  5. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    37
    Is there any URL to get the raw timing in Json or XML format? I mostly just need the driver names and team names that are in the current session.
     
  6. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88

    Hi Noel,

    Well, the new system mainly streams data from the plugin to the web directly through web sockets for faster speed/performance. However, I still left the option to save live data to database in the listener at the specific time interval.

    Yes, there is an api and the wsdl can be found like this:

    http://www.atlanticracing.net/livetiming/service/BroadcastService.asmx?wsdl

    However, not all methods can be accessed as some need authentication if access from the backend. From front end they cannot.

    But some can be accessed without authentication. One method is GetCarPositionJson which contains the driver Id, name, previous gap and car positions but not team name.

    In front end, it can be called with an ajax call like this:

    function ShowDrivers(sessionID) {
    var url = "<%= ResolveUrl("~/Service/BroadcastService.asmx/GetCarPositionJson") %>";


    successHandler = function (results) {
    driverList = results.d;
    }
    $.ajax({
    type: "POST",
    url: url,
    data: "{sessionID: '" + sessionID + "', mapDimensionID: '" + 0 + "', userID: '" + 0 + "'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    async: true,
    success: successHandler,
    error: function (err) { } /*alert(err.Message);*/
    })
    }

    I'd be happy to create a web method which meets your needs, no problem mate, just tell me which data you want and I'll add a web method which returns a json object.

    Cheers
     
    Last edited by a moderator: Dec 12, 2014
  7. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Thinking about it, if you want to read the stream through web sockets on the web, you can as well like this:

    The data object is json ;)

    try {
    // create a new websocket and connect
    window.ws = new wsImpl('ws://' + webStreamIP + ':' + webStreamPort + '/');


    // when data is comming from the server, this metod is called
    ws.onmessage = function (evt) {


    dataReceieved = 1;


    var data = JSON.parse(evt.data);




    if ((data[0].ID == 1) && (data[0].SessionID == sessionID)) {
    //console.log('On Score');


    if (typeof onScoreMessage == 'function') {
    onScoreMessage(data);
    }
    }


    if ((data[0].ID == 2) && (data[0].SessionID == sessionID)) {
    //console.log('On onLiveTimingMessage');


    if (typeof onLiveTimingMessage == 'function') {
    onLiveTimingMessage(data);
    }
    }


    if ((data[0].ID == 3) && (data[0].SessionID == sessionID)) {


    //console.log('On onCarPositionMessage');
    if (typeof onCarPositionMessage == 'function') {
    onCarPositionMessage(data);
    }
    }
    };


    // when the connection is established, this method is called
    ws.onopen = function () {


    //console.log('On Open');
    localStorage.setItem("prevSessionID", localStorage.getItem("sessionID"));
    };


    // when the connection is closed, this method is called
    ws.onclose = function () {


    //console.log('On Close');
    localStorage.setItem("prevSessionID", '');
    }


    ws.onerror = function (errorEvent) {
    console.log('WebSocket Status:: Error was reported');
    };
    }
    catch (exception) { if (window.console) console.log(exception); }
     
  8. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    37
    I'm actually writing a gridedit tool that will let you dynamically build a gridedit batch on demand. We never know what drivers will be starting the race so the work around has been to list every single driver of every team. We end up with a 200 line batch. So I wrote a tool for rF1 that would let you open a config file that listed the grid by team name rather than driver name. My tool would then query the live timing to get the current driver name of that team and build a batch dynamically. The same thing for applying penalties. rF does a soundex on the driver names so if you apply a penalty for a driver that isn't actually on the server it will pick the closest match. Sort of ridiculous. So my tool let us assign penalties by team name and it figured out what driver to give it to on the fly. The problem is right now I haven't ported my old timing plugin from rF1 to rF2 so I need to adapt my tool to work with someone elses timing. Right now we are using yours. :)

    I started work yesterday on a plugin dedicated to running scripts that will send chat messages, penalties and set the grid. I also want it to be able to whisper a message to a specific driver when he joins the server. I also want the tool to watch mResoultsStream for custom server commands. /racenotes for example could be sent by an admin and the plugin would then echo the racenotes script on demand. Doing this at the plugin level would be way better than my old tool which automated the dedi server UI. But I am in a time crunch right now because the race is this weekend. I just want to bandaid my old tool and then continue on the new plugin later.
     
  9. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Sounds all cool, as always time is the problem :)

    Like I said, whatever you need from me exposed (through web service or you could as well use the LiveTimingData.dll directly depending what youre programming with), just ask or whatever help I can gice you.

    And tomorrow I'm off (baby sitting though!) so I can surely help :p


     
  10. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    So I came up with a pilot version for Quick Online Racing where drivers can check what racing events are coming up, subscribe to it and also see who has subscribed to that event. This is an attempt from my side to bring together all those drivers who want to do a quick race but always find empty servers.

    Like this, all drivers wanting to do a quick race can see what, when and where others want to race and join them. Basically it brings visibility to each other and brings them together.

    The alpha app can be checked out here:

    http://www.atlanticracing.net/Livetiming/RacingServers.aspx

    In a nut shell, I wrote an engine that when the rFactor 2 is fired up, my app reads the game server configurations and automatically creates all the upcoming sessions. So whatever you set in rF2, it will be automatically created.

    I did not put too much fuss on design and functionality as I dont want to make lots of effort for nothing. So basically, everything is quick basic but at least the concept can be tested.

    I will add more servers this weekend and tweak stuff, but I'd love to know what you guys think! To use it, you need to go to Account > Login > Register and then you can subscribe to an event and also see what others have subscribed too.

    This is another attempted from my side to bring these kind of drivers together so I hope this concept will be useful.

    Cheers

    [​IMG]
     
  11. rsgraham59

    rsgraham59 Registered

    Joined:
    Dec 30, 2014
    Messages:
    13
    Likes Received:
    0
    Is there an Installation guide?
    I have
    enabled IIS
    Installed MySQL
    Installed HeidiSQL
    Installed the plugin, Listener and Web.
    Run the DB scripts to create the DB.

    Now how do I tie it all together?
     
  12. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Your almost done then :) if you give me rdp or teamview access I can have a look.

    Sent from my GT-I9300 using Tapatalk
     
  13. rsgraham59

    rsgraham59 Registered

    Joined:
    Dec 30, 2014
    Messages:
    13
    Likes Received:
    0
    Thanks for the help mate. The only issue that was left after you finished was the Windows Firewall. I punched a hole in it and now all is good.
     
  14. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Awesome! Let me know if you encounter any issues or have any ideas/feedback ;-)

    Sent from my GT-I9300 using Tapatalk
     
  15. TOCA2FREAK

    TOCA2FREAK Registered

    Joined:
    Apr 6, 2011
    Messages:
    927
    Likes Received:
    125
    Hi. This tools looks awesome. Are there any step by step instructions on how to setup?

    Thanks. :)
     
  16. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
  17. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    Hellooooo!

    A request, If I may.

    There is a % laps complete to award points. Can we have one where it is DNF = no points. Putting 100% works until someone is lapped, then they get no points.
     
  18. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88

    Good idea Rich! It should be an easy fix.

    Now on another note, I see that your live timing app is down! I am playing with an idea, where instead of everyone hosting his own live timing app, I will have a dedicated server which will host a live timing app for everyone that needs.

    This will have the following benefits:

    1. Live timing app always up and running :p
    2. Live timing app will always be up to date and latest version! users will always benefit from new enhancements straight away.
    3. Bugs will be fixed and deployed in a fast way. Thus quicker support.
    4. You do not need or worry about the web and database server!
    5. If one has nowhere to host web or does not have enough power to install DB then problem solved!
    6. One location where users can see all live timings for all communities
    7. Users will be able to search/book/participate to a quick race (my idea of a few posts above)


    So, if you want to participate in this experiment, let me know :) For now, I can manage to keep this service for FREE but then if this will become more successful I will ask for a small fee every month to support the server. If this works, then I might have a FREE version with simple functionality and a PRO will all the goodies.

    Also just for you guys to know, I will soon be adding many other stuff, like Profile registration and user statistics, Data Management System where one could manage all laps and session data and anything else a PRO subscription will ask for!


    Any, let me know if interested :)

    Cheers
     
    Last edited by a moderator: Jan 12, 2015
  19. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    I'd be interested mate.

    My app isn't down though? (I only have one server live currently)
     
  20. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Ok great! We can test it this weekend if you want :)

    Ps: ah maybe I just did not see the clio streaming last night

    Sent from my GT-I9300 using Tapatalk
     

Share This Page