Page 4 of 34 FirstFirst ... 2345614 ... LastLast
Results 31 to 40 of 331

Thread: Dedicated Server configuration

  1. #31
    Superkart Pilot
    Join Date
    Sep 2017
    Location
    Wollongong
    Posts
    211
    Platform
    PC
    I too am experiencing problems with AI filling sessions even although I have turned it off, but I think I have almost everything else working using rotate_lua. I haven't tried doing anything with multi class though, so maybe that is broken too if other people are having problems?

    Some of the settings I had to work out the attribute names myself (from the httpapi web page) and manually enter them in the rotate files. I have things like the safety rating, rank and a few other things working correctly now by adding the attributes to the rotate lua config file myself.

    I'll clean usernames and passwords out of my config files and I will post them here to help out anyone interested. Give me 20-30 mins and I'll make another post with them.
    Last edited by Brado23; 25-09-2017 at 22:48.
    The following 2 users likes this Post: G17CH, patycy


  2. #32
    Superkart Pilot
    Join Date
    Sep 2017
    Location
    Wollongong
    Posts
    211
    Platform
    PC

    My Dedicated Server config

    Ok, so here are my config files.

    server.cfg

    Code:
    "//" : "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 : "My Server Name"
    
    // 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 : "myjoinpwd"
    
    // 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 : 32
    
    // 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 : ""
    
    // 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 (https://en.wikipedia.org/wiki/Basic_access_authentication).
    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 : {
        // "stepan" : "foo",
        // "michal" : "bar",
        "myadmin" : "myadminpwd",
    }
    
    // User groups. Map from group names to lists of users in said groups.
    httpApiGroups : {
        // "private" : [ "stepan", "michal" ],
        // "admin" : [ "stepan" ],
        "private" : [ "myadmin" ],
        "admin" : [ "myadmin" ],
    }
    
    // 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",
        
        // pinglimit
        // "epinter_pinglimit",
    ]
    
    // 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" : 0,
    
        // 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" : 30,
        "QualifyLength" : 15
        "RaceLength" : 8,
    
        // 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" : 1776812712,
    
        // 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,
    
        // Visual only damage
        "DamageType" : 1,
    
        // No tire wear.
        "TireWearType" : 6,
    
        // Fuel usage off.
        "FuelUsageType" : 0,
    
        // Penalties on.
        "PenaltiesType" : 1,
    
        // Any camera view allowed.
        "AllowedViews" : 0,
    
        // Track Brands Hatch Indy. See /api/list/tracks/ in HTTP API or globals "lists.tracks", "id_to_track" or "name_to_track" in Lua API.
        "TrackId" : 904625875,
    
        // Vehicle class Road A. 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" : -112887377,
    
        // Vehicle McLaren 720S (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" : 1353949246,
    
        // Starting date and time.
        "RaceDateYear" : 2017,
        "RaceDateMonth" : 9,
        "RaceDateDay" : 22,
        "RaceDateHour" : 11,
    
        // 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" : 1,
        "RaceWeatherSlot1" : -934211870,
        "RaceWeatherSlot2" : -934211870,
        "RaceWeatherSlot3" : -934211870,
        "RaceWeatherSlot4" : -934211870,
    }
    sms_rotate_config.json

    Code:
    // Config version.
    version : 7
    
    // Default configuration.
    config : {
    
    	// Is the current rotation index persistent? If true, the rotation will continue after server restart,
    	// If false, the rotation will always start from the first setup.
    	// You can always delete the sms_rotate_data.json file from lua_config to reset the persisted index.
    	"persist_index" : true,
    
    	// The default setup. This is a table with attributes and values. The following rules apply to the attributes:
    	// - If TrackId is specified: The track to enforce. Automatically sets 1 to ServerControlsTrack
    	// - If VehicleModelId is specified: The vehicle to enforce. Automatically sets 1 to ServerControlsVehicle, sets FORCE_IDENTICAL_VEHICLES to Flags
    	// - If VehicleClassId is specified: The class to enforce. Automatically sets 1 to ServerControlsVehicleClass, sets FORCE_SAME_VEHICLE_CLASS to Flags
    	// - Track, vehicle model, vehicle class and all enum/flags attributes can use values in string forms - so you can use either track id, or track name.
    	// - Flags in string form can contain multiple flags separated by comma, so for example "ABS_ALLOWED,SC_ALLOWED,TCS_ALLOWED"
    	// - The setup should never contain any of the "ServerControls" attributes, those are decided automatically.
    	// - The setup should never contain both VehicleModelId and VehicleClassId at the same time. Restrict either the class or specific vehicle.
    	// - The Flags attribute should never contain FORCE_IDENTICAL_VEHICLES or FORCE_SAME_VEHICLE_CLASS flags, those are decided automatically.
    	"default" : {
        "GridSize" : 24,
        "MaxPlayers" : 24,
        
    		"PracticeLength" : 0,
    		"QualifyLength" : 15,
    		"RaceLength" : 8,
    
    		"Flags" : 1776812712,
    		"DamageType" : "VISUAL_ONLY",
    		"TireWearType" : "OFF",
    		"FuelUsageType" : "OFF",
    		"PenaltiesType" : "FULL",
    		"AllowedViews" : "Any",
    		
    		"AllowablePenaltyTime" : 5,
    		"ManualPitStops" : 1,
    		"MinimumOnlineRank" : "U",
    		"MinimumOnlineStrength" : 1200,
    
        "QualifyDateYear" : 2017,
    		"QualifyDateMonth" : 9,
    		"QualifyDateDay" : 22,
    		"QualifyDateHour" : 11,
    		"RaceDateYear" : 2017,
    		"RaceDateMonth" : 9,
    		"RaceDateDay" : 22,
    		"RaceDateHour" : 14,
    
    		"QualifyWeatherSlots" : 1,
    		"QualifyWeatherSlot1" : "LightCloud",
    		"QualifyWeatherSlot2" : "Clear",
    		"QualifyWeatherSlot3" : "Clear",
    		"QualifyWeatherSlot4" : "Clear",
    		"RaceWeatherSlots" : 1,
    		"RaceWeatherSlot1" : "MediumCloud",
    		"RaceWeatherSlot2" : "Clear",
    		"RaceWeatherSlot3" : "Clear",
    		"RaceWeatherSlot4" : "Clear",
    	},
    
    	// The rotation. Array of setups to rotate. If empty, just the default setup will be used with no actual rotation happening.
    	//
    	// These setups are applied on top of the default setup, then applied to the game. Previous setup in the rotation is never used.
    	// So for example if you wanted to repeat the same track in multiple consecutive setups, different from the default track,
    	// each of those setups needs to explicitly include that track. Also remember that apart from the flags nothing can be "removed"
    	// from the default setup, so if the default setup contains a track, some track will always be enforced (either the default one,
    	// or the setup-specific one). And one last thing, these override setups can never include an attribute that's not specified in
    	// the default setup - it can just override some of the default attributes, not add new ones. The only exception are the
    	// track/vehicle/class attributes.
    	//
    	// Attributes in these setups can have a special attribute RemoveFlags set, which will remove the specified flags from the default
    	// setup instead of adding them to it (which is what the Flags attribute will do)
    	
    	"rotation" : [
    		{
    			"TrackId" : "Bathurst Mount Panorama",
    			"VehicleClassId" : "V8 Supercars",
    		},
    		{
    			"TrackId" : -945967394,
    			"VehicleClassId" : "GT3",
    		},
    		{
    			"TrackId" : "Red Bull Ring GP",
    			"VehicleClassId" : "Formula Renault",
    		},
    		{
    			"TrackId" : "Brands Hatch GP",
    			"VehicleClassId" : "Megane Trophy",
    		}
    	]
    }
    NOTE: Settings defined in the sms_rotate_config.json will overwrite those in the server.cfg.


    I also find the following links useful when searching for attributes, etc on the dedicated server itself. I have set these up as bookmarks.

    Click image for larger version. 

Name:	pCars DS API links.png 
Views:	265 
Size:	5.0 KB 
ID:	240559
    The following 5 users likes this Post: Dalhil, m00ndancer, mshagg, patycy, philmcphil


  3. #33
    Superkart Pilot
    Join Date
    Sep 2017
    Location
    Wollongong
    Posts
    211
    Platform
    PC
    Actually two things someone might be able to help me with...

    Does anyone know how to make the dedicated server sit in the Lobby for one of the tracks in your rotation while waiting for people to join, rather than just being empty and non-active. The pCars 2 server browser displays dedicated servers that are empty and non-active weird (has broadcaster and director icons displayed, rating as a white box, and jibberish for the Remaining column), or just completely wrong.

    Secondly, every time I browse to one of the API web pages I showed above, I get the following message in the console window of the dedicated server itself...

    INFO: Rejecting request with URI '/favicon.ico', path 'favicon.ico' does not match any registered HTTP query handler

    favicon.ico is just the icon that is used for the web page to show with your bookmarks, etc. I created a favicon.ico file of my own and tried putting it in several directories on the dedicated server but no where seems to stop the message (or display the icon on the web page). Does anyone know where this file needs to be placed? I've tried a few places under the web_files directory with no luck.

    Thanks.
    Last edited by Brado23; 25-09-2017 at 22:52.

  4. #34
    Superkart Pilot
    Join Date
    Sep 2017
    Location
    Wollongong
    Posts
    211
    Platform
    PC
    I just did a bit more testing with mine and it appears that the Manual Pit Control setting doesn't seem to work. There may be a bug with that too?

  5. #35
    Kart Driver
    Join Date
    Sep 2017
    Posts
    66
    Platform
    PC
    Hi All! Just thought I'd share my experiences on this...

    I'm experiencing the same issue with AI filling-up the session, but it seems to only be in the first session of the rotation. So for example if I set up 4 sessions using sms_rotate_config.json (e.g. imola, monza, brands, redbull) and start my server I get AI in imola but NOT in monza, brands and redbull. I haven't tested yet whether AI appears when it the rotation cycles back to imola again but it would be good to know whether it's just me or if those on this thread experience the same behaviour.

    Also bearing in mind if AI appears in this pattern (or at random), it mightn't be such an issue if I can use the server's web UI to skip sessions manually, but that's broken for me too (this is the "Next Session" button in the deprecated "Status" menu item at the bottom-left). Is that broken for everyone else too?

  6. #36
    Superkart Pilot
    Join Date
    Sep 2017
    Location
    Wollongong
    Posts
    211
    Platform
    PC
    I haven't noticed what happens in the other rotations with AI. I'll check tonight.

    And yes, the Next Session button or Advance Session or whatever it is in the depreciated status menu doesn't work for me either.

  7. #37
    Kart Driver
    Join Date
    Sep 2017
    Posts
    66
    Platform
    PC
    Thank you Brado23 for confirming the "Next Session" functionality's broken. I've done some further testing and can confirm it's only the first session since starting the server that's populated with AI - subsequent sessions, even when cycling back through the configured rotation are NOT populated with AI. It's a pity it's not possible to have a running server re-read the config without a restart, but it doesn't seem so bad now

    Also regarding your point about favicon.ico - I think your only option is to lower the logLevel (in server.cnf) from "info" to "warning" or "error" if you absolutely must get rid of those messages.

  8. #38
    WMD Member philmcphil's Avatar
    Join Date
    Oct 2011
    Location
    France
    Posts
    10
    Thank you,

    concretly, what need to be set in the server.cfg to have a server running with the basics?

    i don't have a 100% understanding english lol .

    In advance thanks for the support !!
    OS:WINDOWS7 64 - SSD INTEL 520SERIES - i7 4770@3.5GHZ - GTX980 - 3X27" IIYAMA PLE2773HDS-B1 - T500 RS + TH8RS - RSEAT EVO2

  9. #39
    Kart Driver Minolin's Avatar
    Join Date
    Dec 2015
    Posts
    34
    Platform
    PC
    Quote Originally Posted by philmcphil View Post
    Thank you,

    concretly, what need to be set in the server.cfg to have a server running with the basics?

    i don't have a 100% understanding english lol .

    In advance thanks for the support !!

    There is a ready-to-go sample file in a subfolder, just copy it next to the server.exe and rename it to server.cfg. Many of the settings in the file are pretty straight forward, until you hit the flag stuff. Then you either need to read into the sms_rotate.lib (recommended) or read the PDF files (also recommended)
    The following 2 users likes this Post: F1_Racer68, philmcphil


  10. #40
    Superkart Pilot
    Join Date
    Sep 2017
    Location
    Wollongong
    Posts
    211
    Platform
    PC
    For the flags use Asturbo's spreadsheet.....

    https://docs.google.com/spreadsheets...it?usp=sharing
    The following 2 users likes this Post: F1_Racer68, philmcphil


Similar Threads

  1. Replies: 21
    Last Post: 03-10-2017, 19:42
  2. Ho do you setup a pCars2 server on a Dedicated server?
    By Ross Hawkey in forum Multiplayer
    Replies: 8
    Last Post: 23-09-2017, 07:08
  3. Replies: 8
    Last Post: 25-04-2017, 23:52
  4. Dedicated Server - server.cfg & LUA Rotate
    By KAMPFBIBER81 in forum Multiplayer
    Replies: 13
    Last Post: 21-02-2017, 10:37
  5. Replies: 12
    Last Post: 23-10-2015, 21:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •