mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-14 07:38:06 +03:00
Fixed dispatch double callbacks when server initialized
This commit is contained in:
parent
bf60680d87
commit
b0d23eff22
@ -67,7 +67,7 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ProcessCallback( msg );
|
ProcessCallback( msg, pipe == ServerPipe );
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A callback is a general global message
|
/// A callback is a general global message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void ProcessCallback( CallbackMsg_t msg )
|
private static void ProcessCallback( CallbackMsg_t msg, bool isServer )
|
||||||
{
|
{
|
||||||
// Is this a special callback telling us that the call result is ready?
|
// Is this a special callback telling us that the call result is ready?
|
||||||
if ( msg.Type == CallbackType.SteamAPICallCompleted )
|
if ( msg.Type == CallbackType.SteamAPICallCompleted )
|
||||||
@ -92,6 +92,9 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
foreach ( var item in list )
|
foreach ( var item in list )
|
||||||
{
|
{
|
||||||
|
if ( item.server != isServer )
|
||||||
|
continue;
|
||||||
|
|
||||||
item.action( msg.Data );
|
item.action( msg.Data );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ namespace Steamworks
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
internal static void InstallEvents( bool server )
|
internal void InstallEvents( bool server )
|
||||||
{
|
{
|
||||||
Dispatch.Install<SteamNetConnectionStatusChangedCallback_t>( ConnectionStatusChanged, server );
|
Dispatch.Install<SteamNetConnectionStatusChangedCallback_t>( ConnectionStatusChanged, server );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user