Day of Infamy

Day of Infamy

59 ratings
Day of Infamy Windows Dedicated Server
By Arc
Dedicated Server basics and advanced in comprehensive yet easy to read guide.
   
Award
Favorite
Favorited
Unfavorite
1.) Introduction
Ohai, I'm Arc and this guide will show you how to start a server in a few simple steps and help you maintain and even customise it.

Your server should be up and running by the 4th section of the guide, anything onwards is only should you need to customize or further maintain your server.
2.) Preparation, requirements
In this section i’ll explain what you will need to have. From necessary Hardware to minimum and recommended software requirements.
2.1) Hardware requirements
It is possible to run server and a client on the same machine, if you have Hardware capable of it that is.
Minimum Requirements:

HDD: 12GB or more for custom content and future patches,
RAM: 2GB free,
CPU: Core i3 (or AMD equivalent) or better, prefered high performance per-core, BOTS (AI) will tank your CPU !
Stable internet connection, prefered wired (cable, fibre optic),
Internet Bandwidth: At least 4Mbps Download/Upload for 6 player COOP or 6v6 PVP, You will need a lot of bandwidth for big PVP server.

Optional:
External HTTP server (for custom content), DoI server does support Steam Workshop.

The next step is for those of you behind a router.
You need to forward the following ports (port forwarding):
27005 (client port) and 27015 (default server port, UDP for traffic, TCP for RCON)

If you want to assign different port than default 27015, you need to forward that as well.
Port range normally used for servers:
UDP/TCP 27000 to 27050

How to do port forwarding:
http://portforward.com/
2.2) Software requirements
These are required for the guide and minimum amount of software you should have for comfortable server management.

Required:
Microsoft Visual C++ 2013/2015 Redistributable Package (both x86 and x64)
https://www.microsoft.com/en-gb/download/details.aspx?id=40784
https://www.microsoft.com/en-us/download/details.aspx?id=48145

Steam Client or SteamCMD for downloading the server
http://media.steampowered.com/installer/steamcmd.zip
or
http://media.steampowered.com/client/installer/SteamSetup.exe

Optional/Recommended:

Notepad++ text editor for easier file creation and editing:
https://notepad-plus-plus.org/download/

7Zip for custom content packing and unpacking:
http://sourceforge.net/projects/sevenzip/files/latest/download?source=files

GCFscape for unpacking VPK files should you need to modify them: http://nemesis.thewavelength.net/index.php?p=26
3.) Downloading the server
Once we meet the necessary requirements we can download our server. I’ll describe both method of how can one obtain a server, pick only 1.
3.1) Steam Client
Go to your Steam client, Library, change “games” tab to “tools” and find “Day of Infamy Dedicated Server”, let it download, that’s all.
3.2) SteamCMD
Download SteamCMD, create folder C:\SteamCMD, put the steamcmd.exe into that folder, run .exe and it will download necessary files and updates. Once it’s done you can now download Day of Infamy Dedicated Server by typing following commands into SteamCMD console line by line:
force_install_dir <path> login anonymous app_update 462310 validate quit
Explanations:
login: it’s like steam login, you can use your account if you want but it’s not necessary
force_install_dir : if you do not want to have Server downloaded inside of SteamCMD folder use this command, <path> means full path to your desired folder (example: force_install_dir E:\Games\SRCDS )


app_update: is actual download/update command, requires ID of tool you want to download (462310 for Day of Infamy server).
quit: if you want to quit SteamCMD after you download the server.


Troubleshooting:
This error message pops up if you put unsupported character to folder path (example: E:\Games?\SRCDS )
error! app 462310 state is 0x1 after update job.
4.) Basic Server setup
Now You can proceed to setup the actual server, only with minimum necessary commands.
4.1) Startup file (aka batch)
You will be starting your server with this file instead of srcds.exe.

Go to your SRCDS folder and create plain text file inside same folder as srcds.exe is. Rename that file to “Startup” and change it’s extension from .TXT to .BAT (you need to have unchecked “Hide extension of known files” in windows, google for it if you do not know).

Now, edit the Startup.bat in notepad, and place there following commands:
start srcds.exe -usercon +maxplayers 24 +sv_lan 0 +map "bastogne offensive"

-usercon: enables server/rcon port so you can use 27015 as an actual server port
+maxplayers: limiter for player slots, this is also needed for COOP server as it’s limit bot+player number
+map: change it to map+mode you want to server start with

Complete maplist:
https://pastebin.com/H0zrGsa7

List of game modes:
https://pastebin.com/eMNNQWY6

There are few optional parameters you might be interested in:
-port xxxxx // sets server port, example: -port 27020, needed for multiple servers at same IP +servercfgfile name_of_cfg // use ONLY in case you have custom named main server.cfg, otherwise do not include
4.2.) Creating basic server.cfg
Every “config” (*.CFG) file is located in “..\doi\cfg” directory, so server.cfg belongs to that directory as well..

Fully functional example of server.cfg (you can copy&paste it, just change password, name and mapcyclefile):
/////////////BASIC////////// hostname "your_server_name" // server name rcon_password "your_password" // remote console access password sv_password "" // server password for private matches, if you have sv_playlist, it won't be matchmaked /////////////LOGGING///////////// log on // enables/disables server logging, it will store all text which console prints into TXT files sv_logbans 1 sv_logecho 1 sv_logfile 1 sv_log_onefile 1 /////////////BAN LIST///////////// sv_battleye 1 // Anti-cheat, 0 = disabled exec banned_user.cfg // personal banlist based on user IDs exec banned_ip.cfg // personal banlist based on user IPs writeid writeip /////////////MAPCYCLE FILE///////////// "mapcyclefile" "your_mapcycle.txt" // this cvar sets your mapcycle file and defines your map/gamemode rotation


explanations:
mapcyclefile: this Console Variable (aka CVAR, cvars can be found in “cvarlist” explained later in this guide, you will not need this for basic setup) sets your map cycle file, you can either use default mapcycle files or create your own.


Unlike Insurgency server, DoI no longer uses default mapcycle files for NWI servers so don't be surprised if you didn't see any in your doi folder.

Now You have fully functional server with basic settings, if you want more customization just continue reading this guide.
5.) Advanced Server settings
Now we can proceed to personal modification of the server, starting with list of locations of files we will be using. As well as example files for other server functions.
5.1) Useful file directories
"..\doi" // this is our parent directory, there are default files, our generated cvarlist, motd file, and other directories shown below "..\doi\cfg" // server config files (*.CFG) directory "..\doi\maps" // default map directory, FastDL custom maps will be here as well "..\doi\scripts\theaters" // non-workshop custom Theater script director "..\doi\scripts\playlists\<custom>" // non-workshop custom Playlists "..\doi\custom" // folder for custom content (non-workshop VPK format) like skins or sounds "..\doi\logs" // server log text files, if it's logging enabled "root\steamapps\workshop\content\447820" // Steam workshop download folder, DO NOT MOVE files from/into it
5.2) Cvarlist
Before you jump to edit files, you need to know what CVARs are available.

You can generate cvarlist manually by typing this into the server console:
cvarlist log cvarlist.txt
it will store whole cvarlist to a text file located in “..\doi” directory. If you choose this method, it’s recommended to generate cvarlist each server update !
5.3) List of gamemode config files and how to edit them
Firstly you must know how Server handles loading of multiple config files before you will be editing them:
server.cfg // this is your primary server config file containing global variables default_server_<mode>.cfg // default file which contains settings for specific mode server_<mode>.cfg // non-default config, overrides default, use this for custom servers server_<map>.cfg // optional file for settings per-map server_<map>_<mode>.cfg // optional file for settings per-map-gamemode
Loaded from top to bottom (from most general to most specific).
If you have conflicting CVARS (Console Variables, simply put: commands) the last loaded config will have highest priority, thus overriding such conflicting cvar.

You just saw that there is possibility to have per-map settings as well as per-map-gamemode. Those config files are not default and you must create them if you want to have such settings.

Now You can proceed to edit files which are loaded by the server and correspond to the current game mode. These files are located in "..\doi\cfg" directory and contain per-gamemode settings, the name of the file matching the mode it modifies.

Example of server_stronghold.cfg, starting with default settings:
"mp_coop_lobbysize" "6" // how many players are allowed in coop modes, maximum 8 "mp_timelimit" "20" "mp_maxgames" "1" // maximum number of games played "mp_maxrounds" "5" // maximum number of rounds played before map changes without reaching winlimit "mp_winlimit_coop" "1" // maximum number of WINS before next map can be loaded "mp_roundtime" "900" // round time in seconds, ATTENTION! for COOP modes, this is time till next objective is captured, not for whole round ! "mp_cp_capture_time" "30" // number of seconds needed to capture an objective "mp_cp_deteriorate_time" "0" "mp_supply_token_base" "10" // number of supply points at start of the map "mp_supply_token_bot_base" "18" // number of supply points for bots "mp_supply_rate_losing_team_high" "1" // how many supply points will player earn on losing team as MVP "mp_supply_rate_losing_team_low" "1" // non-MVP losing team "mp_supply_rate_winning_team_high" "1" // how many supply points will player earn on winning team as MVP "mp_supply_rate_winning_team_low" "1" // non-MVP winning team "mp_stronghold_bot_respawn_frequency" "40" // in seconds

Now you can edit this with adding optional CVARs such as these:

"mp_supply_token_max" "50" // maximum supply points (base + earned) "mp_player_resupply_delay_base" "10" // base delay between player resupply in seconds "mp_player_resupply_delay_max" "130" // maximum delay between resupply in seconds "mp_player_resupply_delay_penalty" "20" // penalty for resupply spamming, in seconds "mp_player_resupply_penalty_reset" "45" // time in seconds where penalty resets "mp_timer_pregame" "0" // timer for the pre-game (before the game starts, usually after map change or on mp_restartgame 1), in seconds "mp_timer_preround" "10" // timer for the pre-round (before the round starts, usually after a previous round ends or on mp_restartround 1), in seconds "mp_timer_postround" "8" // timer for the post-round (after the round starts) "mp_timer_postgame" "10" // timer for the post-game (at the end of a game / map rotation) "mp_timer_preround_first" "10" // timer for pre-round right after the map loads (additional timer, it counts towards “mp_timer_preround”) "bot_damage" "1" // the amount of damage bots give off compared to normal players, 0.1 - 1.0 (in 0.1 increments)

These are only examples, there are hundreds of variables which you can customize.
5.4) Custom server.cfg
Here i’ll explain optional CVARs for your already functional basic server.cfg, bare in mind, there are a lot more CVARs than in this guide, see Cvarlist.
"mp_friendlyfire" "1" // enables/disables friendly fire "mp_tkpunish" "2" // How to punish team killing ( 0 = none, 1 = warning, 2 = kill ) "sv_vote_failure_timer" "10" // how many seconds before you can vote again after failed vote "sv_vote_issue_changegamemode_allowed" "0" // enables/disables vote option for changing gamemode "sv_vote_issue_changelevel_allowed" "1" // enables/disables vote option for “changelevel” "sv_vote_issue_nextlevel_allowextend" "1" "sv_vote_issue_nextlevel_round_count_delay" "0" "sv_vote_issue_kick_allowed" "1" "sv_vote_issue_botdifficulty_allowed" "0" "sv_vote_issue_botcount_allowed" "0" "sv_map_voting" "1" // enables/disables map voting "sv_vote_issue_nextlevel_choicesmode" "1" // enables/disables eng game map choice screen "mp_spectator_allow_chase" "0" // enables/disables chase cam for spectator "mp_allowspectators" "1" "spec_allow_bots" "0" // enables/disables spectating of bots "sv_deadvoice" "1" // enabling this will allow the dead and living to VOIP each other "sv_deadtalk" "1" // enabling this will allow the dead and living to chat text each other "sv_deadtalk_team" "0" // is deadchat limited to just your team? "sv_alltalk" "0" // enables/disables voice chat between team sides "mp_voice_use_3d_voip" "1" // enables/disables 3D voice chat "sv_hud_deathmessages" "0" // death messages (kill feed) "sv_hud_scoreboard_show_kd" "1" // show k:d on scoreboard "sv_hud_targetindicator" "1" // show friendly player names/diamonds when looking at them "sv_weapon_manager_cleanup" "1" // enables/disables weapon manager (WM is responsible for cleaning dropped weapons and bodies) "sv_weapon_manager_drop_timer" "1200" // how many seconds will dropped weapons remain till they vanish "sv_weapon_manager_max_count" "50" // how many dropped weapons can be on map at a time


Certain cvars are better suited as global ones (server.cfg) and some for per-gamemode settings.
5.5) per-map and per-map-gamemode configs
!!! UNTESTED !!!

As you already know, you can make such settings, it will use same CVARs as you put into your server_gamemode.cfg, i pick Skirmish mode with sinjar map as an example:
Create text file inside “CFG” folder, rename it to “server_bastogne.cfg” (again, you need to have disabled “hide known file extensions” in windows to be able to change TXT to CFG). Now you can put whatever CVAR you want to be active for that map.

Same goes for per-map-gamemode: Create text file in “CFG folder” rename it to “server_bastogne_offensive.cfg

Both Config options MUST start with “server_” as shown in the guide, otherwise your Server will not load them.
You can have both optional config files at the same time, this purely depends on your preferences.

!!! UNTESTED !!!
5.6) Custom mapcycle file
Now you can create your own mapcycle.
Create text file and rename it to mapcycle_whatever.txt (mapcycle_mixed.txt for example) in “..\doi” folder, open it and add copy&paste your desired map names and mode names into it following this example:
bastogne liberation crete offensive dog_red frontline etc.

You can have all modes at one mapcycle, as well as 1 mode only or a few of them. Your choice.
Now when you have file saved, set it in server.cfg by changing “mapcyclefile”” variable:
"mapcyclefile" "mapcycle_whatever.txt"

Remember to write down “.txt”, otherwise it won’t work.
5.7) Message of the day (aka MOTD)
MOTD is simple text file which shows whatever you write there during client’s map load screen. Keep it as simple as possible.
Create text file in “..\doi” directory, rename it to “motd.txt”.
Example file:
Welcome in Arc's COOP server Admin: Arc Rules: TeamKill will result in permanent BAN Gamemodes: Stronghold, entrenchment, raid
5.8) Matchmaking and Stats
Here is a separate guide containing everything you need to know about Playlist, server matchmaking and stats:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=952503848
5.9) Remote Control (aka RCON)
Server can be remotely controlled. You need to set password for it. You already have necessary cvar line added in basic server.cfg, but for recap it’s:
rcon_password <your password>
Once you are in game playing on your server and want to remotely access to your server, open client console and type there:
rcon_password <your password> rcon status
This signs you as admin and displays current status of the game and disables auto-kick for your person.
Now if you want to change some variable simply put “rcon” before you type cvar, example:
rcon mp_maxrounds 8
5.10) Config file commenting
This useful feature is visible across whole guide. It’s commenting of lines by adding “//” (double slash) symbol.
All which is behind the double slash is ignored by the server. You can create sidenotes with it (as shown throughout the guide) or you can disable cvars with it instead of deleting them, example:
//sv_playlist nwi/coop
Now the whole line will be ignored thus will server have matchmaking disabled.
5.11) External admin tools
SourceMod:
Sourcemod is all-kind of admin tool, powered by user scripts (plugins) it can do almost anything on the server.
Installing:
https://wiki.alliedmods.net/Installing_SourceMod

All documentations:
https://wiki.alliedmods.net/index.php/Category:SourceMod_Documentation

Plugins:
http://www.sourcemod.net/plugins.php?cat=0&mod=-1&title=&author=&description=&search=1

There are also other tools like HLStatsX for player stats, web based rcon tools and so on. I’m lacking of knowledge here so search in google !
5.12) Scripting possibilities for batch and SteamCMD
You can modify startup batch file to contain “autorestart” feature in Windows. Just modify your existing file and replace it with this:
@echo off cls echo Recovering srcds.exe from crashes... echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter. title srcds.exe Watchdog :srcds echo (%date% / %time%) srcds started. start /wait srcds.exe +maxplayers 24 -usercon +map bastogne offensive echo (%time%) WARNING: srcds closed or crashed, restarting. goto srcds
Replace highlighted code with your own settings.

For SteamCMD you can create script which make it easier to downloading and updating your server in future.

1.) create a blank TXT file in SteamCMD main directory (where the SteamCMD.exe is) rename it to, for example "doi_server" and copy&paste there this code and change path to the folder you want:
@ShutdownOnFailedCommand 1 @NoPromptForPassword 1 login anonymous force_install_dir <path> app_update 462310 validate quit

<path> - full path to folder you want to download the Server into, example:
force_install_dir E:\Servers\doi_server
Bare in mind that if you have space char between any word in <path> you need to bound that via quotation marks, example:
force_install_dir "E:\Servers\doi server"

2.) Now you have the script file, you just need to tell SteamCMD to use it, create shorttcut on your desktop (or wherever you want it to be) of SteamCMD.exe and add this parameter to "Target" line in it's Properties:
+runscript script_name.txt

for example:
C:\SteamCMD\steamcmd.exe +runscript doi_server.txt
5.13) Kicking, Banning and Unbanning
Create following files in “..\doi\cfg” directory:
banned_ip.cfg banned_user.cfg

!!!!!!!! if you copypasted my example, skip this step below !!!!!!!!

Now add these commands into your “server.cfg”
exec banned_user.cfg // personal banlist based on user IDs exec banned_ip.cfg // personal banlist based on user IPs writeid writeip

!!!!!!!! end of skippable part !!!!!!!!

To discover player SteamID or IP, type "status" into the Server console, or "rcon status" to the Client console.

Kicking:
kick <name> kickid <id>

Explanation:
<name> is user name
<id> is SteamID and have following format: STEAM_x:x:xxxxxxxx where “x” stands for number

Examples:
kick arc
kickid STEAM_0:0:12345678

Adding/removing banned users/ips through console (works also via RCON):

Adding/removing IP:
addip <time> <ip> removeip <ip>

Explanation:
<time> how many MINUTES will be IP banned, 0 = permanent ban
<ip> stands for numeric IPv4 address of user (example: 1.2.3.4)
removeip does not need <time> parameter

Examples:
addip 0 "1.2.3.4"
removeip 1.2.3.4

Adding/removing steamID:
banid <time> <id> removeid <id>

Explanation:
<time> how many MINUTES will be IP banned, 0 = permanent ban
<id> is SteamID and have following format: STEAM_x:x:xxxxxxxx where “x” stands for number

Examples:
banid 0 STEAM_0:0:12345678
removeid STEAM_0:0:87654321

To write banned IPs/IDs to a file, type this command into the console depending of what you’ve banned:
writeid writeip

To view banned IDs or IPs through console, use those resepctive commands:
listid listip

listid - will show you how many IDs are banned, exact IDs and for how long
listip - will show you how many IPs are banned, exact IPs and for how long
5.14) Anti-cheat
Day of Infamy does have 3rd party Anti-cheat called "BattlEye". It is enabled by default for all NWI PVP servers and community servers running NWI PVP playlist.

If you do want to enable this anti-cheat on your custom server while not using NWI PVP playlist, simply add this line to your server config file or your custom playlist:
sv_battleye 1
6.) Custom content
Use of Steam Workshop is RECOMMENDED

Servers can handle custom content like maps, skins, sounds, theaters server-side, which means it will be forced and uploaded to clients. Some of content works only with Steam workshop support enabled, i’ll explain later.

There are 2 ways how to maintain custom content:

Steam workshop and FastDL server (see HW requirements in Basic section)
Workshop is generally easier to maintain and it’s not time consuming to set. But you are forced to use Steam servers which can sometimes be slow or stop responding.
Use of Steam Workshop is RECOMMENDED

FastDL server can be faster than Steam Workshop, but it’s harder to maintain the content and generally hard to find “Free of use” server for your content hosting.
VPK mods works server-side only through Steam Workshop.

How to Workshop:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=952463590

How to FastDL:
You need to follow directory structure on your FastDL server
doi doi\custom doi\maps doi\scripts\theaters

By use of 7Zip pack custom content to BZ2 format before upload. Maps go to “maps” folder, theater files into “scripts\theaters”, and so on.

Then in your main "server.cfg", add this line:
sv_downloadurl "http_link" // specify link to main "insurgency" folder on your Fast Download server

How to net_maxfilesize:

In case you have high upload speed and small-sized custom files (maps for example), you do not need FastDL or Steam Workshop support set.

The command should go into server.cfg and will look like this:
net_maxfilesize 64 sv_allowupload 1 sv_allowdownload 1

However, net_maxfilesize is limited to 64MB. So Server itself can only upload files which are =< 64MB !!

Also, this works only if you did not set “sv_downloadurl”, otherwise the server will pick the FastDL folder as the one which will client download content from.

If the custom content is larger than 64MB, FastDL or Steam Workshop is needed.
6.1) Theaters (aka Scenario scripts)
Theaters can change all kind of things. Weapon weight, restrictions for team, and stuff like that.

To enable custom theater on your server, open server_gamemode.cfg corresponding to settings in your theater file and put this line into it:
"mp_theater_override" "name_of_theater_file_without_extension"

This is not compatible with use of NWI Playlists or custom Playlists which have this under "forced_cvars" section.

Use Steam Workshop to distribute custom files !
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=952463590
7.) Known issues
Port 27020 is pre-occupied by SourceTV so server will not be able to run on this port unless you put "-nohltv" into the command line.

Theater script is known for it’s behaving during client download procedure if host uses FastDL. Steam Workshop should work just fine !
9.) Additional notes and info
Always make backup of your config files. Every major update of server or validating files will result in re-downloading default files and configs (default_server_gamemode.cfg, etc.).
Guide updates
This guide is up to date for version 2.9.8.9
https://steamhost.cn/steamcommunity_com/games/447820/announcements/detail/1261417911001378487

Feel free to post suggestions & feedback !

69 Comments
RVK 2 Jul, 2024 @ 7:27am 
Yeah no worries. Figured I leave a comment so that the next person following the guide has some idea on how to fix the ruleset problem.
Arc  [author] 2 Jul, 2024 @ 2:47am 
The SteamCMD part was lifted off valve wiki as-is with minor modifications to fit the Ins/DoI, so whatever they changed in those docs throughout the years will not be correct in my guides as a result.

I do not have much time to keep up with changes to these, so thanks for the reminder.

As for the ruleset/playlist riority: No clue, been years since i knew any of this.
RVK 21 Jun, 2024 @ 5:52pm 
Just wanted to say a big thanks for this and the playlist guides. Very well written and helpful, thank you!

I wanted to point out in this guide you'll want the force_install_dir <path> before login anonymous, steamcmd will warn of this too. For the playlist guide, I had trouble getting the american campaign to work in reichswald and finally figured out I had to put the sv_ruleset before the sv_playlist otherwise it defaulted to commonwealth. Not sure why but for some reason that worked.
al infierno 11 Dec, 2022 @ 8:51pm 
Nevermind my last comment, I tried running srcds_x64.exe instead of srcds.exe and it worked!
al infierno 11 Dec, 2022 @ 8:48pm 
Hi, I followed the steps but when I launch startup.bat for srcds.exe, the window just opens and instantly closes without any errors. I've hosted servers successfully in the past and never had this particular issue, and I'm at a bit of a loss troubleshooting it. Any ideas?
Kramer84 25 Mar, 2022 @ 11:20am 
I'm stuck at the port forwarding part, did the others too but can't make to see my server online in the display :steamsad:
Arc  [author] 4 Jun, 2021 @ 12:22am 
Np, I'm still active on all my guides as well as on Ins/DoI/Sandstorm and other Steam Community forums !
CaptainCadet 4 Jun, 2021 @ 12:06am 
Ok thanks! I'm really grateful for your responding to me considering the last post was in April.
Arc  [author] 3 Jun, 2021 @ 11:06pm 
If playlists are empty > Section 5.6) "Custom mapcycle file"
CaptainCadet 3 Jun, 2021 @ 8:34pm 
So how do I get a map rotation and map vote?

I dont have any files in the playlist files of either doi server or doi the game