Master Server
#1
Would any developer like to help me with setting up a master server?
Anything about compiling, configuring, and running?
One thing I'm not sure of is the IP address to use when running. I assumed it was my LAN IP that I wanted to bind to.
Another thing I don't know is what to put in the "master.cfg" file. The only options I think I could find were to ban people.
I would also like to know if there is an option for more verbose logging. The log file isn't showing very much.
Any information is appreciated.
Thanks given by:
#2
(01 Aug 11, 11:46PM)Mashuu Wrote: compiling
Assuming you're on a decent OS: cd source/src && make master && cp ac_master /some/where
Otherwise, IIRC the CodeBlocks project that comes with AC has a build configuration for the master.

(01 Aug 11, 11:46PM)Mashuu Wrote: configuring
Command line options are
ac_master /working/dir port ip
/working/dir is where master.cfg is and master.log will be. You can probably leave out port and IP.
In master.cfg, you can define bans (ban, servban, gban) and add auth keys.

(01 Aug 11, 11:46PM)Mashuu Wrote: and running
Should be straightforward, see above.

(01 Aug 11, 11:46PM)Mashuu Wrote: One thing I'm not sure of is the IP address to use when running. I assumed it was my LAN IP that I wanted to bind to.
Unless you have multiple network interfaces, you shouldn't have to bind anything.

(01 Aug 11, 11:46PM)Mashuu Wrote: I would also like to know if there is an option for more verbose logging. The log file isn't showing very much.
You'd have to modify the source code. It already logs server registration (and failure) and auth operations. I mean, what else would you want?

Thanks given by:
#3
Yes, I got it to compile using "make master", but wasn't sure if there was anything else to know.

I also got it to run using "ac_master /working/dir port ip". If I leave out the IP, or set it to my external IP, it tells me it fails to create a socket. I just wasn't sure if I was supposed to use the external IP or internal. The only COMMANDs I saw were for banning and auth, but I wasn't sure that was all available, and I don't know the exact syntax for these in master.cfg.

Hmm, the only thing being logged for me is failure to run and successful runs. Any idea why this might be? Also, it is only logging to the logfile and the logfile only updates after I stop the master server. Any way to make it log to the terminal/command prompt?

Sorry if these questions are ridiculous, but it would be easier if there were docs.

I'm also wondering about the compatibility with v1.0, how could I make this work with previous versions? Or if there was a different type of master server for 1.0, how can I run that? I read the README.txt in the 1.0 CubeMS directory and it says you need some knowledge of IIS 5+, MSSQL and ASP.NET to make any use of it, and I don't know about those things. Any help to get that setup, or other options?
Thanks given by:
#4
(02 Aug 11, 12:00PM)Mashuu Wrote: If I leave out the IP, or set it to my external IP, it tells me it fails to create a socket.
You're right, I confused it with the Sauerbraten master server, which sets the IP automatically if you don't set it. In this case, your internal IP should work.

(02 Aug 11, 12:00PM)Mashuu Wrote: and I don't know the exact syntax for these in master.cfg.
ban 1.2.3.4
bans that IP (in this case 1.2.3.4) from accessing the master server, same for servban (bans that IP from registering a server) and gban (bans that IP from game servers)
clearbans
removes all bans
adduser name pubkey
adds an auth user with that name and public key (generated with /genauthkey), can then be used to auth on servers using /auth
clearusers
Clears all previously defined users

(02 Aug 11, 12:00PM)Mashuu Wrote: Hmm, the only thing being logged for me is failure to run and successful runs. Any idea why this might be?
Because I told you some nonsense up there. I confused to-server output with logging... You're right, it only logs master startup, auth attempts and log reloading.

(02 Aug 11, 12:00PM)Mashuu Wrote: the logfile only updates after I stop the master server.
That's probably an issue with output buffering. What OS?

(02 Aug 11, 12:00PM)Mashuu Wrote: Any way to make it log to the terminal/command prompt?
Not without source modification. Except tail -f master.log, of course.

(02 Aug 11, 12:00PM)Mashuu Wrote: Sorry if these questions are ridiculous, but it would be easier if there were docs.
They're not ridiculous. But re docs: I think you're the first who ever asked about this stuff. It just wouldn't pay off to write docs :P


(02 Aug 11, 12:00PM)Mashuu Wrote: I'm also wondering about the compatibility with v1.0, how could I make this work with previous versions? Or if there was a different type of master server for 1.0, how can I run that? I read the README.txt in the 1.0 CubeMS directory and it says you need some knowledge of IIS 5+, MSSQL and ASP.NET to make any use of it, and I don't know about those things. Any help to get that setup
"IIS 5+, MSSQL and ASP.NET"... I won't (and can't) help you with that. :P
The old master system was based on HTTP. You could either write your own master for that (using e.g. an FCGI application, a self-contained server or even a PHP+MySQL combination), or adapt the new master server to accept HTTP requests.

Thanks given by:
#5
Oh, well then the master.cfg is easy enough then :P

I'm currently running it on Windows 7 Home Premium 64-bit but hope to switch it onto my linux.

It just seems strange to me that nobody would ask anything about the master server. Sure you can manually connect to servers, but the list just makes it so easy to find them and it's a pretty big part for people. Of course there's the default master server, but it's only one. Oh well.

Yeah, I didn't really want to get into all that. I remembered the old master server was http, and my ISP blocks port 80. I suppose I could try a different port. But I figured it would be better to try and make the new master server work with 1.0. I'm afraid I don't know enough C++ for this though, as I don't even know all the basics. I don't think I would have so many questions if I could read the source code better too. XD
Thanks given by:
#6
(02 Aug 11, 07:20PM)Mashuu Wrote: I'm currently running it on Windows 7 Home Premium 64-bit but hope to switch it onto my linux.
That's probably the cause of the logging issues. You could try commenting this line
setvbuf(logfile, NULL, _IOLBF, 0);
in master.cpp (don't forget to recompile).

(02 Aug 11, 07:20PM)Mashuu Wrote: Of course there's the default master server, but it's only one. Oh well.
Well, virtually everyone uses this one. Since you can't use multiple master servers at once, such concentration is inevitable.

(02 Aug 11, 07:20PM)Mashuu Wrote: I suppose I could try a different port. But I figured it would be better to try and make the new master server work with 1.0.
Unfortunately, port 80 is hard-coded. Btw, are you sure you need a master server for 1.0? ;)
Thanks given by:
#7
I tried commenting the line, recompiled, and ran it, but it still didn't show anything, like success or failure to run, in the logfile until I closed the master server.

Hmm, well I don't need a master server for 1.0, but someone asked if I could and I thought it would be cool to try. I thought I've heard of other 1.0 master servers being made. Like in PHP or Perl or Java. I guess if it's all HTTP on port 80 I can't host here anyways because of my ISP. I could try to host on a friends though..
Thanks given by: