That blog does not exist

Game Development Community

Master Server Prototype

by Thomas \"Man of Ice\" Lund · 06/30/2004 (5:59 pm) · 43 comments

Download Code File

Due to popular request (1-2 people in IRC ;-) ) I'll pull this one out of the moth ball closet and post as a resource. Easier to find here.

This was originally "released" in the forums here ages ago.

I also want to point your interest to several other master server implementations available.

First the PushBotton Labs one
www.pblabs.com/download.php

And the one in OpenTNL (although not TGE compatible out of the box)
opentnl.sf.net

All you need to do (besides running the Perl code) is to change your client\prefs.cs file with the ip+port of your master server
$pref::Master0 = "2:master.garagegames.com:28002";
and server\defaults.cs
$pref::Master[0] = "2:master.garagegames.com:28002";
for the server to report to the master server

No filtering or anything is supported. This is purely meant as a proof of concept implementation.
Page «Previous 1 2 3 Last »
#1
06/30/2004 (9:41 pm)
My my, being productive aren't we :D

Thomas, I followed the original thread with a keen eye, to bad you haven't had any time to put in any more work in this.
Any plans to add stuff like filtering later ??
#2
06/30/2004 (11:46 pm)
Hehe - the secret plan is to have all 5 code snippits displayed in my name ;-)

Nah - honestly. A few guys on IRC yesterday didnt know there existed any master servers besides the original one, and didnt know there was one in TNL either.

There is no plan to further add on this at all. Its a very simple, easy to read and clean little implementation that exactly shows how the protocol works.

For anyone interested in filtering, check out your serverConnection.cc and .h - the relevant protocol parts are clearly labelled, and extremely easy to add to the perl master server.
#3
07/01/2004 (3:56 am)
zip file (c3masterserver.zip) is not found.
#4
07/01/2004 (4:01 am)
Re-uploaded.....I thought they had fixed this
#5
07/02/2004 (5:05 am)
That was a spiffy little master server. Had a bug or two in it, but we ran it during development of Lore for a long time.

Cool stuff.
#6
07/08/2004 (9:41 pm)
Just wondering but is it possible to run this perl code on a web server also hosting a website. I know I asked Ed this before but I forgot the exact response.
#7
07/08/2004 (10:46 pm)
Yes - very easily. It doesnt run on any port occupied by other programs. If its a unix/linux server and you have "screen" installed, then simply type

screen c3masterserver.pl

once its started type

ctrl-a ctrl-d

and the screen is exited, but running in the background.

Reattach to the process by typing screen -r
#8
07/10/2004 (1:58 pm)
Hey Thomas,
Is this possible to setup if screen isn't installed?
#9
07/10/2004 (2:18 pm)
Sure - but if the server needs to run while you aren't logged in, then you will need to wrap it up in some daemon service or start it in the logon scripts.

Start the program and its answers queries - but when you log out of the machine, the service will stop unless you do something about it - screen is a program that keeps your process connected to you even while not logged in. In itself screen has nothing to do with the master server
#10
12/08/2004 (8:45 pm)
Thank you!
This resource works great!
#11
12/25/2004 (4:11 pm)
How do you run the perl?
#12
12/25/2004 (11:28 pm)
On Linux/Unix you need to do chmod a+x on the program, and then simply start it

On windows you install e.g. activestate perl, and then just double click on the program. Not much to it
#13
12/26/2004 (8:32 am)
I have Mac OS X.
#14
12/26/2004 (11:54 pm)
Perl is a programming language, so you will need to find and download a Perl interpreter for Max OS X. Since OS X is basically a BSD unix system, I could not fathom Perl not existing for it.
#15
01/25/2005 (4:02 pm)
for those of you who still need to know how to start it in linux and leave it runing type

nohup ./app here &

that logs all output to hte nohup file very handy for debugging ;)
#16
01/25/2005 (4:43 pm)
Hmm im seeming ot have troubles quierying the master server I have it running localy on a windows box and this is my line

$pref::Master[0] = "2:127.0.0.1:7777";

when i create a server though i get no output from the master server.
#17
12/17/2005 (10:19 pm)
I got it to run, but I have a friend trying to connect, and it won't find it. It never even goes to "Ping Server" in Torque. I copied all the code correctly...
#18
09/28/2006 (1:42 pm)
Thanks Thomas! I have had this in my resource bookmarks for a long time. Implemented it recently with no problems!

For those that are wanting to have this run every time they reboot their server (if they are running a standard red hat enterprise server), here is a tip:

You can give the file execute rights (just set permissions on the file) and add the following to the
/etc/rc/d/rc.local file. The rc.local file is executed on boot.

/{full directory path to your file/c3masterserver.pl &> /dev/null &

I changed the file name to .cgi instead of .pl to get it to recognize by the linux install of perl without modifications.

This starts the program and redirects stdout and stderr to /dev/null (&>
/dev/null) and tell the program to run in the background (the trailing
&) without an active terminal. If you want to capture the output of the
program change /dev/null to the file name.

This will get your master server up and running in a little more stable fashion (it comes back up after a reboot).

Good Luck!
#19
03/04/2007 (4:11 pm)
Anyone have this working with TGE 1.5?
#20
03/04/2007 (6:47 pm)
I can't get this to work with TGE 1.5 - has anybody gotten it to work with TGE 1.5?
Page «Previous 1 2 3 Last »