Prevent propagation of lock release events.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2720 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-07-22 22:54:14 +00:00
parent ef2d31db0b
commit 76af5d2353
3 changed files with 22 additions and 4 deletions
@@ -1,5 +1,5 @@
//
// $Id: DEvent.java,v 1.13 2003/04/30 22:32:04 mdb Exp $
// $Id: DEvent.java,v 1.14 2003/07/22 22:54:14 mdb Exp $
package com.threerings.presents.dobj;
@@ -37,6 +37,17 @@ public abstract class DEvent implements Streamable
return _toid;
}
/**
* Some events are used only internally on the server and need not be
* broadcast to subscribers, proxy or otherwise. Such events can
* return true here and short-circuit the normal proxy event dispatch
* mechanism.
*/
public boolean isPrivate ()
{
return false;
}
/**
* Applies the attribute modifications represented by this event to
* the specified target object. This is called by the distributed
@@ -1,5 +1,5 @@
//
// $Id: DObject.java,v 1.65 2003/07/20 17:02:26 mdb Exp $
// $Id: DObject.java,v 1.66 2003/07/22 22:54:14 mdb Exp $
package com.threerings.presents.dobj;
@@ -402,7 +402,7 @@ public class DObject implements Streamable
*/
public void notifyProxies (DEvent event)
{
if (_subs == null) {
if (_subs == null || event.isPrivate()) {
return;
}
@@ -1,5 +1,5 @@
//
// $Id: ReleaseLockEvent.java,v 1.7 2002/12/20 23:29:04 mdb Exp $
// $Id: ReleaseLockEvent.java,v 1.8 2003/07/22 22:54:14 mdb Exp $
package com.threerings.presents.dobj;
@@ -36,6 +36,13 @@ public class ReleaseLockEvent extends NamedEvent
{
}
// documentation inherited
public boolean isPrivate ()
{
// we need only run on the server; no need to propagate to proxies
return true;
}
/**
* Applies this lock release to the object.
*/