This reverts commit 179cb50557.
This commit is contained in:
parent
179cb50557
commit
c2ecc76457
588 changed files with 16260 additions and 10926 deletions
|
|
@ -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")
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue