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

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

  1. le_poilu

    le_poilu Well-Known Member

    Joined:
    Jan 30, 2015
    Ratings:
    +278 / 0 / -0
    Hi

    Looking into your tools for a league in MP.

    Is there a way to use the XML/JSON exported from Dedicated server ?
     
    • Like Like x 1
  2. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    Not yet, if you attach such result files here, I can script something that supports those files as well.
     
    • Like Like x 1
  3. le_poilu

    le_poilu Well-Known Member

    Joined:
    Jan 30, 2015
    Ratings:
    +278 / 0 / -0
    Good :)

    Here's a xml and a JSON from my dedi so you can have o look on it :)

    thanks
     

    Attached Files:

    • Like Like x 1
  4. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    @le_poilu I've added support for the json result files :)

    to generate you can user either

    Code:
    r3e-open-championship.exe -addrace ./results/season1.lua 201511030659.json -makehtml ./results/season1.lua ./results/season1.html
    
    or luajit, which gives you a dos console for logging

    Code:
    luajit.exe r3e-open-championship.lua -addrace ./results/season1.lua 201511030659.json -makehtml ./results/season1.lua ./results/season1.html
    
    neither option will start the user-interfae.

    Small glitch is that s3s doesn't use the full tracknames in json nor xml, so I cannot associate the appropriate icons.

    Currently I use the "FullName" for the driver names, if you want to change it, edit top of the r3e-open-championship.lua file
    Code:
    -- change this
    local jsonDriverName = "FullName"
    -- to that, for "nicknames"
    local jsonDriverName = "Username"
    
     

    Attached Files:

    • Like Like x 1
  5. le_poilu

    le_poilu Well-Known Member

    Joined:
    Jan 30, 2015
    Ratings:
    +278 / 0 / -0
    Thanks.

    We will use it for our upcoming league!

    Great work
     
    • Like Like x 1
  6. le_poilu

    le_poilu Well-Known Member

    Joined:
    Jan 30, 2015
    Ratings:
    +278 / 0 / -0
    Hi

    I did a small test with your tool and a JSON file.
    Work great, but I coudn't get results to appends, and I only got the last race in the results until I understand It will only do it with a different JSON filename.

    I've created a batch file with this code:
    Code:
    r3e-open-championship.exe -addrace ./results/season1.lua lastone.json -makehtml ./results/season1.lua ./results/season1.html
    So I'll only have to push the last JSON in place of lastone.json and run the script.
    But as said, it doesn't work, as your tool seems to check the file name for new results

    Is there a way to modify this and check race date for example ? (it's a data in the JSON) so it'll only append race with different date/hour


    Thanks again for your work
     
  7. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    The only check done is the "date" inside json file
    "Time":"\/Date(1446573561137)\/"
    if that is already logged, then the race will not be added. If you use the luajit.exe commandline option and run it from a dosbox, then you should a message as to why the file is not added.

    Just tried that with the file you gave me and only edited the Date string (ignoring the last 3 digits, as the date check is based on seconds not milliseconds)
     
  8. ttfredo

    ttfredo New Member

    Joined:
    Dec 24, 2015
    Ratings:
    +0 / 0 / -0
    Hi,

    I discovered the tool there is little time.
    I just tested with a .json file but I have an error message.
    Thks for your job and for your help

    [​IMG]
     
  9. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    You can attach the json file and I will have a look.
     
  10. ttfredo

    ttfredo New Member

    Joined:
    Dec 24, 2015
    Ratings:
    +0 / 0 / -0
    Here is the file.
    tks
     

    Attached Files:

  11. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    @ttfredo tried your file and it works for me. I've improved the output messages a little. I think you may have not pointed to the right json file. In the directory you show there is no "lastone.json" file for example.

    When you use "luajit.exe r3e-open-championship.lua ..." then you will get better error messages directly on the console
     
  12. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    a batch file could lool like this

    Code:
    luajit.exe r3e-open-championship.lua -addrace ./results/%1.lua %2 -makehtml ./results/%1.lua ./results/%1.html
    
    and then call it via

    Code:
    batchfile myseason E:\myserver\201511030659.json
    
     
    • Like Like x 1
  13. ttfredo

    ttfredo New Member

    Joined:
    Dec 24, 2015
    Ratings:
    +0 / 0 / -0
    Happy New Year Pixel Jetstream.
    I did a test with another .json without success.
    I tested it with a batch file
    Code:
    luajit.exe R3E-open-championship.lua -addrace ./results/test1.lua 201601031032.json -makehtml ./results/test1.lua ./results/test1.html
    
    Here is the file .json
     

    Attached Files:

  14. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    what do you get printed on the command line? And what do you define as success?

    I do get the html files generated within the "results" directory just fine (attaching them)

    in the commandline box you can right-click and select "Mark" or "Select" or so, then drag a rectangle across the output text, and press enter. That will put the output text into the clipboard and you paste it here (or you can paste a screenshot as before).

    This was the result of running the "update" batch file (which is defined as in previous post)
    Code:
    D:\projects\r3e-open-championship>update test 201601031032.json
    
    D:\projects\r3e-open-championship>luajit.exe r3e-open-championship.lua -addrace
    ./results/test.lua 201601031032.json -makehtml ./results/test.lua ./results/test
    .html
    ... -addrace ...
    race parsed     Saleen S7R dea166949a691e079b1d2c46e9d166db     2016/1/3 22:32:4
    5
    appendrace      ./results/test.lua
    ... -makehtml ...
    generate HTML   ./results/test.html
    uniquedrivers used
    ... done ...
     

    Attached Files:

    Last edited: Jan 5, 2016
  15. ttfredo

    ttfredo New Member

    Joined:
    Dec 24, 2015
    Ratings:
    +0 / 0 / -0
    It's Ok now. I mastike.
    But there is an error on the ranking.
    said the winner in the ranking was actually one lap down.
    To check should be added the number of turn.
    Thks for your help
     
  16. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +182 / 0 / -0
    In your example is the color of the font from the testdriver orange.
    For one single race is the font of the number one orange, but with a championship can it be someone else I found out.
    How can I change that so that every font is white?
    For the rest is this a great tool.
     
  17. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    @ttfredo the latest version fixes the bug and the winner is correct now

    @NL-Jos
    Orange is supposed to be the human player when racing against AI. But yeah makes little sense in Multi-player.
    For changing format and colors it's best to edit the _style.css file.
    inside it:
    Code:
    #player {
      color:#E5A500;
    }
    by commenting as below, the orange highlight is removed
    #player {
      /*color:#E5A500;*/
    }
    
     
  18. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +182 / 0 / -0
    @pixeljetstream, thanks for that info.
    I hold on an championship with different cars from different classes
    I notice that when i copy the text from the latest race into the race(s) before that the cars en team from the latest race are in the total list.
    May i ask the brutal question if it is possible to disable the colom from the car and drivers?
     
  19. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    @NL-Jos, can you attach a screenshot and mark what you want to have removed?
     
  20. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +182 / 0 / -0
    Ofcourse, but there is nothing to mark because I removed it. LOL
    But I'm sure you see it in the picture.
    Notice: You see no orange text in this picture because i made my own text in white before i get your message how to change the orange color.
     

    Attached Files: