Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » Beyond Jazz Jackrabbit 2

Query protocol and list server development

blurredd

JCF Member

Joined: Nov 2001

Posts: 1,896

blurredd is an asset to this forumblurredd is an asset to this forum

Jul 16, 2009, 12:21 PM
blurredd is offline
Reply With Quote
Query protocol and list server development

My previous threads dealing with players timing out and creating a more convenient way for zipping level packs didn't get the type of response I was looking for (so far anyway), but I'm hoping this thread is different considering others are showing interest in further development in this area.

Basically what I want to propose is adapting an existing query protocol to be used with JJ2 in place of the current inefficient method of having a fake player join a server and retrieving information. I'm partial towards using the Gamespy Query Protocol version 4 (read more about it here and here), although it's mainly because it's used by UT3 and I like implementing Unreal Tournament ideas into JJ2 (must be because of the Epic relation).

I'm thinking a script would have to query the port that is server's hosting port + 1, so by default the query port would be 10053. The list servers should be updated to be able to handle custom game types and the like. A packet sent by a server connecting to the list servers will be used to indicate the server is capable of accepting the newer form of queries when listed in the server list.

I'm probably forgetting something, but I mostly want to get this out there before I forget to post this again. I would like to help establish a standard way of doing everything I proposed before I start work on anything (unlike what I did with JJ2+).
__________________
D3
Extra. No CTO v0.75
Animating Tiles Properties.
ATB Contest. Scripting Language.
Gameplay Theories.
1UP. Pitfall. Desolation.
SC2.

djazz

JCF Member

Joined: Feb 2009

Posts: 257

djazz is OFF DA CHARTdjazz is OFF DA CHARTdjazz is OFF DA CHART

Jul 16, 2009, 01:12 PM
djazz is offline
Reply With Quote
Sounds really interesting, BlurredD!

Some questions

Is this for both external and internal GIPs?
The server list needs JJ2+ features. Am I get it right?
And that fake player/gamespy would be the player viewing info about specified server? or?
Or is it a rebuild of the JJ2's protocol?

(Sorry if I'm total lost)

Feels good to stay the Epic way (UT, Killing Spree..).
__________________
WebJCS 2 (new and in progress)
WebJCS 1 (old but complete)
SGIP Simple Games in Progress list
Level Packer v2 - With a GUI!
PHP Tileset Compiler
blurredd

JCF Member

Joined: Nov 2001

Posts: 1,896

blurredd is an asset to this forumblurredd is an asset to this forum

Jul 16, 2009, 02:21 PM
blurredd is offline
Reply With Quote
Quote:
Originally Posted by DJazz View Post
Is this for both external and internal GIPs?
Pretty much, though I don't intend on implementing the new form of server queries through JJ2 right away.

Quote:
The server list needs JJ2+ features. Am I get it right?
Well, not really. I'm assuming by "server list" you mean the program the list servers use. The list servers would just need to somehow indicate which servers can accept queries using the new query protocol. Now that I think about it, I should look into how server browsing works on UT3.

Quote:
And that fake player/gamespy would be the player viewing info about specified server? or?
Or is it a rebuild of the JJ2's protocol?
My proposal would be to simply implement server queries like how they are done on other games. That is, a script somewhere sends a packet indicating it wants info from a server, and the server replies with all the information in a single packet. No more sending multiple packets to establish a connection as a "player" and then receiving server information that way. It's an ugly hack which really shouldn't be used anymore--except to query older servers if that's really necessary. The new query protocol should be able to work through JJ2 without disrupting how servers usually works, though admittedly I am making a lot of assumptions right now.

I do plan on redoing all of JJ2's (and in turn JJ2+'s) net code since I think it's very limiting at the moment, but it's not something I want to focus on right now.
__________________
D3
Extra. No CTO v0.75
Animating Tiles Properties.
ATB Contest. Scripting Language.
Gameplay Theories.
1UP. Pitfall. Desolation.
SC2.

Cpp

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Jul 16, 2009, 09:27 PM
Cpp is offline
Reply With Quote
You're assuming that most NATted jj2 servers have their port 10053 forwarded. I see a major firewall problem here. Personally I would go for an existing TCP port i.e. 10052 as most servers have that forwarded. Since plus is already capable of native packet inspection, you can design a new packet that houses all the query packets inside. Since non-plus servers won't recognize this packet, they will simply drop it. You can wrap an existing standard packets in a shell pretty easily, all you do is attach two bytes at the beginning of a packet - packet size and a new "query" packet ID.

Quote:
struct TCP_Packet {
char PacketLength; // Length of the packet
char PacketID; // Identified type of packet
char ExtraData[]; // Can be of variable size
};

Also, the idea of having the server display ping of its clients (like in many other games) would be neat.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
blurredd

JCF Member

Joined: Nov 2001

Posts: 1,896

blurredd is an asset to this forumblurredd is an asset to this forum

Jul 17, 2009, 04:51 PM
blurredd is offline
Reply With Quote
I'm assuming that people will forward port UDP port 10053 when told to, which shouldn't be asking a lot. And when I manage to get UPnP working (some time in 2010...), they might not have to even think about it. I wouldn't want to use TCP since the packets for queries don't have to be reliable, plus JJ2's packet structure is limiting.
__________________
D3
Extra. No CTO v0.75
Animating Tiles Properties.
ATB Contest. Scripting Language.
Gameplay Theories.
1UP. Pitfall. Desolation.
SC2.

Cpp

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Jul 18, 2009, 04:12 AM
Cpp is offline
Reply With Quote
Yeah, I just gave it some thought and it seems like trying to wrap the xfire stuff into a jj2 TCP packet structure would break the compatibility completely. Just one thought. I've always seen people suggest to forward ports 10052 and 10054 both TCP and UDP in order to get hosting working. We know that jj2 doesn't use all four options at once (10052:tcp, 10052:udp, 10054:tcp, 10054:udp), so do you think you can stick the query protocol in here somewhere rather than port 10053?
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 05:46 PM.