Running Multiple Servers

For all the help you need with Armagetron!
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Running Multiple Servers

Post by sinewav »

I'm not satisfied with the three "How to Run Multiple Servers" pages on the wiki. The Ubuntu one is closest to how I want to set it up on my Ubuntu server at home. The problem with all three sets of instructions is that the final setup does not allow me to use custom AI for the servers, or creates a lot of unnecessary complexity in the process.

After looking over ./configure --help, I'm a bit confused about the relationship between settings. I wouldn't mind some feedback on how to set the flags for a directory that looks something like this:

Code: Select all

/armagetronad-version
  /bin
  /servers
    /server-1
      /etc
      /logs
      /resource
      /var
    /server-1
      /etc
      /logs
      /resource
      /var
  /start-stop-scripts
I can write the start-stop scripts myself based on the examples on the wiki. I just don't know how some of the configure flags affect others. For instance, if you --disable-sysinstall is it also necessary to --disable-useradd? Do I need a user? How about --disable-etc?
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2342
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: Running Multiple Servers

Post by compguygene »

As to the compile flags, if you just keep it simple like this:

Code: Select all

./configure --prefix=/home/compguygene/aa --enable-dedicated --enable-armathentication
The --enable-dedicated is really the only flag you need to set the flags appropriate to build the dedicated server. The --prefix=/whatever-this-directory-is/armagetronad-version will cause the proper files to go into the directory structure that you have identified. Commands like --disable-etc would be used in a more granular way, though I am not exactly certain how as I have never used it.
You can use the script on the wiki page you referenced to have a custom ai. I used the same script myself to host your old servers with custom ai's and others with different ai's. You just have to make one change.

The following line is from the srv script which actually starts the server

Code: Select all

$tron --resourcedir $resourcedir --userconfigdir $userconfigdir --vardir $vardir
You need to add the --userdatadir parameter to the command to specify where to find things like custom languages and your own aiplayers.cfg.

Code: Select all

$tron --resourcedir $resourcedir --userconfigdir $userconfigdir --vardir $vardir --userdatadir /whatever-this-directory-is/armagetronad-version/servers/"$1"/
This will create a directory called resource under the servers/server-1 directory. That is where the aiplayers.cfg file will go.

All of this, by the way assumes that you are using .2.8.x servers. .4 servers are similar, but no longer use the var directory and put everything in that resource directory. So, watch for that as you experiment, things might be different in a new .4 build. I would take the time to verify this behavior better for you, but I let my old vps expire as I was unsatisfied with its performance and I will be getting a new one very soon, just not yet.
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Running Multiple Servers

Post by Light »

If you still have it set up like in my tutorial you should be able to put it at ...

Code: Select all

/home/USERNAME/armagetronad/servers/SERVER/config/aiplayers.cfg
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Running Multiple Servers

Post by sinewav »

compguygene wrote:You need to add the --userdatadir parameter to the command to specify where to find things like custom languages and your own aiplayers.cfg.
Are you sure? I just want to know definitively that --userdatadir will override anything in /etc/armagetronad. This is really what it all comes down to. I want to know which flags will override root directories and what files go where. The names of the flags are not intuitive.
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2342
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: Running Multiple Servers

Post by compguygene »

Yes. I am sure. I searched the forum for the forum thread where I had a discussion with Z-Man about this very topic, but I just couldn't find it. --userdatadir will let you sub your own aiplayers.cfg for example. But if you don't have one, the default will be used. I agree with you that the names of the flags are not really intuitive. Having started to dig into the code some, I can see that the names relate to the code, not the user experience. But, this is pretty typical unix-like stuff, and handy when a programmer is relating the code to what happens. As I stated, this is what I had to do to run your old servers, like tron arcade, that have a custom aiplayers.cfg. So, I know that it works. When I get my new VPS and set it up, I will post on this topic and report exactly how .4 works. I have an idea for a .4 server that I am going to play with.
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2342
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: Running Multiple Servers

Post by compguygene »

Sine, I wanted to take this opportunity to give you what may be a better ./configure command than the one that I gave you earlier. I am going to run a few servers from a home pc too, and when I ran the configure command that I gave you, I realized that I should have included the following paramaters to not bother having arma make initscripts since we won't be using them and to keep everything only in the directory structure specified.

Code: Select all

./configure --prefix=/home/compguygene/aa --enable-dedicated --enable-armathentication   --enable-automakedefaults --disable-useradd --disable-etc --disable-initscripts
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
User avatar
/dev/null
Shutout Match Winner
Posts: 819
Joined: Sat Sep 04, 2004 6:28 pm
Location: Chicago-ish

Re: Running Multiple Servers

Post by /dev/null »

Ive always found it silly that all that stuff is hardcoded into the binary. Seems simpler to just look where its run and use the configs there, if none, create defaults. Would save a lot of pointless wasting of our times.

And before one of you whiners gets all butthurt, yes, I know you can build it that way, but we dont, almost no one does.
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2342
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: Running Multiple Servers

Post by compguygene »

Some of us actually like having control over where the config files go and like the flexibility the devs have left. You would be surprised how many server admins build from source and specify the details of where stuff goes. It makes things easier to control. Of course, you can opt to just use the .deb in debian/ubuntu to run the dedicated server and the choices that the package maintainer made.
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Running Multiple Servers

Post by Light »

compguygene wrote:Some of us actually like having control over where the config files go and like the flexibility the devs have left. You would be surprised how many server admins build from source and specify the details of where stuff goes. It makes things easier to control. Of course, you can opt to just use the .deb in debian/ubuntu to run the dedicated server and the choices that the package maintainer made.
Completely correct. Especially for those of us building from multiple sources and keeping separate clients. I like having everything in one tidy folder (with a couple subs of course). All organized in one place. Even my run script keeps things like my user file and screenshots in there so I don't have to go looking. It's very convenient.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Running Multiple Servers

Post by sinewav »

I can't help feeling some of these flags are redundant, or override others. Someone please explain the difference between:

--prefix
--exec-prefix
--program-prefix

Thank you.
Last edited by sinewav on Wed Aug 19, 2015 3:55 am, edited 1 time in total.
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Running Multiple Servers

Post by Light »

They seem to be setting the paths for different files, though I'm not sure what architecture-(in)dependent files would be there. Not sure which would be which since I've never differed the paths.

As for program-prefix, I'm not sure. Seems like an option to allow you to set a prefix on the file names rather than just the path.

Code: Select all

--prefix=PREFIX         install architecture-independent files in PREFIX [/usr/local]
--exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX [PREFIX]
--program-prefix=PREFIX            prepend PREFIX to installed program names
User avatar
Z-Man
God & Project Admin
Posts: 11587
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Running Multiple Servers

Post by Z-Man »

--exec-prefix indeed overrides --prefix for the files it affects. Data files go to what --prefix says, executables go to what --exec-prefix says or if that is not set, to what --prefix says.
--program-prefix and --program-suffix would allow you to have your executable called prefix-armagetronad-suffix. But those two are automake default things that we don't support.

The default build can run right where you compile it and use the data without installation, just do 'make run'. We use that all of the time in development. And every installation is directly movable, you can give 'make install' some environment variable (forgot which) and it'll install the whole tree there. Still, the best way to run multiple servers is what compguy suggests, as long as they're supposed to use the same code: use the --userdatadir etc. command line arguments.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Running Multiple Servers

Post by sinewav »

Thanks for everyone's help so far. I have almost got this machine running correctly. As it turns out, the flag that overwrites aiplayers.cfg is --userconfigdir, not --userdatadir, which kinda makes sense. I now have a setup that is a combination of all three wiki pages dedicated to this subject, haha. Stupid open source programs and all that ridiculous "freedom" as in "free to be frustrated with so many customization options."

I'm having a little trouble learning screen, but I'll get there.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Running Multiple Servers

Post by sinewav »

95% done. Servers can run and be found by the master. However, I have a couple questions about authentication.

1) How do I solve "Server address mismatch" where my LAN IP is different than my forward facing IP?

2) I installed zthreads, but authentication still happens between rounds instead of immediately. What to do?


Note: I probably don't need authentication, but I want to understand it. If I can't get it working I can always go back to using ADMIN_PASS, right?
User avatar
aP|Nelg
Match Winner
Posts: 621
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: Running Multiple Servers

Post by aP|Nelg »

sinewav wrote:2) I installed zthreads, but authentication still happens between rounds instead of immediately. What to do?
If you install zthread, you'd have to recompile tron in order for tron to pick it up. Might be good to rerun ./configure too
Post Reply