swiftlys2/docs/api/releases/features/ai/
API Reference › SteamAPI

ISteamNetworkingSignalingRecvContext

Struct
Namespace: SwiftlyS2.Shared.SteamAPI · Assembly: SwiftlyS2.CS2.dll
[Serializable]
public struct ISteamNetworkingSignalingRecvContext

Interface used when a custom signal is received. See ISteamNetworkingSockets::ReceivedP2PCustomSignal

View source

Methods

OnConnectRequest(HSteamNetConnection, ref SteamNetworkingIdentity, int)

Called when the signal represents a request for a new connection. If you want to ignore the request, just return NULL. In this case, the peer will NOT receive any reply. You should consider ignoring requests rather than actively rejecting them, as a security measure. If you actively reject requests, then this makes it possible to detect if a user is online or not, just by sending them a request. If you wish to send back a rejection, then use ISteamNetworkingSockets::CloseConnection() and then return NULL. We will marshal a properly formatted rejection signal and call SendRejectionSignal() so you can send it to them. If you return a signaling object, the connection is NOT immediately accepted by default. Instead, it stays in the "connecting" state, and the usual callback is posted, and your app can accept the connection using ISteamNetworkingSockets::AcceptConnection. This may be useful so that these sorts of connections can be more similar to your application code as other types of connections accepted on a listen socket. If this is not useful and you want to skip this callback process and immediately accept the connection, call ISteamNetworkingSockets::AcceptConnection before returning the signaling object. After accepting a connection (through either means), the connection will transition into the "finding route" state.

public nint OnConnectRequest(HSteamNetConnection hConn, ref SteamNetworkingIdentity identityPeer, int nLocalVirtualPort)
Parameters
Returns

SendRejectionSignal(ref SteamNetworkingIdentity, nint, int)

This is called to actively communicate rejection or failure to the incoming message. If you intend to ignore all incoming requests that you do not wish to accept, then it's not strictly necessary to implement this.

public void SendRejectionSignal(ref SteamNetworkingIdentity identityPeer, nint pMsg, int cbMsg)
Parameters