Reduce conflict

This commit is contained in:
BruceChen 2023-01-14 15:58:36 +08:00
parent e0294f1beb
commit de9b47b2d9

View file

@ -329,10 +329,8 @@ namespace MinecraftClient.Protocol.Handlers
/// <returns>TRUE if the packet was processed, FALSE if ignored or unknown</returns>
internal bool HandlePacket(int packetID, Queue<byte> packetData)
{
#if Release
try
{
#endif
if (login_phase)
{
switch (packetID) //Packet IDs are different while logging in
@ -1984,8 +1982,8 @@ namespace MinecraftClient.Protocol.Handlers
return false; //Ignored packet
}
return true; //Packet processed
#if Release
}
#if Release
catch (Exception innerException)
{
if (innerException is ThreadAbortException || innerException is SocketException || innerException.InnerException is SocketException)
@ -1999,6 +1997,10 @@ namespace MinecraftClient.Protocol.Handlers
innerException.GetType()),
innerException);
}
#else
catch (SocketException) { }
catch (ThreadAbortException) { }
catch (ObjectDisposedException) { }
#endif
}