mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-28 07:35:55 +03:00
Fixed pointer size in ConnectionInterface
This commit is contained in:
parent
39bc7b5c1b
commit
caea5ccb9b
@ -72,9 +72,8 @@ public virtual void OnDisconnected( ConnectionInfo data )
|
|||||||
|
|
||||||
public void Receive( int bufferSize = 32 )
|
public void Receive( int bufferSize = 32 )
|
||||||
{
|
{
|
||||||
// #32bit
|
|
||||||
int processed = 0;
|
int processed = 0;
|
||||||
IntPtr messageBuffer = Marshal.AllocHGlobal( 8 * bufferSize );
|
IntPtr messageBuffer = Marshal.AllocHGlobal( IntPtr.Size * bufferSize );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -82,8 +81,7 @@ public void Receive( int bufferSize = 32 )
|
|||||||
|
|
||||||
for ( int i = 0; i < processed; i++ )
|
for ( int i = 0; i < processed; i++ )
|
||||||
{
|
{
|
||||||
// #32bit
|
ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * IntPtr.Size ) );
|
||||||
ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * 8) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -64,9 +64,8 @@ public virtual void OnDisconnected( Connection connection, ConnectionInfo data )
|
|||||||
|
|
||||||
public void Receive( int bufferSize = 32 )
|
public void Receive( int bufferSize = 32 )
|
||||||
{
|
{
|
||||||
// #32bit
|
|
||||||
int processed = 0;
|
int processed = 0;
|
||||||
IntPtr messageBuffer = Marshal.AllocHGlobal( 8 * bufferSize );
|
IntPtr messageBuffer = Marshal.AllocHGlobal( IntPtr.Size * bufferSize );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -74,8 +73,7 @@ public void Receive( int bufferSize = 32 )
|
|||||||
|
|
||||||
for ( int i = 0; i < processed; i++ )
|
for ( int i = 0; i < processed; i++ )
|
||||||
{
|
{
|
||||||
// #32bit
|
ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * IntPtr.Size ) );
|
||||||
ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * 8 ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
Loading…
Reference in New Issue
Block a user