Skip to content

Commit

Permalink
Merge pull request #1053 from xPaw/userInitiated
Browse files Browse the repository at this point in the history
Fix up userInitiated in various disconnect calls
  • Loading branch information
yaakov-h authored Nov 18, 2021
2 parents e00e29b + dcef1b0 commit 0e42c79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions SteamKit2/SteamKit2/Steam/CMClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void Connect( ServerRecord? cmServer = null )
{
lock ( connectionLock )
{
this.Disconnect();
Disconnect( userInitiated: true );
Debug.Assert( connection == null );

Debug.Assert( connectionCancellation == null );
Expand Down Expand Up @@ -233,7 +233,7 @@ public void Connect( ServerRecord? cmServer = null )
/// </summary>
public void Disconnect() => Disconnect( userInitiated: true );

void Disconnect( bool userInitiated)
private protected void Disconnect( bool userInitiated )
{
lock ( connectionLock )
{
Expand Down Expand Up @@ -339,7 +339,7 @@ protected virtual bool OnClientMsgReceived( [NotNullWhen(true)] IPacketMsg? pack
if ( packetMsg == null )
{
LogDebug( "CMClient", "Packet message failed to parse, shutting down connection" );
Disconnect();
Disconnect( userInitiated: false );
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions SteamKit2/SteamKit2/Steam/SteamClient/SteamClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ protected override bool OnClientMsgReceived( IPacketMsg? packetMsg )
catch ( ProtoException ex )
{
LogDebug( nameof( SteamClient ), $"'{key.Name}' handler failed to (de)serialize a protobuf: {ex}" );
Disconnect();
Disconnect( userInitiated: false );
return false;
}
catch ( Exception ex )
{
LogDebug( nameof( SteamClient ), $"Unhandled exception from '{key.Name}' handler: {ex}" );
Disconnect();
Disconnect( userInitiated: false );
return false;
}
}
Expand Down

0 comments on commit 0e42c79

Please sign in to comment.