Skip to content

Commit

Permalink
Add bad CM handling to logon (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw authored and azuisleet committed Nov 2, 2019
1 parent 611c1dd commit 919af92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SteamKit2/SteamKit2/Steam/CMClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,9 @@ void HandleLogOnResponse( IPacketMsg packetMsg )
}

var logonResp = new ClientMsgProtobuf<CMsgClientLogonResponse>( packetMsg );
var logonResult = ( EResult )logonResp.Body.eresult;

if ( logonResp.Body.eresult == ( int )EResult.OK )
if ( logonResult == EResult.OK )
{
SessionID = logonResp.ProtoHeader.client_sessionid;
SteamID = logonResp.ProtoHeader.steamid;
Expand All @@ -537,6 +538,10 @@ void HandleLogOnResponse( IPacketMsg packetMsg )
heartBeatFunc.Delay = TimeSpan.FromSeconds( hbDelay );
heartBeatFunc.Start();
}
else if ( logonResult == EResult.TryAnotherCM || logonResult == EResult.ServiceUnavailable )
{
Servers.TryMark( connection.CurrentEndPoint, connection.ProtocolTypes, ServerQuality.Bad );
}
}
void HandleLoggedOff( IPacketMsg packetMsg )
{
Expand Down

0 comments on commit 919af92

Please sign in to comment.