MANUAL for GMnet PUNCH
This is a linear breakdown of what packets are sent:
SERVER:
-> Sends UDP packet to master server containing the string “reg” with the line feed character (unicode 10) at the end
-> (Re-)connects via TCP to master server
-> Sends TCP packet to master server containing the string “reg” with the line feed character (unicode 10) at the end
-> Repeats every X minutes [alternative smethod is to reconnect when TCP socket is closed]
MASTER SERVER:
<- When recieving the UDP packet with “reg” the UDP port for that server get’s saved
<- When recieving the TCP packet with “reg” this connection socket is saved so the master server can use it later to communicate with the server
CLIENT:
-> Sends UDP packet to master Server containing the string “connect” with the line feed character (unicode 10) at the end
-> Opens TCP connection to master server
-> Sends TCP packet to master Server containing the string “connect”+line feed+IP of the server we want to connect to+line feed
MASTER SERVER:
<- When recieving UDP packet with “connect” the UDP port for that client get’s saved
<- When recieving TCP packet that has “connect” in the first line (unicode 10 is used as a newline).
CLIENT: <- Wait for packet of master server
SERVER: <- Wait for packet of master server
<- Wait for incoming client Knock-Knock packet (-3):
CLIENT:
-> When recieving the welcome packet: Mark client as connected.
-> When not recieving a welcome packet after a timeout: Tell the player the connection failed
Without hole punching the client simply sends the Knock-Knock packets to the server and waits for the servers welcome message.
All pages in this manual are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
GameMaker: Studio is owned by YoYoGames. GMnet is not affiliated with YoYoGames.
The GMnet logos use icons from Entypo (http://entypo.com/) and Open Iconic (https://useiconic.com/open/). They are licensed under CC BY-SA 4.0.