SRCDS Steam group


2 L4D servers on same machine
#1
Hi!
Im trying to host 2 L4D servers on my new server running Ubuntu, runs on a Core 2 quad witch 8gb of ram, using a VM for the L4D server...

Im starting the server with: screen -A -m -d -S l4d-server ./srcds_run -console -game l4d +map l4d_vs_hospital01_apartment +maxplayers 14 -autoupdate

to get screen and such... now how do I do to start server 2 on the same VM but I want server 2 to use a diffrent server.cfg...
is this possible without make 2 l4d dir's?

thanx
Reply
#2
you can us the -fork cmd not exactly how to use it but it goes in your cmd line
Reply
#3
you can put +exec server1.cfg and +exec server2.cfg in your command line for each server
Reply
#4
So
since he wants to run two servers, he should run in cmd
-fork 2

and for two server.cfg

+exec server1.cfg +exec server2.cfg

conclusion

Code:
./srcds_run -game left4dead -console -autoupdate +maxplayers 8 -fork 2 +exec server1.cfg +exec server2.cfg

is that correct?? what about the ports.
Reply
#5
ok, so I can leave the server.cfg empty and use +exec server1.cfg to make the server use certain cfgs, nice, and then I guess I just use +port and have two diffrent ports for the diffrent servers ofc.
ty very much! will try this out!
Reply
#6
Code:
./steam \
+clientport 27005+## \
+hostport 27015+## \
+exec server_cfg##.cfg \
+map l4d_vs_hospital01_apartment \
+ip a.b.c.d \
-steamport 27690+## \
-fork 4 \
-netconport 90## \
-netconpassword password \
-game left4dead \
-autoupdate \

Will start 4 left4dead servers, leave off the netcon stuff if you don't know what it is or aren't going to use it. The config files start at 01, ie. server_cfg01.cfg is the first server. Dunno if they ever fixed the bug they had with forked servers not starting properly unless you specified a map in the start up line, however it doesn't hurt anything to include it.
Reply
#7
Firefox005 Wrote:
Code:
./steam \
+clientport 27005+## \
+hostport 27015+## \
+exec server_cfg##.cfg \
+map l4d_vs_hospital01_apartment \
+ip a.b.c.d \
-steamport 27690+## \
-fork 4 \
-netconport 90## \
-netconpassword password \
-game left4dead \
-autoupdate \

Will start 4 left4dead servers, leave off the netcon stuff if you don't know what it is or aren't going to use it. The config files start at 01, ie. server_cfg01.cfg is the first server. Dunno if they ever fixed the bug they had with forked servers not starting properly unless you specified a map in the start up line, however it doesn't hurt anything to include it.

oh nice man!
Reply
#8
By specifying +exec server##.cfg in the command line, will this cause the server to run this file every time the map changes? I haven't gotten it to work yet, though. It still loads my default, server.cfg.

Additionally, since you still have to specify the starting map, can you just change the map in one or both of the configs to make them start on different maps?

UPDATE: Got it working. I didn't know I had to rename or delete my default config file. Still wish I could set different maps by default though...
Reply
#9
FearedAtheist Wrote:By specifying +exec server##.cfg in the command line, will this cause the server to run this file every time the map changes?

As you've already found out: No, the server##.cfg runs only once, at initial server start. Then all of your servers use the standard server.cfg at every mapchange. If you really want to have the individual cfg files executed at mapchange, then I have constructed the following "workaround":

First create the individual config files for each server. You can name them (almost) anything you'd like. For convenience, I just call them server01.cfg, server02.cfg etc. Just be sure NOT to use the standard server.cfg. Put anything you'd like into these.

Next, create small files to be executed from the startup commandline. I call them run01.cfg, run02.cfg etc. These have to be numbered sequentially. These files only contain one single line each. This one:

alias loadservercfg "exec server01"

Replace server01 with whatever you called the real server config files above. Run02.cfg should of course refer to server02, or whatever you called the file for the second server. And so on.

Now create a server.cfg file with this one line in it:

loadservercfg

Finally, the server startup line should include +exec run##.cfg (instead of +exec server##.cfg).

The trick is that every server always executes server.cfg, but each server instance can have different aliases. So I use the runXX.cfg to define an alias that executes the specific server config file. This way server.cfg executes different serverXX.cfg files depending on which server calls it.
Reply
#10
Very clever!

The only issue I see here is that having a server.cfg to begin with caused my servers to load that over even the command line execs. So if that's the case then it will call loadservercfg before the aliases are created. I will try it, though.

Thanks, man.
Reply
#11
Works! Thanks again.
Reply
#12
Very elegant solution!

A question:

Since valve doesn't allow to specify start map per fork and sourcemod bails out if you change map in the server cfg, how do you set the server to versus or co-op?

My approach is to set the variable

director_no_human_zombies 0 //versus server 0, normal 1

It seems to set the server to the correct mode at least even if the start map is a co-op map.
Reply
#13
You can specify in your server_cfg##.cfg different mapcycle files to use for each server. Simply add the line:

mapcyclefile <mapcyclefilenamehere.txt>

and inside that file you add the maps that you want on the server, if you only have vs maps it will be a versus server.
Reply
#14
Firefox005 Wrote:You can specify in your server_cfg##.cfg different mapcycle files to use for each server. Simply add the line:

mapcyclefile <mapcyclefilenamehere.txt>

and inside that file you add the maps that you want on the server, if you only have vs maps it will be a versus server.

Ok, so I have created

mapcycle_vs.txt
Code:
l4d_vs_farm01_hilltop
l4d_vs_hospital01_apartment

missioncycle_vs.txt
Code:
farm_vs
hospital_vs

and my server_xx.cfg contains

Code:
mapcyclefile mapcycle_vs.txt
missioncyclefile missioncycle_vs.txt

But the command line argument contains a co-op map since my other fork is a co-op server.

At which point in time will the server change map from the default non-vs map?

When I query the server it states that is is in versus mode and has 8 slots, but the map is still set to the one given at the command line.
Reply
#15
It says mapcyclefile and missioncyclefile are unknown commands.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)