HELP WANTED ...

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
KoolBear
DBB Co-Founder
DBB Co-Founder
Posts: 10132
Joined: Thu Nov 05, 1998 12:01 pm
Location: Houston, TX USA
Contact:

HELP WANTED ...

Post by KoolBear » Sun Feb 05, 2006 10:09 am

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!
User avatar
SirWinner
DBB Fleet Admiral
DBB Fleet Admiral
Posts: 2700
Joined: Thu Nov 05, 1998 12:01 pm
Location: Oklahoma City, Oklahoma, United States of America
Contact:

Post by SirWinner » Mon Feb 06, 2006 6:36 pm

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
User avatar
KoolBear
DBB Co-Founder
DBB Co-Founder
Posts: 10132
Joined: Thu Nov 05, 1998 12:01 pm
Location: Houston, TX USA
Contact:

Post by KoolBear » Mon Feb 06, 2006 7:41 pm

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
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6415
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw » Tue Feb 07, 2006 9:45 pm

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.
Valin Halcyon
DBB Admiral
DBB Admiral
Posts: 1102
Joined: Sun Jan 02, 2000 3:01 am

Post by Valin Halcyon » Wed Feb 08, 2006 6:40 am

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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel » Wed Feb 08, 2006 10:21 am

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.
User avatar
SirWinner
DBB Fleet Admiral
DBB Fleet Admiral
Posts: 2700
Joined: Thu Nov 05, 1998 12:01 pm
Location: Oklahoma City, Oklahoma, United States of America
Contact:

Post by SirWinner » Sun Feb 12, 2006 4:42 pm

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)
User avatar
KoolBear
DBB Co-Founder
DBB Co-Founder
Posts: 10132
Joined: Thu Nov 05, 1998 12:01 pm
Location: Houston, TX USA
Contact:

Post by KoolBear » Sun Feb 12, 2006 4:47 pm

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.
pATCheS
DBB Ace
DBB Ace
Posts: 187
Joined: Sat Apr 03, 2004 9:12 pm
Contact:

Post by pATCheS » Mon Feb 13, 2006 8:53 pm

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?
User avatar
KoolBear
DBB Co-Founder
DBB Co-Founder
Posts: 10132
Joined: Thu Nov 05, 1998 12:01 pm
Location: Houston, TX USA
Contact:

Post by KoolBear » Tue Feb 14, 2006 4:15 pm

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
pATCheS
DBB Ace
DBB Ace
Posts: 187
Joined: Sat Apr 03, 2004 9:12 pm
Contact:

Post by pATCheS » Thu Feb 16, 2006 8:27 am

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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel » Fri Feb 17, 2006 11:30 am

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.
Post Reply