- Administration
- Chat system
- Event listeners
- File system
- Global gamestate
- Peer to peer messages
- Remote Procedural Calls
- Remote sounds
- Spawning & Syncing objects
- Player datastructure & functions
- Streaming data
- Voice chat
- Analytics & Web API
- Debugging
- Steam Integration
The _reliable
parameter in a function means whether it is okay to miss packets (false
) and save up resending or if it is imperative that the packet arrives (true
)
Add the obj_net_web
object to your game's startup room
Call the net_init
function.
Get a NetGM2 application key and analytics page
Whenever you want to create a connection to a server, use
net_connect(_ip, _port)
Before that, you need to configure netgm2, call net_set_config
, it goes like so:
net_set_config({
timeout: number, /* of milliseconds until we time out */
p2p_handler: function, /* Gets called whenever you receive a p2p message, arguments being: callback(_recipient_id, _data) */
uses_accounts: bool, /* Does the server use an account system? */
discord: DiscordStruct {
app_id: string,
custom_presence: bool /* Whether you want to use the built in NetGM2 presence or want to use your own code, needs _NekoPresence_ */
}
})
/*
Make sure to set the player's name!
*/
net_set_name("...")
/*
Set a password if you use the account system
*/
net_set_password("...")
// Call this
net_multiclient()
enum NET_STATE
{
CONNECTING,
CONNECTED,
REGISTERED,
DISCONNECTED,
}
function net_get_state() -> NET_STATE
function net_get_server_name() -> string