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
Methods
AllocateMessage(int)
public SteamNetworkingMessagePtr AllocateMessage(int allocateBufferCount)
Parameters
allocateBufferCount
int
Returns
CheckPingDataUpToDate(float)
public bool CheckPingDataUpToDate(float maxAgeSeconds)
Parameters
maxAgeSeconds
float
Returns
ConvertPingLocationToString(in SteamNetworkPingLocation, Span<byte>)
public void ConvertPingLocationToString(in SteamNetworkPingLocation location, Span<byte> pszBuf)
Parameters
location
SteamNetworkPingLocationpszBuf
Span<byte>
EstimatePingTimeBetweenTwoLocations(in SteamNetworkPingLocation, in SteamNetworkPingLocation)
public int EstimatePingTimeBetweenTwoLocations(in SteamNetworkPingLocation location1, in SteamNetworkPingLocation location2)
Parameters
location1
SteamNetworkPingLocationlocation2
SteamNetworkPingLocation
Returns
EstimatePingTimeFromLocalHost(in SteamNetworkPingLocation)
public int EstimatePingTimeFromLocalHost(in SteamNetworkPingLocation remoteLocation)
Parameters
remoteLocation
SteamNetworkPingLocation
Returns
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
ESteamNetworkingConfigValuescopeType
ESteamNetworkingConfigScopescopeObj
nintoutDataType
ESteamNetworkingConfigDataTyperesult
Span<byte>resultCount
long
Returns
GetConfigValueInfo(ESteamNetworkingConfigValue, out ESteamNetworkingConfigDataType, out ESteamNetworkingConfigScope)
public string? GetConfigValueInfo(ESteamNetworkingConfigValue value, out ESteamNetworkingConfigDataType outDataType, out ESteamNetworkingConfigScope outScope)
Parameters
value
ESteamNetworkingConfigValueoutDataType
ESteamNetworkingConfigDataTypeoutScope
ESteamNetworkingConfigScope
Returns
GetDirectPingToPOP(SteamNetworkingPOPID)
public int GetDirectPingToPOP(SteamNetworkingPOPID popID)
Parameters
popID
SteamNetworkingPOPID
Returns
GetIPv4FakeIPType(uint)
public ESteamNetworkingFakeIPType GetIPv4FakeIPType(uint ipv4)
Parameters
ipv4
uint
Returns
GetLocalPingLocation(ref SteamNetworkPingLocation)
public float GetLocalPingLocation(ref SteamNetworkPingLocation result)
Parameters
result
SteamNetworkPingLocation
Returns
GetLocalTimestamp()
public SteamNetworkingMicroseconds GetLocalTimestamp()
Returns
GetPOPCount()
public int GetPOPCount()
Returns
GetPOPList(Span<SteamNetworkingPOPID>)
public int GetPOPList(Span<SteamNetworkingPOPID> list)
Parameters
list
Span<SteamNetworkingPOPID>
Returns
GetPingToDataCenter(SteamNetworkingPOPID, out SteamNetworkingPOPID)
public int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetworkingPOPID viaRelayPoP)
Parameters
popID
SteamNetworkingPOPIDviaRelayPoP
SteamNetworkingPOPID
Returns
GetRealIdentityForFakeIP(in SteamNetworkingIPAddr, out SteamNetworkingIdentity)
public EResult GetRealIdentityForFakeIP(in SteamNetworkingIPAddr fakeIP, out SteamNetworkingIdentity outRealIdentity)
Parameters
fakeIP
SteamNetworkingIPAddroutRealIdentity
SteamNetworkingIdentity
Returns
GetRelayNetworkStatus(out SteamRelayNetworkStatus)
Fetch current status of the relay network.
public ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayNetworkStatus details)
Parameters
details
SteamRelayNetworkStatusDetailed 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
IterateGenericEditableConfigValues(ESteamNetworkingConfigValue, bool)
public ESteamNetworkingConfigValue IterateGenericEditableConfigValues(ESteamNetworkingConfigValue current, bool enumerateDevVars)
Parameters
current
ESteamNetworkingConfigValueenumerateDevVars
bool
Returns
OnSteamRelayNetworkStatus(CallbackAction<SteamRelayNetworkStatus>)
public IDisposable OnSteamRelayNetworkStatus(CallbackAction<SteamRelayNetworkStatus> func)
Parameters
Returns
ParsePingLocationString(string, ref SteamNetworkPingLocation)
public bool ParsePingLocationString(string pszString, ref SteamNetworkPingLocation result)
Parameters
pszString
stringresult
SteamNetworkPingLocation
Returns
SetConfigValue(ESteamNetworkingConfigValue, ESteamNetworkingConfigScope, nint, ESteamNetworkingConfigDataType, ReadOnlySpan<byte>)
public bool SetConfigValue(ESteamNetworkingConfigValue value, ESteamNetworkingConfigScope scopeType, nint scopeObj, ESteamNetworkingConfigDataType dataType, ReadOnlySpan<byte> arg)
Parameters
value
ESteamNetworkingConfigValuescopeType
ESteamNetworkingConfigScopescopeObj
nintdataType
ESteamNetworkingConfigDataTypearg
ReadOnlySpan<byte>
Returns
SetConfigValueStruct(in SteamNetworkingConfigValue, ESteamNetworkingConfigScope, nint)
public bool SetConfigValueStruct(in SteamNetworkingConfigValue opt, ESteamNetworkingConfigScope scopeType, nint scopeObj)
Parameters
opt
SteamNetworkingConfigValuescopeType
ESteamNetworkingConfigScopescopeObj
nint
Returns
SetConnectionConfigValueFloat(HSteamNetConnection, ESteamNetworkingConfigValue, float)
public bool SetConnectionConfigValueFloat(HSteamNetConnection conn, ESteamNetworkingConfigValue value, float val)
Parameters
conn
HSteamNetConnectionvalue
ESteamNetworkingConfigValueval
float
Returns
SetConnectionConfigValueInt32(HSteamNetConnection, ESteamNetworkingConfigValue, int)
public bool SetConnectionConfigValueInt32(HSteamNetConnection conn, ESteamNetworkingConfigValue value, int val)
Parameters
conn
HSteamNetConnectionvalue
ESteamNetworkingConfigValueval
int
Returns
SetConnectionConfigValueString(HSteamNetConnection, ESteamNetworkingConfigValue, string)
public bool SetConnectionConfigValueString(HSteamNetConnection conn, ESteamNetworkingConfigValue value, string val)
Parameters
conn
HSteamNetConnectionvalue
ESteamNetworkingConfigValueval
string
Returns
SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType, Action<ESteamNetworkingSocketsDebugOutputType, string>)
public IDisposable SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType detailLevel, Action<ESteamNetworkingSocketsDebugOutputType, string> function)
Parameters
detailLevel
ESteamNetworkingSocketsDebugOutputTypefunction
Action<ESteamNetworkingSocketsDebugOutputType, string>
Returns
SetGlobalCallback_FakeIPResult(SteamEventAction<SteamNetworkingFakeIPResult>)
public IDisposable SetGlobalCallback_FakeIPResult(SteamEventAction<SteamNetworkingFakeIPResult> callback)
Parameters
callback
SteamEventAction<SteamNetworkingFakeIPResult>
Returns
SetGlobalCallback_MessagesSessionFailed(SteamEventAction<SteamNetworkingMessagesSessionFailed>)
public IDisposable SetGlobalCallback_MessagesSessionFailed(SteamEventAction<SteamNetworkingMessagesSessionFailed> callback)
Parameters
Returns
SetGlobalCallback_MessagesSessionRequest(SteamEventAction<SteamNetworkingMessagesSessionRequest>)
public IDisposable SetGlobalCallback_MessagesSessionRequest(SteamEventAction<SteamNetworkingMessagesSessionRequest> callback)
Parameters
Returns
SetGlobalCallback_SteamNetAuthenticationStatusChanged(SteamEventAction<SteamNetAuthenticationStatus>)
public IDisposable SetGlobalCallback_SteamNetAuthenticationStatusChanged(SteamEventAction<SteamNetAuthenticationStatus> callback)
Parameters
callback
SteamEventAction<SteamNetAuthenticationStatus>
Returns
SetGlobalCallback_SteamNetConnectionStatusChanged(SteamEventAction<SteamNetConnectionStatusChangedCallback>)
public IDisposable SetGlobalCallback_SteamNetConnectionStatusChanged(SteamEventAction<SteamNetConnectionStatusChangedCallback> callback)
Parameters
Returns
SetGlobalCallback_SteamRelayNetworkStatusChanged(SteamEventAction<SteamRelayNetworkStatus>)
public IDisposable SetGlobalCallback_SteamRelayNetworkStatusChanged(SteamEventAction<SteamRelayNetworkStatus> callback)
Parameters
callback
SteamEventAction<SteamRelayNetworkStatus>
Returns
SetGlobalConfigValueFloat(ESteamNetworkingConfigValue, float)
public bool SetGlobalConfigValueFloat(ESteamNetworkingConfigValue value, float val)
Parameters
value
ESteamNetworkingConfigValueval
float
Returns
SetGlobalConfigValueInt32(ESteamNetworkingConfigValue, int)
public bool SetGlobalConfigValueInt32(ESteamNetworkingConfigValue value, int val)
Parameters
value
ESteamNetworkingConfigValueval
int
Returns
SetGlobalConfigValuePtr(ESteamNetworkingConfigValue, Span<byte>)
public bool SetGlobalConfigValuePtr(ESteamNetworkingConfigValue value, Span<byte> val)
Parameters
value
ESteamNetworkingConfigValueval
Span<byte>
Returns
SetGlobalConfigValueString(ESteamNetworkingConfigValue, string)
public bool SetGlobalConfigValueString(ESteamNetworkingConfigValue value, string val)
Parameters
value
ESteamNetworkingConfigValueval
string
Returns
SteamNetworkingIPAddr_GetFakeIPType(in SteamNetworkingIPAddr)
public ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType(in SteamNetworkingIPAddr addr)
Parameters
Returns
SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr, string)
public bool SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr addr, string pszStr)
Parameters
addr
SteamNetworkingIPAddrpszStr
string
Returns
SteamNetworkingIPAddr_ToString(in SteamNetworkingIPAddr, Span<byte>, bool)
public void SteamNetworkingIPAddr_ToString(in SteamNetworkingIPAddr addr, Span<byte> buf, bool withPort)
Parameters
addr
SteamNetworkingIPAddrbuf
Span<byte>withPort
bool
SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity, string)
public bool SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity identity, string pszStr)
Parameters
identity
SteamNetworkingIdentitypszStr
string
Returns
SteamNetworkingIdentity_ToString(in SteamNetworkingIdentity, Span<byte>)
public void SteamNetworkingIdentity_ToString(in SteamNetworkingIdentity identity, Span<byte> buf)
Parameters
identity
SteamNetworkingIdentitybuf
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.