Steamworks.NET icon indicating copy to clipboard operation
Steamworks.NET copied to clipboard

SteamNetworkingSockets.SendMessages has incorrect parameter types; can't be called successfully

Open Idles opened this issue 1 year ago • 0 comments

I was trying to put to use the newly-fixed connection lanes API and ran into something else; getting SIGSEGV in Unity when trying to call SteamNetworkingSockets.SendMessages.

The native method has this signature:

void SendMessages( int nMessages, SteamNetworkingMessage_t *const *pMessages, int64 *pOutMessageNumberOrResult );

The Steamworks.NET binding for that method has the signature:

public static void SendMessages(int nMessages, SteamNetworkingMessage_t[] pMessages, long[] pOutMessageNumberOrResult)

So looks to me like there's an issue with the pMessages parameter type. For other native APIs that take ** parameters, Steamworks.NET appears to use IntPtr[]. Seems like the fix should be similar to the one for #597

I did a search and wasn't able to find any projects on Github calling this method using Steamworks.NET, so it might not be in use by anyone else and thus went unnoticed

Idles avatar Mar 01 '24 06:03 Idles