From 24accddc75785ebb18d9a0a64671b371d0afcd1e Mon Sep 17 00:00:00 2001 From: Sylvio Sell Date: Tue, 3 Jul 2018 17:43:31 +0200 Subject: [PATCH] littlefix --- Source/peote/net/Remote.hx | 6 +++--- samples/rpc/src/remoteParams/User.hx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/peote/net/Remote.hx b/Source/peote/net/Remote.hx index 88467c0..f6d080a 100644 --- a/Source/peote/net/Remote.hx +++ b/Source/peote/net/Remote.hx @@ -29,6 +29,8 @@ class RemoteImpl return pack; } + public static function hasMeta(f:Field, s:String):Bool {for (m in f.meta) { if (m.name == s || m.name == ':$s') return true; } return false; } + public static function build() { try { Context.resolvePath("org/msgpack/MsgPack.hx"); isMsgPack = true; } catch (e:Dynamic) {} @@ -43,12 +45,10 @@ class RemoteImpl var fields = Context.getBuildFields(); for (f in fields) { - function hasMeta(s:String):Bool {for (m in f.meta) { if (m.name == s) return true;} return false;} - if (f.name == "new") { hasNoNew = false; } - else if ( hasMeta(":remote") ) + else if ( hasMeta(f, "remote") ) { var remParams = new Array(); switch (f.kind) diff --git a/samples/rpc/src/remoteParams/User.hx b/samples/rpc/src/remoteParams/User.hx index d96c678..248095b 100644 --- a/samples/rpc/src/remoteParams/User.hx +++ b/samples/rpc/src/remoteParams/User.hx @@ -7,8 +7,8 @@ package remoteParams; public var other:String; // NOT serialized #else class User { - @:s public var name: String; // serialized - @:s public var age: Int; // serialized + public var name: String; // serialized + public var age: Int; // serialized public var other:String; // serialized #end