Skip to content

Commit

Permalink
SteamNetworkingSockets improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rlabrecque committed Apr 15, 2020
1 parent 6700235 commit 455741e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Plugins/Steamworks.NET/autogen/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ internal static class NativeMethods {
#endregion
#region SteamNetworkingMessage_t Accessors
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_SteamNetworkingMessage_t_Release", CallingConvention = CallingConvention.Cdecl)]
public static extern void SteamAPI_SteamNetworkingMessage_t_Release(ref SteamNetworkingMessage_t self);
public static extern void SteamAPI_SteamNetworkingMessage_t_Release(IntPtr self);
#endregion
#region ISteamNetworkingConnectionCustomSignaling Accessors
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingConnectionCustomSignaling_SendSignal", CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -2097,7 +2097,7 @@ internal static class NativeMethods {
public static extern EResult ISteamNetworkingSockets_FlushMessagesOnConnection(IntPtr instancePtr, HSteamNetConnection hConn);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection", CallingConvention = CallingConvention.Cdecl)]
public static extern int ISteamNetworkingSockets_ReceiveMessagesOnConnection(IntPtr instancePtr, HSteamNetConnection hConn, out SteamNetworkingMessage_t ppOutMessages, int nMaxMessages);
public static extern int ISteamNetworkingSockets_ReceiveMessagesOnConnection(IntPtr instancePtr, HSteamNetConnection hConn, [In, Out] IntPtr[] ppOutMessages, int nMaxMessages);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionInfo", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
Expand Down Expand Up @@ -2140,7 +2140,7 @@ internal static class NativeMethods {
public static extern bool ISteamNetworkingSockets_SetConnectionPollGroup(IntPtr instancePtr, HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnPollGroup", CallingConvention = CallingConvention.Cdecl)]
public static extern int ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(IntPtr instancePtr, HSteamNetPollGroup hPollGroup, out SteamNetworkingMessage_t ppOutMessages, int nMaxMessages);
public static extern int ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(IntPtr instancePtr, HSteamNetPollGroup hPollGroup, [In, Out] IntPtr[] ppOutMessages, int nMaxMessages);
#if STEAMNETWORKINGSOCKETS_ENABLE_SDR
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceivedRelayAuthTicket", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ public static EResult FlushMessagesOnConnection(HSteamNetConnection hConn) {
/// <para>/ of them free up resources after you are done. It is safe to keep the object alive for</para>
/// <para>/ a little while (put it into some queue, etc), and you may call Release() from any thread.</para>
/// </summary>
public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, out SteamNetworkingMessage_t ppOutMessages, int nMaxMessages) {
public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[] ppOutMessages, int nMaxMessages) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out ppOutMessages, nMaxMessages);
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages);
}

/// <summary>
Expand Down Expand Up @@ -558,9 +558,9 @@ public static bool SetConnectionPollGroup(HSteamNetConnection hConn, HSteamNetPo
/// <para>/ appear consecutively in the list; they may be interleaved with messages for</para>
/// <para>/ other connections.)</para>
/// </summary>
public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, out SteamNetworkingMessage_t ppOutMessages, int nMaxMessages) {
public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntPtr[] ppOutMessages, int nMaxMessages) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup, out ppOutMessages, nMaxMessages);
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages);
}
#if STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions Plugins/Steamworks.NET/autogen/isteamnetworkingsockets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ public static EResult FlushMessagesOnConnection(HSteamNetConnection hConn) {
/// <para>/ of them free up resources after you are done. It is safe to keep the object alive for</para>
/// <para>/ a little while (put it into some queue, etc), and you may call Release() from any thread.</para>
/// </summary>
public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, out SteamNetworkingMessage_t ppOutMessages, int nMaxMessages) {
public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[] ppOutMessages, int nMaxMessages) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out ppOutMessages, nMaxMessages);
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages);
}

/// <summary>
Expand Down Expand Up @@ -558,9 +558,9 @@ public static bool SetConnectionPollGroup(HSteamNetConnection hConn, HSteamNetPo
/// <para>/ appear consecutively in the list; they may be interleaved with messages for</para>
/// <para>/ other connections.)</para>
/// </summary>
public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, out SteamNetworkingMessage_t ppOutMessages, int nMaxMessages) {
public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntPtr[] ppOutMessages, int nMaxMessages) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamAPIContext.GetSteamNetworkingSockets(), hPollGroup, out ppOutMessages, nMaxMessages);
return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages);
}
#if STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public struct SteamNetworkingMessage_t
/// You MUST call this when you're done with the object,
/// to free up memory, etc.
public void Release() {
NativeMethods.SteamAPI_SteamNetworkingMessage_t_Release(ref this);
NativeMethods.SteamAPI_SteamNetworkingMessage_t_Release(m_pfnRelease);
}
}
}
Expand Down

0 comments on commit 455741e

Please sign in to comment.