PDA

View Full Version : Track Rotation, Server Configuration Help



Alan_Bernardo
23-09-2015, 23:10
I need a step-by-step instruction on how to set track rotation:

1. What file to edit
2. What the final edit looks like

As an example, I'd like to see the following,

1. Brno
2. Road B
3. 15 Minute Practice
4. 15 Minute Qual
5. Clear Weather

(second track)

1. Circuit de Barcelona-Catalunya National
2. Road B
3. 15 Minute Practice
4. 15 Minute Qual
5. Clear Weather

Other things,

Fuel: Normal
Tires: Normal
Penalties: Full
Aids (1): Realistic
Aids (2): No on all else
Damage: Performance
Other: Custom Vehicle Set UP, Auto Start Engine

If someone could show me where this information is, exactly, and what file to edit, exactly, I will gladly do it myself.

No matter what I edit, the same configuration (default) appears on the server.

Thanks!

erickgoldner
24-09-2015, 01:30
All right, here we go:

On server.cfg, check if the Lua options are enabled like this:



// 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.
// Still work in progress so disabled by default.
//"sms_stats",
]

After that, start you server one first time.
Now check the lua_config folder and there will be a sms_rotate_config.json file on there with the default config. YouŽll need to edit this file (there's a few line of explanation on it)!

Inside the "default" : attribute youŽre gonna set the default parameters which you don't want to change on rotation.
And on the "rotation" : attribute youŽre gonna create the array of tracks to rotate with the specific changes you want.

Here's how it should look like (with your parameters already):


// Config version.
version : 2

// 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" : {
"Practice1Length" : 0,
"Practice2Length" : 15,
"QualifyLength" : 15,
"WarmupLength" : 0,
"Race1Length" : 6,

"Flags" : "ALLOW_CUSTOM_VEHICLE_SETUP,FORCE_REALISTIC_DRIVING_AIDS,ABS_ALLOWED,SC_ALLOWED,TCS_ALLOWED,MECHANICAL_FAILURES,AUTO_START_ENGINE",
"DamageType" : "PERFORMANCEIMPACTING",
"TireWearType" : "STANDARD",
"FuelUsageType" : "STANDARD",
"PenaltiesType" : "FULL",
"AllowedViews" : "Any",

"DateYear" : 2015,
"DateMonth" : 9,
"DateDay" : 23,
"DateHour" : 8,
"DateMinute" : 0,

"DateProgression" : 1,
"ForecastProgression" : 1,

"WeatherSlots" : 1,
"WeatherSlot1" : "Clear",
"WeatherSlot2" : "Clear",
"WeatherSlot3" : "Clear",
"WeatherSlot4" : "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" : [
{
// Changing just track
"TrackId" : "Brno",
"VehicleClassId" : "Road B",
},
{
// Changing just track
"TrackId" : "Circuit de Barcelona-Catalunya National",
"VehicleClassId" : "Road B",
}

]
}



After you start your server again, it should be visible with the Road B class and the Brno track. If you enter the lobby and exit, it should change to Barcelona as well (it changes if the race is over or if everybody leaves the server).

One thing that i still didn't figured it out yet is why some attributes on the default are ignored and recovered from the server.cfg.
For example: The numer of laps and or Qualify length, if not forced on the array, are gonna be recovered from the server.cfg and not from the default attribute.

Alan_Bernardo
24-09-2015, 02:45
Yeah, I figured it out.

Anyway right now to get some live statistics?

Thanks

erickgoldner
24-09-2015, 02:54
Yeah, I figured it out.

Anyway right now to get some live statistics?

Thanks

If you enable the "sms_stats" addon on server.cfg, it will generate a file with Server, Session and Players stats while the server is up and running!
But is kind of hard to get the info from it, since it keeps adding the info over time (think that if generated a file for each session would be better).

Alan_Bernardo
24-09-2015, 03:23
Thanks! Much appreciated.

Eddie.PND
24-09-2015, 21:21
Hi everybody.

Following previous short guide I have ran a DS switching NurbGP and HockenhimGP. The first was all right, the second was always Hockenheim national. Code is surely right. I tried by "name" too.
But the game ran correctly

Here IS my lua file:

// Config version.
version : 2

// Default configuration.
config : {
"persist_index" : true,
"default" : {
"Practice1Length" : 30,
"Practice2Length" : 60,
"QualifyLength" : 15,
"WarmupLength" : 5,
"Race1Length" : 6,

"Flags" : 838952,
"DamageType" : 3,
"TireWearType" : 6,
"FuelUsageType" : 0,
"PenaltiesType" : 1,
"AllowedViews" : 3,

"DateYear" : 2015,
"DateMonth" : 9,
"DateDay" : 22,
"DateHour" : 12,
"DateMinute" : 0,

"DateProgression" : 1,
"ForecastProgression" : 2,

"WeatherSlots" : 4,
"WeatherSlot1" : 270338437,
"WeatherSlot2" : 129238383,
"WeatherSlot3" : 1461703858,
"WeatherSlot4" : 888299130,
},

"rotation" : [
{
"TrackId" : -945967394,
"VehicleClassId" : -1270088329,
},
{
"TrackId" : 1695182971,
"VehicleClassId" : -1270088329,
}

]
}

Here is my server cfg:

logLevel : "info"
eventsLogSize : 10000
name : "***"
secure : true
password : "***"
maxPlayerCount : 20
bindIP : ""
steamPort : 8766
hostPort : 27015
queryPort : 27016
sleepWaiting : 250
sleepActive : 10

enableHttpApi : true
httpApiLogLevel : "warning"
httpApiInterface : "127.000.000.001"
httpApiPort : 9000
httpApiExtraHeaders : {}


enableLuaApi : true
luaAddonRoot: "lua"
luaConfigRoot: "lua_config"
luaOutputRoot: "lua_output"
luaApiAddons : [
"sms_base",
"sms_rotate",
"sms_motd",
]


allowEmptyJoin : true
controlGameSetup : true
sessionAttributes: {
"ServerControlsTrack" : 0,
"ServerControlsVehicle" : 0,
"GridSize" : 20,
"MaxPlayers" : 20,
"Practice1Length" : 30,
"Practice2Length" : 60,
"QualifyLength" : 15,
"WarmupLength" : 5,
"Race1Length" : 6,
"Flags" : 837928,
"DamageType" : 3,
"TireWearType" : 6,
"FuelUsageType" : 0,
"PenaltiesType" : 1,
"AllowedViews" : 3,
"TrackId" : 1695182971,
"VehicleClassId" : 0,
"VehicleModelId" : 0,
"DateYear" : 2015,
"DateMonth" : 9,
"DateDay" : 22,
"DateHour" : 12,
"DateMinute" : 0,
"DateProgression" : 1,
"ForecastProgression" : 2,
"WeatherSlots" : 4,
"WeatherSlot1" : 270338437,
"WeatherSlot2" : 129238383,
"WeatherSlot3" : 1461703858,
"WeatherSlot4" : 888299130,
}


And last, what does it means:

httpApiExtraHeaders : {}

Thanks for your support.