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

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.
 
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?
 
If you selected DEDI version at r2la first start, then you need to be signed in as admin to see control buttons.
If you didn't select DEDI version, then you don't need to sign in, you are already an admin always.

But since LITTLEBLACKO_ says that he presses "+" button, then its visible and he is already admin.
my bad
 
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?

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?
 
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.
 
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.
 
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.

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?
 
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:
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?
 
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?
 
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.
 
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.
 
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.
 
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.
 
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.

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.
 

Attachments

  • rf2la.JPG
    rf2la.JPG
    167.3 KB · Views: 251
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.
 
Back
Top