Additional robustness: mark the server dobjmgr internal events as private

and refuse subscriptions to invalid oids (it's not out of the realm of
possibility that the clients were somehow subscribing to oid 0 and funny
things were happening).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2778 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-08-16 04:14:56 +00:00
parent 11fc21a59b
commit f013aba02b
2 changed files with 26 additions and 6 deletions
@@ -1,5 +1,5 @@
//
// $Id: ClientDObjectMgr.java,v 1.24 2003/05/22 17:23:53 mdb Exp $
// $Id: ClientDObjectMgr.java,v 1.25 2003/08/16 04:14:56 mdb Exp $
package com.threerings.presents.client;
@@ -74,7 +74,12 @@ public class ClientDObjectMgr
// inherit documentation from the interface
public void subscribeToObject (int oid, Subscriber target)
{
queueAction(oid, target, true);
if (oid <= 0) {
target.requestFailed(
oid, new ObjectAccessException("Invalid oid " + oid + "."));
} else {
queueAction(oid, target, true);
}
}
// inherit documentation from the interface
@@ -1,5 +1,5 @@
//
// $Id: PresentsDObjectMgr.java,v 1.36 2003/08/15 18:50:02 mdb Exp $
// $Id: PresentsDObjectMgr.java,v 1.37 2003/08/16 04:14:56 mdb Exp $
package com.threerings.presents.server;
@@ -77,9 +77,14 @@ public class PresentsDObjectMgr
// inherit documentation from the interface
public void subscribeToObject (int oid, Subscriber target)
{
// queue up an access object event
postEvent(new AccessObjectEvent(oid, target,
AccessObjectEvent.SUBSCRIBE));
if (oid <= 0) {
target.requestFailed(
oid, new ObjectAccessException("Invalid oid " + oid + "."));
} else {
// queue up an access object event
postEvent(new AccessObjectEvent(
oid, target, AccessObjectEvent.SUBSCRIBE));
}
}
// inherit documentation from the interface
@@ -659,6 +664,11 @@ public class PresentsDObjectMgr
_target = target;
}
public boolean isPrivate ()
{
return true;
}
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -731,6 +741,11 @@ public class PresentsDObjectMgr
_action = action;
}
public boolean isPrivate ()
{
return true;
}
public boolean applyToObject (DObject target)
throws ObjectAccessException
{