Table of Contents

Interface IP2PNetworkingService

Namespace
PopcorningGuineaPig.Engine.Services
Assembly
PopcorningGuineaPig.Engine.dll
public interface IP2PNetworkingService

Properties

AutoAccept

When true (the default), incoming sessions are accepted after OnSessionRequested fires. Banqi relies on that. Set false and call AcceptSession(CSteamID) yourself to filter.

bool AutoAccept { get; set; }

Property Value

bool

IsAvailable

bool IsAvailable { get; }

Property Value

bool

Methods

AcceptSession(CSteamID)

void AcceptSession(CSteamID peerId)

Parameters

peerId CSteamID

CloseSession(CSteamID)

void CloseSession(CSteamID peerId)

Parameters

peerId CSteamID

GetPeerSession(CSteamID)

Whether this peer's Messages session is Connected, the last SessionFailed end reason (0 if that callback never fired), and its debug string. A session that goes quiet without the callback is not live.

PeerLink GetPeerSession(CSteamID peerId)

Parameters

peerId CSteamID

Returns

PeerLink

PollPackets()

void PollPackets()

SendPacket(CSteamID, byte[], bool, int)

void SendPacket(CSteamID peerId, byte[] data, bool reliable = true, int channel = 0)

Parameters

peerId CSteamID
data byte[]
reliable bool
channel int

Events

OnPacketReceived

event Action<CSteamID, byte[]>? OnPacketReceived

Event Type

Action<CSteamID, byte[]>

OnPeerDisconnected

event Action<CSteamID>? OnPeerDisconnected

Event Type

Action<CSteamID>

OnSessionRequested

event Action<CSteamID>? OnSessionRequested

Event Type

Action<CSteamID>