diff --git a/Facepunch.Steamworks/Enum/DebugOutputType.cs b/Facepunch.Steamworks/Enum/DebugOutputType.cs new file mode 100644 index 0000000..5f36bbd --- /dev/null +++ b/Facepunch.Steamworks/Enum/DebugOutputType.cs @@ -0,0 +1,17 @@ +namespace Steamworks.Data +{ + enum DebugOutputType : int + { + None = 0, + Bug = 1, // You used the API incorrectly, or an internal error happened + Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc) + Important = 3, // Nothing is wrong, but this is an important notification + Warning = 4, + Msg = 5, // Recommended amount + Verbose = 6, // Quite a bit + Debug = 7, // Practically everything + Everything = 8, // Wall of text, detailed packet contents breakdown, etc + + Force32Bit = 0x7fffffff + }; +} diff --git a/Facepunch.Steamworks/Enum/NetConfig.cs b/Facepunch.Steamworks/Enum/NetConfig.cs new file mode 100644 index 0000000..c45fd64 --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetConfig.cs @@ -0,0 +1,57 @@ +namespace Steamworks.Data +{ + internal enum NetConfig : int + { + Invalid = 0, + FakePacketLoss_Send = 2, + FakePacketLoss_Recv = 3, + FakePacketLag_Send = 4, + FakePacketLag_Recv = 5, + + FakePacketReorder_Send = 6, + FakePacketReorder_Recv = 7, + + FakePacketReorder_Time = 8, + + FakePacketDup_Send = 26, + FakePacketDup_Recv = 27, + + FakePacketDup_TimeMax = 28, + + TimeoutInitial = 24, + + TimeoutConnected = 25, + + SendBufferSize = 9, + + SendRateMin = 10, + SendRateMax = 11, + + NagleTime = 12, + + IP_AllowWithoutAuth = 23, + + SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, + + SDRClient_ConsecutitivePingTimeoutsFail = 20, + + SDRClient_MinPingsBeforePingAccurate = 21, + + SDRClient_SingleSocket = 22, + + SDRClient_ForceRelayCluster = 29, + + SDRClient_DebugTicketAddress = 30, + + SDRClient_ForceProxyAddr = 31, + + LogLevel_AckRTT = 13, + LogLevel_PacketDecode = 14, + LogLevel_Message = 15, + LogLevel_PacketGaps = 16, + LogLevel_P2PRendezvous = 17, + LogLevel_SDRRelayPings = 18, + + Force32Bit = 0x7fffffff + } +} diff --git a/Facepunch.Steamworks/Enum/NetConfigResult.cs b/Facepunch.Steamworks/Enum/NetConfigResult.cs new file mode 100644 index 0000000..8f8c6a2 --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetConfigResult.cs @@ -0,0 +1,13 @@ +namespace Steamworks.Data +{ + enum NetConfigResult + { + BadValue = -1, // No such configuration value + BadScopeObj = -2, // Bad connection handle, etc + BufferTooSmall = -3, // Couldn't fit the result in your buffer + OK = 1, + OKInherited = 2, // A value was not set at this level, but the effective (inherited) value was returned. + + Force32Bit = 0x7fffffff + }; +} diff --git a/Facepunch.Steamworks/Enum/NetConfigType.cs b/Facepunch.Steamworks/Enum/NetConfigType.cs new file mode 100644 index 0000000..7e7b60d --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetConfigType.cs @@ -0,0 +1,13 @@ +namespace Steamworks.Data +{ + enum NetConfigType + { + Int32 = 1, + Int64 = 2, + Float = 3, + String = 4, + FunctionPtr = 5, // NOTE: When setting callbacks, you should put the pointer into a variable and pass a pointer to that variable. + + Force32Bit = 0x7fffffff + }; +} diff --git a/Facepunch.Steamworks/Enum/NetScope.cs b/Facepunch.Steamworks/Enum/NetScope.cs new file mode 100644 index 0000000..4d03d5b --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetScope.cs @@ -0,0 +1,12 @@ +namespace Steamworks.Data +{ + internal enum NetScope : int + { + Global = 1, + SocketsInterface = 2, + ListenSocket = 3, + Connection = 4, + + Force32Bit = 0x7fffffff + } +} diff --git a/Facepunch.Steamworks/Enum/SteamNetworking.cs b/Facepunch.Steamworks/Enum/SteamNetworking.cs deleted file mode 100644 index b37b1dd..0000000 --- a/Facepunch.Steamworks/Enum/SteamNetworking.cs +++ /dev/null @@ -1,104 +0,0 @@ -namespace Steamworks.Data -{ - enum SteamNetworkingGetConfigValueResult - { - BadValue = -1, // No such configuration value - BadScopeObj = -2, // Bad connection handle, etc - BufferTooSmall = -3, // Couldn't fit the result in your buffer - OK = 1, - OKInherited = 2, // A value was not set at this level, but the effective (inherited) value was returned. - - Force32Bit = 0x7fffffff - }; - - enum NetConfigType - { - Int32 = 1, - Int64 = 2, - Float = 3, - String = 4, - FunctionPtr = 5, // NOTE: When setting callbacks, you should put the pointer into a variable and pass a pointer to that variable. - - Force32Bit = 0x7fffffff - }; - - enum SteamNetworkingSocketsDebugOutputType : int - { - None = 0, - Bug = 1, // You used the API incorrectly, or an internal error happened - Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc) - Important = 3, // Nothing is wrong, but this is an important notification - Warning = 4, - Msg = 5, // Recommended amount - Verbose = 6, // Quite a bit - Debug = 7, // Practically everything - Everything = 8, // Wall of text, detailed packet contents breakdown, etc - - Force32Bit = 0x7fffffff - }; - - internal enum NetScope : int - { - Global = 1, - SocketsInterface = 2, - ListenSocket = 3, - Connection = 4, - - Force32Bit = 0x7fffffff - } - - internal enum NetConfig : int - { - Invalid = 0, - FakePacketLoss_Send = 2, - FakePacketLoss_Recv = 3, - FakePacketLag_Send = 4, - FakePacketLag_Recv = 5, - - FakePacketReorder_Send = 6, - FakePacketReorder_Recv = 7, - - FakePacketReorder_Time = 8, - - FakePacketDup_Send = 26, - FakePacketDup_Recv = 27, - - FakePacketDup_TimeMax = 28, - - TimeoutInitial = 24, - - TimeoutConnected = 25, - - SendBufferSize = 9, - - SendRateMin = 10, - SendRateMax = 11, - - NagleTime = 12, - - IP_AllowWithoutAuth = 23, - - SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, - - SDRClient_ConsecutitivePingTimeoutsFail = 20, - - SDRClient_MinPingsBeforePingAccurate = 21, - - SDRClient_SingleSocket = 22, - - SDRClient_ForceRelayCluster = 29, - - SDRClient_DebugTicketAddress = 30, - - SDRClient_ForceProxyAddr = 31, - - LogLevel_AckRTT = 13, - LogLevel_PacketDecode = 14, - LogLevel_Message = 15, - LogLevel_PacketGaps = 16, - LogLevel_P2PRendezvous = 17, - LogLevel_SDRRelayPings = 18, - - Force32Bit = 0x7fffffff - } -} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs index f8c256d..0b45f7b 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -169,11 +169,11 @@ internal long GetLocalTimestamp() #region FunctionMeta [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - private delegate void FSetDebugOutputFunction( IntPtr self, SteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ); + private delegate void FSetDebugOutputFunction( IntPtr self, DebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ); private FSetDebugOutputFunction _SetDebugOutputFunction; #endregion - internal void SetDebugOutputFunction( SteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) + internal void SetDebugOutputFunction( DebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) { _SetDebugOutputFunction( Self, eDetailLevel, pfnFunc ); } @@ -192,11 +192,11 @@ internal bool SetConfigValue( NetConfig eValue, NetScope eScopeType, long scopeO #region FunctionMeta [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - private delegate SteamNetworkingGetConfigValueResult FGetConfigValue( IntPtr self, NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ); + private delegate NetConfigResult FGetConfigValue( IntPtr self, NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ); private FGetConfigValue _GetConfigValue; #endregion - internal SteamNetworkingGetConfigValueResult GetConfigValue( NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ) + internal NetConfigResult GetConfigValue( NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ) { return _GetConfigValue( Self, eValue, eScopeType, scopeObj, ref pOutDataType, pResult, ref cbResult ); } diff --git a/Facepunch.Steamworks/SteamNetworkingUtils.cs b/Facepunch.Steamworks/SteamNetworkingUtils.cs index a8147ad..3c339c5 100644 --- a/Facepunch.Steamworks/SteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -133,7 +133,7 @@ internal unsafe static int GetConfigInt( NetConfig type ) int* ptr = &value; ulong size = sizeof( int ); var result = Internal.GetConfigValue( type, NetScope.Global, 0, ref dtype, (IntPtr) ptr, ref size ); - if ( result != SteamNetworkingGetConfigValueResult.OK ) + if ( result != NetConfigResult.OK ) return 0; return value; @@ -152,7 +152,7 @@ internal unsafe static float GetConfigFloat( NetConfig type ) float* ptr = &value; ulong size = sizeof( float ); var result = Internal.GetConfigValue( type, NetScope.Global, 0, ref dtype, (IntPtr)ptr, ref size ); - if ( result != SteamNetworkingGetConfigValueResult.OK ) + if ( result != NetConfigResult.OK ) return 0; return value; diff --git a/Facepunch.Steamworks/Structs/SteamNetworking.cs b/Facepunch.Steamworks/Structs/SteamNetworking.cs index 328ed27..3b8f786 100644 --- a/Facepunch.Steamworks/Structs/SteamNetworking.cs +++ b/Facepunch.Steamworks/Structs/SteamNetworking.cs @@ -5,7 +5,7 @@ namespace Steamworks.Data { - delegate void FSteamNetworkingSocketsDebugOutput (SteamNetworkingSocketsDebugOutputType nType, string pszMsg ); + delegate void FSteamNetworkingSocketsDebugOutput (DebugOutputType nType, string pszMsg ); public struct SteamNetworkingPOPID { diff --git a/Generator/Cleanup.cs b/Generator/Cleanup.cs index 6efb163..0cd94e8 100644 --- a/Generator/Cleanup.cs +++ b/Generator/Cleanup.cs @@ -37,6 +37,8 @@ public static string ConvertType( string type ) type = type.Replace( "SteamNetConnectionInfo_t", "ConnectionInfo" ); type = type.Replace( "SteamNetworkingConnectionState", "ConnectionState" ); type = type.Replace( "SteamNetworkingMicroseconds", "long" ); + type = type.Replace( "SteamNetworkingSocketsDebugOutputType", "DebugOutputType" ); + type = type.Replace( "SteamNetworkingGetConfigValueResult", "NetConfigResult" ); return type; }