diff --git a/src/as/com/threerings/presents/client/ClientDObjectMgr.as b/src/as/com/threerings/presents/client/ClientDObjectMgr.as index 480d64add..180937907 100644 --- a/src/as/com/threerings/presents/client/ClientDObjectMgr.as +++ b/src/as/com/threerings/presents/client/ClientDObjectMgr.as @@ -76,7 +76,7 @@ public class ClientDObjectMgr _flushInterval.addEventListener(TimerEvent.TIMER, flushObjects); _flushInterval.start(); - _actionInterval = new Timer(1); //TODO! + _actionInterval = new Timer(500); //TODO! _actionInterval.addEventListener(TimerEvent.TIMER, processNextAction); _actionInterval.start(); } diff --git a/src/as/com/threerings/presents/client/Communicator.as b/src/as/com/threerings/presents/client/Communicator.as index 0137cee8a..b1557186d 100644 --- a/src/as/com/threerings/presents/client/Communicator.as +++ b/src/as/com/threerings/presents/client/Communicator.as @@ -10,6 +10,8 @@ import flash.net.Socket; import flash.util.ByteArray; import flash.util.Endian; +import com.threerings.util.Util; + import com.threerings.io.FrameAvailableEvent; import com.threerings.io.FrameReader; import com.threerings.io.ObjectInputStream; @@ -90,6 +92,8 @@ public class Communicator // write the message (ends up in _outBuffer) _outStream.writeObject(msg); + trace("outBuffer: " + Util.bytesToString(_outBuffer)); + // frame it by writing the length, then the bytes _socket.writeInt(_outBuffer.length); _socket.writeBytes(_outBuffer); diff --git a/src/as/com/threerings/presents/dobj/DEvent.as b/src/as/com/threerings/presents/dobj/DEvent.as index 525519add..a0c1bfd6d 100644 --- a/src/as/com/threerings/presents/dobj/DEvent.as +++ b/src/as/com/threerings/presents/dobj/DEvent.as @@ -9,7 +9,7 @@ import com.threerings.io.Streamable; import com.threerings.util.Comparable; -public class DEvent +public /* abstract */ class DEvent implements Streamable { public function DEvent (targetOid :int) diff --git a/src/as/com/threerings/presents/dobj/NamedEvent.as b/src/as/com/threerings/presents/dobj/NamedEvent.as index de1347ac9..aca8a9b42 100644 --- a/src/as/com/threerings/presents/dobj/NamedEvent.as +++ b/src/as/com/threerings/presents/dobj/NamedEvent.as @@ -9,7 +9,7 @@ import com.threerings.io.ObjectOutputStream; * A common parent class for all events that are associated with a name * (in some cases a field name, in other cases just an identifying name). */ -public class NamedEvent extends DEvent +public /* abstract */ class NamedEvent extends DEvent { /** * Constructs a new named event for the specified target object with diff --git a/src/as/com/threerings/presents/net/Credentials.as b/src/as/com/threerings/presents/net/Credentials.as index d3a5c462c..6c705dc1e 100644 --- a/src/as/com/threerings/presents/net/Credentials.as +++ b/src/as/com/threerings/presents/net/Credentials.as @@ -8,7 +8,7 @@ import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; import com.threerings.io.Streamable; -public class Credentials +public /* abstract */ class Credentials implements Streamable { public function Credentials (username :Name) diff --git a/src/as/com/threerings/presents/net/DownstreamMessage.as b/src/as/com/threerings/presents/net/DownstreamMessage.as index 101d989cf..866a002e9 100644 --- a/src/as/com/threerings/presents/net/DownstreamMessage.as +++ b/src/as/com/threerings/presents/net/DownstreamMessage.as @@ -6,7 +6,7 @@ import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; import com.threerings.io.Streamable; -public class DownstreamMessage +public /* abstract */ class DownstreamMessage implements Streamable { /** The message id of the upstream message with which this downstream diff --git a/src/as/com/threerings/presents/net/UpstreamMessage.as b/src/as/com/threerings/presents/net/UpstreamMessage.as index 6096693ad..831d15799 100644 --- a/src/as/com/threerings/presents/net/UpstreamMessage.as +++ b/src/as/com/threerings/presents/net/UpstreamMessage.as @@ -8,7 +8,7 @@ import com.threerings.io.ObjectOutputStream; import com.threerings.util.JavaConstants; -public class UpstreamMessage +public /* abstract */ class UpstreamMessage implements Streamable { /** This is a unique (within the context of a reasonable period diff --git a/src/as/com/threerings/util/Util.as b/src/as/com/threerings/util/Util.as new file mode 100644 index 000000000..587574cbf --- /dev/null +++ b/src/as/com/threerings/util/Util.as @@ -0,0 +1,21 @@ +package com.threerings.util { + +import flash.util.ByteArray; +import flash.util.StringBuilder; + +public class Util +{ + public static function bytesToString (bytes :ByteArray) :String + { + var buf :StringBuilder = new StringBuilder(); + for (var ii :int = 0; ii < bytes.length; ii++) { + var b :int = bytes[ii]; + buf.append(HEX[b >> 4], HEX[b & 0xF]); + } + return buf.toString(); + } + + private static const HEX :Array = new Array("0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"); +} +}