/// <summary> /// <para>/ Parse back SteamNetworkPingLocation_t string. Returns false if we couldn't understand</para> /// <para>/ the string.</para> /// </summary> public static bool ParsePingLocationString(string pszString, out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); using (var pszString2 = new InteropHelp.UTF8StringHandle(pszString)) { return(NativeMethods.ISteamNetworkingUtils_ParsePingLocationString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), pszString2, out result)); } }
public static void SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity identity, out string buf, uint cbBuf) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cbBuf); NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref identity, intPtr, cbBuf); buf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); }
/// <summary> /// <para> String conversions. You'll usually access these using the respective</para> /// <para> inline methods.</para> /// </summary> public static void SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr addr, out string buf, uint cbBuf, bool bWithPort) { InteropHelp.TestIfAvailableGameServer(); IntPtr buf2 = Marshal.AllocHGlobal((int)cbBuf); NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr, buf2, cbBuf, bWithPort); buf = InteropHelp.PtrToStringUTF8(buf2); Marshal.FreeHGlobal(buf2); }
public static void ConvertPingLocationToString(ref SteamNetworkPingLocation_t location, out string pszBuf, int cchBufSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal(cchBufSize); NativeMethods.ISteamNetworkingUtils_ConvertPingLocationToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location, intPtr, cchBufSize); pszBuf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); }
public static int EstimatePingTimeFromLocalHost(ref SteamNetworkPingLocation_t remoteLocation) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_EstimatePingTimeFromLocalHost(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref remoteLocation)); }
public static int EstimatePingTimeBetweenTwoLocations(ref SteamNetworkPingLocation_t location1, ref SteamNetworkPingLocation_t location2) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location1, ref location2)); }
public static float GetLocalPingLocation(out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetLocalPingLocation(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out result)); }
/// <summary> /// <para>/ Get info about a configuration value. Returns the name of the value,</para> /// <para>/ or NULL if the value doesn't exist. Other output parameters can be NULL</para> /// <para>/ if you do not need them.</para> /// </summary> public static string GetConfigValueInfo(ESteamNetworkingConfigValue eValue, out ESteamNetworkingConfigDataType pOutDataType, out ESteamNetworkingConfigScope pOutScope) { InteropHelp.TestIfAvailableGameServer(); return(InteropHelp.PtrToStringUTF8(NativeMethods.ISteamNetworkingUtils_GetConfigValueInfo(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, out pOutDataType, out pOutScope))); }
public static int GetPOPList(out SteamNetworkingPOPID list, int nListSz) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetPOPList(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out list, nListSz)); }
public static IntPtr AllocateMessage(int cbAllocateBuffer) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_AllocateMessage(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), cbAllocateBuffer)); }
public static int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetworkingPOPID pViaRelayPoP) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetPingToDataCenter(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID, out pViaRelayPoP)); }
public static bool GetConfigValueInfo(ESteamNetworkingConfigValue eValue, IntPtr pOutName, out ESteamNetworkingConfigDataType pOutDataType, out ESteamNetworkingConfigScope pOutScope, out ESteamNetworkingConfigValue pOutNextValue) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetConfigValueInfo(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, pOutName, out pOutDataType, out pOutScope, out pOutNextValue)); }
public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, out ulong cbResult) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, out cbResult)); }
/// <summary> /// <para> Access to Steam Datagram Relay (SDR) network</para> /// <para> Initialization and status check</para> /// <para>/ If you know that you are going to be using the relay network (for example,</para> /// <para>/ because you anticipate making P2P connections), call this to initialize the</para> /// <para>/ relay network. If you do not call this, the initialization will</para> /// <para>/ be delayed until the first time you use a feature that requires access</para> /// <para>/ to the relay network, which will delay that first access.</para> /// <para>/</para> /// <para>/ You can also call this to force a retry if the previous attempt has failed.</para> /// <para>/ Performing any action that requires access to the relay network will also</para> /// <para>/ trigger a retry, and so calling this function is never strictly necessary,</para> /// <para>/ but it can be useful to call it a program launch time, if access to the</para> /// <para>/ relay network is anticipated.</para> /// <para>/</para> /// <para>/ Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t</para> /// <para>/ callbacks to know when initialization has completed.</para> /// <para>/ Typically initialization completes in a few seconds.</para> /// <para>/</para> /// <para>/ Note: dedicated servers hosted in known data centers do *not* need</para> /// <para>/ to call this, since they do not make routing decisions. However, if</para> /// <para>/ the dedicated server will be using P2P functionality, it will act as</para> /// <para>/ a "client" and this should be called.</para> /// </summary> public static void InitRelayNetworkAccess() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamNetworkingUtils_InitRelayNetworkAccess(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); }
public static ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType(ref SteamNetworkingIPAddr addr) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr)); }
public static bool SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr pAddr, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using (var pszStr2 = new InteropHelp.UTF8StringHandle(pszStr)) { return(NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pAddr, pszStr2)); } }
/// <summary> /// <para>/ Iterate the list of all configuration values in the current environment that it might</para> /// <para>/ be possible to display or edit using a generic UI. To get the first iterable value,</para> /// <para>/ pass k_ESteamNetworkingConfig_Invalid. Returns k_ESteamNetworkingConfig_Invalid</para> /// <para>/ to signal end of list.</para> /// <para>/</para> /// <para>/ The bEnumerateDevVars argument can be used to include "dev" vars. These are vars that</para> /// <para>/ are recommended to only be editable in "debug" or "dev" mode and typically should not be</para> /// <para>/ shown in a retail environment where a malicious local user might use this to cheat.</para> /// </summary> public static ESteamNetworkingConfigValue IterateGenericEditableConfigValues(ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_IterateGenericEditableConfigValues(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eCurrent, bEnumerateDevVars)); }
public static ESteamNetworkingConfigValue GetFirstConfigValue() { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetFirstConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils())); }
public static bool CheckPingDataUpToDate(float flMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_CheckPingDataUpToDate(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), flMaxAgeSeconds)); }
public static ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayNetworkStatus_t pDetails) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetRelayNetworkStatus(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pDetails)); }
public static int GetDirectPingToPOP(SteamNetworkingPOPID popID) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetDirectPingToPOP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID)); }
public static void SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamNetworkingUtils_SetDebugOutputFunction(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eDetailLevel, pfnFunc); }
public static int GetPOPCount() { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetPOPCount(CSteamGameServerAPIContext.GetSteamNetworkingUtils())); }
public static ESteamNetworkingFakeIPType GetIPv4FakeIPType(uint nIPv4) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetIPv4FakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4)); }
public static SteamNetworkingMicroseconds GetLocalTimestamp() { InteropHelp.TestIfAvailableGameServer(); return((SteamNetworkingMicroseconds)NativeMethods.ISteamNetworkingUtils_GetLocalTimestamp(CSteamGameServerAPIContext.GetSteamNetworkingUtils())); }
/// <summary> /// <para>/ Get the real identity associated with a given FakeIP.</para> /// <para>/</para> /// <para>/ On failure, returns:</para> /// <para>/ - k_EResultInvalidParam: the IP is not a FakeIP.</para> /// <para>/ - k_EResultNoMatch: we don't recognize that FakeIP and don't know the corresponding identity.</para> /// <para>/</para> /// <para>/ FakeIP's used by active connections, or the FakeIPs assigned to local identities,</para> /// <para>/ will always work. FakeIPs for recently destroyed connections will continue to</para> /// <para>/ return results for a little while, but not forever. At some point, we will forget</para> /// <para>/ FakeIPs to save space. It's reasonably safe to assume that you can read back the</para> /// <para>/ real identity of a connection very soon after it is destroyed. But do not wait</para> /// <para>/ indefinitely.</para> /// </summary> public static EResult GetRealIdentityForFakeIP(ref SteamNetworkingIPAddr fakeIP, out SteamNetworkingIdentity pOutRealIdentity) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_GetRealIdentityForFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref fakeIP, out pOutRealIdentity)); }
public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, ESteamNetworkingConfigDataType eDataType, IntPtr pArg) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamNetworkingUtils_SetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, eDataType, pArg)); }
public static bool SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity pIdentity, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszStr2 = new InteropHelp.UTF8StringHandle(pszStr); return(NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pIdentity, pszStr2)); }