Facepunch.Steamworks Wiki

Steamworks.SteamNetworking

Fields

Called when packets can't get through to the specified user. All queued packets unsent at this point will be dropped, further attempts to send will retry making the connection (but will be dropped if we fail again).
This SteamId wants to send you a message. You should respond by calling AcceptP2PSessionWithUser if you want to recieve their messages

Methods

static bool AcceptP2PSessionWithUser( SteamId user )
This should be called in response to a OnP2PSessionRequest
static bool AllowP2PPacketRelay( bool allow )
Allow or disallow P2P connects to fall back on Steam server relay if direct connection or NAT traversal can't be established. Applies to connections created after setting or old connections that need to reconnect.
static bool CloseP2PSessionWithUser( SteamId user )
This should be called when you're done communicating with a user, as this will free up all of the resources allocated for the connection under-the-hood. If the remote user tries to send data to you again, a new OnP2PSessionRequest callback will be posted
static bool IsP2PPacketAvailable( int channel = 0 )
Checks if a P2P packet is available to read, and gets the size of the message if there is one.
static bool ReadP2PPacket( byte* buffer, uint cbuf, uint size, SteamId steamid, int channel = 0 )
Reads in a packet that has been sent from another user via SendP2PPacket..
static bool SendP2PPacket( SteamId steamid, byte* data, uint length, int nChannel = 1, P2PSend sendType = Reliable )
Sends a P2P packet to the specified user. This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections. NOTE: The first packet send may be delayed as the NAT-traversal code runs.