2
0
Эх сурвалжийг харах

Merge pull request #174 from motion-twin/net_fixes

hxd.net fixes
Nicolas Cannasse 9 жил өмнө
parent
commit
099b1271f0

+ 4 - 2
hxd/net/LocalHost.hx

@@ -114,7 +114,7 @@ class LocalHost extends NetworkHost {
 		isAuth = true;
 	}
 
-	public static function openNewWindow() {
+	public static function openNewWindow( ?params : Dynamic<String> ) {
 		#if (flash && air3)
 		var opt = new flash.display.NativeWindowInitOptions();
 		opt.renderMode = flash.display.NativeWindowRenderMode.DIRECT;
@@ -126,7 +126,9 @@ class LocalHost extends NetworkHost {
 		var ctx = new flash.system.LoaderContext(false, new flash.system.ApplicationDomain());
 		ctx.allowCodeImport = true;
 		win.stage.addChild(l);
-		l.loadBytes(flash.Lib.current.stage.loaderInfo.bytes, ctx);
+		if( params != null )
+			ctx.parameters = params;
+		l.loadBytes(flash.Lib.current.loaderInfo.bytes, ctx);
 		win.activate();
 		#else
 		throw "Not implemented";

+ 2 - 2
hxd/net/Macros.hx

@@ -169,7 +169,7 @@ class Macros {
 			switch( a.toString() ) {
 			case "Float":
 				PFloat;
-			case "Int":
+			case "Int","UInt":
 				PInt;
 			case "Bool":
 				PBool;
@@ -452,7 +452,7 @@ class Macros {
 				}
 			}
 			var cexpr = Context.parse(loop(t.t).toString(), v.pos);
-			return macro $v = $ctx.getRef($cexpr,$cexpr.__clid);
+			return macro $v = $ctx.getRef($cexpr,@:privateAccess $cexpr.__clid);
 		case PAlias(at):
 			var cvt = at.t;
 			return macro {

+ 3 - 2
hxd/net/Serializer.hx

@@ -330,8 +330,9 @@ class Serializer {
 		if( s == null )
 			addByte(0);
 		else {
-			addInt(s.length + 1);
-			out.addString(s);
+			var b = haxe.io.Bytes.ofString(s);
+			addInt(b.length + 1);
+			out.add(b);
 		}
 	}