Dedicated servers support Mods too, and can be automatically installed via dedicated_server_mods_setup.lua in the main mods directory ("server install folder"\mods ; if the file is missing from the build it has to be created manually). This file is run on boot and will download any mods or collection of mods that are setup in the file. An example of this file would be:
ServerModSetup("345692228")
ServerModSetup("346968521")
ServerModSetup("352373173")
ServerModCollectionSetup("379114180")
The mods only update when the version changes on the Workshop, so server boot times should be reasonable and only pickup mod changes as they get posted to the Workshop. These mods will be downloaded and installed to the mods folder, but they aren't enabled by default.
Enabling Mods
To enable mods on dedicated servers, there are two ways.
The first is to force-enable the mods. While simpler, it does not allow you to configure the mod's settings and all mods will use default configuration. To do this, the file modsettings.lua will need to be modified to force enable the mods they desire. For example this would enable three mods from the Workshop.
ForceEnableMod("workshop-345692228")
ForceEnableMod("workshop-346968521")
ForceEnableMod("workshop-352373173")
To ensure that clients will be able to download the corresponding mods from the Workshop, GSAs must not change the mod directory names.
The second option is using a modoverrides.lua file. Dedicated servers can now enable mods and set mod configurations via a file in the configuration directory named modoverrides.lua(Configs\modoverrides.lua or ConfigsBeta\modoverrides.lua depending on what version of the game you play). An example of the contents of this file is
return {
["workshop-350811795"] = { enabled = true },
["workshop-387028143"] = { enabled = true },
["workshop-361336115"] = { enabled = true,
configuration_options =
{
hunt_time = 6,
["String Phrase Option Name"] = "some value",
}
},
["workshop-336882447"] = { enabled = true }
}
In order to retrieve the configuration_options for the mod, you will need to browse to the mod directory and open themodinfo.lua file. Copy the entire configuration_options table and paste in your modoverrides.lua. Then configure to your liking. If there is no configuration_options table, then the mod is not configurable.
Note: Dedicated Servers (and normal clients) can override the mod config options to non-valid options using this method. In this example, 6 is not a normal option for the hunt_time in the Hunt game mode mod.