Custom Championship tool (SP & MP races) (creates HTML reports)

Discussion in 'Community Workshop' started by pixeljetstream, Jan 29, 2015.

  1. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    videos is not my thing, but I will add a "server" section to the ui, so that you can add files to a database with a classic file dialog. Making the software easier/comfortable to use is the kind of work I am not exactly after in freetime projects ;)
     
  2. Squanchy

    Squanchy Well-Known Member

    Joined:
    Nov 21, 2016
    Ratings:
    +66 / 0 / -0
    I'm sorry to bother you, pixeljetstream, but I can't get the app to append results. Even though its the same class and field size, with the same drivers (I checked) it always creates separate result files. I tried the command line to force-append it but it threw an exception (Is this the right commnd- -addrace dataBaseFile raceresultsFile?)

    ---------------------------
    Uncaught lua script exception
    ---------------------------
    r3e-open-championship.luar3e-open-championship.lua:1187: assertion failed!
    stack traceback:
    [string "Initializer"]:1: in function <[string "Initializer"]:1>
    [C]: in function 'assert'
    r3e-open-championship.lua:1187: in function 'ParseResults'
    r3e-open-championship.lua:1232: in function 'UpdateHistory'
    r3e-open-championship.lua:1264: in main chunk
    [string "Initializer"]:1: in function <[string "Initializer"]:1>
    [C]: in function 'xpcall'
    [string "Initializer"]:1: in main chunk
    ---------------------------
    OK
    ---------------------------

    Your help would be greatly appreciated.
     
  3. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    Can you attach the files here or via pm?

    The database + race you want to add
     
    Last edited: Mar 25, 2017
  4. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    @Stonehard didn't get to make the ui version, but there is no a simpler batch file that you can use:

    If you do not want to setup the commandline yourself, simply use the myleague.bat:

    myleague.bat 201602031038.json

    • Pass the json or xml file that the server generates onto it, for example drag drop the result file (json or xml) onto the batch file.
    • This will append the results to a database called myleague and the result html is generated and then shown in your default browser.
    • By renaming the batch file, for example GTR3 Summer Season.bat you will also rename the database being used. So simply copy the batch file, rename it to the league it shall represent, and pass the result files onto it.
    • Every time you pass a result file onto the batch, it will get appended to the database of that filename, so races only need to be added once.
     
  5. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +184 / 0 / -0
    I used your program a lot, but since the possibility to run races with reverse grid i don't use it anymore.
    Sorry, but the results of the firt 2 races (if you run 3) al lost in the raceresult.txt
    What you're writing above could be something but i don't realy understand what you mean with

    "Pass the json or xml file that the server generates onto it, for example drag drop the result file (json or xml) onto the batch file"

    The json file i can found in the dedicated server, for so far i understand but the Batch file you're talking about i don't.
    Sorry.
     
  6. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    There is a "myleague.bat" file that is now part of the project, the latest version on GitHub.
    It allows to combine result files generated by a server. That way no race should get lost.

    It is possible to run the tool from commandline to handle files like that for a while. A batch file simply stores the commandline parameters.
     
    • Like Like x 1
    Last edited: Mar 25, 2017
  7. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +184 / 0 / -0
    And how should i use the myleague.bat file?
    (i told you before i'm not an computer nerd. :p:D:eek:)
     
  8. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    Just drag drop the json or XML files that the server generates for the races onto it.
     
  9. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +184 / 0 / -0
    Do i open the batch with wordpad or something because when i double click on it some kind of ms-dos screen opens.
     
  10. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    You pass the json or XML file onto it via drag drop in file explorer.
     
  11. Squanchy

    Squanchy Well-Known Member

    Joined:
    Nov 21, 2016
    Ratings:
    +66 / 0 / -0
    Yes, it seems that raceresults.txt is not built right. If you do a double-race instead of one, at the end of the second race they just append the second race results twice. There's no way to get the first results it seems.
     
  12. Roman TRT

    Roman TRT Well-Known Member

    Joined:
    Jun 3, 2015
    Ratings:
    +77 / 0 / -0
    At me the given application does not find result files, how to change a way to files?
    Not results: Documents\My Games\SimBin\RaceRoom Racing Experience\UserData\Log\Results

    and there is the same application, only with more complete statistics, both on sites simresults?
     
  13. Nicklas Petersson

    Nicklas Petersson New Member

    Joined:
    Jan 1, 2016
    Ratings:
    +4 / 0 / -0
    Is it possible to get additional points included in raceresult, for example best qual or most lap lead, in this version?
     
  14. keanos

    keanos Well-Known Member

    Joined:
    Oct 29, 2015
    Ratings:
    +142 / 0 / -0
    It seems, after the change of the json files in the August 11th Patch, the json files from the dedicated server will not work any longer.

    Sector3 changed this line in the json files:

    old: "StartTime":"\/Date(1597082450876+0200)\/","Time":"\/Date(1597090244967)
    new: "StartTime":1597295175,"Time":1597339899

    @pixeljetstream Is there a chance this would be added, so that both formats will work?

    And maybe an option to assign zero points for dnf's and
    assign points for quali positions, like:
    default_quali = {5,4,3,2,1},?
     
    Last edited: Sep 6, 2020
  15. SkywalkerTh

    SkywalkerTh New Member

    Joined:
    Sep 28, 2021
    Ratings:
    +0 / 0 / -0
  16. SkywalkerTh

    SkywalkerTh New Member

    Joined:
    Sep 28, 2021
    Ratings:
    +0 / 0 / -0
    I hope that still posted here
     
  17. SkywalkerTh

    SkywalkerTh New Member

    Joined:
    Sep 28, 2021
    Ratings:
    +0 / 0 / -0
    Hello everyone, maybe I am not alone with this "new" error.
    So far I have not had any problems with the creation of the HTML files.
    I use for this the race result as JSON file and send this via cmd command to the luajit.exe
    "luajit.exe r3e-open-championship.lua -addrace results.lua raceresults.json -makehtml results.lua results.html".
    Since one of the last updates of RaceRoom I get this error message with the JSON file:
    ... -addrace ...
    luajit.exe: r3e-open-championship.lua:835: attempt to index field 'Time' (a number value)
    stack traceback:
    r3e-open-championship.lua:835: in function 'ParseResults'.
    r3e-open-championship.lua:1226: in function 'UpdateHistory'.
    r3e-open-championship.lua:1258: in main chunk
    [C]: at 0x004020e0

    Then I changed the race result for the next races and got it in a XML file, when I then pass this XML file to luajit.exe
    "luajit.exe r3e-open-championship.lua -addrace results.lua raceresults.xml -makehtml results.lua results.html",
    then I get this error message:

    ... -makehtml ...
    generate HTML results.html
    uniquedrivers used
    luajit.exe: r3e-open-championship.lua:85: attempt to perform arithmetic on local 'searchDist' (a nil value)
    stack traceback:
    r3e-open-championship.lua:85: in function 'findTrack'.
    r3e-open-championship.lua:478: in function 'addHeaderTracks
    r3e-open-championship.lua:497: in function 'GenerateStatsHTML': 'addHeaderTracks'.
    r3e-open-championship.lua:1271: in main chunk
    [C]: at 0x004020e0

    The HTML file is generated, but only with the XML file, but the HTML is then without content.
    My guess is that something must have changed in the output of the JSON/XML files.

    I would be very happy if someone could help me with this.
    So thank you very much in advance.
     
  18. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    Best is you attach json and XML files that created the errors, so I can fix the code
     
  19. SkywalkerTh

    SkywalkerTh New Member

    Joined:
    Sep 28, 2021
    Ratings:
    +0 / 0 / -0
    Thank you for the quick reply, I am sending you a few examples.
     

    Attached Files:

  20. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    in theory things should work now, I also added support for race2/race3 type sessions, which was missing so far.
     
    • Like Like x 1