Fsockopen + Huffman

Aabra

New Member
Messages
3
Reaction score
0
Points
0
Hey, I'm trying to create a web based server browser for a popular Doom port called Skulltag. There are lots of normal browsers for it but no web-based (PHP) ones. I'm a bit confused however in how to go about using Huffman compression in combination with php. Every time I attempt to connect to the Skulltag Master server to retrieve the list of server ip addresses with fsockopen I get an error 111 connection refused. Should I even be using fsockopen for this? Eventually I'm going to have to connect to each server to get its information (what map, how many players, etc..) but first things first I need to get the list of ip addresses from the master. How should I go about doing this?

Skulltag Master Server:

skulltag.servegame.com:15300

==========================
SKULLTAG Launcher Protocol
==========================

Version 0.2 by Rivecoder ~ April 9, 2008
-----------------------------------------

There's been a lot of demand for our launcher protocol by people who would like to create their own custom utilities and launchers. Well, we've decided to release this publicly, so here it is!

** Definitions
*********************************************************************************
All Skulltag servers and masters use UDP as their protocol.
Definition of types:
Byte: 8 bit integer
Short: 16 bit integer
Long: 32 bit integer
Float: Long representation of a float

** Huffman
*********************************************************************************
All Skulltag network traffic uses Huffman compression. You'll need a copy of huffman.cpp or huffman.java to encode and decode your traffic appropriately.

** Getting the list of servers
*********************************************************************************
This is very easy, accomplished by sending a single long to the server:

Type Value Description
-------------------------------
Long 199 Launcher challenge

The server will respond, either with:

Type Value Description
-------------------------------
Long 0 Beginning of list
Byte 3 Denied; your IP is banned
Byte 4 Denied; your IP has made a request in the past 10 seconds

Assuming you were accepted, you get this next block, which is repeated for every server.

Type Value Description
-------------------------------
Byte 1 Beginning of server
Byte 0-255 IP octet
Byte 0-255 IP octet
Byte 0-255 IP octet
Byte 0-255 IP octet
Short 0-65535 IP port

Finally, the response should end with this:

Type Value Description
-------------------------------
Byte 2 End of list
 
Top