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:
@@ -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;
|
package com.threerings.presents.client;
|
||||||
|
|
||||||
@@ -74,7 +74,12 @@ public class ClientDObjectMgr
|
|||||||
// inherit documentation from the interface
|
// inherit documentation from the interface
|
||||||
public void subscribeToObject (int oid, Subscriber target)
|
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
|
// 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;
|
package com.threerings.presents.server;
|
||||||
|
|
||||||
@@ -77,9 +77,14 @@ public class PresentsDObjectMgr
|
|||||||
// inherit documentation from the interface
|
// inherit documentation from the interface
|
||||||
public void subscribeToObject (int oid, Subscriber target)
|
public void subscribeToObject (int oid, Subscriber target)
|
||||||
{
|
{
|
||||||
// queue up an access object event
|
if (oid <= 0) {
|
||||||
postEvent(new AccessObjectEvent(oid, target,
|
target.requestFailed(
|
||||||
AccessObjectEvent.SUBSCRIBE));
|
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
|
// inherit documentation from the interface
|
||||||
@@ -659,6 +664,11 @@ public class PresentsDObjectMgr
|
|||||||
_target = target;
|
_target = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPrivate ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean applyToObject (DObject target)
|
public boolean applyToObject (DObject target)
|
||||||
throws ObjectAccessException
|
throws ObjectAccessException
|
||||||
{
|
{
|
||||||
@@ -731,6 +741,11 @@ public class PresentsDObjectMgr
|
|||||||
_action = action;
|
_action = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPrivate ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean applyToObject (DObject target)
|
public boolean applyToObject (DObject target)
|
||||||
throws ObjectAccessException
|
throws ObjectAccessException
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user