1. Do you need support for Assetto Corsa Competizione? Please use the proper forum below and ALWAYS zip and attach the WHOLE "Logs" folder in your c:\users\*youruser*\AppData\Local\AC2\Saved. The "AppData" folder is hidden by default, check "Hidden items" in your Windows view properties. If you report a crash, ALWAYS zip and attach the WHOLE "Crashes" folder in the same directory. Do not post "I have the same issue" in an existing thread with a game crash, always open your own thread. Do not PM developers and staff members for personal troubleshooting and support.
  2. As part of our continuous maintenance and improvements to Assetto Corsa Competizione we will be releasing small updates on a regular basis during the esports season which might not go through the usual announcement process detailing the changes until a later version update where these changes will be listed retrospectively.
  3. If ACC doesn't start with an error or the executable is missing, please add your entire Steam directory to the exceptions in your antivirus software, run a Steam integrity check or reinstall the game altogether. Make sure you add the User/Documents/Assetto Corsa Competizione folder to your antivirus/Defender exceptions and exclude it from any file sharing app (GDrive, OneDrive or Dropbox)! The Corsair iCue software is also known to conflict with Input Device initialization, if the game does not start up and you have such devices, please try disabling the iCue software and try again. [file:unknown] [line: 95] secure crt: invalid error is a sign of antivirus interference, while [Pak chunk signing mismatch on chunk] indicates a corrupted installation that requires game file verification.
  4. When reporting an issue with saved games, please always zip and attach your entire User/Documents/Assetto Corsa Competizione/Savegame folder, along with the logs and the crash folder (when reporting related to a crash).

About that maybe-server-api

Discussion in 'Chit Chat Room' started by Minolin, Jun 11, 2015.

  1. f_deutsch

    f_deutsch Hardcore Simmer

    Leaderboard info from the ACSP_LAP_COMPLETED provides the number of laps, so if a user enters race and reuse an already used disconnected car, does it get the laps reset ?

    I was thinking in an approach of identify the first car that completes all laps on ACSP_LAP_COMPLETED and register it on a collection and then process any other car that completes all laps on ACSP_LAP_COMPLETED. Problem here are the cars being already lapped, so would have to keep a "picture" of the LEADERBOARD for future processing once the sessions ends.

    Problem as you mention also, it would be handy to have the timestamp of the ACSP_LAP_COMPLETED as we cannot sure if the UDP packages comes in the correct time sequence.

    All of these reminds me the issues I had when implemented ferito-LiveCarTracker. Fun and frustrating at the same time.
     
  2. f_deutsch

    f_deutsch Hardcore Simmer

    Collisions events are identified by AC client and sent to the server. I can imagine situations where the server gets the collisions from both parties and reports it on that way. We may have to include a server timestamp or time tick (something that would be share among all clients for sync purposes, which I think it already must exists) included on the collision event. We then on the plugin could have a time threshold to identify if it was the same collision or a different one based on that tick value.
     
  3. JackCY

    JackCY Racer

    Where are the API specifications and samples?
    I don't mean the user stuff I mean the official stuff from Kunos.
    Seems like this user thread is all there is? How did you get the API specs and start your work? Got some insider info from Kunos?

    "acRemoteServerUDP_Example"
    Is all I can find as example but no API specs anywhere.
     
  4. Minolin

    Minolin Staff Member KS Dev Team

    No insiders. Just this thread, and a early sample from Stefano I posted somewhere here.
    The current sample you can find here: \Steam\SteamApps\common\assettocorsa\sdk\dev\acRemoteServerUDP_Example

    This is where we exctracted the API specs and built a python & .net framwork of. You won't find much more info outside this thread. Yeah, getting-started documentation is on my list.
     
    Andrea Lojelo and jasjeet like this.
  5. JackCY

    JackCY Racer

    So in other words there is just that one sample and that's it.
    No API specs :(

    Way to go Kunos...

    Good job for all you guys on reversing it from the sample.
     
    jasjeet likes this.
  6. Minolin

    Minolin Staff Member KS Dev Team

    No need to complain. Kunos does what they are good in, and left us space to enhance it (including documentation). The sample was *very* exact and helpful. We didn't need to talk at all, and basically - at least the .net framework - worked spot on as soon as we had 1.2 servers. Every mistake was made on my side (fake server communication, message parsing).

    Apart from that you wouldn't want to talk raw upd for each plugin, so we started building communication layers (py+.net currently) where you can work in much more comfortable. Kunos can't document this part at all.
    If you have questions getting started, just tell us.
     
  7. JackCY

    JackCY Racer

    Yeah what is available in the API, what can one control, what cannot be controlled. What data does it expose, what commands does it support.
     
  8. Minolin

    Minolin Staff Member KS Dev Team

    If you have a look at the front post, the requests will tell the one story. The overview regarding the packages and what they contain is in the bottom, first link below "Misc stuff".
     
  9. JackCY

    JackCY Racer

    Thanks.

    I like the descriptions in brackets, maybe, probably, hopefully :D Accurate descriptions.
    That's why we need Kunos to release a specific offical API documentation.
     
  10. f_deutsch

    f_deutsch Hardcore Simmer

    Hi all,

    I have a functional server plugin that generates a json file for each session, file name format is:

    ferito-plugin-2015-08-03-16-22-54-Qualify.json
    ferito-plugin-2015-08-03-16-28-12-Race.json

    Optionally, the plugin can send the resulting JSON to an URL in POST format, where it can be processed as liked.

    These are the json formats I am generating.

    Code:
    {
       "type" : "Qualify",
       "numberOfLaps" : 0,
       "timestamp" : "2015-08-03-16-22-54",
       "time" : 4,
       "waitTime" : 0,
       "weatherGraphics" : "3_clear",
       "ambientTemp" : 20,
       "roadTemp" : 28,
       "trackName" : "silverstone-national",
       "trackConfig" : "",
       "laps" : [
         {
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "time" : 75761,
           "cuts" : 2,
           "number" : 0,
           "gripLevel" : 0.919737,
           "carPosition" : 1
         },
         {
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "time" : 63803,
           "cuts" : 0,
           "number" : 1,
           "gripLevel" : 0.929737,
           "carPosition" : 1
         },
         {
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "time" : 65129,
           "cuts" : 0,
           "number" : 2,
           "gripLevel" : 0.939736962,
           "carPosition" : 1
         }
       ],
       "contactEvents" : [
         {
           "type" : "Environment",
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "contactCarId" : 255,
           "speed" : 16.8048229
         }
       ],
       "results" : [
         {
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "laps" : 2,
           "position" : 1
         }
       ]
    }
    

    Code:
    {
       "type" : "Race",
       "numberOfLaps" : 2,
       "timestamp" : "2015-08-03-16-28-12",
       "time" : 0,
       "waitTime" : 60000,
       "weatherGraphics" : "3_clear",
       "ambientTemp" : 19,
       "roadTemp" : 25,
       "trackName" : "silverstone-national",
       "trackConfig" : "",
       "laps" : [
         {
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "time" : 70577,
           "cuts" : 0,
           "number" : 1,
           "gripLevel" : 0.9307507,
           "carPosition" : 1
         },
         {
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "time" : 67681,
           "cuts" : 0,
           "number" : 2,
           "gripLevel" : 0.9407507,
           "carPosition" : 1
         }
       ],
       "contactEvents" : [
         {
           "type" : "Environment",
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "contactCarId" : 255,
           "speed" : 15.7507687
         }
       ],
       "results" : [
         {
           "carId" : 0,
           "driverGUID" : "76561197991799861",
           "driverName" : "Fernando Deutsch",
           "laps" : 2,
           "position" : 1
         }
       ]
    }
    

    Its very hard to test the plugin with only one user. I may require some help of anyone that host a server. The plugin can generate a log file to debug certain situations. I think I figured out how to resolve the final results, even if people disconnect once they finish the race and even if people get in during the transition from end race to practice or qual.

    There is some information that would be nice to have included, on both acServer generated JSON and server plugin, that we could discuss later. I do not know the flexibility and time resources like @Lord Kunos could provide to us on this.

    If you are interested in test the server plugin, please let me know. As a note, if the plugin crashes, it will not affect the server functionality at all, and the CPU ocuppancy is close to none.
     
    Thomas Gocke and Minolin like this.
  11. Thomas Gocke

    Thomas Gocke Alien

    I did some work on my plugin too, should be ready for a first release tomorrow.
    The plugin will be easily extendable to handle the generated report in whatever way necessary, and like f_deutsch did, sending it in json format to a webservice of course will be the obvious solution.
    Apart from getting a correct result including all drivers (not only the last connected ones), I really want to report incidents, and together with the driven distance we should be able to create some sort of safety rating.
    As usual, latest code is on https://github.com/flitzi/AC_SERVER_APPS
     
    TDS, f_deutsch and jasjeet like this.
  12. f_deutsch

    f_deutsch Hardcore Simmer

  13. Jaye

    Jaye Alien

    So we got two plugins, both generates different extended versions of the AC JSON results with an upload posibility? Both not using Minolins central server plugin what we need to be able to run more than one plugin? Correct me if I'm wrong pls ^^

    @f_deutsch Normally I would say I can put it on my my servers to help you out with data (there were 150 sessions since Sunday evening) but you also forget us poor linux users :oops:
     
  14. Minolin

    Minolin Staff Member KS Dev Team

    My plugin infrastructure isn't central, standalone as neys python framework (which I think fertio uses). In fact the python API can redirect the traffic to another one, something currently missing in .Net.

    Edit: I'm wrong, fertio uses .Net, but with a direct UDP interface
     
  15. f_deutsch

    f_deutsch Hardcore Simmer

    I can port what I have done in C# into Python, I just would need a Python base code that implements the direct UDP interface.
    Also, I new .NET core is available for Linux, but I am not sure all Linux hostings would include this new software layer.
     
  16. Jaye

    Jaye Alien

    Both solutions would be possible for me, but I'm not so deep into that Mono/.NET topic. Would prefer Mono from the debian repository, because it's less work ^^ As long as it doesn't interfere with speedwise it would be no problem to let it run and collect some of the needed data for you.
     
  17. Thomas Gocke

    Thomas Gocke Alien

    I've uploaded my server tool here:
    https://www.assettocorsa.net/forum/index.php?threads/ac_trackcycle.20242/


    Yes, I'm using Minolin's base plugin, which was a good start, thanks again!

    With the app it is possible to specify a custom report handler, you would just need to implement the simple interface
    Code:
    public interface ISessionReportHandler
    {
        void HandleReport(SessionReport report);
    }
    and specify the containing library in the SessionReportHandler key of the app.config (separated with ; multiple concurrent handlers are possible), which will then be loaded via dependency injection, and you will we provided with a complete and hopefully better session report (serializable object) after every session and you can do with it whatever you need. I'm currently logging almost everything, even driven distances (currently not the real time positions, but if someone wants to store them, I can easily add them to the report).

    On the backend side I've already created a database model, including EF6 entities and the sql create script. The DBFiller is currently not in the release version, but if you clone the repo and build the app it is included and will fill a MSSQL db.
     
    Last edited: Aug 5, 2015
    f_deutsch likes this.
  18. f_deutsch

    f_deutsch Hardcore Simmer

    I have updated my plugin. https://www.assettocorsa.net/forum/index.php?threads/ac_trackcycle.20242/

    Included more data to the resulting JSON. At the moment I do not know if I would change the JSON structure in some way. Root object has a 'laps' collection of Lap objects containing all laps of all drivers. Also there is a 'results' containing Result objects with information about the result of each driver. On this new version I added a 'drivers' collection with a Driver object, which contains the resulting information as well as extra information from the acServer generated JSON. Also each driver has its own 'laps' list containing only Lap objects done by that driver. I think this 'drivers' list structure is more structured and will get rid of the Root 'laps' and 'results' list, but I am still not 100% sure.
     
  19. bigbawmcgraw

    bigbawmcgraw Alien

    The biggest problem I can see (from a stupid end user admin POV) is that there are lots of cool plugins but we can only run one at a time on each server.
    Is there something I'm missing or is it something you guys are working on?
     
  20. Minolin

    Minolin Staff Member KS Dev Team

    I think the quick way we'll see is a port (haha) of neys approach, so every plugin can redirect the messages to another one, and so on.
    Will allow us to create the first wall of plugins, and after that we might get a redirector to clean up the mess ^^
     
    bigbawmcgraw likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice