Results 1 to 4 of 4

Thread: Dedicated Server HTTP API

  1. #1
    WMD Member
    Join Date
    Apr 2012
    Location
    Fuerth, Germany
    Posts
    116
    Platform
    PC

    Dedicated Server HTTP API

    A new thread for all about the Dedicated Server HTTP API.
    AMD Phenom II X6 1090T | MSI GTX970 Gaming 4G | Asus M4A89TD Pro USB3 | 16GB DDR3 | Windows 7 64 Bit | Fanatec CSW V2 + Porsche 918 RSR Rim + Formula Carbon Rim + CSP V2 + CSS SQ V1.5 | TrackIR 4 | 27" 1080p

  2. #2
    WMD Member
    Join Date
    Apr 2012
    Location
    Fuerth, Germany
    Posts
    116
    Platform
    PC
    I don't know if it is known, but there is a problem in the participant data if I poll /api/session/status?participants
    Some values are not filled anymore, for example VehicleId, LiveryId. I know that it was working after release, maybe the problem came with one of the patches.


    Here is an example how it looks now (first participant is me and the second an AI driver):

    Code:
    "participants" : [
          {
            "attributes" : {
              "RefId" : 18880,
              "Name" : "M. -VIPER- Morgan",
              "IsPlayer" : 1,
              "GridPosition" : 0,
              "VehicleId" : 0,
              "LiveryId" : 0,
              "RacePosition" : 21,
              "CurrentLap" : 0,
              "CurrentSector" : 0,
              "Sector1Time" : 0,
              "Sector2Time" : 0,
              "Sector3Time" : 0,
              "LastLapTime" : 0,
              "FastestLapTime" : 0,
              "State" : "InGarage",
              "HeadlightsOn" : 0,
              "WipersLevel" : 0,
              "Speed" : 0,
              "Gear" : 0,
              "RPM" : 1511,
              "PositionX" : 310350,
              "PositionY" : -890,
              "PositionZ" : -278000,
              "Orientation" : 345
            },
            "id" : 0
          },
          {
            "attributes" : {
              "RefId" : 18880,
              "Name" : "Pilaud Fabien",
              "IsPlayer" : 0,
              "GridPosition" : 0,
              "VehicleId" : 0,
              "LiveryId" : 0,
              "RacePosition" : 20,
              "CurrentLap" : 0,
              "CurrentSector" : 0,
              "Sector1Time" : 0,
              "Sector2Time" : 0,
              "Sector3Time" : 0,
              "LastLapTime" : 0,
              "FastestLapTime" : 0,
              "State" : "Racing",
              "HeadlightsOn" : 0,
              "WipersLevel" : 0,
              "Speed" : 128,
              "Gear" : 4,
              "RPM" : 4584,
              "PositionX" : -210580,
              "PositionY" : 31190,
              "PositionZ" : 172910,
              "Orientation" : 79
            },
            "id" : 1
          },
          ...


    And here an example how it was in the past (first participant is me and the second an AI driver, example from pcars1):

    Code:
    "participants" : [
          {
            "attributes" : {
              "RefId" : 20992,
              "Name" : "M. -VIPER- Morgan",
              "IsPlayer" : 1,
              "GridPosition" : 1,
              "VehicleId" : -1166911988,
              "LiveryId" : 51,
              "RacePosition" : 15,
              "CurrentLap" : 0,
              "CurrentSector" : 0,
              "Sector1Time" : 0,
              "Sector2Time" : 0,
              "Sector3Time" : 0,
              "LastLapTime" : 0,
              "FastestLapTime" : 0,
              "State" : "InGarage",
              "HeadlightsOn" : 0,
              "WipersOn" : 0,
              "Speed" : 0,
              "Gear" : 0,
              "RPM" : 0,
              "PositionX" : -101230,
              "PositionY" : 223000,
              "PositionZ" : 445100,
              "Orientation" : 37
            },
            "id" : 0
          },
          {
            "attributes" : {
              "RefId" : 20992,
              "Name" : "Eduardo S. Parreiras",
              "IsPlayer" : 0,
              "GridPosition" : 2,
              "VehicleId" : 1884411907,
              "LiveryId" : 54,
              "RacePosition" : 14,
              "CurrentLap" : 1,
              "CurrentSector" : 1,
              "Sector1Time" : 29775,
              "Sector2Time" : 12718,
              "Sector3Time" : 0,
              "LastLapTime" : 0,
              "FastestLapTime" : 0,
              "State" : "Racing",
              "HeadlightsOn" : 0,
              "WipersOn" : 0,
              "Speed" : 185,
              "Gear" : 4,
              "RPM" : 7627,
              "PositionX" : 126110,
              "PositionY" : 234080,
              "PositionZ" : -477830,
              "Orientation" : 265
            },
            "id" : 1
    	   },
    	   ...
    AMD Phenom II X6 1090T | MSI GTX970 Gaming 4G | Asus M4A89TD Pro USB3 | 16GB DDR3 | Windows 7 64 Bit | Fanatec CSW V2 + Porsche 918 RSR Rim + Formula Carbon Rim + CSP V2 + CSS SQ V1.5 | TrackIR 4 | 27" 1080p

  3. #3
    Kart Driver
    Join Date
    Nov 2016
    Posts
    8
    Platform
    PC
    Thanks! We will take a look!

  4. #4
    WMD Member Dmitry Afanasyev's Avatar
    Join Date
    Oct 2011
    Location
    Russia, Sayansk
    Posts
    88
    Few more questions about HTTP API. At some point (probably since PC1 DS) there were plans to make some player/participant/session parameters changable. According to /api/help we should be able to change session_NAME, player_NAME and participant_NAME, but this attributes currently ReadOnly. Can they be changed to ReadWrite? Maybe through LUA also?
    Code:
    {
            "name" : "api/session/set_attributes",
            "description" : "Request change of attributes from the game",
            "access" : "admin",
            "responsetype" : "json",
            "parameters" : [
               ...
              {
                "name" : "refid",
                "type" : "int",
                "optional" : true,
                "description" : "RefId of player to change. Used only when player attributes are included. Note that you need to run multiple calls to modify multiple players"
              },
               ...
              {
                "name" : "session_NAME",
                "type" : "string",
                "optional" : true,
                "description" : "Session attribute to set. See /api/list/attributes/session for the list of all valid attribute names and types. Only writable attributes can be set"
              },
              {
                "name" : "player_NAME",
                "type" : "string",
                "optional" : true,
                "description" : "Player attribute to set. Remember to also set 'refid'. See /api/list/attributes/player for the list of all valid attribute names and types. Only writable attributes can be set"
              },
              {
                "name" : "participant_NAME",
                "type" : "string",
                "optional" : true,
                "description" : "Participant attribute to set. Remember to also set 'participantid'. See /api/list/attributes/participant for the list of all valid attribute names and types. Only writable attributes can be set"
              }
            ],
            "response" : []
          }
    Another question is about some other participant attributes. Currently we can change session attributes such as GridSize, MaxPlayers, Flags and many other writable ones which will be applyed to either current or next session. But what if we will force to change some participant attributes (currently ReadOnly) such as GridPosition, VehicleId, LiveryId? Should it actually change current start position, car and it's livery for chosen player? So this will allow us to make custom grids.

    Thanks in advance
    Last edited by Dmitry Afanasyev; 13-01-2018 at 11:48.
    MB: ASUS Z87-Pro CPU: Intel Core i7-4770 GPU: MSI GeForce GTX1070 RAM: Hynix 12Gb DDR3-1333 OS: Windows 10 Pro x64 Wheel: Thrustmaster TX + 599XX EVO 30 + TH8A + T3PA Pro
    WMDCars.RU --- D.man --- Steam ID
    The following user likes this Post: satco1066


Similar Threads

  1. Replies: 3
    Last Post: 28-10-2017, 11:29
  2. Dedicated Server Crashes (HTTP API)
    By kevin.m in forum Multiplayer
    Replies: 14
    Last Post: 25-10-2017, 15:06
  3. Replies: 21
    Last Post: 03-10-2017, 19:42
  4. Replies: 8
    Last Post: 25-04-2017, 23:52
  5. Dedicated Server - HTTP API Request
    By Ph0eNiX in forum PC - Technical Help & Support
    Replies: 3
    Last Post: 08-05-2015, 11: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
  •