Dedicated server results logs?

Discussion in 'Automobilista 2 - Help & Support' started by yallu, Jan 3, 2022.

  1. yallu

    yallu New Member

    Joined:
    Nov 27, 2016
    Messages:
    2
    Likes Received:
    1
    Hi, where are or how do I configure DS to generate session results log file(s) I can upload to simresults.net?

    File or files should include:

    * practise
    * qualify
    * race
     
  2. Roy Niessink

    Roy Niessink Well-Known Member AMS2 Club Member

    Joined:
    Mar 27, 2020
    Messages:
    1,466
    Likes Received:
    690
    Hi,

    You need to enable the lua api in server.cfg, then add/enable "sms_stats" in there as well.

    Change ""track_events": true" in sms_stat_config. in the luaconfig folder.
    You also need to modify some code in sms_stats.lua, i attached my modified file with this post, rename the extension to .lua then just put that in your lua\sms_stats folder and overwrite.

    once you have run some events, you need to upload the sms_stats_data.json file which is in the lua config folder to simresults.
     

    Attached Files:

  3. yallu

    yallu New Member

    Joined:
    Nov 27, 2016
    Messages:
    2
    Likes Received:
    1
    Thanks, looks like it's working now. The sms_stats.txt was the same (apart from some white space diffs) as the already existing lua file so no update needed there.

    Sample/template config for private league events (in case someone else needs it):

    - 16 players
    - DTM @ Campo Grande
    - 60 min practice
    - 5 min qualification
    - 22 min race
    - no penalties, full damage @ 75%, otherwise realistic settings
    - need ports open: 8766, 27016, 27017

    Once server running, see: http://localhost:9000/api/help

    Flags:

    ALLOW_CUSTOM_VEHICLE_SETUP: 8
    FORCE_REALISTIC_DRIVING_AIDS: 16
    FORCE_MANUAL: 256
    FORCE_SAME_VEHICLE_CLASS: 512
    TIMED_RACE: 1048576
    PASSWORD_PROTECTED: 4194304
    DISABLE_DRIVING_LINE: 536870912

    TOTAL SUM: 542114584

    Code:
    //////////////////////////
    // Basic server options //
    //////////////////////////
    
    logLevel : "info"
    eventsLogSize : 10000
    name : "AMS2 Server"
    secure : true
    password : "xxxxxxxx"
    maxPlayerCount : 16
    bindIP : ""
    steamPort : 8766
    hostPort : 27016
    queryPort : 27017
    sleepWaiting : 50
    sleepActive : 10
    sportsPlay: false
    
    ///////////////////////////
    // HttpApi configuration //
    ///////////////////////////
    
    enableHttpApi : true
    httpApiLogLevel : "warning"
    httpApiInterface : "127.0.0.1"
    httpApiPort : 9000
    httpApiExtraHeaders : {
        "*" : "Access-Control-Allow-Origin: *"
    }
    httpApiAccessLevels : {
    }
    httpApiAccessFilters : {
        "public" : [
            { "type" : "accept" }
        ],
        "private" : [
            { "type" : "ip-accept", "ip" : "127.0.0.1/32" },
            { "type" : "group", "group" : "private" },
            { "type" : "reject-password" }
        ],
        "admin" : [
            { "type" : "ip-accept", "ip" : "127.0.0.1/32" },
            { "type" : "group", "group" : "admin" },
            { "type" : "reject-password" }
        ],
    }
    httpApiUsers : {
        "sysadm" : "xxxxxxxx",
    }
    httpApiGroups : {
        "private" : [ "sysadm" ],
        "admin" : [ "sysadm" ],
    }
    staticWebFiles: "web_files"
    
    //////////////////////////
    // LuaApi configuration //
    //////////////////////////
    
    enableLuaApi : true
    luaAddonRoot: "lua"
    luaConfigRoot: "lua_config"
    luaOutputRoot: "lua_output"
    luaApiAddons : [
        "sms_base",
        "sms_motd",
        "sms_stats",
    ]
    luaAllowedLibraries : [
        "lib_rotate"
    ]
    
    ////////////////////////////////
    // Game setup control options //
    ////////////////////////////////
    
    allowEmptyJoin : true
    controlGameSetup : false
    sessionAttributes : {
        "ServerControlsSetup" : 0,
        "ServerControlsTrack" : 0,
        "ServerControlsVehicleClass" : 0,
        "ServerControlsVehicle" : 0,
        "GridLayout" : 0,
        "GridSize" : 16,
        "MaxPlayers" : 16,
        "OpponentDifficulty" : 90,
        "Flags" : 542114584,
        "Privacy" : 0,
        "DamageType" : 3,
        "DamageScale" : 75,
        "TireWearType" : 6,
        "FuelUsageType" : 0,
        "PenaltiesType" : 0,
        "PitWhiteLinePenalty" : 0,
        "DriveThroughPenalty" : 0,
        "AllowedCutsBeforePenalty" : 5,
        "ManualPitStops" : 1,
        "ManualRollingStarts" : 0,
        "AllowedViews" : 2,
        "TrackId" : 2135405654,
        "VehicleClassId" : -1270088329,
        "VehicleModelId" : 262982797,
        "GameMode" : -1958878043,
        "PracticeLength" : 60,
        "PracticeDateHour" : 12,
        "PracticeDateProgression" : 1,
        "PracticeWeatherProgression" : 1,
        "PracticeWeatherSlots" : 4,
        "PracticeWeatherSlot1" : 296956818,
        "PracticeWeatherSlot2" : 888299130,
        "PracticeWeatherSlot3" : 129238383,
        "PracticeWeatherSlot4" : 296956818,
        "PracticeLiveTrackPreset" : 0,
        "QualifyLength" : 5,
        "QualifyDateHour" : 14,
        "QualifyDateProgression" : 1,
        "QualifyWeatherProgression" : 1,
        "QualifyWeatherSlots" : 1,
        "QualifyWeatherSlot1" : 888299130,
        "QualifyLiveTrackPreset" : 0,
        "RaceLength" : 22,
        "RaceExtraLap" : 0,
        "RaceDateYear" : 2021,
        "RaceDateMonth" : 7,
        "RaceDateDay" : 1,
        "RaceDateHour" : 15,
        "RaceDateProgression" : 1,
        "RaceWeatherProgression" : 1,
        "RaceWeatherSlots" : 4,
        "RaceWeatherSlot1" : 296956818,
        "RaceWeatherSlot2" : 888299130,
        "RaceWeatherSlot3" : 129238383,
        "RaceWeatherSlot4" : 296956818,
        "RaceRollingStart" : 0,
        "RaceMandatoryPitStops" : 0,
        "RaceFormationLap" : 0,
        "RaceLiveTrackPreset" : 0,
        "DisablePitstopRefuelling" : 0,
    }
     
    • Like Like x 1
  4. Florent.Neron

    Florent.Neron New Member

    Joined:
    Feb 18, 2024
    Messages:
    18
    Likes Received:
    3
    Hello Yallu,
    Do you find a solution to exploit the sms_stats_data.json ?
     

Share This Page