MANUAL for GMnet PUNCH

2. obj_control

Let’s actually talk about this “behaviour”: I will not go over the debug objects in the sample project, I will only guide you through the neccassry objects/code. Let’s start with object obj_control. The only important thing in _objcontrol is the create event. In the create event you can find, that udphp_config is called. This is the first you have to call when you want to use GMnet PUNCH.

How to use udphp_config (arguments):

  • master_ip(stringl) -> The IP of the master server that both server and client will use to connect to each other. Confused? See the section Wait, I need to host a “master server”?! - Where do I get that?.
  • master_port(real) -> The UDP and TCP port the master server listens on.
  • reconnect intverval(real) -> After this amount of steps the server will reconnect to the master server. This has to be done, to ensure the server is always connected to the master server. Future versions will auto-reconnect on loss of connection, but we are still testing that out.
  • connection timeout(real) -> After this amount of time the server and client will give up to connect t eachother. The client will display a connection failed message. This timeout will also be used if you set the client to directly connect to the server.
  • debug(boolean [0/false or 1/true]) -> Show more debug messages. Not recommended for production use.
  • silent(boolean) -> This will turn ALL debug messages off. Recommended for production use.

Copy the call of this script to your game startup or somewhere else where it get’s called before the other GMnet PUNCH scripts. Make sure no global variables starting with udphp_ are used. These are reserved for GMnet PUNCH.


» Next topic: Server

« Previous topic: Implementing GMnet PUNCH in your game


Back to index.


Creative Commons License

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.