|
@@ -1523,9 +1523,24 @@ namespace InABox.Core
|
|
|
public void DeserializeBinary(CoreBinaryReader reader)
|
|
|
{
|
|
|
// For compatability purposes when redesigning system to no longer use Serializable Expression.
|
|
|
- reader.ReadByte();
|
|
|
-
|
|
|
- Property = reader.ReadString();
|
|
|
+ var b = reader.ReadByte();
|
|
|
+ if(b != 0)
|
|
|
+ {
|
|
|
+ var exp = reader.DeserialiseExpression(typeof(T), b);
|
|
|
+ if(exp is ParameterExpression)
|
|
|
+ {
|
|
|
+ Property = "";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Property = CoreUtils.ExpressionToString(typeof(object), exp);
|
|
|
+ Logger.Send(LogType.Information, "", $"Non-zero byte: {Property} ({exp.Type})");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Property = reader.ReadString();
|
|
|
+ }
|
|
|
|
|
|
Operator = (Operator)reader.ReadByte();
|
|
|
if(Operator == Operator.Not)
|
|
@@ -2039,6 +2054,11 @@ namespace InABox.Core
|
|
|
var result = (Activator.CreateInstance(finaltype) as IFilter)!;
|
|
|
|
|
|
var prop = data["Expression"].ToString();
|
|
|
+ if (prop.StartsWith('{'))
|
|
|
+ {
|
|
|
+ var exp = CoreUtils.StringToExpression(prop);
|
|
|
+ prop = CoreUtils.ExpressionToString(typeof(object), exp);
|
|
|
+ }
|
|
|
var op = (Operator)int.Parse(data["Operator"].ToString());
|
|
|
|
|
|
if(data.TryGetValue("IsNot", out var isNotValue) && isNotValue is bool b)
|