eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

Add a function for checking on missing Livery files - developers only #132

Open viper4gh opened 6 years ago

viper4gh commented 6 years ago

HowTo:

Webserver (Linux): [ds-liveview folder]/data/liveries# ls ./* | grep -v 'McLaren\|Bentley\|Jaguar\|Ferrari\|Formula\|Lotus\|Ligier\|Porsche\|Toyota\|Ford\|RWD\|Mitsubishi\|BMW\|Ginetta\|Lamborghini\|Audi\|Radical\|Mercedes\|Nissan\|Renault\|Aston\|KTM\|Dallara\|Marek\|Cadillac\|Polo\|Opel\|Chevrolet\|Pagani\|Olsberg\|Caterham\|Mini\|Kart\|Panoz\|Datsun\|Acura\|Honda\|Oreca\|Citroen\|Mazda\|Slightly\|BAC\|Agajanian' > [documents]/all_livery_files.txt

Editor: edit all_livery_files.txt with notepad++ for example delete na.png

search & replace:

png\n -> png"," ./ -> " :\n -> ":[" ,"\n -> ],\n

add "] at the end for closing the array

Webserver again: copy all and paste it in: pcars_vehicleliverylist.js function checkfiles (sGameMode){ ... var oFiles = { ///// Fill in Data here ////// } ... }

enable the following line in the index.html: PCARSVehicleLiveryList.checkfiles('PCARS2');

set log level to 3 in the config.js

Browser: Open the website and the developer console and set the console filter to "Livery:" Maybe disabling and enabling the filter again, sometimes not all output lines are shown Further scroll through all output lines. If you not doing this step the "Save As" dialog is not saving all lines correct

From DS API there should be 4360 liveries in total. The console outputs a line for every livery and the complete array at the end with its array length. To check if all lines are correct saved, count the lines and compare it with the array length.

Webserver again: For counting the number of available livery files, go into the ds-liveview/data/liveries directory on your Webserver: find . -name "*.png" | wc -l