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:

AllocateMessage

Allocates a SteamNetworkingMessage_t for use with SendMessages.

Signature differences from C++ API:

  • The cbAllocateBuffer parameter is not supported. Set m_pData and m_cbSize manually.

Notes:

  • Assigning to m_pData creates a new string in C++, and frees the old one, but does not modify m_cbSize automatically, so keep it in sync manually.

NetworkingUtils.CheckPingDataUpToDate(flMaxAgeSeconds)

🤖 Auto-generated binding

Parameters:

flMaxAgeSeconds (float) –

Returns:

(bool) Return value

SteamWorks:

CheckPingDataUpToDate

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. If nil then the buffer will be NULL.

Returns:

(str) pszBuf

SteamWorks:

ConvertPingLocationToString

Signature differences from C++ API:

  • Parameter pszBuf is 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:
Returns:

(int) Return value

SteamWorks:

EstimatePingTimeBetweenTwoLocations

NetworkingUtils.EstimatePingTimeFromLocalHost(remoteLocation)

🤖 Auto-generated binding

Parameters:

remoteLocation – (SteamNetworkPingLocation_t)

Returns:

(int) Return value

SteamWorks:

EstimatePingTimeFromLocalHost

NetworkingUtils.GetConfigValueInfo(eValue)

🤖 Auto-generated binding

Parameters:

eValue (int - ESteamNetworkingConfigValue) –

Returns:

(str) Return value

Returns:

(int) pOutDataType

Returns:

(int) pOutScope

SteamWorks:

GetConfigValueInfo

Signature differences from C++ API:

  • Parameter pOutDataType is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter pOutScope is 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:

GetDirectPingToPOP

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:

GetIPv4FakeIPType

NetworkingUtils.GetPOPCount()

🤖 Auto-generated binding

Returns:

(int) Return value

SteamWorks:

GetPOPCount

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. If nil then the buffer will be NULL.

Returns:

(int) Return value

Returns:

(int[]) list

SteamWorks:

GetPOPList

Signature differences from C++ API:

  • Parameter list is 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:

GetPingToDataCenter

Signature differences from C++ API:

  • Parameter pViaRelayPoP is 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:

GetRealIdentityForFakeIP

Signature differences from C++ API:

  • Parameter pOutRealIdentity is 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:

GetRelayNetworkStatus

Signature differences from C++ API:

  • Parameter pDetails is 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:

InitRelayNetworkAccess

Example:

Steam.NetworkingUtils.InitRelayNetworkAccess()
NetworkingUtils.IsFakeIPv4(nIPv4)

🤖 Auto-generated binding

Parameters:

nIPv4 (int) –

Returns:

(bool) Return value

SteamWorks:

IsFakeIPv4

NetworkingUtils.IterateGenericEditableConfigValues(eCurrent, bEnumerateDevVars)

🤖 Auto-generated binding

Parameters:
  • eCurrent (int - ESteamNetworkingConfigValue) –

  • bEnumerateDevVars (bool) –

Returns:

(int - ESteamNetworkingConfigValue) Return value

SteamWorks:

IterateGenericEditableConfigValues

NetworkingUtils.SetConnectionConfigValueFloat(hConn, eValue, val)

🤖 Auto-generated binding

Parameters:
  • hConn (int - HSteamNetConnection) –

  • eValue (int - ESteamNetworkingConfigValue) –

  • val (float) –

Returns:

(bool) Return value

SteamWorks:

SetConnectionConfigValueFloat

NetworkingUtils.SetConnectionConfigValueInt32(hConn, eValue, val)

🤖 Auto-generated binding

Parameters:
  • hConn (int - HSteamNetConnection) –

  • eValue (int - ESteamNetworkingConfigValue) –

  • val (int) –

Returns:

(bool) Return value

SteamWorks:

SetConnectionConfigValueInt32

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:

SetConnectionConfigValueString

NetworkingUtils.SetGlobalCallback_FakeIPResult(callback)

✍️ Manually implemented

Parameters:

callback (function?) – Function receiving a SteamNetworkingFakeIPResult_t. Pass nil to clear.

Returns:

(bool)

SteamWorks:

SetGlobalCallback_FakeIPResult

Sets or clears the global callback for fake IP result events.

Signature differences from C++ API:

  • The C++ FnSteamNetworkingFakeIPResult function pointer is replaced by a Lua function.

NetworkingUtils.SetGlobalCallback_MessagesSessionFailed(callback)

✍️ Manually implemented

Parameters:

callback (function?) – Function receiving a SteamNetworkingMessagesSessionFailed_t. Pass nil to clear.

Returns:

(bool)

SteamWorks:

SetGlobalCallback_MessagesSessionFailed

Sets or clears the global callback for messages session failed events.

Signature differences from C++ API:

  • The C++ FnSteamNetworkingMessagesSessionFailed function pointer is replaced by a Lua function.

NetworkingUtils.SetGlobalCallback_MessagesSessionRequest(callback)

✍️ Manually implemented

Parameters:

callback (function?) – Function receiving a SteamNetworkingMessagesSessionRequest_t. Pass nil to clear.

Returns:

(bool)

SteamWorks:

SetGlobalCallback_MessagesSessionRequest

Sets or clears the global callback for messages session request events.

Signature differences from C++ API:

  • The C++ FnSteamNetworkingMessagesSessionRequest function pointer is replaced by a Lua function.

NetworkingUtils.SetGlobalCallback_SteamNetAuthenticationStatusChanged(callback)

✍️ Manually implemented

Parameters:

callback (function?) – Function receiving a SteamNetAuthenticationStatus_t. Pass nil to clear.

Returns:

(bool)

SteamWorks:

SetGlobalCallback_SteamNetAuthenticationStatusChanged

Sets or clears the global callback for Steam network authentication status changes.

Signature differences from C++ API:

  • The C++ FnSteamNetAuthenticationStatusChanged function pointer is replaced by a Lua function.

NetworkingUtils.SetGlobalCallback_SteamNetConnectionStatusChanged(callback)

✍️ Manually implemented

Parameters:

callback (function?) – Function receiving a SteamNetConnectionStatusChangedCallback_t. Pass nil to clear.

Returns:

(bool)

SteamWorks:

SetGlobalCallback_SteamNetConnectionStatusChanged

Sets or clears the global callback for Steam network connection status changes.

Signature differences from C++ API:

  • The C++ FnSteamNetConnectionStatusChanged function pointer is replaced by a Lua function.

NetworkingUtils.SetGlobalCallback_SteamRelayNetworkStatusChanged(callback)

✍️ Manually implemented

Parameters:

callback (function?) – Function receiving a SteamRelayNetworkStatus_t. Pass nil to clear.

Returns:

(bool)

SteamWorks:

SetGlobalCallback_SteamRelayNetworkStatusChanged

Sets or clears the global callback for Steam relay network status changes.

Signature differences from C++ API:

  • The C++ FnSteamRelayNetworkStatusChanged function 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:

SetGlobalConfigValueFloat

NetworkingUtils.SetGlobalConfigValueInt32(eValue, val)

🤖 Auto-generated binding

Parameters:
  • eValue (int - ESteamNetworkingConfigValue) –

  • val (int) –

Returns:

(bool) Return value

SteamWorks:

SetGlobalConfigValueInt32

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:

SetGlobalConfigValueString

NetworkingUtils.SteamNetworkingIPAddr_GetFakeIPType(addr)

🤖 Auto-generated binding

Parameters:

addr – (SteamNetworkingIPAddr)

Returns:

(int - ESteamNetworkingFakeIPType) Return value

SteamWorks:

SteamNetworkingIPAddr_GetFakeIPType

NetworkingUtils.SteamNetworkingIPAddr_ParseString(pszStr)

🤖 Auto-generated binding

Parameters:

pszStr (str?) –

Returns:

(bool) Return value

Returns:

(SteamNetworkingIPAddr) pAddr

SteamWorks:

SteamNetworkingIPAddr_ParseString

Signature differences from C++ API:

  • Parameter pAddr is 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. If nil then the buffer will be NULL.

  • bWithPort (bool) –

Returns:

(str) buf

SteamWorks:

SteamNetworkingIPAddr_ToString

Signature differences from C++ API:

  • Parameter buf is 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:

SteamNetworkingIdentity_ParseString

Signature differences from C++ API:

  • Parameter pIdentity is 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. If nil then the buffer will be NULL.

Returns:

(str) buf

SteamWorks:

SteamNetworkingIdentity_ToString

Signature differences from C++ API:

  • Parameter buf is 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:

GetLocalPingLocation

NetworkingUtils.ParsePingLocationString()

Not implemented - unsupported type: SteamNetworkPingLocation_t &

SteamWorks:

ParsePingLocationString

NetworkingUtils.GetLocalTimestamp()

Not implemented - unsupported type: SteamNetworkingMicroseconds

SteamWorks:

GetLocalTimestamp

NetworkingUtils.SetDebugOutputFunction()

Not implemented - unsupported type: FSteamNetworkingSocketsDebugOutput

SteamWorks:

SetDebugOutputFunction

NetworkingUtils.SetGlobalConfigValuePtr()

Not implemented - unsupported type: void *

SteamWorks:

SetGlobalConfigValuePtr

NetworkingUtils.SetConfigValue()

Not implemented - blocklist: Needs careful dealing with void*

SteamWorks:

SetConfigValue

NetworkingUtils.SetConfigValueStruct()

Not implemented - blocklist: Needs careful dealing with void*

SteamWorks:

SetConfigValueStruct

NetworkingUtils.GetConfigValue()

Not implemented - unsupported type: void *

SteamWorks:

GetConfigValue

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