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. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,267
    Likes Received:
    1,352
    i'm not sure, but it could be that Rudolf meant an allways running server, like an AC trackday server.
    Though its empty, the time is running. A AMS2 server is just starting a session when 1st joins and ends when time is over or the last participant leaves.
    Also you never can compare the lap times other participants did while the whole session. Lap times are deleted as soon as the participant leaves. On a trackday server the lap times should only be deleted when the session is over.
    I know , for that we would need a real server, not a service relais like the pCARS/AMS2 server.
    But i have confidence ;)
     
  2. Shriukan

    Shriukan Touristenfahrten Community AMS2 Club Member

    Joined:
    Sep 23, 2019
    Messages:
    1,293
    Likes Received:
    931
    I totally agree. I wish the DS wasn't just a simple rebroadcaster for the host. Right now the only way to keep a server up and keep times on a trackday server is to have a driver constantly connected to it and add a lua addon to the server to add times to a database and link it on a
    website. (Example: Touristenfahrten#2 in pCars2 - Touristenfahrten #2 )

    But one thing at a time. :)
     
  3. moneypizzle

    moneypizzle Member

    Joined:
    Jun 9, 2020
    Messages:
    33
    Likes Received:
    27
    I really don't think this statement is correct. I also tried setting it to 120 via sms_rotate_config as Goffik proposed but I seem to get the same results aka 2:04's @ Nurburgring Veedol 2020 with the GT3s by the AI. While they do low 1:57s if you create a lobby. Which is arguably still too slow btw

    Damn, it's weird not sure what I changed but now it does seem to work. So nevermind the above :confused: I did enable the Lua but server says sms_rotate_config was configured wrong. Anyway, it's working now hehe :cool:
     
    Last edited: Nov 4, 2020
  4. Automobilista 2 Italia

    Automobilista 2 Italia New Member

    Joined:
    Oct 12, 2020
    Messages:
    9
    Likes Received:
    0
    Hi guys, someone know the id of gt3 class for the dedicated server? Thanks
     
  5. Goffik

    Goffik Well-Known Member

    Joined:
    Apr 5, 2020
    Messages:
    472
    Likes Received:
    308
    • Like Like x 1
  6. Automobilista 2 Italia

    Automobilista 2 Italia New Member

    Joined:
    Oct 12, 2020
    Messages:
    9
    Likes Received:
    0
  7. Goffik

    Goffik Well-Known Member

    Joined:
    Apr 5, 2020
    Messages:
    472
    Likes Received:
    308
    Yes there is. If you can't see it then it's because your DS is not updated to the latest version.

    "value" : -112887377,
    "name" : "GT3"
     
  8. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,267
    Likes Received:
    1,352
    and as long you don't update your DS, the values above will not work :p
     
    • Agree Agree x 1
  9. Daniel R.

    Daniel R. New Member AMS2 Club Member

    Joined:
    Mar 21, 2017
    Messages:
    11
    Likes Received:
    5
    Hello Guys,
    i´m currently preparing a excel document that enables you to create the complete server.cfg file based on inputs in the excel.
    When i start the server i get the following output, it seems to stuck at the point where it wants to write into the sms_stats_data file.

    Output in conole:
    [2020-11-12 09:33:35] INFO: Starting up the Dedicated Server Library.
    [2020-11-12 09:33:35] INFO: Server configuration loaded:
    - server build version: 1
    - protocol version: 64 (1.0.0.64)
    - server name: 1-dudes-go-wild
    - max session size: 16
    - details: secure, bind IP INADDR_ANY, Steam port 8766, host port 27015, query port 27016, password protected yes
    - whitelist size: 0
    - blacklist size: 0
    - lua api: enabled
    - http api: enabled listening at 127.0.0.1:9000, 1 extra header(s) defined
    - allow empty join: enabled
    - game setup control: enabled
    - sports play : enabled
    [2020-11-12 09:33:35] INFO: HttpApi started
    [2020-11-12 09:33:35] INFO: Loading LuaApi addon 'sms_base'...
    [2020-11-12 09:33:35] INFO: Addon 'sms_base' does not have customized config available. Copying default config over to 'lua_config\sms_base_config.json', check it out to customize the addon if needed.
    [2020-11-12 09:33:35] INFO: Loading LuaApi addon 'sms_motd'...
    [2020-11-12 09:33:35] INFO: Addon 'sms_motd' does not have customized config available. Copying default config over to 'lua_config\sms_motd_config.json', check it out to customize the addon if needed.
    [2020-11-12 09:33:35] INFO: Loading LuaApi addon 'sms_stats'...
    [2020-11-12 09:33:35] INFO: Addon 'sms_stats' does not have customized config available. Copying default config over to 'lua_config\sms_stats_config.json', check it out to customize the addon if needed.
    [2020-11-12 09:33:35] INFO: LuaApi started
    [2020-11-12 09:33:35] INFO: Dedicated server is starting...

    [2020-11-12 09:33:35] INFO: Saving persistent data for addon 'sms_stats' into 'lua_config\sms_stats_data.json'

    What could be the reason for it getting stuck?
    Cheers Dan
     
  10. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,267
    Likes Received:
    1,352
    as long as you don't post the "input", nobody can debug your "output".
    so, w/o your sever.cfg it's ridicoulos to try to assume anything
     
  11. Daniel R.

    Daniel R. New Member AMS2 Club Member

    Joined:
    Mar 21, 2017
    Messages:
    11
    Likes Received:
    5
    Hi,
    ok, this is what´s in my server.cfg:


    //////////////////////////
    // 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 : " 1-dudes-go-wild "

    // 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 : " dudes "

    // 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 : 16 16

    // 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.
    // Use cmdline switch -sportsplay serverIp:hostPort on client to host and join games on sportsPlay server.
    sportsPlay: true

    // (blacklist and whitelist is intentionally not included in this basic sample config as they can complicate things a bit.)


    ///////////////////////////
    // 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 : "127.0.0.1"

    // 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 : {
    //"dave" : "letmein",
    //"renato" : "letmeintoo"
    " steveO " : " dirty " ,

    }

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

    // 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 A
    // 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" : 16,
    "MaxPlayers" : 16,

    // 10m/10m/10l.
    "PracticeLength" : 200,
    "QualifyLength" : 15,
    "RaceLength" : 15,

    // 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" : 2839544602

    // 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" : 95,

    // Visual only damage
    "DamageType" : 1,

    // enable manual pitstops
    "ManualPitStops" : 1,

    // No tire wear.
    "TireWearType" : 6,

    // Fuel usage off.
    "FuelUsageType" : 0,

    // Penalties on.
    "PenaltiesType" : 1,

    // Any camera view allowed.
    "AllowedViews" : 0,

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

    // Vehicle class Super V8. See /api/list/vehicle_classes/ in HTTP API or globals "lists.vehicle_classes", "id_to_vehicle_class" or "name_to_vehicle_class" in Lua API.
    "VehicleClassId" : -1270088329,

    // Vehicle Super V8 (but not forced by default flags). See /api/list/vehicles/ in HTTP API or globals "lists.vehicles", "id_to_vehicle" or "name_to_vehicle" in Lua API.
    "VehicleModelId" : -934098507,

    // Starting date and time.
    "RaceDateHour" : 16,
    "PracticeDateHour" : 10,
    "QualifyDateHour" : 20,

    // Single weather slot set to "Weather_Clear1". See /api/list/enums/weather in HTTP API or globals "lists.enums.weather" or "Weather" in Lua API.
    "PracticeWeatherSlots" : 4,
    "PracticeWeatherSlot1" : -1592958063,
    "PracticeWeatherSlot2" : 270338437,
    "PracticeWeatherSlot3" : -2112363295,
    "PracticeWeatherSlot4" : 129238383,

    // Single weather slot set to "Weather_Clear1". See /api/list/enums/weather in HTTP API or globals "lists.enums.weather" or "Weather" in Lua API.
    "QualifyWeatherSlots" : 4,
    "QualifyWeatherSlot1" : 1461703858,
    "QualifyWeatherSlot2" : 1461703858,
    "QualifyWeatherSlot3" : -1299791789,
    "QualifyWeatherSlot4" : 2067843977,


    // Single weather slot set to "Weather_Clear1". See /api/list/enums/weather in HTTP API or globals "lists.enums.weather" or "Weather" in Lua API.
    "RaceWeatherSlots" : 4,
    "RaceWeatherSlot1" : -1293634875,
    "RaceWeatherSlot2" : 270338437,
    "RaceWeatherSlot3" : 2067843977,
    "RaceWeatherSlot4" : -2112363295,
    }



    Thanks in advance!
    Cheers Dan
     
  12. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    857
    Likes Received:
    1,063
    Doesn't look stuck to me, that's the normal point the launch output would stop for a properly configured server using rotate. Join the server or leave it idle for a while and you should see more output.
     
  13. Tomi Mäkinen

    Tomi Mäkinen New Member AMS2 Club Member

    Joined:
    Feb 29, 2020
    Messages:
    9
    Likes Received:
    1
    Is there any plugin or other way to change driver positions in grid ? What are the commands and ways to communicate data to the server ?
    Wanting to run reverse grid races without using a lap to switch positions.
     
    • Like Like x 1
  14. Daniel R.

    Daniel R. New Member AMS2 Club Member

    Joined:
    Mar 21, 2017
    Messages:
    11
    Likes Received:
    5
    I waited for quite a while, but the server is not starting.
    I can also not reach it via localhost:9000 adress in a webbrowser.

    The console output is stuck at the position i mentioned.
    It does not proceed.

    I tried another server.cfg i created without my tool and it´s starting up fine.
    This is what it looks like in concole::

    [2020-11-12 11:34:04] INFO: Starting up the Dedicated Server Library.
    [2020-11-12 11:34:04] INFO: Server configuration loaded:
    - server build version: 1
    - protocol version: 64 (1.0.0.64)
    - server name: 1-dudes-go-wild
    - max session size: 16
    - details: secure, bind IP INADDR_ANY, Steam port 8766, host port 27015, query port 27016, password protected yes
    - whitelist size: 0
    - blacklist size: 0
    - lua api: enabled
    - http api: enabled listening at 127.0.0.1:9000, 1 extra header(s) defined
    - allow empty join: enabled
    - game setup control: enabled
    - sports play : disabled
    Setting breakpad minidump AppID = 1066890
    [2020-11-12 11:34:04] INFO: HttpApi started
    [2020-11-12 11:34:04] INFO: Loading LuaApi addon 'sms_base'...
    [2020-11-12 11:34:04] INFO: Loading LuaApi addon 'sms_motd'...
    [2020-11-12 11:34:04] INFO: Loading LuaApi addon 'sms_stats'...
    [2020-11-12 11:34:04] INFO: LuaApi started
    [2020-11-12 11:34:04] INFO: Dedicated server is starting...
    [2020-11-12 11:34:04] INFO: Saving persistent data for addon 'sms_stats' into 'lua_config\sms_stats_data.json'
    [2020-11-12 11:34:05] INFO: Connection to Steam established
    [2020-11-12 11:34:05] INFO: Received public IP 91.19.127.142
    [2020-11-12 11:34:05] INFO: Server logged in with Steam id 90140211893790720 ; server is secure
    [2020-11-12 11:34:05] INFO: Server startup finished: AppId 1066890, public IP 91.19.127.142, Steam id 90140211893790720 ; switching to running state


    this is the server.cfg that works:

    "//" : "You can use dummy entries like this to write comments into the config. 'rem' and '#' are also supported as comment entries."
    // But in recent version of the server, standard C++ like one-liner comments are supported as well.

    //////////////////////////
    // 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 : "1-dudes-go-wild"

    // 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 : "dudes"

    // 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 : 16

    // 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.
    // Use cmdline switch -sportsplay serverIp:hostPort on client to host and join games on sportsPlay server.
    sportsPlay: false

    // (blacklist and whitelist is intentionally not included in this basic sample config as they can complicate things a bit.)


    ///////////////////////////
    // 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 : "127.0.0.1"

    // 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 : {
    //"dave" : "letmein",
    //"renato" : "letmeintoo"
    "daniel" : "letmein",

    }

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

    // 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" : 16,
    "MaxPlayers" : 16,

    // 10m/10m/10l.
    "PracticeLength" : 120,
    "QualifyLength" : 15,
    "RaceLength" : 15,

    // 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" : 2839544602,

    // 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" : 100,

    // Visual only damage
    "DamageType" : 1,

    // enable manual pitstops
    "ManualPitStops" : 1,

    // No tire wear.
    "TireWearType" : 6,

    // Fuel usage off.
    "FuelUsageType" : 0,

    // Penalties on.
    "PenaltiesType" : 1,

    // Any camera view allowed.
    "AllowedViews" : 0,

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

    // Vehicle class Super V8. See /api/list/vehicle_classes/ in HTTP API or globals "lists.vehicle_classes", "id_to_vehicle_class" or "name_to_vehicle_class" in Lua API.
    "VehicleClassId" : -1097982207,

    // Vehicle Super V8 (but not forced by default flags). See /api/list/vehicles/ in HTTP API or globals "lists.vehicles", "id_to_vehicle" or "name_to_vehicle" in Lua API.
    "VehicleModelId" : 253111186,

    // Starting date and time.
    "RaceDateHour" : 18,

    // Single weather slot set to "Weather_Clear1". See /api/list/enums/weather in HTTP API or globals "lists.enums.weather" or "Weather" in Lua API.
    "PracticeWeatherSlots" : 4,
    "PracticeWeatherSlot1" : -934211870,
    "PracticeWeatherSlot2" : 129238383,
    "PracticeWeatherSlot3" : -1592958063,
    "PracticeWeatherSlot4" : 888299130,

    // Single weather slot set to "Weather_Clear1". See /api/list/enums/weather in HTTP API or globals "lists.enums.weather" or "Weather" in Lua API.
    "QualifyWeatherSlots" : 4,
    "QualifyWeatherSlot1" : -934211870,
    "QualifyWeatherSlot2" : 129238383,
    "QualifyWeatherSlot3" : -1592958063,
    "QualifyWeatherSlot4" : 888299130,


    // Single weather slot set to "Weather_Clear1". See /api/list/enums/weather in HTTP API or globals "lists.enums.weather" or "Weather" in Lua API.
    "RaceWeatherSlots" : 4,
    "RaceWeatherSlot1" : -934211870,
    "RaceWeatherSlot2" : 129238383,
    "RaceWeatherSlot3" : -1592958063,
    "RaceWeatherSlot4" : 888299130,
    }
     
  15. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,267
    Likes Received:
    1,352
    you have 2 entries here
    maxPlayerCount : 16 16


    Also i would try:
    sportsPlay: false
    while testing
     
  16. Daniel R.

    Daniel R. New Member AMS2 Club Member

    Joined:
    Mar 21, 2017
    Messages:
    11
    Likes Received:
    5
    Thanks, I will try later
    Cheers
     
  17. Daniel R.

    Daniel R. New Member AMS2 Club Member

    Joined:
    Mar 21, 2017
    Messages:
    11
    Likes Received:
    5
    Hello,
    thank you very much Wolfgang.
    It was the sportsPlay option.
    It´s a bit strange because it worked with other servers i created.

    Anyway, Problem Solved, Thanks a lot sir!!
    Cheers Dan

    PS.: Where is the appropiate place to upload my tool to ones i´m finished?

    Cheers Dan
     
    • Like Like x 3
  18. davidantx

    davidantx Member AMS2 Club Member

    Joined:
    Jun 18, 2016
    Messages:
    37
    Likes Received:
    12
    Seems like a fantastic Tool Dan, can't wait to see it.
     
  19. pfoetiman76

    pfoetiman76 New Member AMS2 Club Member

    Joined:
    Oct 2, 2020
    Messages:
    28
    Likes Received:
    11
    Hello everyone. I want to make a dedicated server which behaves like a online lobby. The host can choose the car and track combination. After a race the host can choose another car and track combo. Everyone on the server has to take the same vehicle class but can choose an other car then the host. The time for qualifying and race will always be the same even the weather will always be the same. I tried to configure it but after the first race the host could not change the track. Another problem that appeared was that no one could vote for start. Can anyone help me if I post my server.cfg later.
     

    Attached Files:

  20. Paradiz

    Paradiz RFRO Member AMS2 Club Member

    Joined:
    May 18, 2016
    Messages:
    50
    Likes Received:
    4
    Hi, how can I set a mandatory pit stop for a race?
     

Share This Page