1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AMS2 Dedicated Server Tool / SteamCMD Support

Discussion in 'Automobilista 2 - General Discussion' started by Dave Stephenson, May 29, 2020.

  1. Hangon

    Hangon New Member

    Joined:
    Dec 15, 2020
    Messages:
    28
    Likes Received:
    13
    I never did get a dedi server up..but after browsing this thread again and coming across this post I
    was going about things a little diffrent , and now understand what your saying here. I followed your instructions..I do see a list of DS'es but not my own still?? When i do start the server config everything shows that there is no issue..I have my ports open and everything configured right, or i beleive i do, but still don't see my server under the DS'es..what am i doing wrong..missing??? And when you say i will be runnung a fully configured session , I'm assuming I will see it on the web ui and be able to restart sessions/ advance ..etc
     
  2. kmikiwi

    kmikiwi Member

    Joined:
    Jun 19, 2016
    Messages:
    61
    Likes Received:
    25
    hi there!! please Reiza, donno make more cars and tracks for now, please work on multiplayer system and dedicated servers app or user friendly interface, basic things like control sessions, go to next session, restart race, next event... similar to ams commands or something... people get frustrated trying to make a dedicated server works and to be flexible to communities. Thank you for all your work with this amazing sim, but please.
     
    • Agree Agree x 5
    • Like Like x 1
    • Disagree Disagree x 1
  3. Shriukan

    Shriukan Touristenfahrten Community AMS2 Club Member

    Joined:
    Sep 23, 2019
    Messages:
    1,293
    Likes Received:
    931
    Here we go again. Yet another person who thinks everybody at Reiza can do the same work.

    Mate. There’s a few people working on the system and currently Single Playeris where the majority of the work is being done. Once that is done, we should finally see work being done on the MP systems so have some more patience.

    But content will come as the other teams bring it to a releasable state. The money needs to keep coming in. If there is a content drought, they risk not being able to make a return on their licensing investments quickly enough.
     
    Last edited: Apr 25, 2021
    • Like Like x 1
    • Agree Agree x 1
  4. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,418
    Likes Received:
    1,446
    so you think Reiza should fire 10 graphic and 3D artists and hire 5 more coders o_O
     
  5. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    Hello,
    i have a problem with the dedicated server, that i cannot figure out. Some month ago it worked fine, now that i've come back to AMS2 the server just won't show up. When i host from within the game the lobby shows up and can be joined. I checked ports anyway and all is set up correctly, as expected.

    The server log show that the dedicated server registers with steam and gets it steamID. last thing it logs is "switching to running state"

    The dedicated server does not show any error, but on the web-interface status page it says "joinable X" (not jojnable). I can't remember if this is normal behaviour for a server without an active session. I can use the web-interface to configure the next session and it registers correctly. It's only that it never shows up in the server browser.

    Any ideas whre to start troubleshooting? Has anything changed in the code that would make settings in the server.cfg not work anymore.

    Any help appreciated!

    //////////////////////////
    // Basic server options //
    //////////////////////////

    // Logging level of the server. Messages of this severity and more important will be logged. Can be any of debug/info/warning/error.
    logLevel : "info"

    // Number of gameplay events stored on the server. Oldest ones will be discarded once the game logs more.
    eventsLogSize : 10000

    // The server's name, this will appear in server browser (when implemented) and will be also the default name of sessions hosted on the server.
    name : "Sex, Drugs and Clean Racing"

    // Authenticate users with Steam to check VAC ban when set to true.
    secure : true

    // Password required to create sessions on the server as well as to join the sessions, password set in Create options is ignored on DS.
    password : ""

    // Maximum size of sessions that can be created on this server.
    // Note that setting this above 16 will allow sessions unjoinable by 32-bit clients to be created on the server.
    // The game also currently does not support sessions larger than 32, even if the server can be configured for up to 64 players.
    maxPlayerCount : 64

    // IP address where the server's sockets should be bound. Leave empty for 'all interfaces'.
    bindIP : ""

    // ports used to communicate with Steam and game, they must all be accessible on the public IP of the server.
    steamPort : 8766
    hostPort : 27015
    queryPort : 27016

    // Delay between server ticks in milliseconds, when not hosting and when hosting a game, respectively.
    // Lower values will make the server more responsible and decrease latency by a bit at the expense of higher CPU usage.
    sleepWaiting : 50
    sleepActive : 10

    // Sports Play will use system sockets instead of Steam networking API. Recommended for offline LAN-only events.
    sportsPlay: false

    ///////////////////////////
    // Server access control //
    ///////////////////////////

    // Black list
    // Anyone in this list will not be allowed into the server.
    // You can use array or map/object. If the value is an object, the keys are ignored, but you can used the strings as comments with name or reason for being in the list.
    // If the value is an integer, it's interpreted as a Steam ID of the blacklisted user.
    // If it's a string, it's file from which the black list is loaded. The file can contain either an array or an object just like this one, and can reference more files.
    // Here we just load the list from file "blacklist.cfg"
    blackList : [ "blacklist.cfg" ]

    ///////////////////////////
    // HttpApi configuration //
    ///////////////////////////

    // This provides http-based API and basic web-based controls using a built-in http server.
    // HttpApi is disabled by default, and if you enable it with everything else left to default it will listen only locally on 127.0.0.1:9000

    // Master enable/disable toggle.
    enableHttpApi : true

    // Similar to logLevel above but used only for libwebsockets output.
    // Note that all logging still goes through the main filter, so you won't be able to use more verbose logging here than the main level.
    httpApiLogLevel : "warning"

    // Interface name or IP where to bind the local http server providing the API and web-based controls.
    // This is the textual name of the interface as assigned by your OS, or IP address of the interface.
    // The default value is "127.0.0.1", change it to an empty string to bind the listen socket to all available interfaces.
    httpApiInterface : ""

    // Port where the local http server listens.
    httpApiPort : 9000

    // Map with extra HTTP headers to add to HTTP API responses.
    // The keys are the conditions for adding the headers, the values are the headers to add.
    // There are no conditions supported yet, so just use "*" for a generic wildard for now, that will match everything in the future too.
    httpApiExtraHeaders : {
    "*" : "Access-Control-Allow-Origin: *"
    }

    // Http API access level overrides.
    // Each HTTP API endpoint defines its default access level, usually one of "public", "private" or "admin".
    // This map can override these levels to anything else. The keys are wildcard endpoint paths, and the values are the
    // access levels to use. The first path that matches will be used, processing them in the order as written here.
    // The wildcard patterns are case-sensitive and can contain:
    // - '*': matches 0 or more characters
    // - '%': matches 0 or more characters except for forward slash
    // - '?': matches 1 character
    httpApiAccessLevels : {
    // The default is empty, using defaults as defined by the endpoints themselves.

    // But you could for example use this to change all access levels to public (not recommended!)
    // "*" : "public"

    // Or this to hide the status from public
    // "" : "private"
    // "status" : "private"

    // And similar to hide the help and lists from public
    // "api/help" : "private"
    // "api/list*" : "private"

    // As you can see from the example above, the paths should be written with no initial or trailing slashes.
    }

    // Filtering rules for the access levels.
    // The default access levels are "public", "private" and "admin", but the httpAccessLevels above can define any additional levels.
    // This map then tells the server who has access to which level. It's a map from level names to filtering rules.
    //
    // Filtering rules are then specified as a list of structures, processed in the order as written in the config.
    // Each rule structure contains a type" and then type-specific fields. The supported types are:
    // - "accept": Accept this request, no additional checks.
    // - "reject": Reject this request, no additional checks.
    // - "reject-password": Reject this request and let the client know that a password is required, no additional checks.
    // - "ip-accept": Accept this request if it matches the "ip" mask in CIDR notation (for example, "192.168.1.0/24")
    // - "ip-reject": Reject this request if it matches the "ip" mask in CIDR notation (for example, "192.168.1.0/24")
    // - "user": Accept this request if it authenticates as given "user".
    // - "group" : Accept this request if it authenticates as given "group".
    //
    // User/group authentication is done using the standard HTTP basic access authentication (Basic access authentication - Wikipedia).
    httpApiAccessFilters : {

    // Public rules. The default is to accept everything.
    "public" : [
    { "type" : "accept" }
    ],

    // Private rules. The default is to accept queries from localhost, queries authenticated as users in the "private" group
    // and to reject anything else.
    "private" : [
    { "type" : "ip-accept", "ip" : "127.0.0.1/32" },
    { "type" : "group", "group" : "private" },
    { "type" : "reject-password" }
    ],

    // Admin rules. The default is to accept queries from localhost, queries authenticated as users in the "admin" group
    // and to reject anything else.
    "admin" : [
    { "type" : "ip-accept", "ip" : "127.0.0.1/32" },
    { "type" : "group", "group" : "admin" },
    { "type" : "reject-password" }
    ],

    }

    // User list. Map from user names to passwords, in plain text.
    httpApiUsers : {
    "mic" : "123",
    "twist" : "123"
    }

    // User groups. Map from group names to lists of users in said groups.
    httpApiGroups : {
    "private" : [ "mic", "twist" ],
    "admin" : [ "mic", "twist" ],
    }

    // Root directory where the static files for the web tool are located. Relative to current directory.
    staticWebFiles: "web_files"


    //////////////////////////
    // LuaApi configuration //
    //////////////////////////

    // Lua API allows the server to be extended by in-server scripting in Lua.
    // The server is running Lua version 5.3, currently with no sandboxing applied to the add-ons. All standard Lua library functions are available.

    // WARNING: The LuaApi is not final and the following breaking changes are planned soon:
    // - Rename Lua addon metadata files from *.txt to *.json
    // - Remove default config from the metadata and put it into separate file *_default_config.json
    // - Separate config and persistent data, so that data saved by addons will not pollute the config files, and the config files will retain all comments from the default files.

    // Master enable/disable toggle.
    enableLuaApi : true

    // Root directory from which the Lua addons are loaded. Relative to current directory if it's not absolute.
    luaAddonRoot: "lua"

    // Root directory where the addon configs will be stored if written out by addons. Default configs are defined in the addon base text files.
    luaConfigRoot: "lua_config"

    // Root directory where the addon output will be written, once supported. For now the io functions can write anywhere, but this will be limited to this directory in the future.
    luaOutputRoot: "lua_output"

    // Names of all Lua addons to load. The addons will be loaded in the specified order. Each addon can list other addons as its dependencies, which attempt to load those first.
    // The server will load addons from directory specified in "luaAddonRoot", loading of each addon will start by loading its config from ADDON_NAME/ADDON_NAME.txt
    luaApiAddons : [

    // Core server bootup scripts and helper functions. This will be always loaded first even if not specified here because it's an implicit dependency of all addons.
    "sms_base",

    // Automatic race setup rotation.
    // "sms_rotate",

    // Sends greetings messages to joining members, optionally with race setup info, optionally also whenever returning back to lobby post-race.
    "sms_motd",

    // Tracks various stats on the server - server, session and player stats.
    "sms_stats",
    ]

    // Names of all lua libraries that are allowed to be used by any addons.
    luaAllowedLibraries : [

    // "lib_rotate"
    ]


    ////////////////////////////////
    // Game setup control options //
    ////////////////////////////////

    // Set to true to make this server show up in the browser even if it's empty.
    allowEmptyJoin : true

    // Set to true to enable API that allows the server to control the game's setup. The host will not be able to control the setup if this is set.
    // Set to true to enable API that allows the server to control the game's setup. The host will not be able to control the setup if this is set.
    // This must be set to "true" for the following attributes to work: ServerControlsTrack, ServerControlsVehicleClass, ServerControlsVehicle
    controlGameSetup : true

    // Initial attribute values, see /api/list/attributes/session for the full list.
    // These attributes will be used when joining an empty server via the borwser (if allowEmptyJoin is true) and as the intial attributes for the set_attributes and set_next_attributes APIs (if controlGameSetup is true)
    // The defaults set these values:
    sessionAttributes : {
    // The host player can control track selection if set to 0. Set to 1 to disable track selection in the game.
    "ServerControlsTrack" : 1,

    // The host player can change the vehicle class by going through the garage if set to 0. Set to 1 to disallow players changing the class.
    // Flag FORCE_SAME_VEHICLE_CLASS (1024) should be also set for this to make sense, otherwise players are able to choose cars from any class.
    "ServerControlsVehicleClass" : 1,

    // Players can change their vehicle if set to 0. Set to 1 to disallow players changing the vehicle.
    // Flag FORCE_IDENTICAL_VEHICLES (2) should be also set for this to make sense.
    "ServerControlsVehicle" : 1,

    // Grid size up to 32, all reserved to players, so no AI.
    // Note that 32-bit clients will not be able to join the game if this is larger than 16.
    "GridSize" : 24,
    "MaxPlayers" : 24,

    // Just 3 race laps.
    "PracticeLength" : 10,
    "QualifyLength" : 10,
    "RaceLength" : 6,

    // Race flags - bitfield consisting of many flags, the default is set like this:
    // ALLOW_CUSTOM_VEHICLE_SETUP (8) + ABS_ALLOWED (32) + SC_ALLOWED (64) + TCS_ALLOWED (128) + "
    // FORCE_SAME_VEHICLE_CLASS (512) + FILL_SESSION_WITH_AI (131072) + AUTO_START_ENGINE (524288) = 656106"
    // See /api/list/flags/session in HTTP API, or globals "lists.flags.session" or "SessionFlags" in Lua API for the full list.
    "Flags" : -1593310216,

    // AI opponent difficulty, from 0 to 100. Applies only on loading if GridSize is larger than MaxPlayers, and the FILL_SESSION_WITH_AI flag is enabled.
    "OpponentDifficulty" : 50,

    "DamageType" : 3,

    "TireWearType" : 6,

    "FuelUsageType" : 0,

    "PenaltiesType" : 1,

    "AllowedViews" : 0,

    "ManualPitStops" : 1,

    "RaceMandatoryPitStops" : 0,

    "PitWhiteLinePenalty" : 1,

    "AllowedCutsBeforePenalty" : 3,

    "ManualRollingStarts" : 1,

    // Track. See /api/list/tracks/ in HTTP API or globals "lists.tracks", "id_to_track" or "name_to_track" in Lua API.
    "TrackId" : -1478712571,

    // Vehicle class
    "VehicleClassId" : 1553262379,

    // Vehicle
    "VehicleModelId" : 379055283,

    //See /api/list/enums/weather in HTTP API or globals "lists.enums.weather" or "Weather" in Lua API.

    "RaceDateHour" : 13,
    "RaceDateProgression" : 5,
    "RaceWeatherProgression" : 5,

    "RaceWeatherSlots" : 4,
    "RaceWeatherSlot1" : 296956818,
    "RaceWeatherSlot2" : 296956818,
    "RaceWeatherSlot3" : 296956818,
    "RaceWeatherSlot4" : 296956818,

    "PracticeDateHour" : 9,
    "PracticeDateProgression" : 5,
    "PracticeWeatherProgression" 5,

    "PracticeWeatherSlots" : 4,
    "PracticeWeatherSlot1" : 296956818,
    "PracticeWeatherSlot2" : 296956818,
    "PracticeWeatherSlot3" : 296956818,
    "PracticeWeatherSlot4" : 296956818,

    "QualifyDateHour" : 11,
    "QualifyDateProgression" : 5,
    "QualifyWeatherProgression" : 5,

    "QualifyWeatherSlots" : 4,
    "QualifyWeatherSlot1" : 296956818,
    "QualifyWeatherSlot2" : 296956818,
    "QualifyWeatherSlot3" : 296956818,
    "QualifyWeatherSlot4" : 296956818,
    }
     
    Last edited: Apr 27, 2021
  6. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,418
    Likes Received:
    1,446
    is it on the same PC like your game. ?
    If not, is it uptodate? There were several updates
     
    • Useful Useful x 1
  7. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    Yes, i run both the client and server from the same pc (i like the added functionality the dedi brings, despite it's usability flaws). I already integrity checked the dedi files.

    I guess, i'll check if it shows up when i use default configs isntead of my own changes, however i cannot really imagine that this will help: If there was a config error, it should show up in the log, shouldn't it? I have even set the log to "debug" and did not notice anything suspicious.

    "switching to running state" is the default final log int he prompt for a server that just booted up, correct? or would i expect further messages after that?
     
  8. Dann Murillo

    Dann Murillo tinyurl.com/osrdiscord AMS2 Club Member

    Joined:
    Mar 9, 2016
    Messages:
    675
    Likes Received:
    405
    You should get this message after switching to running state:
    "INFO: Saving persistent data for addon 'sms_rotate' into 'lua_config3\sms_rotate_data.json'"

    Send a screenshot of your server window like this. Sometimes there are clues that can help.
    upload_2021-4-27_12-33-39.png
     
    • Useful Useful x 1
  9. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    ok. we might be on to something. i don't have sms_rotate activated. that was intentionally when i set up the server, but i have forgotten why. i guess i just did not want the functionality, since i want to use the web-interface for track changes.

    will test with the addon enabled.

    [2021-04-27 20:02:52] INFO: Starting up the Dedicated Server Library.
    [2021-04-27 20:02:52] INFO: Server configuration loaded:
    - server build date: Mar 31 2021
    - server build version: 1
    - protocol version: 65 (1.0.0.65)
    - server name: Sex, Drugs and Clean Racing
    - max session size: 64
    - details: secure, bind IP INADDR_ANY, Steam port 8766, host port 27015, query port 27016, password protected no
    - whitelist size: 0
    - blacklist size: 1
    - lua api: enabled
    - http api: enabled listening at :9000, 1 extra header(s) defined
    - allow empty join: enabled
    - game setup control: enabled
    - sports play : disabled
    Setting breakpad minidump AppID = 1338040
    [2021-04-27 20:02:52] INFO: HttpApi started
    [2021-04-27 20:02:52] INFO: Loading LuaApi addon 'sms_base'...
    [2021-04-27 20:02:52] INFO: Loading LuaApi addon 'sms_motd'...
    [2021-04-27 20:02:52] INFO: Loading LuaApi addon 'sms_stats'...
    [2021-04-27 20:02:52] INFO: LuaApi started
    [2021-04-27 20:02:52] INFO: Dedicated server is starting...
    [2021-04-27 20:02:53] INFO: Connection to Steam established
    [2021-04-27 20:02:53] INFO: Received public IP XXX
    [2021-04-27 20:02:53] INFO: Server logged in with Steam id XXX ; server is secure
    [2021-04-27 20:02:53] INFO: Server startup finished: AppId 1338040, public IP XXX, Steam id XXX ; switching to running state
     
  10. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    when i activate the rotate plugin, i get the following errors:

    switching to running state
    Verify setup warning: Invalid track id 'Interlagos' used in the setup
    SmsRotate: Setup at index 1 contains errors!
    Verify setup warning: Invalid track id 'Londrina Long' used in the setup
    SmsRotate: Setup at index 2 contains errors!
    SmsRotate: Rotation setups contain errors, rotation addon disabled

    i don't know how to solve these. the server does still not show up. i don't want to deal with the plugins, if i don't have to. can the missing rotate plugin be the cause for the server not showing up? back in decembre, i it worked flawlessly without the rotate plugin enabled. i had my default session settings defined in the server.cfg and would change it from there with the web-interface. is "rotate" now needed for the server to actually work?
    and how can i make the rotate plugin work? i don't understand what's wrong with the session id. i use the default json for rotate.
     
    Last edited: Apr 28, 2021
  11. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    did anyone of you get the dedicated server to show up with the sms_rotate plugin disabled?
     
  12. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    873
    Likes Received:
    1,124
    @twistking yep tested one here with no issue. I've attached the config I used.

    Maybe double check firewall config and ensure exe is properly up to date as protocol version has changed since December.
     

    Attached Files:

    • Agree Agree x 1
    • Useful Useful x 1
  13. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    ok. thanks a lot! i will test again with your config and if it still won't work, i'll reset everything and start from scratch!

    *edit* it didn't...
     
    Last edited: May 5, 2021
  14. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    i finally solved the problem by opening my UDP port-range to 27000-27016, while before i had 27015-27016 only. TCP is still only 27015-27016.
    8766 is unchanged for both TCP and UDP.

    i made the changes in accordance to this info:
    Required Ports for Steam - Steam Support

    it did work before with the "tighter" port settings (and did so for years on project cars 2...), so there must have been changes with steam, i guess.
     
    Last edited: May 4, 2021
    • Like Like x 1
  15. BrassYeti

    BrassYeti New Member

    Joined:
    Mar 26, 2020
    Messages:
    23
    Likes Received:
    4
    is there a setting for random grid order for the second race?
     
  16. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    it's me again with another question unfortunately.

    since i redownloaded the server files i lost my edit to circumvent the "flag bug" where the web-interface (i presume) would override flag values that can not be set in the gui. this results is the "race_ready_input" flag getting deleted on server start. again, i don't use the sms plugins. i set all flags in the server.cfg (-1593310216 in my case) but wait for race ready is not active when the server starts. there was a work-around, where you would modify a file somewhere, but i cannot remember what and where. i had it working before i redownloaded the server files. any hints?
     
  17. twistking

    twistking Member

    Joined:
    Apr 27, 2021
    Messages:
    68
    Likes Received:
    17
    nevermind. found the solution. see below
     
  18. Lab Pong

    Lab Pong OG Sim'er

    Joined:
    May 6, 2021
    Messages:
    133
    Likes Received:
    26
    Thanks for the info here and the help of a couple good friends.....I got my server working.

    ButI have a small problem, the luai in my cfg file is not totally overriding the race lap lengths and something is odd with the shown car class in the server control panel. (it shows the stock car).

    I am basically just running a handful of tracks with only GT3 class cars. In my server control panel, it always shows a diff class of cars (not sure if that is what is in the cfg file or what?)

    Here are a few pics of my control panel and the areas of the cfg relevant to them. I would appreciate any help with sorting out my cfg file if needed.
     

    Attached Files:

  19. Lab Pong

    Lab Pong OG Sim'er

    Joined:
    May 6, 2021
    Messages:
    133
    Likes Received:
    26
    I got a few things sorted out, but also I can not figure out how to set the Pit Lane to be manual driving out? Is this in the lua rotate file?
     
  20. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    873
    Likes Received:
    1,124
    I don't have handy access to an install atm but it's part of the flags line iirc

    edit. Sorry that's wrong can add the following in lua config
    Code:
    "ManualPitStops" : 1,
    Full list can be accessed at http://localhost:9000/api/list/attributes in the session section
     
    Last edited: May 13, 2021
    • Like Like x 1

Share This Page