ISteamNetworkingUtils
Note
This documentation is auto-generated. Methods marked with 🤖 are automatically generated bindings. Methods marked with ✍️ are manually implemented and methods marked with ✋ are currently not implemented.
List of Functions
List of Callbacks
Function Reference
- NetworkingUtils.AllocateMessage()
✍️ Manually implemented
- Returns:
(SteamNetworkingMessage_t) New message userdata with an empty payload buffer.
- SteamWorks:
Allocates a SteamNetworkingMessage_t for use with SendMessages.
Signature differences from C++ API:
The
cbAllocateBufferparameter is not supported. Setm_pDataandm_cbSizemanually.
Notes:
Assigning to
m_pDatacreates a new string in C++, and frees the old one, but does not modifym_cbSizeautomatically, so keep it in sync manually.
- NetworkingUtils.CheckPingDataUpToDate(flMaxAgeSeconds)
🤖 Auto-generated binding
- Parameters:
flMaxAgeSeconds (float) –
- Returns:
(bool) Return value
- SteamWorks:
Example:
local ok = Steam.NetworkingUtils.CheckPingDataUpToDate(60.0)
if not ok then
print('Ping data is stale; refreshing...')
end
- NetworkingUtils.ConvertPingLocationToString(location, cchBufSize)
🤖 Auto-generated binding
- Parameters:
location – (SteamNetworkPingLocation_t)
cchBufSize (int?) – size of the buffer to allocate for
pszBuf. Ifnilthen the buffer will beNULL.
- Returns:
(str)
pszBuf- SteamWorks:
Signature differences from C++ API:
Parameter
pszBufis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
- NetworkingUtils.EstimatePingTimeBetweenTwoLocations(location1, location2)
🤖 Auto-generated binding
- Parameters:
location1 – (SteamNetworkPingLocation_t)
location2 – (SteamNetworkPingLocation_t)
- Returns:
(int) Return value
- SteamWorks:
- NetworkingUtils.EstimatePingTimeFromLocalHost(remoteLocation)
🤖 Auto-generated binding
- Parameters:
remoteLocation – (SteamNetworkPingLocation_t)
- Returns:
(int) Return value
- SteamWorks:
- NetworkingUtils.GetConfigValueInfo(eValue)
🤖 Auto-generated binding
- Parameters:
eValue (int - ESteamNetworkingConfigValue) –
- Returns:
(str) Return value
- Returns:
(int)
pOutDataType- Returns:
(int)
pOutScope- SteamWorks:
Signature differences from C++ API:
Parameter
pOutDataTypeis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
pOutScopeis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
- NetworkingUtils.GetDirectPingToPOP(popID)
🤖 Auto-generated binding
- Parameters:
popID (int - SteamNetworkingPOPID) –
- Returns:
(int) Return value
- SteamWorks:
Example:
local ping = Steam.NetworkingUtils.GetDirectPingToPOP(popID)
print('Ping to POP:', ping, 'ms')
- NetworkingUtils.GetIPv4FakeIPType(nIPv4)
🤖 Auto-generated binding
- Parameters:
nIPv4 (int) –
- Returns:
(int - ESteamNetworkingFakeIPType) Return value
- SteamWorks:
- NetworkingUtils.GetPOPCount()
🤖 Auto-generated binding
- Returns:
(int) Return value
- SteamWorks:
Example:
local count = Steam.NetworkingUtils.GetPOPCount()
print('Steam relay POPs available:', count)
- NetworkingUtils.GetPOPList(nListSz)
🤖 Auto-generated binding
- Parameters:
nListSz (int?) – size of the buffer to allocate for
list. Ifnilthen the buffer will beNULL.- Returns:
(int) Return value
- Returns:
(int[])
list- SteamWorks:
Signature differences from C++ API:
Parameter
listis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
- NetworkingUtils.GetPingToDataCenter(popID)
🤖 Auto-generated binding
- Parameters:
popID (int - SteamNetworkingPOPID) –
- Returns:
(int) Return value
- Returns:
(int)
pViaRelayPoP- SteamWorks:
Signature differences from C++ API:
Parameter
pViaRelayPoPis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
- NetworkingUtils.GetRealIdentityForFakeIP(fakeIP)
🤖 Auto-generated binding
- Parameters:
fakeIP – (SteamNetworkingIPAddr)
- Returns:
(int - EResult) Return value
- Returns:
(SteamNetworkingIdentity)
pOutRealIdentity- SteamWorks:
Signature differences from C++ API:
Parameter
pOutRealIdentityis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
- NetworkingUtils.GetRelayNetworkStatus()
🤖 Auto-generated binding
- Returns:
(int - ESteamNetworkingAvailability) Return value
- Returns:
(SteamRelayNetworkStatus_t)
pDetails- SteamWorks:
Signature differences from C++ API:
Parameter
pDetailsis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
Example:
local status = Steam.NetworkingUtils.GetRelayNetworkStatus()
if status == Steam.k_ESteamNetworkingAvailability_Current then
print('Relay network ready')
end
- NetworkingUtils.InitRelayNetworkAccess()
🤖 Auto-generated binding
- SteamWorks:
Example:
Steam.NetworkingUtils.InitRelayNetworkAccess()
- NetworkingUtils.IsFakeIPv4(nIPv4)
🤖 Auto-generated binding
- Parameters:
nIPv4 (int) –
- Returns:
(bool) Return value
- SteamWorks:
- NetworkingUtils.IterateGenericEditableConfigValues(eCurrent, bEnumerateDevVars)
🤖 Auto-generated binding
- Parameters:
eCurrent (int - ESteamNetworkingConfigValue) –
bEnumerateDevVars (bool) –
- Returns:
(int - ESteamNetworkingConfigValue) Return value
- SteamWorks:
- NetworkingUtils.SetConnectionConfigValueFloat(hConn, eValue, val)
🤖 Auto-generated binding
- Parameters:
hConn (int - HSteamNetConnection) –
eValue (int - ESteamNetworkingConfigValue) –
val (float) –
- Returns:
(bool) Return value
- SteamWorks:
- NetworkingUtils.SetConnectionConfigValueInt32(hConn, eValue, val)
🤖 Auto-generated binding
- Parameters:
hConn (int - HSteamNetConnection) –
eValue (int - ESteamNetworkingConfigValue) –
val (int) –
- Returns:
(bool) Return value
- SteamWorks:
Example:
-- Override timeout for a specific connection
Steam.NetworkingUtils.SetConnectionConfigValueInt32(
hConn, Steam.k_ESteamNetworkingConfig_TimeoutConnected, 60000)
- NetworkingUtils.SetConnectionConfigValueString(hConn, eValue, val)
🤖 Auto-generated binding
- Parameters:
hConn (int - HSteamNetConnection) –
eValue (int - ESteamNetworkingConfigValue) –
val (str?) –
- Returns:
(bool) Return value
- SteamWorks:
- NetworkingUtils.SetGlobalCallback_FakeIPResult(callback)
✍️ Manually implemented
- Parameters:
callback (function?) – Function receiving a SteamNetworkingFakeIPResult_t. Pass
nilto clear.- Returns:
(bool)
- SteamWorks:
Sets or clears the global callback for fake IP result events.
Signature differences from C++ API:
The C++
FnSteamNetworkingFakeIPResultfunction pointer is replaced by a Lua function.
- NetworkingUtils.SetGlobalCallback_MessagesSessionFailed(callback)
✍️ Manually implemented
- Parameters:
callback (function?) – Function receiving a SteamNetworkingMessagesSessionFailed_t. Pass
nilto clear.- Returns:
(bool)
- SteamWorks:
Sets or clears the global callback for messages session failed events.
Signature differences from C++ API:
The C++
FnSteamNetworkingMessagesSessionFailedfunction pointer is replaced by a Lua function.
- NetworkingUtils.SetGlobalCallback_MessagesSessionRequest(callback)
✍️ Manually implemented
- Parameters:
callback (function?) – Function receiving a SteamNetworkingMessagesSessionRequest_t. Pass
nilto clear.- Returns:
(bool)
- SteamWorks:
Sets or clears the global callback for messages session request events.
Signature differences from C++ API:
The C++
FnSteamNetworkingMessagesSessionRequestfunction pointer is replaced by a Lua function.
- NetworkingUtils.SetGlobalCallback_SteamNetAuthenticationStatusChanged(callback)
✍️ Manually implemented
- Parameters:
callback (function?) – Function receiving a SteamNetAuthenticationStatus_t. Pass
nilto clear.- Returns:
(bool)
- SteamWorks:
Sets or clears the global callback for Steam network authentication status changes.
Signature differences from C++ API:
The C++
FnSteamNetAuthenticationStatusChangedfunction pointer is replaced by a Lua function.
- NetworkingUtils.SetGlobalCallback_SteamNetConnectionStatusChanged(callback)
✍️ Manually implemented
- Parameters:
callback (function?) – Function receiving a SteamNetConnectionStatusChangedCallback_t. Pass
nilto clear.- Returns:
(bool)
- SteamWorks:
Sets or clears the global callback for Steam network connection status changes.
Signature differences from C++ API:
The C++
FnSteamNetConnectionStatusChangedfunction pointer is replaced by a Lua function.
- NetworkingUtils.SetGlobalCallback_SteamRelayNetworkStatusChanged(callback)
✍️ Manually implemented
- Parameters:
callback (function?) – Function receiving a SteamRelayNetworkStatus_t. Pass
nilto clear.- Returns:
(bool)
- SteamWorks:
Sets or clears the global callback for Steam relay network status changes.
Signature differences from C++ API:
The C++
FnSteamRelayNetworkStatusChangedfunction pointer is replaced by a Lua function.
- NetworkingUtils.SetGlobalConfigValueFloat(eValue, val)
🤖 Auto-generated binding
- Parameters:
eValue (int - ESteamNetworkingConfigValue) –
val (float) –
- Returns:
(bool) Return value
- SteamWorks:
- NetworkingUtils.SetGlobalConfigValueInt32(eValue, val)
🤖 Auto-generated binding
- Parameters:
eValue (int - ESteamNetworkingConfigValue) –
val (int) –
- Returns:
(bool) Return value
- SteamWorks:
Example:
-- Set send buffer size globally
Steam.NetworkingUtils.SetGlobalConfigValueInt32(
Steam.k_ESteamNetworkingConfig_SendBufferSize, 524288)
- NetworkingUtils.SetGlobalConfigValueString(eValue, val)
🤖 Auto-generated binding
- Parameters:
eValue (int - ESteamNetworkingConfigValue) –
val (str?) –
- Returns:
(bool) Return value
- SteamWorks:
- NetworkingUtils.SteamNetworkingIPAddr_GetFakeIPType(addr)
🤖 Auto-generated binding
- Parameters:
addr – (SteamNetworkingIPAddr)
- Returns:
(int - ESteamNetworkingFakeIPType) Return value
- SteamWorks:
- NetworkingUtils.SteamNetworkingIPAddr_ParseString(pszStr)
🤖 Auto-generated binding
- Parameters:
pszStr (str?) –
- Returns:
(bool) Return value
- Returns:
(SteamNetworkingIPAddr)
pAddr- SteamWorks:
Signature differences from C++ API:
Parameter
pAddris not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
Example:
local ok, addr = Steam.NetworkingUtils.SteamNetworkingIPAddr_ParseString('192.168.1.100:27015')
if ok then
print('Parsed IP address successfully')
end
- NetworkingUtils.SteamNetworkingIPAddr_ToString(addr, cbBuf, bWithPort)
🤖 Auto-generated binding
- Parameters:
addr – (SteamNetworkingIPAddr)
cbBuf (int?) – size of the buffer to allocate for
buf. Ifnilthen the buffer will beNULL.bWithPort (bool) –
- Returns:
(str)
buf- SteamWorks:
Signature differences from C++ API:
Parameter
bufis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
Example:
local str = Steam.NetworkingUtils.SteamNetworkingIPAddr_ToString(addr, 64, true)
print('Address:', str)
- NetworkingUtils.SteamNetworkingIdentity_ParseString(pszStr)
🤖 Auto-generated binding
- Parameters:
pszStr (str?) –
- Returns:
(bool) Return value
- Returns:
(SteamNetworkingIdentity)
pIdentity- SteamWorks:
Signature differences from C++ API:
Parameter
pIdentityis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
Example:
local ok, identity = Steam.NetworkingUtils.SteamNetworkingIdentity_ParseString('steamid:76561197960287930')
if ok then
print('Parsed identity successfully')
end
- NetworkingUtils.SteamNetworkingIdentity_ToString(identity, cbBuf)
🤖 Auto-generated binding
- Parameters:
identity – (SteamNetworkingIdentity)
cbBuf (int?) – size of the buffer to allocate for
buf. Ifnilthen the buffer will beNULL.
- Returns:
(str)
buf- SteamWorks:
Signature differences from C++ API:
Parameter
bufis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.
Example:
local str = Steam.NetworkingUtils.SteamNetworkingIdentity_ToString(identity, 128)
print('Identity:', str)
Unimplemented Methods
- NetworkingUtils.GetLocalPingLocation()
✋ Not implemented - unsupported type: SteamNetworkPingLocation_t &
- SteamWorks:
- NetworkingUtils.ParsePingLocationString()
✋ Not implemented - unsupported type: SteamNetworkPingLocation_t &
- SteamWorks:
- NetworkingUtils.GetLocalTimestamp()
✋ Not implemented - unsupported type: SteamNetworkingMicroseconds
- SteamWorks:
- NetworkingUtils.SetDebugOutputFunction()
✋ Not implemented - unsupported type: FSteamNetworkingSocketsDebugOutput
- SteamWorks:
- NetworkingUtils.SetGlobalConfigValuePtr()
✋ Not implemented - unsupported type: void *
- SteamWorks:
- NetworkingUtils.SetConfigValue()
✋ Not implemented - blocklist: Needs careful dealing with void*
- SteamWorks:
- NetworkingUtils.SetConfigValueStruct()
✋ Not implemented - blocklist: Needs careful dealing with void*
- SteamWorks:
- NetworkingUtils.GetConfigValue()
✋ Not implemented - unsupported type: void *
- SteamWorks:
Callbacks
- NetworkingUtils.OnSteamRelayNetworkStatus()
Callback for SteamRelayNetworkStatus_t
callback(data) receives:
data.m_eAvail (int - ESteamNetworkingAvailability)
data.m_bPingMeasurementInProgress (int)
data.m_eAvailNetworkConfig (int - ESteamNetworkingAvailability)
data.m_eAvailAnyRelay (int - ESteamNetworkingAvailability)
data.m_debugMsg (string)
Example:
function Steam.NetworkingUtils.OnSteamRelayNetworkStatus(data)
if data.m_eAvail == Steam.k_ESteamNetworkingAvailability_Current then
print('Relay network is ready')
end
end