diff --git a/src/as/com/threerings/crowd/chat/client/ChatDirector.as b/src/as/com/threerings/crowd/chat/client/ChatDirector.as index f08f5772b..38e9c2faa 100644 --- a/src/as/com/threerings/crowd/chat/client/ChatDirector.as +++ b/src/as/com/threerings/crowd/chat/client/ChatDirector.as @@ -325,6 +325,7 @@ public class ChatDirector extends BasicDirector return result; } + trace("Chatted: " + record + ", " + hist[0]); if (record) { // get the final history-ready command string hist[0] = "/" + ((hist[0] == null) ? command : hist[0]); diff --git a/src/as/com/threerings/presents/client/Communicator.as b/src/as/com/threerings/presents/client/Communicator.as index 22569b4a2..9f9eeb72f 100644 --- a/src/as/com/threerings/presents/client/Communicator.as +++ b/src/as/com/threerings/presents/client/Communicator.as @@ -189,6 +189,7 @@ public class Communicator */ protected function socketClosed (event :Event) :void { + Log.getLog(this).warning("socket was closed: " + event); _client.notifyObservers(ClientEvent.CLIENT_CONNECTION_FAILED); shutdown(null); } diff --git a/src/as/com/threerings/presents/data/ConfirmMarshaller.as b/src/as/com/threerings/presents/data/ConfirmMarshaller.as index c3f0c2953..da28e025e 100644 --- a/src/as/com/threerings/presents/data/ConfirmMarshaller.as +++ b/src/as/com/threerings/presents/data/ConfirmMarshaller.as @@ -8,13 +8,13 @@ public class ConfirmMarshaller extends ListenerMarshaller public static const REQUEST_PROCESSED :int = 1; // documetnation inherited from interfacc - public function requestProcessed () + public function requestProcessed () :void { // TODO: server only? } // documetnation inherited - public function dispatchResponse (methodId :int, args :Array) :void + public override function dispatchResponse (methodId :int, args :Array) :void { switch (methodId) { case REQUEST_PROCESSED: diff --git a/src/as/com/threerings/util/Cloneable.as b/src/as/com/threerings/util/Cloneable.as new file mode 100644 index 000000000..d8ca20d73 --- /dev/null +++ b/src/as/com/threerings/util/Cloneable.as @@ -0,0 +1,10 @@ +package com.threerings.util { + +public interface Cloneable +{ + /** + * Create a clone of this object. + */ + function clone () :Object; +} +} diff --git a/src/as/com/threerings/whirled/data/AuxModel.as b/src/as/com/threerings/whirled/data/AuxModel.as index 784ac235c..e7adf1f5e 100644 --- a/src/as/com/threerings/whirled/data/AuxModel.as +++ b/src/as/com/threerings/whirled/data/AuxModel.as @@ -21,17 +21,15 @@ package com.threerings.whirled.data { +import com.threerings.util.Cloneable; + import com.threerings.io.Streamable; /** * An interface that must be implemented by auxiliary scene models. */ -public interface AuxModel extends Streamable /*, Cloneable*/ +public interface AuxModel extends Streamable, Cloneable { - /** - * Creates a clone of this auxiliary model. - */ - function clone () :Object; - //throws CloneNotSupportedException; + // no new methods } } diff --git a/src/as/com/threerings/whirled/data/SceneModel.as b/src/as/com/threerings/whirled/data/SceneModel.as index 97f38acd8..b4f8cc64b 100644 --- a/src/as/com/threerings/whirled/data/SceneModel.as +++ b/src/as/com/threerings/whirled/data/SceneModel.as @@ -22,6 +22,7 @@ package com.threerings.whirled.data { import com.threerings.util.ClassUtil; +import com.threerings.util.Cloneable; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; @@ -38,7 +39,7 @@ import com.threerings.io.TypedArray; * server to the client. */ public class SceneModel - implements Streamable /*, Cloneable */ + implements Streamable, Cloneable { /** This scene's unique identifier. */ public var sceneId :int; @@ -64,7 +65,7 @@ public class SceneModel auxModels.push(auxModel); } - // documentation inherited + // documentation inherited from interface Cloneable public function clone () :Object { var clazz :Class = ClassUtil.getClass(this); diff --git a/src/as/com/threerings/whirled/spot/data/Location.as b/src/as/com/threerings/whirled/spot/data/Location.as index 79390a316..5a5c0dc92 100644 --- a/src/as/com/threerings/whirled/spot/data/Location.as +++ b/src/as/com/threerings/whirled/spot/data/Location.as @@ -23,12 +23,13 @@ package com.threerings.whirled.spot.data { import com.threerings.io.Streamable; +import com.threerings.util.Cloneable; import com.threerings.util.Hashable; /** * Contains information on a scene occupant's position and orientation. */ -public interface Location extends Streamable, Hashable +public interface Location extends Cloneable, Streamable, Hashable { /** * Get a new Location instance that is equals() to this one but that @@ -42,9 +43,10 @@ public interface Location extends Streamable, Hashable */ function equivalent (other :Location) :Boolean; - /** - * Locations are cloneable. - */ - function clone () :Object; + /** Two locations are equals by coordinates only. */ + //function equals (other :Object) :Boolean; + + /** The hashcode should be based on coordinates only. */ + //function hashCode () :int; } } diff --git a/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as b/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as index 41e4b70b2..8f79a4f7e 100644 --- a/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as +++ b/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as @@ -21,6 +21,9 @@ package com.threerings.whirled.spot.data { +import com.threerings.util.Byte; +import com.threerings.util.Integer; + import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.ConfirmListener; @@ -29,7 +32,7 @@ import com.threerings.presents.data.ConfirmMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; import com.threerings.whirled.client.SceneService; import com.threerings.whirled.client.SceneService_SceneMoveListener; -import com.threerings.whirled.data.SceneMarshaller; +import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller; import com.threerings.whirled.spot.client.SpotService; import com.threerings.whirled.spot.data.Location; @@ -73,7 +76,7 @@ public class SpotMarshaller extends InvocationMarshaller // documentation inherited from interface public function joinCluster (arg1 :Client, arg2 :int, arg3 :ConfirmListener) :void { - var listener3 :ConfirmMarshaller listener3 = new ConfirmMarshaller(); + var listener3 :ConfirmMarshaller = new ConfirmMarshaller(); listener3.listener = arg3; sendRequest(arg1, JOIN_CLUSTER, [ new Integer(arg2), listener3