Results 1 to 2 of 2

Thread: Inconsistent sms_stats_data.json

  1. #1
    Kart Driver
    Join Date
    Jan 2019
    Location
    Barcelona
    Posts
    7
    Platform
    PC

    Question Inconsistent sms_stats_data.json

    Hi all,

    I manage a pcars2 league in a simracing community and we have a hotlap tracking app which imports valid laptimes from sms_stats_data.json to an sql database for later use. The problem is the huge amount of inconsistencies I have to deal with inside the sms_stats_data.json file...

    All this examples are taken from the same 1 week long sms_stats_data.json with only practice sessions allowed.

    Inconsistencies in PARTICIPANTS subarrays:

    Sometimes the subarray is keyed with the "participantid" field, sometimes not...

    Case 1 example:
    Code:
    "participants" : {
      "0" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 73,
    	"Name" : "Hidden on purpose",
    	"RefId" : 63872,
    	"VehicleId" : 1353949246
      }
    },
    Case 2 example:
    Code:
    "participants" : [
      {
    	"IsPlayer" : 1,
    	"LiveryId" : 53,
    	"Name" : "Hidden on purpose",
    	"RefId" : 50688,
    	"VehicleId" : 1153746660
      }
    ],
    This issue happens with one or with more than one participants.

    In this next case, you can see another problem, that is the player name being empty:

    Code:
    "participants" : {
      "0" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 54,
    	"Name" : "Hidden on purpose",
    	"RefId" : 22080,
    	"VehicleId" : 809291220
      },
      "1" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 99,
    	"Name" : "",
    	"RefId" : 49153,
    	"VehicleId" : -1416203489
      },
      "2" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 99,
    	"Name" : "Hidden on purpose",
    	"RefId" : 9793,
    	"VehicleId" : -1416203489
      },
      "3" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 69,
    	"Name" : "Hidden on purpose",
    	"RefId" : 44418,
    	"VehicleId" : -1860886593
      },
      "4" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 99,
    	"Name" : "Hidden on purpose",
    	"RefId" : 2369,
    	"VehicleId" : -93033971
      },
      "5" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 99,
    	"Name" : "",
    	"RefId" : 53314,
    	"VehicleId" : 1153746660
      },
      "6" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 78,
    	"Name" : "Hidden on purpose",
    	"RefId" : 30529,
    	"VehicleId" : -1860886593
      },
      "7" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 59,
    	"Name" : "Hidden on purpose",
    	"RefId" : 24642,
    	"VehicleId" : 809291220
      },
      "8" : {
    	"IsPlayer" : 1,
    	"LiveryId" : 99,
    	"Name" : "Hidden on purpose",
    	"RefId" : 36995,
    	"VehicleId" : -93033971
      }
    },
    When this happens, the only solution I found is to get the participantid from the laptime event and search in the corresponding session's participants array, but that is not possible when there is no key in the latter, as I mentioned earlier. You can see this on the following case, which corresponds to a laptime registered in the same session as Case 2 example:

    Code:
    {
    "attributes" : {
      "IsMainBranch" : 1,
      "Lap" : 0,
      "LapTime" : 20417,
      "RacePosition" : 1
    },
    "event_name" : "CutTrackStart",
    "is_player" : true,
    "name" : "Hidden on purpose",
    "participantid" : 1,
    "refid" : 50688,
    "time" : 1604411036
    },
    I solved this with a refid value check for each participant, but this overcomplicates the code innecessarily.

    Inconsistencies in MEMBERS subarrays:

    The other major issue is regarding the members subarray, as it is sometimes empty. This would be the source to get the current setup for each player, wether he uses a controller or a wheel or which aids he has activated, and so on. Is would be also the way to get the player's steam ID, but it is sometimes empty and I cannot find the reason.

    Conclusion

    In the end, I have managed to register every valid lap and store the driver, car, livery, date and time and laptime, with an overcomplicated code full of 'if' statements, but I cannot get the driver configuration nor its steam ID. Has anyone faced this issues before? Has this anything to do with my DS files?

  2. #2
    Rookie
    Join Date
    May 2021
    Posts
    1
    Platform
    PC
    Hi there! Any news? I'm facing the same issue here...

Similar Threads

  1. No Race Results in sms_stats_data.json?
    By boris_s. in forum Third-Party Apps & API Discussion
    Replies: 57
    Last Post: 01-07-2018, 05:07
  2. sms_stats_data.json is broken
    By twobib in forum Multiplayer
    Replies: 3
    Last Post: 24-02-2018, 10:08
  3. How do I set all cars in sms_rotate_config.json?
    By Truebrit in forum Multiplayer
    Replies: 2
    Last Post: 21-12-2017, 13:21
  4. sms_stats_data.json question
    By Zincau in forum Multiplayer
    Replies: 0
    Last Post: 07-06-2017, 12:29
  5. Purpose of sms_stats_data File?
    By Alan_Bernardo in forum Multiplayer
    Replies: 3
    Last Post: 13-10-2015, 20:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •