A Nights Haunting: Source

A Nights Haunting: Source

Not enough ratings
How to create a "Listen" Server
By dr.N0
In this guide i will teach you the differences between servers and how to use them in source engine. Specifically in this tutorial you will learn how to make a Local Area Networking server Also Known As a "Listen" Server.
   
Award
Favorite
Favorited
Unfavorite
Source engine servers and how to use them
All source engine mods run primarily under the same relative system substructures leading
a gamers client - then the server. Whether your running online, local area, or on your own IP its always a 2 piece software system. in order to play source engine sdkbase 2013 multiplayer, the client must always have a server to rely on to run period.

  • The first and most common type of server we all know and love are the online servers. These servers companion the source engine mods game client and are typically known as "Tools" which are built into source engines source engine sdkbase 2013 dedicated servers software. Using the Source SDKbase 2013 dedicated servers allows you to companion the software itself with the sourcemod itself and using both you can run a server online.

  • the second and also most common type of server is just running a local game through create a server which in doing this will enable you the client to run a game server under your own IP. Users would use your IP and Port on an internet level to connect to your server. which often doesnt work strong enough to reach you around the world, hence why the source dedicated server software comes in to play a bigger role on a better machine than your own with accessibility to the world wide web like INTERNAP for example.

  • and the third and also common type of server is a Local Area Networking server aka Listen server.
  • The listen server specifically is a closed network server that isolates the group to 1 specific network, meaning all the users must be on the same network in order to play together and find the server.
so how do we create a listen server?
Creating a Listen server
To create a LAN server it requires different server configuration files than what youd normally use for an online server.
Online servers use the server.cfg file usually found in the sourcemod/game/cfg/server.cfg file path.
BUT listen servers use a set of files instead labelled listenserver.cfg and listenserver_default.cfg.
These 2 files are essentially the same as the server.cfg file only these 2 files bare a server variable that shifts the servers networking focus to Local Area instead of internet accessibility. This server variable is sv_lan.

sv_lan 0 is trigged OFF
sv_lan 1 is triggered ON

Inside the listenserver.cfg are the variable settings that by user default will be loaded. Inside listenserver_default.cfg are the same variables but usually less as this file bares just the minimal default settings the sourcemod needs to establish a LAN server that runs, and users usually add more settings to their LAN server to make their experience more personalized.

A listen server configuration file would look similar to the one below
*notice how sv_lan 1 is set directly at the top for server configuration clarity.

//LOCAL AREA NETWORK CONFIGURATIONS sv_lan 1 fps_max 600 sv_tags "LANPARTY" sv_allowdownload 1 sv_allowupload 1 sv_downloadurl "http://drn0.site.nfoservers.com/anh/" sv_nostats 0 net_maxfilesize 64 pausable "0" // Voice Comm sv_voiceenable "1" sv_alltalk 1 sv_pure 0 mp_chattime 26 sv_filetransfercompression 0 // server control settings mp_tkpunish 0 mp_autokick 0 mp_footsteps 1 mp_falldamage 1 mp_logmessages 1 mp_maxrounds 6 mp_weaponstay 1 sv_weapon_drop_enabled 1 mp_flashlight 1 mp_allowspectators 1 mp_defaultteam 3 mp_respawntime 6 mp_autoteambalance 1 mp_autoteambalance_delay 20 mp_autoteambalance_warning_delay 6 sv_maxspeed 14 sv_cheats 0 sv_region 0 // bandwidth rates/settings sv_minrate 0 sv_maxrate 0 sv_minupdaterate 10 sv_maxupdaterate 66 sv_mincmdrate 10 sv_maxcmdrate 66 sv_client_cmdrate_difference 1 sv_client_predict 1 sv_client_interpolate 1 sv_client_min_interp_ratio -1 sv_client_max_interp_ratio -1 //sv_timeout 300 sv_timeout 300 // decal controls decalfrequency 60 mp_decals 200 // Enable log - Enables logging to file, console, and udp < on | off >. // Recommended: log on log on // Log bans - Log server bans in the server logs. // Default: sv_logbans 1 // Recommended: sv_logbans 1 sv_logbans 1 // Log echo - Display log information to the server console. // Default: sv_logecho 1 // Recommended: sv_logecho 1 sv_logecho 1 // Log file - Log server information in the log file. // Default: sv_logfile 1 // Recommended: sv_logfile 1 sv_logfile 1 // One file log - Log server information to only one file. // Default: sv_log_onefile 0 // Recommended: sv_log_onefile 0 sv_log_onefile 0 // Source TV configurations tv_enable 1 tv_port 27020 tv_autorecord 0 tv_allow_camera_man 0 tv_maxrate 5000 tv_delay 30 tv_delaymapchange 1 tv_name "LAN T.V." tv_title "LAN T.V." tv_msg "Welcome to A Nights Haunting Source LAN T.V." tv_maxclients 10 tv_transmitall 1 tv_relaypassword "" tv_timeout 30 tv_chattimelimit 3 tv_chatgroupsize 0 tv_allow_camera_man 1 // Exec Configs exec banned_user.cfg mapcyclefile mapcycle.txt

Compared to a server.cfg file THIS file is missing some things but whats that?

to be short its missing the "hostname" field to name the server
its missing the time limit, player limit, friendly fire - pretty much anything that can be typed into the sourcemods create a server menu options but whys that?
this is because when the server launches, its loading those settings including whats inside the listenserver.cfg file. if listenserver.cfg is missing it looks for the default one.

-- Normal online servers dont really launch through this create a server type menu so all options including hostname needs to be included into the server.cfg to make restarting and rerunning the servers most effortlessly as restarting servers is a regular thing for most administrators - having to type in these details over and over could become painful over time. -- so writing everything you can onto a online server takes place for the server.cfg usually - so you can run it and its always the same - thats what these config files are for.
Running the listen server
Once your listenserver.cfg and listenserver_default.cfg files are set up and in place you can create a server and run it.
When the game loads in and you join
you will want to check your console[~] to make sure the server is running in LAN.
You should see a string of outputs initiating the server
Server logging enabled. Server logging data to file logs\L0606062.log L 06/06/2025 - 16:12:30: Log file started (file "logs\L0606062.log") (game "C:\Program Files (x86)\Steam\steamapps\sourcemods\anhsource") (version "6630498") L 06/06/2025 - 16:12:30: server_cvar: "tv_enable" "1" SourceTV not active. 'banned_user.cfg' not present; not executing. Unknown command "mapchangecfgfile" L 06/06/2025 - 16:12:30: "dr.N0<2><[U:1:22856930]><>" connected, address "loopback" Team Deathmatch Map: anh_killhaus Players: 1 / 12 Build: 6630498 Server Number: 1

L 06/06/2025 - 16:12:30: "dr.N0<2><[U:1:22856930]><>" connected, address "loopback"
This line here will indicate that your network connection is enclosed in Local Area Network and your server should be visible in the LAN section of the Find Server server browser user interface.

as shown above in console output and also in the server browser LAN section picture above if your server is still not showing up, you can change the level and it should trigger a fresh reset to establish the server onto the browser for users to join you.

You would also notice that source tv had an issue.
L 06/06/2025 - 16:12:30: server_cvar: "tv_enable" "1"
SourceTV not active.

This may not only be the case as to why the server hadnt showed up in the browser but changing levels will snap it out of it. so this may be common for doing this with source tv enabled on LAN and also for other source engine mods. just change level or quit and try running one again right after.

If your server still isnt running or seen on the serverbrowser in the LAN section you may need to check your advanced firewall setting, check your network settings, and be sure all users are on the same internet connection as the host of the game.(this does NOT have to be LAN cable driven - can be used all users on the same wifi connection.)
Conclusion
So to run a listen server.
sourcemod/game/cfg/listenserver.cfg and listenserver_default.cfg must be present.
sv_lan 1 must be set in the configuration files.
all users must be on the same internet network.
you may need to start a server twice and or changelevel to trigger the server onto the serverbrowser especially if using source tv on lan.
if your still having issues it could be because of firewall issues and or open port issues and or network sharing issues.
- you can also always consult the games developers

and that concludes this tutorial!
Till Next Time - Ta Ta For Now!