Code Monkey home page Code Monkey logo

simresults's Issues

Assetto Corsa: Read skin and ballast

Read skin and ballast information.

"Cars": [
        {
            "CarId": 0,
            "Driver": {
                "Name": "Driver",
                "Team": "",
                "Guid": "7111111111111459"
            },
            "Model": "ag_porsche997rsr_11",
            "Skin": "porsche_1",
            "BallastKG": 0
        },

Clean unittests with custom logs

Change code like this:

    $file_path = realpath(__DIR__.'/logs/assettocorsa-server/discarded.laps.txt');
    $session = Data_Reader::factory($file_path)->getSession(3);

To something like:

    $session = Data_Reader::factory(realpath(__DIR__.'/logs/assettocorsa-server/discarded.laps.txt'))->getSession();

Ac-server: Improve tyre performance

When doing regex above Lap data. Somehow detect that there are no lap changes after that lap? So this means 2 regexes, but maybe safe like 10-60 after that.

Remove cache code from Session

Make an interface of Session. Make the current Session class an implementation of it. Remove all cache code from that implementation and make use of a cached decorator implementing the interface.

CachedSession --> Session --> SessionInterface

Add toString to Lap

Consider adding toString to the Lap class. This makes code simpler by excluding getTime() from the following code

\Simresults\Helper::formatTime($participants[$i]->getBestLap()->getTime());

Refactor readers with a common interface

Alot of readers share common functionality (for example fix positions based on participant order). Also all readers started to have their own implementation and order how to get things (big clutter in getSessions() method too).

We need to fix this and make all readers act within with the same behavior using a common interface. Template methods? Is this possible due to different data formats?

Throw exception when file is not found

Is now throwing Simresults\Exception\NoData: Cannot find a reader for the given data which is incorrect. The "given data" is not read.

Throw a File Not Found exception instead.

Set grid position for Assetto Corsa reader

Set race grid position based on the previous qualify session for the Assetto Corsa reader (race_out.json). Same functionality as used within Assetto Corsa Server reader.

Prevent duplicate code?

Set original session date string

Set the session date as original string too. This is useful for readers of logs that don't include dates that can be converted to a proper PHP timezones. I think this is better for the ac-server reader.

Create an array helper class

Almost every reader has the code below. Fix it.

/**
 * Retrieve a single key from an array. If the key does not exist in the
 * array, the default value will be returned instead.
 *
 *     // Get the value "username" from $_POST, if it exists
 *     $username = Arr::get($_POST, 'username');
 *
 *     // Get the value "sorting" from $_GET, if it exists
 *     $sorting = Arr::get($_GET, 'sorting');
 *
 * This function is from the Kohana project (http://kohanaframework.org/).
 *
 * @param   array   $array      array to extract from
 * @param   string  $key        key name
 * @param   mixed   $default    default value
 * @return  mixed
 */
protected function get($array, $key, $default = NULL)
{
    return isset($array[$key]) ? $array[$key] : $default;
}

Project Cars 2: Player not being recognized as the same user across two races.

I'm using your website to calculate the points for our league and it is showing one of our players as being a separate user across two races. Here is a link to the result:

https://simresults.net/181018-4Jj

If it would be useful I can attach the logfiles I used to create this result. You can see that the player 'V8_Fiero' is listed twice on the points breakdown and is in both race 2 and 3. We are using the MotoGP points schedule.

One thing to note is that I entered each race as a separate json file. We run two races a week and I removed all the other history results from each file so it only contained one practice/qual/race session.

ProjectCars 2 no result data for admin/first player on ded

Hi , I'm one of the admins at simracingonline.co.uk & we have an issue with my info (as admin & first on the server) never appearing in the results for pc2 , I have done the edits to the sms_stats_json ,here are my edits >

-- Session game state changes.
function handle_session_game_state_change( old_state, new_state )
if not old_state or old_state == "" then
old_state = "None"
end
session_game_state = new_state
if ( old_state == "None" ) and ( new_state == "Lobby" ) then
handle_new_session_lobby()
elseif ( old_state == "Returning" ) and ( new_state == "Lobby" ) then
handle_returning_session_lobby()
elseif ( old_state == "Lobby" ) and ( new_state == "Loading" ) then
handle_session_loading()
elseif ( old_state == "Loading" ) and ( new_state == "PostRace" or new_state == "Race" ) then
handle_session_loaded()
elseif ( old_state == "PostRace" or old_state == "Race" ) and ( new_state ~= "PostRace" and new_state ~= "Race" ) then
if new_state == "None" then
handle_session_finished_prematurely()
else
handle_session_finished()
end
end
end

These seem to work as we now have results ! however my info is never parsed and Im left out of every result ?
here is a pic of race 1 (of 2 that day & should be the last 2 races in the results) Im admin on the server and finished 6th 'Rob Milliken'

send to mouser

& this
This is what we get from simresults without any of my info ..

yyyyxxxx

We don't know what to do ?? its been like this from the start meaning my data is never shown ..

I tried to upload my sms_stats_data but i dont have winzip and wrar wont work ..it's posted in this thread at SMS forums http://forum.projectcarsgame.com/showthread.php?56405-No-Race-Results-in-sms_stats_data-json&p=1461236&viewfull=1#post1461236

Im reading in the forum that other players have it working with no issues & so it must be something on my end ?
Thanks in advance if you find any time to help !
Rob .. ;-)

Bug on API?

Hello,

I try to use the API for grouping the result of my league (on R3E). For that purpose, I created a JSON as described in your docs:
http://ec2-35-180-32-180.eu-west-3.compute.amazonaws.com/results/json/simresult.json

Seems to work well : http://simresults.net/remote?results=http%3A%2F%2Fec2-35-180-32-180.eu-west-3.compute.amazonaws.com%2Fresults%2Fjson%2Fsimresult.json

Unfortunately, it does not work well at the moment because, if I update my json input file, for example by adding a new event, this event does not appear in the dropdown list when I refresh the page in simresults (while I can see the change in my webserver). Finally, I'll see this event a few hours later (which is problematic as our drivers want to see the results just after the race).

Seems that there is some caching or something?

I also notice that when I select one event and then an other in the dropdown, there is a duplicated parameter in the URL : "&result=4&result=11". This bug is also visible when using the demo in your API description page : http://simresults.net/remote?results=http%3A%2F%2Fsimresults.net%2Fexample.json&result=1&result=0

Maybe is those two issue related with each other?

Thanks in advance for your support,

BR

PS : there is also another bug in raceroom, all names are now "broken" : John D instead of John Doe (only when using manual upload, not through the API)

Assetto Corsa missing lap 1 position data

I have an instance where lap 1 is missing for all participants. All other laps are processed ok. This is an Assetto Corsa json file. I can see lap 1 in the file for all participants. Any workaround for this problem? Thanks.

Qualification times are missing in Raceroom

Hi,

Since a few weeks, the qualifications times are missing in the display of raceroom qualification table, like here : http://simresults.net/171023-vG1

Those times are still in the Json so it should be a bug :

Ex :

{
"FullName":"David Torned",
"Username":"Torned",
"Car":"McLaren MP4-12C GT3",
"CarPerformanceIndex":60,
"Position":2,
"PositionInClass":2,
"BestLapTime":97958,
"TotalTime":-1,
"FinishStatus":"Finished",
"RaceSessionLaps":[
{
"Time":-1000,
"Position":2,
"PitStopOccured":false
}
]

I've looked in the code and I think I know why it does not worked. Qualification has a section "RaceSessionLaps" (which is wierd) and has a consequence, you parser does not take into account "BestLapTime" which is where we can find the time for the qualification. See line 183 and 212 of Data/Reader/RaceRoomServer.php.

Thanks

Refused laps with different log format are included

Example:

LAP ShijouR26B 2:42:396 
SPLIT COUNT: 3
Dynamic track ok
LAP REFUSED BECAUSE THE SESSION HAS NOT STARTED YET

Filter them out too. See how we can change the regex. Currently works only when it's on the next line (\n|\r)(?!WARNING: LAPTIME DISCARDED|LAP REFUSED) which won't work in this case :(

AC-server-json: Detailed incidents

Source: http://www.assettocorsa.net/forum/index.php?threads/simresults-net-a-webbased-result-reader-php-library.2658/page-16#post-937593

(example log is known at Alex or Mauserrifle).

I use $session->getIncidents() for retrieving collisions. That's kind of ugly because i have to parse these message strings someway, try to match it against my drivers to get in touch with the involved driver guids.
I saw an "Events" section in the json which provides detailed information about collisions including type (car collision / environment collision) and the involved driver's guid.
My it be possible to include these information in you library?

Project Cars: distance traveled

From the PC forum:

I have a small request,
in the log file, there is a value "trackdistance" by drivers.
It would be nice to integrated with the total number of laps made during the different sessions.

Add `isValid` to Lap?

Project Cars now excludes invalid laps. But it could be nice to still have these laps for stats but exclude from all other logic such as best lap.

50% laps completion rule

In the AC Server JSON reader, drivers that have not completed 50% of the laps are marked as FINISH_NONE. Implement this on other (AC) readers too?

Implement json export

Easy converting to JSON would be of big value for users who do not know PHP and just want to get a fast universal JSON output.

rFactor: Calculate pitstop time

Request by CordellCahill:

Another thing is calculating pit stop bogey times. Looking at the stream part it seems it can be calculated using that. Say take the last sector 3 starting time stamp before a pit then get the timestamp of the start of the proceeding sector 2. Take that time and subtract an avg of what that time is without the pit....boom, bogey time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.