INFO How to make an HLDS Dedicated Server for MS:C

icuownage

New Adventurer
Joined
Mar 30, 2008
Messages
36
Reaction score
0
i kinda got a problem but it very minor. you know the restarter for stage 3 i think it is. well i added the code for the config and the server name never changes for it when i start it by clicking the msc.bat file, the server name comes up as "your server name goes here", but wen i do it from the dedicated server it comes up as fine, this is very minor but i want to know why
 

Mikkel

New Adventurer
MSC Developer
The Pirates of Dreadwind
Joined
Feb 13, 2007
Messages
1,000
Reaction score
0
Age
31
Location
Denmark
You find a file called "listenserver.cfg" and a file called "server.cfg" if you run a dedicated server, you use the "server.cfg"
 

A.M.Zinthos!

New Adventurer
Socialist Guild
Joined
Jul 27, 2009
Messages
13
Reaction score
0
I've been trying to set a server up got it working but it seems people get lag spikes every 2 seconds.

I have a

Processor:
Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz (2 CPUs)

Memory:
3326MB RAM

Hard Drive:
300 GB

Video Card:
NVIDIA GeForce 8800 GTX


Could anyone help me with this issue?
 

A.M.Zinthos!

New Adventurer
Socialist Guild
Joined
Jul 27, 2009
Messages
13
Reaction score
0
Yes

Code:
// Name of the server
hostname "[Not yet FN] Zinthos's Torture house"

// Internet server (1 for LAN)
sv_lan 0

// Cuts down on verbosness of console (saves some memory and CPU time)
developer 0

// Player Vs. Player Settings (0 to disable, 1 only outside towns, 2 PvP anywhere)
ms_pklevel 0

// Number of characters that can be stored by each player on the server
// Set to 0 for client side characters
ms_serverchar 3

// Allow vote kicking (recommend disable, as is buggy)
ms_allowkickvote 0

// Allow voting for time
ms_allowtimevote 1

// Add your rcon password here
rcon_password "lolurnotgettingmypassword;D"

// Voice comm settings (hiqh quality)
sv_voiceenable 1
sv_voicequality 5
sv_voicecodec voice_speex

// Allow all players to hear one another, regardless of team
sv_alltalk 1
sv_spectalk 1

// Custom Content Server for fast downloads, Feel free to make your own
sv_downloadurl "http://www.thothie.com/hlserv"

// Disable clients' ability to pause the server
pausable 0

// Player bounding boxes (collisions, not clipping, superfluous)
sv_clienttrace 3.5

// Maximum client movement speed (superfluous)
sv_maxspeed 600

//Newer MSC specific options:

//Server Restart/Reset System
ms_reset_if_empty 0 //reset the server 60 seconds after last person leaves if set to 1
ms_timelimit 20 //change the map to Edana if server is empty this many minutes

//Admin system
ms_admin_contact "[email protected]" //put your e-mail here for clients to reach you
ms_ban_to_cfg  1 //write permanent bans to the server/lisetnserver.cfg in addition to ms_bans.cfg
ms_chatlog 1 //log chat to files

//Vote system
msvote_ban_enable 0 //enable ban vote
msvote_ban_time 60 //length of ban from ban vote
msvote_farm_all_day 1 //allow voting for the map the players are on
msvote_kick_enable 0 //allow kick votes
msvote_map_enable 1 //allow map votes
msvote_map_type "all" //"all" or "root" (root for home towns only)
msvote_pvp_enable 0 //allow voting for PvP (resets after map change or subsequent vote)

Thats whats in my server.cfg
 

J-M v2.5.5

BANNED
BANNED
Joined
Feb 26, 2005
Messages
5,675
Reaction score
1
Age
35
Location
Nijmegen, the Netherlands.
Yours looks good... I'm going to post mine, just incase it's useful:
Code:
developer "0"
exec msc_bans.cfg
hostname "J-M's house [FN]"
ip "80.101.42.9"
maxplayers "6"
mp_falldamage "1"
ms_admin_contact "[email protected]"
ms_ban_to_cfg "1"
ms_central_addr "[edited out]"
ms_central_enabled "1"
ms_central_pass "[edited out]"
ms_chatlog "1"
ms_joinreset "1"
ms_pklevel "0"
ms_reset_if_empty "1"
ms_serverchar "3"
ms_timelimit "10"
msvote_ban_enable "1"
msvote_ban_time "60"
msvote_farm_all_day "1"
msvote_kick_enable "1"
msvote_map_enable "1"
msvote_map_type "all"
msvote_pvp_enable "0"
pausable "0"
rcon_password "[edited out]"
sv_aim "0"
sv_cheats "0"
sv_clienttrace "3.5"
sv_downloadurl "http://www.thothie.com/hlserv"
sv_lan "0"
sv_maxspeed "600"
sv_timeout "120"
sv_password "[edited out]"
sv_voicecodec "voice_speex"
sv_voiceenable "1"
sv_voicequality "5"
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
There's a number of possible reasons for this.

For a dedicated server, the most likely explanation (barring viruses or crappy ISP/router) is a QOS networking issue. You can usually circumvent this by placing the HLDS on high priority. One should also likely dedicate the HLDS to the secondary CPU, as it is the one least used. The HLDS is not a multi-threaded application, so this will not impact performance negatively, and in fact, will remove the HLDS of the influence of interrupts (which Windows tosses to CPU0). You can use a task management system such as Prio to automate this process.

On a listen server, the most common cause (again, after viruses and crappy ISP/routers) is the host character having a pack within a pack. This causes an infinite loop, on both server and client side, that can lead to packets being dropped in a rhythmic fashion as you describe. Since, on listen servers, the host and client are locked at the same priority, the effect is much more pronounced than it is on an HLDS. The only way to fix this is to remove the embedded container. (This maybe wise, as eventually we are going to remove the ability to do this, and containers so embedded will simply vanish, along with their contents.)

Badly configured ethernet and crappy ethernet drivers are another common cause. If you have one of the fancier Intel ethernet controllers, one might remove the drivers, then reinstall them without the extra features (driver only, no network management or interlaced LAN features). Make sure you have the latest driver on hand first, however, as you'll have no internet once you've uninstalled the driver.

Another common cause (actually probably the most common, so I shoulda put this first), is a crappy wireless connection. Generally when hosting a server you want to, if at all possible, have a direct cable line to the modem or router (preferably via ethernet - as the USB networking some modems allow is notoriously craptastic for hosting).

Interference from another computer on the network (for instance, one running P2P torrents) is also quite common.
 

A.M.Zinthos!

New Adventurer
Socialist Guild
Joined
Jul 27, 2009
Messages
13
Reaction score
0
Thank you Thothie and JM. I tried all of it and still no good I guess its time to put the blame on my ISP/router while i run a virus scan :p
 

KMakato

New Adventurer
DarkTide
Joined
Jun 5, 2009
Messages
5
Reaction score
0
Age
36
Location
Northeastern US
Quick question. How come no one has mentioned the "sys_ticrate" variable?
Also the use of a "High Resolution Timer"? (don't remember if this was mentioned)

I don't want to say anymore until I find out if there is some reason this hasn't been mentioned :/
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Well, there are possible exploits involved, but we do our best to watch for them on FN and filter out those who have used them (although I notice we seem to have one or two exceptions in that list.) We've also added some measures to prevent this sort of network sploit.

The more practical reason is two fold, 1) There was no sys_ticrate when the original tutorial was written, and 2) the sys_ticrate often provides what can be called "illusionary FPS" - making your system perform much worse, rather than better, which I discovered after some painful research.

The processing delay, that the HLDS provides, is there to give the interrupts time to process requests made by it. If you change the tic rate, even if the HLDS isn't on CPU0, odds are it will not be in sync with the network requests. The result is that the HLDS processes extra frames that are not updated to the clients, as there's no time for the network to receive and forward them. This results in either stuttering, or client and server getting vastly out of sync. So if you have a 1000fps server rate, odds are, about 800 of those are being dedicated to de-syncing your clients. It takes an active metamod plugin, such as Ping Booster, to manage the network connections and avoid this trap. (Although those lucky linux HLDS users have a switch function built in for that - but alas, no one's figured out how to compile the ms.dll over to an .so)

The high res timer isn't required for anything after XP SP2 and has little or no effect, except to sometimes cause this same issue to happen without the tic rate being altered.
 

KMakato

New Adventurer
DarkTide
Joined
Jun 5, 2009
Messages
5
Reaction score
0
Age
36
Location
Northeastern US
Odd.
Well, I do notice that if set to a rate of 450-600 (which gives a readout of 400-550 respectively) the server runs a bit choppier than normal, but set around 200-350 (150-300 readout) it runs smoother than at a default setting of 100 (max 70 readout).
I'm running XP Pro x64 SP2 and if I don't have a timer running, it caps at 103 (+-5 depending on my clock speed), but if I start the timer, it'll jump up to about 50 less than the tic rate is set to, with a max of 550 running (any tic setting above 600 makes no difference {I'm running AMD :3 }).
I don't really see any other way to get it to run above the ~100 FPS that it caps at without changing these things.
I guess the main question is: "Is it a big "NO" to do this far as the possible exploit is concerned?" I haven't the slightest clue as far as that could go, not to mention I'm not interested in doing such a thing :3

Thanks,
-Kmakato
 

Borya

New Adventurer
Blades of Urdual
Joined
Aug 15, 2004
Messages
376
Reaction score
3
Age
37
Location
A glacial palace in the elder forest of the north.
While this may not be the perfect place to post this, I figure one of you guys might be able to help...
When I first set up my listenserver, my server would show up on the master list fine. But then one day, it stopped showing up, and I've never been able to figure out how to get it to show up again. Any ideas on how to fix this?

Edit: Figured out my issue, I think. Changed my sv_region to 255 from 0 and it magically appeared.
 

Hakariaki

New Adventurer
The Dragonknights
Joined
Jul 24, 2009
Messages
156
Reaction score
0
Age
35
my server dosent show up under internet for me, not even lan games now, but it shows under favourits since i added my internal ip adress. but still shows up fine for everyone else.
got sv_region 255 aswell.

dosent really matter for me but still wondering why dosent it show for myself?
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Hakariaki said:
my server dosent show up under internet for me, not even lan games now, but it shows under favourits since i added my internal ip adress. but still shows up fine for everyone else.
got sv_region 255 aswell.

dosent really matter for me but still wondering why dosent it show for myself?

This is an issue that a lot of folks come across, that I've gotten no good solution to myself, as I've never had the issue. *Usually* it seems to be firewall related - be sure all the ports listed in the top page of the tutorial are open.

Ye might also want to check if your master servers are registering properly. There should be at least two. The two I get out here in Cali are:

HLDS said:
Adding master server 72.165.61.136:27010
Adding master server 72.165.61.189:27010

You can also try the somewhat superstitious effort of typing "heartbeat" in console, and seeing if your server registers publicly after that.

ceriux said:
the restarter doesnt work with the new version of hlds.

got it working =)

The restarter works with the current version of the HLDS, provided it is configured to run in console mode (installed as indicated), and not in GUI mode.

However, the restarter isn't as much use in Vista/7 as it cannot override the error handling of those operating systems. Even if you turn the error reporting off in Vista/7, unlike XP, it doesn't actually turn off entirely. You have to manually disable WerFault.exe by switching up permissions and deleting it (and updates may undo this later). Short of that, there's no way to stop the thing from suspending the system and holding all the ports the HLDS would use shut until you click on it. ><
 

ceriux

Adventurer
Joined
Feb 17, 2005
Messages
2,297
Reaction score
5
Age
36
Location
At my computer :)
Thothie said:
ceriux said:
the restarter doesnt work with the new version of hlds.

got it working =)

The restarter works with the current version of the HLDS, provided it is configured to run in console mode (installed as indicated), and not in GUI mode.

However, the restarter isn't as much use in Vista/7 as it cannot override the error handling of those operating systems. Even if you turn the error reporting off in Vista/7, unlike XP, it doesn't actually turn off entirely. You have to manually disable WerFault.exe by switching up permissions and deleting it (and updates may undo this later). Short of that, there's no way to stop the thing from suspending the system and holding all the ports the HLDS would use shut until you click on it. ><

ceriux said:
got it working =)

thanks for the extra info though!
 

Borya

New Adventurer
Blades of Urdual
Joined
Aug 15, 2004
Messages
376
Reaction score
3
Age
37
Location
A glacial palace in the elder forest of the north.
WHO KEEPS MESSIN' WIT MUH GAWT-DAMN PACKETS

ffffffffsc.jpg


I keep getting this on my listenserver. Why the hell is this occurring all of a sudden? And before anyone suggests it, no, it has nothing to do with port forwarding (at least on my end), as I've taken my router out of the equation recently due to an unrelated issue.

Also, there's some REAAAAALLY bad lag lately (completely unplayable at times). On my listen server. With just me on it. Did Blasto move the box that's running FN onto the moon?
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Re: WHO KEEPS MESSIN' WIT MUH GAWT-DAMN PACKETS

The FN server could be on the moon, and it wouldn't cause your server to lag anymore - although it might cause your character to corrupt a bit more often. ;)

The server does not wait for FN to update characters after they are loaded - it just streams out the info periodically and hopes FN gets it.

As for the error - I suspect there be some sort of split CPU issue there, which is also likely causing your lag. Generally that error occurs when the server side and client side timers get horribly out of sync and aren't able to compensate. A difference of -3/466461 is rather astounding though.

I would suggest attempting to strip down your windows. Get yourself down to between 16 and 24 running processes (30 and 43 in Vista). You'll have to do this primarily by eliminating non-essential services, uninstalling superfluous software, and the like. Make sure your HL.exe (or HLDS.EXE) is running at Above Normal or High priority as well - it might help override any QOS issues it's running into with other services. Make sure none of the other processes are running at any higher priority than Normal (and that nothing at all is in Real Time mode - as that may utterly block interrupt requests).
 

Gorynych

New Adventurer
Blades of Urdual
Joined
Dec 31, 2009
Messages
214
Reaction score
0
Age
29
Location
How do I get out of this box?
First time I tried to make a DS from these instructions, it failed. I couldn't see why it may have failed.

Error:
Could not initialize steam

I fixed this by deleting everything I had done, and Restarted the HLDS process. This worked for me, so if anyone gets this error, try re-doing the entire thing.

ALSO

When I did finish that error, it told me that it could not "Locate" ports 27015, I change this to port "27020" This worked absolutely fine.

Hope this helps
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Please note that as of JAN2010, we now include the " steam_appid.txt " with the install. We suggest you copy this file to same folder where the hlds.exe resides, as well as to the valve subfolder, if your server is failing to show up in the browser list.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Running HLDS as a service

So, you want that damned HLDS out of your way? Or perhaps you want to "hide" an MSC HLDS on a family, girlfriend's, or work computer? ^_^ Well, here's how to do that.

First you will need two programs:

instsrv.exe
srvany.exe

These are included in this download: http://www.thothie.com/msc_dev3/run_HLDS_as_service.rar
(You can also download these as part of the Win2k3 Resource Kit)

Unzip these some place on your computer, such as c:\hlds (to be used in this example).

Click Start->Run or go to the command prompt and type:

c:\hlds\instsrv MSC_HLDS c:\hlds\srvany.exe

This will install the srvany.exe as a service named MSC_HLDS, which allows you to treat any program as a service.

Now go Start->Run and enter "regedit"

Open the following key in the left field:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

Search for the MSC_HLDS folder in the left field entry, and open it.

Right click the MSC_HLDS folder, and select New->Key

Name the key "Parameters"

Right click in the right pane, and make the following New->String entries:
appdirectory "c:\hlds\"
Application "c:\hlds\restarter.exe"
(enter these sans quotes)

("c:\hlds\" should point to your HLDS folder. "c:\hlds\restarter.exe" should point to whatever restarter program you use. Regardless of what restart system you use, said program MUST automatically launch the HLDS when it starts. Batch file restarters work with this method as well.)

IMPORTANT: If using Thothie's restarter, make sure that "Start HLDS on Load" is checked!

Go Start->Run and type "services.msc"

Scroll down the list, and you should see MSC_HLDS. Start this service. You can right click on it and change the startup options as well. (Manual start, start with system, etc.)

If you watch the task manager Processes panel (ctrl-alt-delete) you should, in a few moments, see the HLDS.EXE and your restarter.


So, great, now I have an invisible HLDS. How do I get at the console?

First, you'll have to set the rcon_password <your_password_here> in your server.cfg.

Then you can use a server manager program such as HLSW to monitor the server. Or, simply communicate with the server through your client.

I suggest adding the server to your favorites in Steam for quick and easy monitoring, just to be sure it's up on a regular basis.

Fatal errors will still cause pop-ups, but otherwise, the HLDS should be invisible. It will also use slightly fewer resources on the system.

To stop the HLDS, go to services.msc and stop the MSC_HLDS service. Then go to the task manager (ctrl-alt-delete) and end the restarter.exe and hlds.exe processes.




Sent this to a few individuals who asked awhile ago, so I figured time to make a public tutorial. Note, while it seems like a nifty idea, you cannot register the HLDS directly, for the service system will only restart the srvany.exe when it fails (which almost never happens) - and not the HLDS itself.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
If yer having an issue with foos trying to vote in HLDM maps, you can prevent this by deleting them. Delete all BSP's in:
c:\hlds\valve\maps

This cannot be prevented on a listenserver however.

I'll set it up so you can't vote for them in the next patch. Not for security reasons, mind you, but the HLDM maps don't work under MSC at all - as they use the wrong sort of spawn points.

If you need a PVP map, I'd suggest pvp_canyons, or one of the other pvp maps included with the program. Use pvp_arena if you want one with no hide-and-seek opportunities. (Or hell, use char_recover and votepvp, if yer really hard core.)
 
Top