Skip to content
This repository was archived by the owner on Dec 23, 2022. It is now read-only.

Commit adf6326

Browse files
committed
Use Authenticated to call OnAuthResult event to ensure it's correct
1 parent 996a6c6 commit adf6326

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

RCONServerLib/RemoteConClient.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,21 +267,22 @@ internal void ParsePacket(byte[] rawPacket)
267267
{
268268
// ExecCommand is AuthResponse too.
269269
if (packet.Type == RemoteConPacket.PacketType.ExecCommand)
270+
{
270271
if (packet.Id == -1)
271272
{
272273
Log("Authentication failed.");
273274
Authenticated = false;
274-
if (OnAuthResult != null)
275-
OnAuthResult(false);
276275
}
277276
else
278277
{
279278
Log("Authentication success.");
280279
Authenticated = true;
281-
if (OnAuthResult != null)
282-
OnAuthResult(false);
283280
}
284281

282+
if (OnAuthResult != null)
283+
OnAuthResult(Authenticated);
284+
}
285+
285286
return;
286287
}
287288

0 commit comments

Comments
 (0)