From 73b5c9ceb69de8b688320b8054192c696c73d041 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Fri, 4 Sep 2020 09:53:07 +0100 Subject: [PATCH] Manually create SteamNet delegates --- .../Interfaces/ISteamNetworkingUtils.cs | 2 +- Facepunch.Steamworks/Networking/Delegates.cs | 25 +++++++++++++++++++ .../Networking/NetDebugFunc.cs | 9 ------- 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 Facepunch.Steamworks/Networking/Delegates.cs delete mode 100644 Facepunch.Steamworks/Networking/NetDebugFunc.cs diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs index d185602..a25247a 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -257,7 +257,7 @@ namespace Steamworks var returnValue = _SetConnectionConfigValueFloat( Self, hConn, eValue, val ); return returnValue; } - + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueString", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Networking/Delegates.cs b/Facepunch.Steamworks/Networking/Delegates.cs new file mode 100644 index 0000000..d376a0b --- /dev/null +++ b/Facepunch.Steamworks/Networking/Delegates.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Steamworks.Data; + +namespace Steamworks +{ + [UnmanagedFunctionPointer( Platform.CC )] + internal delegate void NetDebugFunc( [In] NetDebugOutput nType, [In] IntPtr pszMsg ); + + [UnmanagedFunctionPointer( Platform.CC )] + internal unsafe delegate void FnSteamNetConnectionStatusChanged( ref SteamNetConnectionStatusChangedCallback_t arg ); + + [UnmanagedFunctionPointer( Platform.CC )] + internal delegate void FnSteamNetAuthenticationStatusChanged( ref SteamNetAuthenticationStatus_t arg ); + + [UnmanagedFunctionPointer( Platform.CC )] + internal delegate void FnSteamRelayNetworkStatusChanged( ref SteamRelayNetworkStatus_t arg ); + + [UnmanagedFunctionPointer( Platform.CC )] + internal delegate void FnSteamNetworkingMessagesSessionRequest( ref SteamNetworkingMessagesSessionRequest_t arg ); + + [UnmanagedFunctionPointer( Platform.CC )] + internal delegate void FnSteamNetworkingMessagesSessionFailed( ref SteamNetworkingMessagesSessionFailed_t arg ); +} diff --git a/Facepunch.Steamworks/Networking/NetDebugFunc.cs b/Facepunch.Steamworks/Networking/NetDebugFunc.cs deleted file mode 100644 index ec4cabd..0000000 --- a/Facepunch.Steamworks/Networking/NetDebugFunc.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Steamworks.Data; -using System; -using System.Runtime.InteropServices; - -namespace Steamworks.Data -{ - [UnmanagedFunctionPointer( Platform.CC )] - delegate void NetDebugFunc( [In] NetDebugOutput nType, [In] IntPtr pszMsg ); -} \ No newline at end of file