Team Fortress 2

Team Fortress 2

112 次評價
TF2 Dedicated Server for Dummies (Post SteamPipe)
由 Copium_TV 發表
AN EXTENSIVE TF2 DEDICATED SERVER TUTORIAL FOR DUMMIES
(post SteamPipe update)

Latest rev: June 2014
   
獎勵
加入最愛
已加入最愛
移除最愛
TUTORIAL REQUIREMENTS
1. TUTORIAL REQUIREMENTS

Note:
No matter what OS you're using (Win 7/8), you might encounter issues with installing/moving server files in your C:\ partition, with all the OS admin privileges and restrictions.

So, the safest bet is installing all the TF2 server files, on a second partition, say "D:\".

In my case, I decided to create a folder, its full path is:

D:\Servers\

You will need to create the following files/folders:

File Name
Folder Path
What for?
folder1
D:\Servers\steamcmd\
Extract steamcmd.zip files here
folder2
D:\Servers\TF2\
TF2 dedicated server folder
folder3
D:\Servers\misc\
Folder containing all .bat files
steamcmd.bat
D:\Servers\misc\steamcmd.bat
SteamCMD updater
install.bat
D:\Servers\misc\install.bat
TF2 server installer (only run once)
update.bat
D:\Servers\misc\update.bat
TF2 server updater
start.bat
D:\Servers\misc\start.bat
TF2 server Starter

- the "Misc" folder will contain all the .bat files you create before following this tutorial;
- the folder paths will be used when editing those .bat files, just make sure you write the correct path;
- if your folder path contains spaces ( ex. C:\TF2 DS\ ), in every .bat file you create, your full folder path needs to be incased in " ". [advised by Starly396]
TF2 DEDICATED SERVER - INSTALLING STEPS
2. TF2 DEDICATED SERVER - INSTALLING STEPS
  • Download and unzip this file:
    SteamCMD in folder "D:\Servers\steamcmd\".

  • Create "steamcmd.bat" file, edit it and copy-paste this:
    D:\Servers\steamcmd\steamcmd.exe

  • Run that steamcmd.bat file and let it update itself. Close that window when you see the string "Steam>". Ignore the error.


  • Create "install.bat" and "update.bat" and copy-paste this string in each of them:
    D:\Servers\steamcmd\steamcmd +login anonymous +force_install_dir D:\Servers\TF2\ +app_update 232250 validate +quit

  • Run the install.bat once and wait until TF2 server downloads all its files.
TF2 DEDICATED SERVER - UPDATING YOUR SERVER
3. TF2 DEDICATED SERVER - UPDATING YOUR SERVER
  • Run the "update.bat" each time TF2 server updates get released.

    - if it cannot connect and update immediately, wait 5-10 until Steam servers are connectable...
    - even if connected, some files will be served slowly by the steam servers, just be patient.
TF2 DEDICATED SERVER - CUSTOMIZING YOUR SERVER
4. TF2 DEDICATED SERVER - CUSTOMIZING YOUR SERVER
  • Download and install latest stable versions of:
    metamod[www.sourcemm.net] -- (how to install Metamod[wiki.alliedmods.net])
    sourcemod[www.sourcemod.net] -- (how to install SourceMod[wiki.alliedmods.net])

  • Choose and install your favorite plugins.


  • Create a server.cfg file in "D:\Servers\TF2\tf\cfg" and edit it. Here's an example of server.cfg:

    // Server Name hostname "Insert your TF2 server name here" // Rcon Cvars rcon_password "" //Set's remote control password sv_rcon_banpenalty 15 //Number of minutes to ban users who fail rcon authentication sv_rcon_log 1 //Enable/disable rcon logging. sv_rcon_maxfailures 3 //Max number of times a user can fail rcon authentication before being banned sv_rcon_minfailures 5 //Number of times a user can fail rcon authentication in sv_rcon_minfailuretime before being banned sv_rcon_minfailuretime 10 //Number of seconds to track failed rcon authentications // Server Password sv_password "insert a password here" // Password protects server mapcyclefile "cfg/mapcycle.txt" // Server Cvars mp_allowspectators 1 //Toggles whether the server allows spectator mode or not mp_autocrosshair 0 mp_autoteambalance 0 //Toggles server autoteambalance mp_respawnwavetime 0 mp_disable_respawn_times 1 mp_bonusroundtime 5 //Time in seconds after round win until round restarts mp_chattime 5 //amount of time in seconds players can chat after the game is over mp_decals 1 mp_defaultteam 1 mp_disable_autokick 1 //Prevents a userid from being auto-kicked mp_enableroundwaittime 0 //Enable timers to wait between rounds. mp_fadetoblack 0 //fade a player's screen to black when he dies mp_falldamage 5 //Amount of damage players sustains from a fall mp_flashlight 0 //Toggles flashlight on or off mp_footsteps 1 //Toggles footsteps on or off mp_forcecamera 0 //Restricts spectator modes for dead players mp_forcerespawn 1 mp_fraglimit 0 mp_idlemaxtime 999999 //Maximum time a player is allowed to be idle (in minutes) mp_maxrounds 999999 //max number of rounds to play before server changes maps mp_teams_unbalance_limit 2 //Teams are unbalanced when one team has this many more players than the other team. (0 disables check) mp_time_between_capscoring 5 //Delay between scoring of owned capture points. mp_timelimit 30 //game time per map in minutes mp_winlimit 999999 //Max number of rounds one team can win before server changes maps sv_allow_color_correction 1 //Allow or disallow clients to use color correction on this server. sv_allow_wait_command 0 //Allow or disallow the wait command on clients connected to this server. sv_allowdownload 1 //Allow clients to download files sv_allowupload 1 //Allow clients to upload customizations files sv_alltalk 0 //Players can hear all other players, no team restrictions sv_alternateticks 0 //If set, server only simulates entities on even numbered ticks. sv_autosave 0 //Set to 1 to autosave game on level transition. Does not affect autosave triggers. sv_bonus_challenge 0 //Set to values other than 0 to select a bonus map challenge type. sv_cacheencodedents 1 //If set to 1, does an optimization to prevent extra SendTable_Encode calls. sv_cheats 0 //Allow cheats on server sv_clearhinthistory 0 //Clear memory of server side hints displayed to the player. sv_consistency 0 //Whether the server enforces file consistency for critical files sv_contact "" //Contact email for server sysop sv_downloadurl "" //Location from which clients can download missing files sv_enableoldqueries 1 //Enable support for old style (HL1) server queries sv_pausable 0 //Is the server pausable. // Lan or internet play, Server region cvars sv_lan 0 //Server is a lan server ( no heartbeat, no authentication, no non-class C addresses ) sv_region 255 // Region Codes: 0 - US East coast, 1 - US West coast, 2 - South America, 2 - South America, 3 - Europe, 4 - Asia, 5 - Australia, 6 - Middle East, 7 - Africa, 255 - world //server Logging sv_log_onefile 0 //Log server information to only one file. sv_logbans 1 //Log server bans in the server logs. sv_logblocks 0 //If true when log when a query is blocked (can cause very large log files) sv_logecho 0 //Echo log information to the console. sv_logfile 1 //Log server information in the log file. sv_logflush 0 //Flush the log file to disk on each write (slow). sv_logsdir "logs" //Folder in the game directory where server logs will be stored. //Server Rates sv_maxcmdrate 0 //(If sv_mincmdrate is > 0), this sets the maximum value for cl_cmdrate. sv_maxrate 40000 //Max bandwidth rate allowed on server, 0 == unlimited sv_maxreplay 2 //Maximum replay time in seconds sv_maxupdaterate 105 //Maximum updates per second that the server will allow sv_mincmdrate 0 //This sets the minimum value for cl_cmdrate. 0 == unlimited. sv_minrate 0 //Min bandwidth rate allowed on server, 0 == unlimited sv_minupdaterate 100 //Minimum updates per second that the server will allow

  • Copy your favorite maps into "D:\Servers\TF2\tf\maps\".


  • Create/edit the "mapcycle.txt" inside "D:\Servers\TF2\tf\cfg\". Delete all useless map names, edit/write down only the maps you want your server to run.
TF2 DEDICATED SERVER - STARTING YOUR SERVER
5. TF2 DEDICATED SERVER - STARTING YOUR SERVER
  • This file "srcds.exe" should exist in "D:\Servers\TF2\"

  • Create the "start.bat" file and place this string:
    D:\Servers\TF2\srcds.exe -console -game tf -hostport 23 +maxplayers 20 +map mapname

    - modify hostport accordingly (if you run your server behind a firewall, etc);
    - modify maxplayers as you wish (32 is usually max)
    - mapname will be your map filename (ex: achievement_idle)
    - if you copy-pasted my server.cfg, the map doesn't restart, there's no timelimit

  • Click on start.bat

  • Enjoy your TF2 Server!



P.S.
Make sure you read some guides on how to properly open your router/server ports, so friends and other players can join your servers.
ADDENDUM
6. ADDITIONAL STUFF

Recommended Plugins

Add Observer Point[forums.alliedmods.net] - required plugin if your server crashes when random player dies/suicides
TF2 Advanced Infinite ammo[forums.alliedmods.net] - infinite ammo, rage, shield charge, metal, decapitation
TF2 first/third person view[forums.alliedmods.net] - a 1st/3rd person view of your character
TF2 100% Critical Chance[forums.alliedmods.net] - blast noobs into oblivion with a 100% crit chance
TF2 Roll the Dice[forums.alliedmods.net] - spam !rtd into chat to get cool bonuses or punishment
TF2 Backpack Viewer[forums.alliedmods.net] - an extensive plugin that lets you preview player's backpack via MOTD window


Note:
These plugins might update/disappear entirely and are not under my control, but in the hands of their original creators.


SteamCMD complete games ID list

- check the proper ID if you want to install a dedicated server for another source game such as CS:GO, DOD:S, CS:S, L4D2, etc.

https://developer.valvesoftware.com/wiki/SteamCMD





ENJOY

QUICK TUTORIAL MOCK-UP (video)
Here's a quick video mock-up of the tutorial, if you still have trouble.

Unedited video with some random music.


84 則留言
cringe guy from 2019 2019 年 10 月 26 日 下午 2:19 
When I try to install the server, it says "Error! App '232250' state is 0x202 after update job." Help?
azrellie ♥ 2019 年 3 月 16 日 上午 9:59 
i have an error with joining my server, i did everything correctly but when i join my server this occurs "connection failed after 4 retries"
fix?
Son-Dream 2018 年 8 月 19 日 上午 11:51 
Thank you. Very useful guide. Thumbs up.
RealmTree 2018 年 8 月 3 日 上午 4:00 
update.bat is not present on my pc at all... what can i do?
Goodgun 2017 年 9 月 7 日 下午 3:50 
wait never mind, accidentally put tf2 content in another folder
Goodgun 2017 年 9 月 7 日 下午 3:47 
failed to load the launcher DLL:
The specified module could not be found.

any help with this?
Copium_TV  [作者] 2017 年 6 月 19 日 上午 8:17 
Froot, that has nothing to do with my guide instructions. Fix your OS installation... RIP :D
Also_A_Duck 2017 年 6 月 18 日 上午 10:38 
ok i tried to change the +mapname thing in the bullshit start.bat. And Guess what? THE FUCKING START.BAT AND SRCDS.EXE ARE FUCKING GONE AND I CANT MAKE NEW ONES CAUSE I "need permision" EVEN THOUGH IM THE FUCKING ADMINISTRATOR ON THIS COMPUTER!
Dr. Eggman 2017 年 2 月 20 日 上午 8:22 
Thank you it is working better way :D
Ant 2016 年 10 月 2 日 下午 3:22 
I'm having troubles with an error message "your server needs to be restarted in order to get the latest update" I'm sure I put the proper directory but I moved the srcds from a failed attempt. where do i get a good scrds?