At Ray's suggestion, go ahead and throw an error when the wrong type is read. Use the Type(obj) cast syntax (I was unaware that this would actually throw an error). Reading objects of a basic type like Array must still use "readObject(Array) as Array" so this is still supported, though not needed for user types.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5441 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -108,9 +108,9 @@ public class ClientObject extends DObject
|
||||
override public function readObject (ins :ObjectInputStream) :void
|
||||
{
|
||||
super.readObject(ins);
|
||||
username = (ins.readObject(Name) as Name);
|
||||
receivers = (ins.readObject(DSet) as DSet);
|
||||
_permPolicy = (ins.readObject(PermissionPolicy) as PermissionPolicy);
|
||||
username = Name(ins.readObject());
|
||||
receivers = DSet(ins.readObject());
|
||||
_permPolicy = PermissionPolicy(ins.readObject());
|
||||
}
|
||||
|
||||
protected var _permPolicy :PermissionPolicy;
|
||||
|
||||
Reference in New Issue
Block a user