rollback r4636 due to interference with non-yohoho projects
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4637 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -26,11 +26,8 @@ import java.util.Iterator;
|
|||||||
import com.threerings.util.Name;
|
import com.threerings.util.Name;
|
||||||
|
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
import com.threerings.presents.dobj.DObjectManager;
|
|
||||||
import com.threerings.presents.dobj.DSet;
|
import com.threerings.presents.dobj.DSet;
|
||||||
import com.threerings.presents.dobj.MessageEvent;
|
|
||||||
import com.threerings.presents.dobj.OidList;
|
import com.threerings.presents.dobj.OidList;
|
||||||
import com.threerings.presents.server.LocalDObjectMgr;
|
|
||||||
|
|
||||||
import com.threerings.crowd.Log;
|
import com.threerings.crowd.Log;
|
||||||
import com.threerings.crowd.chat.data.SpeakMarshaller;
|
import com.threerings.crowd.chat.data.SpeakMarshaller;
|
||||||
@@ -57,33 +54,14 @@ public class PlaceObject extends DObject
|
|||||||
// AUTO-GENERATED: FIELDS END
|
// AUTO-GENERATED: FIELDS END
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exists solely to make calls into the client's DObjManager look sensible:
|
* Exists solely to make calls into the manager look sensible:
|
||||||
* <pre>_plobj.manager.invoke("someMethod", args);</pre>
|
* <pre>_plobj.manager.invoke("someMethod", args);</pre>
|
||||||
*/
|
*/
|
||||||
public class ManagerCaller
|
public class ManagerCaller
|
||||||
{
|
{
|
||||||
|
|
||||||
public ManagerCaller ()
|
|
||||||
{
|
|
||||||
// Avoid NPE boochery if we're in singleplayer mode in yohoho:
|
|
||||||
// It turns out that GameController posts events directly to the queue
|
|
||||||
// of the DObjectManager of the GameObject, which is in this case the
|
|
||||||
// DObjectManager instead of the ClientDObjectMgr, so the sourceOid is
|
|
||||||
// unchanged, leading to the nasty problem of caller being null as the
|
|
||||||
// message was not actually received from any connected outside client.
|
|
||||||
DObjectManager clomgr = LocalDObjectMgr.clomgr;
|
|
||||||
if (clomgr != null) {
|
|
||||||
_mgr = clomgr;
|
|
||||||
} else {
|
|
||||||
_mgr = PlaceObject.this.getManager();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void invoke (String method, Object ... args) {
|
public void invoke (String method, Object ... args) {
|
||||||
_mgr.postEvent(new MessageEvent(_oid, method, args));
|
postMessage(method, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DObjectManager _mgr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import com.threerings.presents.net.BootstrapData;
|
|||||||
import com.threerings.presents.net.Credentials;
|
import com.threerings.presents.net.Credentials;
|
||||||
import com.threerings.presents.net.PingRequest;
|
import com.threerings.presents.net.PingRequest;
|
||||||
import com.threerings.presents.net.PongResponse;
|
import com.threerings.presents.net.PongResponse;
|
||||||
import com.threerings.presents.server.LocalDObjectMgr;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Through the client object, a connection to the system is established and maintained. The client
|
* Through the client object, a connection to the system is established and maintained. The client
|
||||||
@@ -620,7 +619,6 @@ public class Client
|
|||||||
// clear out our references
|
// clear out our references
|
||||||
_comm = null;
|
_comm = null;
|
||||||
_omgr = null;
|
_omgr = null;
|
||||||
LocalDObjectMgr.clomgr = null;
|
|
||||||
_clobj = null;
|
_clobj = null;
|
||||||
_cloid = -1;
|
_cloid = -1;
|
||||||
_standalone = false;
|
_standalone = false;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class LocalDObjectMgr extends PresentsDObjectMgr
|
|||||||
*/
|
*/
|
||||||
public DObjectManager getClientDObjectMgr (final int clientOid)
|
public DObjectManager getClientDObjectMgr (final int clientOid)
|
||||||
{
|
{
|
||||||
clomgr = new DObjectManager() {
|
return new DObjectManager() {
|
||||||
public boolean isManager (DObject object) {
|
public boolean isManager (DObject object) {
|
||||||
return LocalDObjectMgr.this.isManager(object);
|
return LocalDObjectMgr.this.isManager(object);
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,6 @@ public class LocalDObjectMgr extends PresentsDObjectMgr
|
|||||||
LocalDObjectMgr.this.removedLastSubscriber(obj, deathWish);
|
LocalDObjectMgr.this.removedLastSubscriber(obj, deathWish);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return clomgr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
@@ -93,6 +92,4 @@ public class LocalDObjectMgr extends PresentsDObjectMgr
|
|||||||
// accounting data
|
// accounting data
|
||||||
EventQueue.invokeLater(unit);
|
EventQueue.invokeLater(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DObjectManager clomgr = null;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user