Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -160,6 +160,10 @@ namespace Server.Commands.Generic
FieldAttributes.Private | FieldAttributes.InitOnly
);
// parseMethod.Invoke(null,
// parseArgs.Length == 2 ? new object[] {toParse, (int) parseArgs[1]} : new object[] {toParse});
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldstr, toParse);
@ -230,17 +234,36 @@ namespace Server.Commands.Generic
public override void Compile(MethodEmitter emitter)
{
bool inverse = m_Operator == StringOperator.NotEqual;
bool inverse = false;
string methodName = m_Operator switch
string methodName;
switch (m_Operator)
{
StringOperator.Equal => "Equals",
StringOperator.NotEqual => "Equals",
StringOperator.Contains => "Contains",
StringOperator.StartsWith => "StartsWith",
StringOperator.EndsWith => "EndsWith",
_ => throw new InvalidOperationException("Invalid string comparison operator.")
};
case StringOperator.Equal:
methodName = "Equals";
break;
case StringOperator.NotEqual:
methodName = "Equals";
inverse = true;
break;
case StringOperator.Contains:
methodName = "Contains";
break;
case StringOperator.StartsWith:
methodName = "StartsWith";
break;
case StringOperator.EndsWith:
methodName = "EndsWith";
break;
default:
throw new InvalidOperationException("Invalid string comparison operator.");
}
if (m_IgnoreCase || methodName == "Equals")
{

View file

@ -32,7 +32,8 @@ namespace Server.Commands.Generic
prop.CheckAccess(from);
}
assembly ??= new AssemblyEmitter("__dynamic");
if (assembly == null)
assembly = new AssemblyEmitter("__dynamic");
m_Comparer = DistinctCompiler.Compile<object>(assembly, baseType, m_Properties.ToArray());
}

View file

@ -31,7 +31,8 @@ namespace Server.Commands.Generic
order.Property.CheckAccess(from);
}
assembly ??= new AssemblyEmitter("__dynamic");
if (assembly == null)
assembly = new AssemblyEmitter("__dynamic");
m_Comparer = SortCompiler.Compile<object>(assembly, baseType, m_Orders.ToArray());
}
@ -68,6 +69,7 @@ namespace Server.Commands.Generic
case "up":
case "asc":
case "ascending":
isAscending = true;
++offset;
break;