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

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

  1. Davvid

    Davvid Registered

    Joined:
    Feb 11, 2012
    Messages:
    163
    Likes Received:
    31
    Hi
    When I try to set up current version of the tool I get this (after finalizing 1st run):
    Code:
    Something went wrong...
    Traceback (most recent call last):
      File "D:/web2py_2.14.6/applications/r2la\compiled\controllers.default.index.py", line 249, in index
      File "D:\web2py_2.14.6/applications/r2la/modules\la_core.py", line 147, in import_logs
    TypeError: cannot concatenate 'str' and 'NoneType' objects
    Is it possible to trace which log file causes the error ? Earlier version of the tool doesn't complain.
     
  2. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    Some <Driver> section in your log(s) has empty <CarType> tag. <CarType> should always have some string value. It happens with some user created mods with bugs. Look at log files where such mods were used. You can open them in some text editor, search for CarType word and see which one is empty.

    This requirement of CarType string value was not changed between earlier and new versions of r2la. It was like this from the earliest r2la versions. So maybe check again if earlier version does not show error, it would be strange. What is your earlier version number?
     
  3. Hmatty

    Hmatty Registered

    Joined:
    Feb 19, 2014
    Messages:
    164
    Likes Received:
    18
    my bad
     
  4. Davvid

    Davvid Registered

    Joined:
    Feb 11, 2012
    Messages:
    163
    Likes Received:
    31
    Thanks for quick answer!
    Earlier version is: 2.058.19

    But as you said it shouldn't make a difference and it isn't probably. Because:
    I divided my logs into chunks (500) and when I fed the tool those amount of logs at once it accepted it and didn't throw that error (in current version).
    I have got many logs (~3000), maybe it's too many to process at the same time?
     
  5. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    I don't know why it showed error with 3000 and does not with 500+500+500... Number of logs should not matter with error message that you posted. That line in code uses <CarType> data from every log and every driver in that log and assumes it is not empty. Maybe there is/was another error message in r2la cmd window, if you see it there, copy it here.

    Generally 3000 logs is a bit too much. Results Viewer page can be slow and some browser/PC configs can run out of memory. I recommend keeping number of logs under 1000 (export old championships to static html, remove old logs). But if it works for you with 1000+, you can keep using it like that, no problem.
     
    buzz hornet likes this.
  6. Matthias

    Matthias Registered

    Joined:
    Jan 16, 2012
    Messages:
    39
    Likes Received:
    5
    Hello,
    i try to update from 2.039 to 2.058.24 and want to import championship data as described.
    But the r2la_settings.json in the old r2la directory is empty.
    How does r2la v2.039 store the championship data?

    Thank you.
     
  7. Davvid

    Davvid Registered

    Joined:
    Feb 11, 2012
    Messages:
    163
    Likes Received:
    31
    Thanks for info. It is unclear to me, too. And yeah having 3000 files is indeed little sluggish now but still acceptable.
    The problem is I have no idea how to quickly test all (over 3000) my files for having that empty <CarType> lines. Can you recommend some method perhaps?
     
  8. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    Matthias, there should be no difference, v2.039 should store championship data in r2la_settings.json automatically any time when some championship options change or new champ races are added/removed. There was a bug in that version that caused an error on r2la_settings save when user had manual Team or Class names in championship with non-ASCII (non Latin) characters. Do you have any such names? Look at your r2la cmd window when you save some changes in your championship(s) options, are there any errors in that window? If you say that r2la_settings.json exists, but is empty, it is likely that there should be some error message.

    Davvid, try this. Download https://notepad-plus-plus.org Then try to use its "Find in files..." feature as described here - https://www.ghacks.net/2016/09/16/use-notepad-to-find-text-in-all-files-of-a-folder/ Point it to your rFactor 2\UserData\Log\Results directory. Uncheck "In all sub-folders" option. Search for this string: <CarType></CarType>
     
    Last edited: Apr 7, 2020
    atomed and Davvid like this.
  9. knackko

    knackko Registered

    Joined:
    Oct 6, 2010
    Messages:
    142
    Likes Received:
    65
    Hi Nibo !
    We are always using R2LA@ODS, and the db increases with championships and hotlap competitions :).
    Please, may I ask a feature regarding the championship manager, that should be to archive old championships like we can do with hotlap competitions. Just in order to make the page more clear after several championships. Optionnaly, thinking about it, why not make the championship page presentation like the hotlaps comps?
     
  10. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    knackko, I think I can do that.
     
    atomed and knackko like this.
  11. Matthias

    Matthias Registered

    Joined:
    Jan 16, 2012
    Messages:
    39
    Likes Received:
    5
    Thanks for the quick reply, Nibo.

    It seems you are right:
    starting browser...
    Traceback (most recent call last):
    File "D:/web2py/applications/r2ladedi\compiled\models.settings.py", line 21, i
    n save_settings
    File "json/__init__.py", line 250, in dumps
    File "json/encoder.py", line 210, in encode
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal
    not in range(128)

    So how can i find the wrong characters?
    Do i have to search in each championship, all raceresults?
     
  12. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    You have to look at all championships in which you (admin) created manual team or class names in r2la. Look at those names and remove any names with non-ASCII characters, then create and re-assign that team/classes only with Latin symbols.
     
  13. Davvid

    Davvid Registered

    Joined:
    Feb 11, 2012
    Messages:
    163
    Likes Received:
    31
    Nibo likes this.
  14. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    Updated to 2.058.31:
    • Added "Finished" checkbox option to championships. Championships marked "finished" are moved to "Finished championships" list below "Active championships" list on Championship Manager page.
    • Added option to display "Active championships" as grid of panels (similar to "Dedi competitions" page). Admin can select list or grid option clicking on icon in top left corner on Championship Manager page.
    • Added "Image link" option to championships. This image will be displayed in championship "card" on Championship Manager page in "grid" mode. "Image link" must be a string link to image on this server (you can put images into rF2 Log Analyzer ver. x/web2py/applications/r2la/static/images/ folder) or some other server, example http://*this server IP*/r2la/static/images/my_image.png or http://i.imgur.com/xxxxxxx.jpg
    • Fixed championship tables even row transparent background when table overflows main div area.
    • Empty CarType tags in xml (because of bugs in some mods), now will be displayed as "EmptyCarType" in r2la.
     
    Davvid, atomed, Badboy and 4 others like this.
  15. Keith Carter

    Keith Carter Registered

    Joined:
    Nov 26, 2016
    Messages:
    45
    Likes Received:
    47
    Nibo! Thank you so much for all of the work you do for this. Is there any way to add more customization options to the pages like the background colors, the highlight color, & the race event type colors? I did see that you introduced some customization, but only for what appear to be changes on the points page.
     
  16. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    I can add some css classes for customization if it is technically possible and will not break anything and will not be out of place. You need to tell me exactly what elements on what page(s) you want to customize and I will consider it.
    Alternatively, you already can try to change some css classes or ids by adding your personal code to rF2 Log Analyzer ver. 2.058.31\web2py\applications\r2la\static\css\app.css file. Look at r2la pages in browser debug mode to see elements classes. Maybe you don't need actions from me.
     
  17. Giacomo Lapadula

    Giacomo Lapadula Registered

    Joined:
    Jan 26, 2012
    Messages:
    9
    Likes Received:
    0
    hi, how do I change from normal mode to DEDI mode?
     
  18. Keith Carter

    Keith Carter Registered

    Joined:
    Nov 26, 2016
    Messages:
    45
    Likes Received:
    47
    Thanks for considering it. Everywhere I placed an arrow would be a nice object to be able to edit the color on. I'll take a look at running the browser in debug mode, but I had searched the files for the color codes I was able to capture and couldn't find them. I'll see if debug mode shows them differently.
     

    Attached Files:

  19. buzz hornet

    buzz hornet Registered

    Joined:
    Oct 5, 2010
    Messages:
    338
    Likes Received:
    249
    Another quality update, appreciate your support for this wonderful tool.
     
  20. Nibo

    Nibo Registered

    Joined:
    Oct 12, 2010
    Messages:
    2,251
    Likes Received:
    965
    iakopo, you only can select mode at the first start of r2la. So you need to start new r2la instance in DEDI mode and then import your championships (r2la_settings.json) into it. Look in r2la steam guide how to setup r2la in DEDI mode ("Installation/Setup for r2la DEDI mode" section). Then if you need to import your championships from non-DEDI version, after DEDI version shows Results VIewer, copy r2la_settings.json file from your old r2la folder into new r2la folder, go to "Options" page and press "Import track associations and championships" (this is the same procedure as you do on r2la version upgrade).

    Keith Carter, every element there needs an explanation:
    1. Site background texture. You can change it by replacing r2la/static/images/nasty_fabric.png file. Keep the name, change png to something different.
    2. Top navbar is a complex uikit element. I can tell you how to change its background color, but I can not change all other elements properties, i.e. hoover/press colors, drop-down elements colors, css is to complex for me there. You can change its background color by adding this line to app.css (set your own color value):
    Code:
    .uk-navbar {background-color: #F0D1FF;}
    3. Custom banner div background. You can change it by adding this line to app.css:
    Code:
    #custom_site_banner > div {background-color: #F0D1FF;}
    4. Blue line highlight color in Results Viewer can be changed by finding and changing this existing lines in app.css:
    Code:
    .log_panel:hover {background-color:#ccf1ff}
    .log_panel {cursor:default}
    .log_panel_active {background-color:#ccf1ff}
    5. Race/qual/practice badges. I added .uk-badge-race .uk-badge-qual .uk-badge-practice classes to app.css just now and re-uploaded r2la archive without version change. Re-download it, install, find and change that values.
    6. Session report background. Its pretty complex panel. If you change its background it looks really bad, all tabs and tables there were created around default background color. If you really want, you can change it by adding this line to app.css:
    Code:
    #report_wrapper .uk-panel {background-color: #F0D1FF;}
    There are other report_wrapper ids in code on other pages, so it can break something else. Really I don't recommend changing this and can not make it changeable, because I would need to make all reports design elements to work with other bg colors, that's too much work.
     
    Keith Carter likes this.

Share This Page