Online play without port forwarding: host with a room code, join with the code.
Room codes need 0.1.16 on both sides. Hosting on a port and joining by address still works, also against 0.1.15.
Online play
- Room codes. In the Dragon Net Battle window the host gets a six-character code and tells it to the other player, who enters it on the Join tab. No port forwarding, no virtual network. Hosting on a port is still there: untick "Use a room code".
- A relay when the two games cannot reach each other directly (some routers, most mobile connections). The game tries the direct ways first and goes through the relay after three seconds without an answer. F1, Video shows "(relay)" beside the ping when a match runs through it.
- A running match takes packets from the other player's address only.
The matchmaking service
Room codes go through a small service (a Cloudflare Worker) whose whole source is in the repository, in port/matchmaking. BT3_MATCH_URL points the game at another copy of it.
- The game tells it the name typed in the window and the addresses it can be reached at. The service keeps them with the room for at most ten minutes and hands them to the player who enters the code.
- An address of your local network is handed over only to a player on the same network. The other player learns your public address, as in any direct match.
- The relay is Cloudflare's TURN service. It passes the match's packets (the buttons pressed) on and keeps nothing.
- Without a room code none of this is used.
- The service has daily limits. If the relay's allowance for the month is used up, room codes go on working without it.
Tested
Room codes between a PC on a home line and one on a mobile hotspot behind carrier NAT, directly and with the relay forced, Linux and Windows.
Not tested
A session longer than three hours through the relay (its login runs out then). Known and not explained: with the relay forced between two machines behind one router, a match can drop to a crawl after about ten seconds; this does not happen in normal use, where two players on one network connect directly, and did not happen between two networks.