diff --git a/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as b/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as index 77c93e262..970752eec 100644 --- a/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as +++ b/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as @@ -90,8 +90,12 @@ public class AttributeChangedEvent extends NamedEvent oldValue :Object = null) { super(targetOid, name); - _value = value; - _oldValue = oldValue; + + // only init these values if they were specified + if (arguments.length > 0) { + _value = value; + _oldValue = oldValue; + } } // documentation inherited diff --git a/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as b/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as index 96d162814..20b4c91a6 100644 --- a/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as +++ b/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as @@ -56,11 +56,13 @@ public class ElementUpdatedEvent extends NamedEvent oldValue :Object = null, index :int = 0) { super(targetOid, name); - _value = value; - if (oldValue != null) { + + // only init these values if they were specified + if (arguments.length > 0) { + _value = value; _oldValue = oldValue; + _index = index; } - _index = index; } /** diff --git a/src/as/com/threerings/presents/dobj/EntryAddedEvent.as b/src/as/com/threerings/presents/dobj/EntryAddedEvent.as index f60178749..76b60c7bf 100644 --- a/src/as/com/threerings/presents/dobj/EntryAddedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryAddedEvent.as @@ -49,7 +49,11 @@ public class EntryAddedEvent extends NamedEvent targetOid :int = 0, name :String = null, entry :DSet_Entry = null) { super(targetOid, name); - _entry = entry; + + // only init these values if they were specified + if (arguments.length > 0) { + _entry = entry; + } } /** diff --git a/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as b/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as index 79bf55d14..4901740be 100644 --- a/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as @@ -53,8 +53,10 @@ public class EntryRemovedEvent extends NamedEvent oldEntry :DSet_Entry = null) { super(targetOid, name); - _key = key; - if (oldEntry != null) { + + // only init these values if they were specified + if (arguments.length > 0) { + _key = key; _oldEntry = oldEntry; } } diff --git a/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as b/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as index ba799462f..b1d311342 100644 --- a/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as @@ -51,8 +51,10 @@ public class EntryUpdatedEvent extends NamedEvent oldEntry :DSet_Entry = null) { super(targetOid, name); - _entry = entry; - if (oldEntry != null) { + + // only init these values if they were specified + if (arguments.length > 0) { + _entry = entry; _oldEntry = oldEntry; } } diff --git a/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as b/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as index 665765b43..80b03a1b5 100644 --- a/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as +++ b/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as @@ -53,9 +53,13 @@ public class InvocationNotificationEvent extends DEvent args :Array = null) { super(targetOid); - _receiverId = receiverId; - _methodId = methodId; - _args = args; + + // only init these values if they were specified + if (arguments.length > 0) { + _receiverId = receiverId; + _methodId = methodId; + _args = args; + } } /** diff --git a/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as b/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as index 00cac5fd5..48a0f0a89 100644 --- a/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as +++ b/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as @@ -49,9 +49,13 @@ public class InvocationRequestEvent extends DEvent args :Array = null) { super(targetOid); - _invCode = invCode; - _methodId = methodId; - _args = args; + + // only init these values if they were specified + if (arguments.length > 0) { + _invCode = invCode; + _methodId = methodId; + _args = args; + } } /** diff --git a/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as b/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as index f84e1d74d..901eeead7 100644 --- a/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as +++ b/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as @@ -49,9 +49,13 @@ public class InvocationResponseEvent extends DEvent args :Array = null) { super(targetOid); - _requestId = requestId; - _methodId = methodId; - _args = args; + + // only init these values if they were specified + if (arguments.length > 0) { + _requestId = requestId; + _methodId = methodId; + _args = args; + } } /** diff --git a/src/as/com/threerings/presents/dobj/MessageEvent.as b/src/as/com/threerings/presents/dobj/MessageEvent.as index a1b91329b..d20b42fe2 100644 --- a/src/as/com/threerings/presents/dobj/MessageEvent.as +++ b/src/as/com/threerings/presents/dobj/MessageEvent.as @@ -53,7 +53,11 @@ public class MessageEvent extends NamedEvent targetOid :int = 0, name :String = null, args :Array = null) { super(targetOid, name); - _args = args; + + // only init these values if they were specified + if (arguments.length > 0) { + _args = args; + } } /** diff --git a/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as b/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as index 169d98689..f64cb99d9 100644 --- a/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as +++ b/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as @@ -50,7 +50,11 @@ public class ObjectAddedEvent extends NamedEvent targetOid :int = 0, name :String = null, oid :int = 0) { super(targetOid, name); - _oid = oid; + + // only init these values if they were specified + if (arguments.length > 0) { + _oid = oid; + } } /** diff --git a/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as b/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as index a94cf6329..538aa89c0 100644 --- a/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as +++ b/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as @@ -52,7 +52,11 @@ public class ObjectRemovedEvent extends NamedEvent targetOid :int = 0, name :String = null, oid :int = 0) { super(targetOid, name); - _oid = oid; + + // only init these values if they were specified + if (arguments.length > 0) { + _oid = oid; + } } /** diff --git a/src/as/com/threerings/presents/dobj/OidList.as b/src/as/com/threerings/presents/dobj/OidList.as index 30a92f818..cc3925eeb 100644 --- a/src/as/com/threerings/presents/dobj/OidList.as +++ b/src/as/com/threerings/presents/dobj/OidList.as @@ -104,6 +104,14 @@ public class OidList return _oids[index]; } + /** + * Return a new array containing all the oids in this list. + */ + public function toArray () :Array + { + return _oids.concat(); + } + // documentation inherited from interface Streamable public function writeObject (out :ObjectOutputStream) :void {