Adds more packet tests (#173)

This commit is contained in:
Kamron Batman 2020-07-05 20:14:23 -07:00 committed by GitHub
parent f868c34678
commit 9d4bc7cda2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 1015 additions and 33 deletions

View file

@ -630,7 +630,7 @@ namespace Server.Network
{
var info = ExpansionInfo.Table[i];
if ((info.RequiredClient != null && Version >= info.RequiredClient) || (Flags & info.ClientFlags) != 0)
if (info.RequiredClient != null && Version >= info.RequiredClient || (Flags & info.ClientFlags) != 0)
return info;
}
@ -642,13 +642,10 @@ namespace Server.Network
public ProtocolChanges ProtocolChanges { get; set; }
public bool SupportsExpansion(ExpansionInfo info, bool checkCoreExpansion = true)
{
if (info == null || (checkCoreExpansion && (int)Core.Expansion < info.ID))
return false;
return info.RequiredClient != null ? Version >= info.RequiredClient : (Flags & info.ClientFlags) != 0;
}
public bool SupportsExpansion(ExpansionInfo info, bool checkCoreExpansion = true) =>
info != null && (!checkCoreExpansion || (int)Core.Expansion >= info.ID) && (info.RequiredClient != null
? Version >= info.RequiredClient
: (Flags & info.ClientFlags) != 0);
public bool SupportsExpansion(Expansion ex, bool checkCoreExpansion = true) =>
SupportsExpansion(ExpansionInfo.GetInfo(ex), checkCoreExpansion);