Table of Contents

Class ISteamNetworkingUtils

Namespace
MarymoorStudios.Core.Steamworks
Assembly
MarymoorStudios.Core.Steamworks.dll
public sealed class ISteamNetworkingUtils : SteamNativeObject
Inheritance
ISteamNetworkingUtils
Inherited Members

Fields

INTERFACE_VERSION

public const string INTERFACE_VERSION = "SteamNetworkingUtils004"

Field Value

string

Methods

AllocateMessage(int)

public SteamNetworkingMessagePtr AllocateMessage(int allocateBufferCount)

Parameters

allocateBufferCount int

Returns

SteamNetworkingMessagePtr

CheckPingDataUpToDate(float)

public bool CheckPingDataUpToDate(float maxAgeSeconds)

Parameters

maxAgeSeconds float

Returns

bool

ConvertPingLocationToString(in SteamNetworkPingLocation, Span<byte>)

public void ConvertPingLocationToString(in SteamNetworkPingLocation location, Span<byte> pszBuf)

Parameters

location SteamNetworkPingLocation
pszBuf Span<byte>

EstimatePingTimeBetweenTwoLocations(in SteamNetworkPingLocation, in SteamNetworkPingLocation)

public int EstimatePingTimeBetweenTwoLocations(in SteamNetworkPingLocation location1, in SteamNetworkPingLocation location2)

Parameters

location1 SteamNetworkPingLocation
location2 SteamNetworkPingLocation

Returns

int

EstimatePingTimeFromLocalHost(in SteamNetworkPingLocation)

public int EstimatePingTimeFromLocalHost(in SteamNetworkPingLocation remoteLocation)

Parameters

remoteLocation SteamNetworkPingLocation

Returns

int

GetConfigValue(ESteamNetworkingConfigValue, ESteamNetworkingConfigScope, nint, out ESteamNetworkingConfigDataType, Span<byte>, out long)

public ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue value, ESteamNetworkingConfigScope scopeType, nint scopeObj, out ESteamNetworkingConfigDataType outDataType, Span<byte> result, out long resultCount)

Parameters

value ESteamNetworkingConfigValue
scopeType ESteamNetworkingConfigScope
scopeObj nint
outDataType ESteamNetworkingConfigDataType
result Span<byte>
resultCount long

Returns

ESteamNetworkingGetConfigValueResult

GetConfigValueInfo(ESteamNetworkingConfigValue, out ESteamNetworkingConfigDataType, out ESteamNetworkingConfigScope)

public string? GetConfigValueInfo(ESteamNetworkingConfigValue value, out ESteamNetworkingConfigDataType outDataType, out ESteamNetworkingConfigScope outScope)

Parameters

value ESteamNetworkingConfigValue
outDataType ESteamNetworkingConfigDataType
outScope ESteamNetworkingConfigScope

Returns

string

GetDirectPingToPOP(SteamNetworkingPOPID)

public int GetDirectPingToPOP(SteamNetworkingPOPID popID)

Parameters

popID SteamNetworkingPOPID

Returns

int

GetIPv4FakeIPType(uint)

public ESteamNetworkingFakeIPType GetIPv4FakeIPType(uint ipv4)

Parameters

ipv4 uint

Returns

ESteamNetworkingFakeIPType

GetLocalPingLocation(ref SteamNetworkPingLocation)

public float GetLocalPingLocation(ref SteamNetworkPingLocation result)

Parameters

result SteamNetworkPingLocation

Returns

float

GetLocalTimestamp()

public SteamNetworkingMicroseconds GetLocalTimestamp()

Returns

SteamNetworkingMicroseconds

GetPOPCount()

public int GetPOPCount()

Returns

int

GetPOPList(Span<SteamNetworkingPOPID>)

public int GetPOPList(Span<SteamNetworkingPOPID> list)

Parameters

list Span<SteamNetworkingPOPID>

Returns

int

GetPingToDataCenter(SteamNetworkingPOPID, out SteamNetworkingPOPID)

public int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetworkingPOPID viaRelayPoP)

Parameters

popID SteamNetworkingPOPID
viaRelayPoP SteamNetworkingPOPID

Returns

int

GetRealIdentityForFakeIP(in SteamNetworkingIPAddr, out SteamNetworkingIdentity)

public EResult GetRealIdentityForFakeIP(in SteamNetworkingIPAddr fakeIP, out SteamNetworkingIdentity outRealIdentity)

Parameters

fakeIP SteamNetworkingIPAddr
outRealIdentity SteamNetworkingIdentity

Returns

EResult

GetRelayNetworkStatus(out SteamRelayNetworkStatus)

Fetch current status of the relay network.

public ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayNetworkStatus details)

Parameters

details SteamRelayNetworkStatus

Detailed information about the current relay status.

Returns

ESteamNetworkingAvailability

The current value of Avail.

Remarks

SteamRelayNetworkStatus is also a callback. It will be triggered on both the user and gameserver interfaces any time the status changes, or ping measurement starts or stops.

If you want more details, see details.

InitRelayNetworkAccess()

Initiates (asynchronous) initialization of the Steam Datagram Relay (SDR) Network.

public void InitRelayNetworkAccess()

Remarks

If you know that you are going to be using the relay network (for example, because you anticipate making P2P connections), call this to initialize the relay network. If you do not call this, the initialization will be delayed until the first time you use a feature that requires access to the relay network, which will delay that first access.

You can also call this to force a retry if the previous attempt has failed. Performing any action that requires access to the relay network will also trigger a retry, and so calling this function is never strictly necessary, but it can be useful to call it at program launch time, if access to the relay network is anticipated. Use GetRelayNetworkStatus(out SteamRelayNetworkStatus) or listen for SteamRelayNetworkStatus callbacks to know when initialization has completed. Typically, initialization completes in a few seconds.

Note: dedicated servers hosted in known data centers do *not* need to call this, since they do not make routing decisions. However, if the dedicated server will be using P2P functionality, it will act as a client and this should be called.

IsFakeIPv4(uint)

public bool IsFakeIPv4(uint ipv4)

Parameters

ipv4 uint

Returns

bool

IterateGenericEditableConfigValues(ESteamNetworkingConfigValue, bool)

public ESteamNetworkingConfigValue IterateGenericEditableConfigValues(ESteamNetworkingConfigValue current, bool enumerateDevVars)

Parameters

current ESteamNetworkingConfigValue
enumerateDevVars bool

Returns

ESteamNetworkingConfigValue

OnSteamRelayNetworkStatus(CallbackAction<SteamRelayNetworkStatus>)

public IDisposable OnSteamRelayNetworkStatus(CallbackAction<SteamRelayNetworkStatus> func)

Parameters

func CallbackAction<SteamRelayNetworkStatus>

Returns

IDisposable

ParsePingLocationString(string, ref SteamNetworkPingLocation)

public bool ParsePingLocationString(string pszString, ref SteamNetworkPingLocation result)

Parameters

pszString string
result SteamNetworkPingLocation

Returns

bool

SetConfigValue(ESteamNetworkingConfigValue, ESteamNetworkingConfigScope, nint, ESteamNetworkingConfigDataType, ReadOnlySpan<byte>)

public bool SetConfigValue(ESteamNetworkingConfigValue value, ESteamNetworkingConfigScope scopeType, nint scopeObj, ESteamNetworkingConfigDataType dataType, ReadOnlySpan<byte> arg)

Parameters

value ESteamNetworkingConfigValue
scopeType ESteamNetworkingConfigScope
scopeObj nint
dataType ESteamNetworkingConfigDataType
arg ReadOnlySpan<byte>

Returns

bool

SetConfigValueStruct(in SteamNetworkingConfigValue, ESteamNetworkingConfigScope, nint)

public bool SetConfigValueStruct(in SteamNetworkingConfigValue opt, ESteamNetworkingConfigScope scopeType, nint scopeObj)

Parameters

opt SteamNetworkingConfigValue
scopeType ESteamNetworkingConfigScope
scopeObj nint

Returns

bool

SetConnectionConfigValueFloat(HSteamNetConnection, ESteamNetworkingConfigValue, float)

public bool SetConnectionConfigValueFloat(HSteamNetConnection conn, ESteamNetworkingConfigValue value, float val)

Parameters

conn HSteamNetConnection
value ESteamNetworkingConfigValue
val float

Returns

bool

SetConnectionConfigValueInt32(HSteamNetConnection, ESteamNetworkingConfigValue, int)

public bool SetConnectionConfigValueInt32(HSteamNetConnection conn, ESteamNetworkingConfigValue value, int val)

Parameters

conn HSteamNetConnection
value ESteamNetworkingConfigValue
val int

Returns

bool

SetConnectionConfigValueString(HSteamNetConnection, ESteamNetworkingConfigValue, string)

public bool SetConnectionConfigValueString(HSteamNetConnection conn, ESteamNetworkingConfigValue value, string val)

Parameters

conn HSteamNetConnection
value ESteamNetworkingConfigValue
val string

Returns

bool

SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType, Action<ESteamNetworkingSocketsDebugOutputType, string>)

public IDisposable SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType detailLevel, Action<ESteamNetworkingSocketsDebugOutputType, string> function)

Parameters

detailLevel ESteamNetworkingSocketsDebugOutputType
function Action<ESteamNetworkingSocketsDebugOutputType, string>

Returns

IDisposable

SetGlobalCallback_FakeIPResult(SteamEventAction<SteamNetworkingFakeIPResult>)

public IDisposable SetGlobalCallback_FakeIPResult(SteamEventAction<SteamNetworkingFakeIPResult> callback)

Parameters

callback SteamEventAction<SteamNetworkingFakeIPResult>

Returns

IDisposable

SetGlobalCallback_MessagesSessionFailed(SteamEventAction<SteamNetworkingMessagesSessionFailed>)

public IDisposable SetGlobalCallback_MessagesSessionFailed(SteamEventAction<SteamNetworkingMessagesSessionFailed> callback)

Parameters

callback SteamEventAction<SteamNetworkingMessagesSessionFailed>

Returns

IDisposable

SetGlobalCallback_MessagesSessionRequest(SteamEventAction<SteamNetworkingMessagesSessionRequest>)

public IDisposable SetGlobalCallback_MessagesSessionRequest(SteamEventAction<SteamNetworkingMessagesSessionRequest> callback)

Parameters

callback SteamEventAction<SteamNetworkingMessagesSessionRequest>

Returns

IDisposable

SetGlobalCallback_SteamNetAuthenticationStatusChanged(SteamEventAction<SteamNetAuthenticationStatus>)

public IDisposable SetGlobalCallback_SteamNetAuthenticationStatusChanged(SteamEventAction<SteamNetAuthenticationStatus> callback)

Parameters

callback SteamEventAction<SteamNetAuthenticationStatus>

Returns

IDisposable

SetGlobalCallback_SteamNetConnectionStatusChanged(SteamEventAction<SteamNetConnectionStatusChangedCallback>)

public IDisposable SetGlobalCallback_SteamNetConnectionStatusChanged(SteamEventAction<SteamNetConnectionStatusChangedCallback> callback)

Parameters

callback SteamEventAction<SteamNetConnectionStatusChangedCallback>

Returns

IDisposable

SetGlobalCallback_SteamRelayNetworkStatusChanged(SteamEventAction<SteamRelayNetworkStatus>)

public IDisposable SetGlobalCallback_SteamRelayNetworkStatusChanged(SteamEventAction<SteamRelayNetworkStatus> callback)

Parameters

callback SteamEventAction<SteamRelayNetworkStatus>

Returns

IDisposable

SetGlobalConfigValueFloat(ESteamNetworkingConfigValue, float)

public bool SetGlobalConfigValueFloat(ESteamNetworkingConfigValue value, float val)

Parameters

value ESteamNetworkingConfigValue
val float

Returns

bool

SetGlobalConfigValueInt32(ESteamNetworkingConfigValue, int)

public bool SetGlobalConfigValueInt32(ESteamNetworkingConfigValue value, int val)

Parameters

value ESteamNetworkingConfigValue
val int

Returns

bool

SetGlobalConfigValuePtr(ESteamNetworkingConfigValue, Span<byte>)

public bool SetGlobalConfigValuePtr(ESteamNetworkingConfigValue value, Span<byte> val)

Parameters

value ESteamNetworkingConfigValue
val Span<byte>

Returns

bool

SetGlobalConfigValueString(ESteamNetworkingConfigValue, string)

public bool SetGlobalConfigValueString(ESteamNetworkingConfigValue value, string val)

Parameters

value ESteamNetworkingConfigValue
val string

Returns

bool

SteamNetworkingIPAddr_GetFakeIPType(in SteamNetworkingIPAddr)

public ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType(in SteamNetworkingIPAddr addr)

Parameters

addr SteamNetworkingIPAddr

Returns

ESteamNetworkingFakeIPType

SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr, string)

public bool SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr addr, string pszStr)

Parameters

addr SteamNetworkingIPAddr
pszStr string

Returns

bool

SteamNetworkingIPAddr_ToString(in SteamNetworkingIPAddr, Span<byte>, bool)

public void SteamNetworkingIPAddr_ToString(in SteamNetworkingIPAddr addr, Span<byte> buf, bool withPort)

Parameters

addr SteamNetworkingIPAddr
buf Span<byte>
withPort bool

SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity, string)

public bool SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity identity, string pszStr)

Parameters

identity SteamNetworkingIdentity
pszStr string

Returns

bool

SteamNetworkingIdentity_ToString(in SteamNetworkingIdentity, Span<byte>)

public void SteamNetworkingIdentity_ToString(in SteamNetworkingIdentity identity, Span<byte> buf)

Parameters

identity SteamNetworkingIdentity
buf Span<byte>

UntilRelayNetworkAccess(CancellationToken)

Initializes the Steam Datagram Relay (SDR) Network and waits until it is ready.

public Promise UntilRelayNetworkAccess(CancellationToken cancel = default)

Parameters

cancel CancellationToken

Returns

Promise

Resolves ONLY when the relay network has successfully connected.

Remarks

If you know that you are going to be using the relay network (for example, because you anticipate making P2P connections), call this to initialize the relay network. If you do not call this, the initialization will be delayed until the first time you use a feature that requires access to the relay network, which will delay that first access.

You can also call this to force a retry if the previous attempt has failed. Performing any action that requires access to the relay network will also trigger a retry, and so calling this function is never strictly necessary, but it can be useful to call it at program launch time, if access to the relay network is anticipated.

This method resolves ONLY when the relay network has successfully initialized. To determine more detailed status of an initialization in progress use GetRelayNetworkStatus(out SteamRelayNetworkStatus) or listen for SteamRelayNetworkStatus callbacks. Typically, initialization completes in a few seconds.

Note: dedicated servers hosted in known data centers do *not* need to call this, since they do not make routing decisions. However, if the dedicated server will be using P2P functionality, it will act as a client and this should be called.