The Next Tetris: Online Edition

Protocol

Next tetris is solved with a so called "DC module" for the IRC server.

The Next Tetris implementation is actually a headache when it comes
to coexist with the other GameSpy games.

Domains and Ports

  • peerchat.gamespy.com
  • gpcm.gamespy.com
  • gamestats.gamespy.com

Breakdown:

1. The Dreamcast always start out with sending a "USRIP" to the IRC server
    * Pretty much, give me my IP before I register to the IRC server.
2. The response is the key if the game is going to work or not.
    * For Next Tetris the IRC server needs to respond with a 302 and the IP set to 0.0.0.0 (FYI google IRC response codes)

The 302 - 0.0.0.0 should only be used in the Next Tetris game, using 0.0.0.0 in for example Starlancer will result in
that you can only create one game at the time (you have probably seen this). In Starlancer and PBA the IP (0.0.0.0)
will be hashed and used in the channel name. Therefore getting "channel name already exist"-error (everybody has the same
hash when creating a channel).

3. The DC sends NICK, USER
    * USER USERNAME 127.0.0.1 peerchat.gamespy.com : RANK
    * USER will not contain a hashed IP as Starlancer and PBA, the only things that separates them.
    * The RANK is one byte value after the ":" and is only used in the lobby before a game.
4. Now we are in the lobby and want to challenge another user to a game, this is what is printed in the IRC channel:
    * CHAL*USER1*USER2*0.0.0.0
    * ACKCHAL*USER2*USER1
    * ACCEPT*USER2*USER1*0.0.0.0
5. As you can see the 302 response is used as the connect IP, but it is even worse (for coexistence with other GS games), because Next Tetris is a TCP/UDP p2p
    the game actually binds to 0.0.0.0.
6. The wildcard bind is good because almost everybody nowadays is behind a router. But we don't want the game to 
    send data to 0.0.0.0.
7. This is solved with the DC module that rewrites 0.0.0.0 to the correct public IP.

Now you say, why not just send 302 - Public IP, because if you do, the 0.0.0.0 is replaced with
the correct IP when you challenge your opponent in Next Tetris. I thought so too....

The issue is that the DC is trying to bind to the Public IP which is not on the DC, atleast not on the
DreamPi setup. And you will not start the game and see a TCP RST.

But for Starlancer and PBA you need to send 302 - Public IP, the complexity
is to differentiate between the games from just getting a USRIP.

This is solved with finding a specific hash and force a IRC re-registration
in the DC module.

Your welcome!

Needed by the player

  • Open TCP/UDP (3512) port for actual gameplay

Wireshark Packet Logs

Dreamcast Live

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License