Page 1 of 1

HELP WANTED ...

Posted: Sun Feb 05, 2006 10:09 am
by KoolBear
The DBB and D2X needs you!

We need someone to develop a master tracker for D2X, the DBB will host the tracker, this application will provide the means for any one to host a tracker and report into the master tracker. Obviously I know nothing so you will need to co-ordinate your efforts with Diedel.

At this point in time the server the DBB is hosted on doesn't support perl, this may or maynot change, depending on what Richard Cranium can do.

Our goal is to make the playing of D2X simple and easy, the game already has a built in mission transfer tool. So what more do we need!

A master tracker!

Posted: Mon Feb 06, 2006 6:36 pm
by SirWinner
Mike / Koolbear,

Does the data need to be uploaded to and downloaded from an FTP site?

What sort of data needs to be tracked? Log files or user edited data?

Should one assume that we are talking Text Data as in a sort of new notepad edited file each time that then gets uploaded then read-only upon downloading the multiple text files?

Need a little more information as to the specifications of what you need... Perhaps we could get the ideas down via e-mail and prehash out what exactly is needed before coding anything... then we could resolve this in an effective and timely manner.

If there's anything I can do, let me know.

Don't want to see ANY version of Descent DIE!

:roll:

P. S. I do read my e-mails.

:P

Posted: Mon Feb 06, 2006 7:41 pm
by KoolBear
Now remember I'm not a programmer. Diedel could tell you better.

Currently this is the tracker that d2x uses ...

Code: Select all

#!/usr/bin/perl
# Author: Sebastian \"VEX-Munk\" Starosielec © 2005
# Contact: sebastian.starosielec@ruhr-uni-bochum.de
# License: GNU Public License 
# Server Program
use IO::Socket::INET;
use Data::Dumper;

# Config
my $TIMEOUT;
my $LISTENPORT;

$TIMEOUT = 30;
$LISTENPORT = 9424;

# Create a new socket
$InSocket = new IO::Socket::INET->new(LocalPort=>$LISTENPORT,Proto=>'udp');
print \">> Server Program <<\\n\";
%Tracker=();

# Keep receiving messages from client
while(1) {
	$InSocket->recv($Message,8);
	print \"Incoming Message: \", $Message , \"\\n\";
	if ($Message =~ /^S/) {					# incoming Message from Server: store Message in List
		print \"Message from Server\\n\";
		$key = $InSocket->peeraddr() . chr(int($InSocket->peerport() / 256)) . chr($InSocket->peerport() % 256);
		$Tracker{$key} = time();
		print Dumper(\\%Tracker);
	} elsif ($Message =~ /^R/) {	# incoming Message from Client: read Message from List
		print \"Message from Client\\n\";

		# Updating Tracker list, delete old Tracker Entries
		while ($key = each(%Tracker)) {
			print \"Differences \", $key, \": \", time() - $Tracker{$key}, \"\\n\";
			if (time() - $Tracker{$key} > $TIMEOUT) { #Timeout ?
				delete $Tracker{$key};
			}
		}

		# Creating Response
		$Count = keys(%Tracker);
		print \"Count: \", $Count, \"\\n\";
		$Response = \"S\" . chr($Count);
		while ($key = each(%Tracker)) {
			$Response .= $key;
		}		
		$Response .= \"\\x00\" x (512 - length($Response));
		
		print \"Length Response: \", length($Response), \"\\n\";
		$InSocket->send($Response);		
	}
}
If I understood Diedel correctly we need a similar application that is housed here at the DBB. This Master Tracker would reside here and run as a service or simliar level.

When a player selectes Multiplayer in D2X then the game locates the requests hosted games that the tracker has received from all the client trackers and returns this information to the game so the user can select from ALL available games.

Hopefully this could incorporate the DXX (D1) effort as well. I have sent an email to that team.

KB

Posted: Tue Feb 07, 2006 9:45 pm
by fliptw
Diedel needs to post the server/client info packets. That just tells potential clients the IP's of the servers; wouldn't it be nice to view who's playing on which server on the web?

Its not that hard to translate the above to work in PHP. It depends on how the DBB server is set up, if you really want to host it here.

Posted: Wed Feb 08, 2006 6:40 am
by Valin Halcyon
Remember Kali? Might anyone remember the packet data it used? There ya go.

The UDP networking in D2X-XL is the old kali_IPX wrapper. It's basically a UDP transport over an arbitrary port that you can specify or let search the server IP for whatever port responds. After that, It's the same as IPX...sockets and all.

Posted: Wed Feb 08, 2006 10:21 am
by Diedel
The above perl code is the code of the D2X-XL tracker VEX-Munk had created for me. It is a very simple application with an extremely simple protocol. The tracker communication protocol is described in detail here: http://www.descent2.de/d2x-tracker.html.

KB and I have been talking about a 'master tracker' where all available trackers would register. That way, D2X-XL could simply query the master tracker for currently available trackers and then query these trackers for available game hosts.

Actually the current D2X-XL tracker code could be used for a master tracker too. It would only need to be expanded by a function that would report itself to a master tracker.

Posted: Sun Feb 12, 2006 4:42 pm
by SirWinner
Ah... Now the picture becomes clear.

Sad part is I don't know perl yet.

Looks like the basic idea is posted via the link that Diedel posted above.

Simple send and receive of small packets on host and client sides it seems.

8)

Posted: Sun Feb 12, 2006 4:47 pm
by KoolBear
SirWinner,

That's teh problem our current hosting arrangement doesn't provide for perl support! I

And I haven't been able to pin RC doen on a commitment to support it either.

So we really need a php application like the one above, it can access a database that we setup for it.

Posted: Mon Feb 13, 2006 8:53 pm
by pATCheS
Why have multiple trackers, why not just use the DBB? Or is that the idea?

If you could make D2X-XL spit out HTTP requests, it wouldn't be hard to write a PHP script to generate a listing. And to post a game on the list, send parameters in the request and the script will mark the time the game was added and the last time it reported, and it can weed out old requests the next time a list is requested. It would be very simple this way, and it'd work through any connection that allows port 80.

Maybe there should be a way for the PHP script to try talking back to the client to test for connectivity? That way there's no more second-guessing what the issue is when someone can't join your game.

Edit: There is a way. :)

If the connectivity check fails, is there any way to color the entry red on the game list?

Posted: Tue Feb 14, 2006 4:15 pm
by KoolBear
pATChes,

Great!

Diedel and I were thinking the DBB would act as a \"Master Tracker\" or a place that other trackers could phone home to. The D2X-XL would only have to call the dbb to get a response from all available trackers.

If this is something you could work out then I need to get you and Diedel working together on this.

Thanks!

KB

Posted: Thu Feb 16, 2006 8:27 am
by pATCheS
I can't work on it for probably something like two weeks, give or take some. Moving to southern California on the 22nd.

The multiple trackers idea isn't a particularly good one, there's no real need for it, and getting the trackers to stay synced up with one another would have a lot of caveats and increase bandwidth usage. Better to just use the DBB as the only tracker, but still keep support for custom-defined trackers. Not that bandwidth is a concern, D2 is very low volume, but that's why it's silly to have support for multiple simultaneous networked trackers. I'd say have two trackers running identical software that clients report to/request from independently, so that if one goes down, the other is still there, and no one playing the game notices short of perhaps a notification window.

Posted: Fri Feb 17, 2006 11:30 am
by Diedel
patches,

the multiple trackers idea works differently.

There would be a master tracker where every server tracker somebody sets up somewhere would register. I would hardcode the master tracker address in D2X-XL, or would put it into the d2x.ini you download together with D2X-XL.

D2X-XL would query the master tracker for available trackers, and would then query these for available game hosts.

That way, no client would need to bother with adding a tracker entry to d2x.ini, and you wouldn't need to get notified or find out about its IP address.

To make this work, the current tracker code would need a very simple modification, making it send a registration request to the master tracker.

That's all.

On the other side can a tracker hold 80 server entries, and I doubt there will be more worldwide at any given time ... so having a regular tracker on the DBB server and me putting its address in d2x.ini is certainly sufficient for the time being. As the tracker only helps to make the initial contact of host and client, it being far away from a host or client wouldn't create a performance hit (lag) on D2X-XL UDP/IP multiplayer games.