mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-03-13 05:50:16 +03:00
Corrected ISteamNetworkingMessages, that was having wrong prototype
This commit is contained in:
parent
a3124e504e
commit
9ae6342620
@ -25,10 +25,12 @@ namespace Steamworks
|
||||
|
||||
#region FunctionMeta
|
||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingMessages_SendMessageToUser", CallingConvention = Platform.CC)]
|
||||
private static extern Result _SendMessageToUser( IntPtr self, ref NetIdentity identityRemote, [In,Out] IntPtr[] pubData, uint cubData, int nSendFlags, int nRemoteChannel );
|
||||
//private static extern Result _SendMessageToUser( IntPtr self, ref NetIdentity identityRemote, [In,Out] IntPtr[] pubData, uint cubData, int nSendFlags, int nRemoteChannel );
|
||||
private static extern Result _SendMessageToUser( IntPtr self, ref NetIdentity identityRemote, IntPtr pubData, uint cubData, int nSendFlags, int nRemoteChannel );
|
||||
|
||||
#endregion
|
||||
internal Result SendMessageToUser( ref NetIdentity identityRemote, [In,Out] IntPtr[] pubData, uint cubData, int nSendFlags, int nRemoteChannel )
|
||||
internal Result SendMessageToUser( ref NetIdentity identityRemote, IntPtr pubData, uint cubData, int nSendFlags, int nRemoteChannel )
|
||||
//internal Result SendMessageToUser( ref NetIdentity identityRemote, [In,Out] IntPtr[] pubData, uint cubData, int nSendFlags, int nRemoteChannel )
|
||||
{
|
||||
var returnValue = _SendMessageToUser( Self, ref identityRemote, pubData, cubData, nSendFlags, nRemoteChannel );
|
||||
return returnValue;
|
||||
|
@ -52,9 +52,7 @@ namespace Steamworks
|
||||
uint length = (uint)data.Length;
|
||||
fixed ( byte* p = data )
|
||||
{
|
||||
IntPtr[] pubData = new IntPtr[] { (IntPtr)p };
|
||||
|
||||
return Internal.SendMessageToUser( ref identity, pubData, length, (int)flags, channel );
|
||||
return Internal.SendMessageToUser( ref identity, (IntPtr)p, length, (int)flags, channel );
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,9 +103,9 @@ namespace Steamworks
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] bytes = new byte[msg->DataSize];
|
||||
Marshal.Copy(msg->DataPtr, bytes, 0, msg->DataSize);
|
||||
callback( bytes, msg->DataSize, msg->RecvTime, msg->MessageNumber, msg->Channel );
|
||||
byte[] data = new byte[msg->DataSize];
|
||||
Marshal.Copy( msg->DataPtr, data, 0, msg->DataSize );
|
||||
callback( data, msg->DataSize, msg->RecvTime, msg->MessageNumber, msg->Channel );
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user