Fixed up some things and added streaming translations.
I'm to the point where I need to go back to array streaming and straighten that out. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3905 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -95,9 +95,9 @@ public class Client extends EventDispatcher
|
||||
public function getService (clazz :Class) :InvocationService
|
||||
{
|
||||
if (_bstrap != null) {
|
||||
for each (var service :InvocationService in _bstrap.services) {
|
||||
if (service is clazz) {
|
||||
return service;
|
||||
for each (var isvc :InvocationService in _bstrap.services.source) {
|
||||
if (isvc is clazz) {
|
||||
return isvc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,6 +190,8 @@ public class Client extends EventDispatcher
|
||||
_cloid = data.clientOid;
|
||||
|
||||
_invdir.init(omgr, _cloid, this);
|
||||
|
||||
Log.debug("TimeBaseService: " + requireService(TimeBaseService));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -298,8 +298,7 @@ public class ClientDObjectMgr
|
||||
_ocache[oid] = obj;
|
||||
|
||||
// let the penders know that the object is available
|
||||
var req :PendingRequest = _penders[oid];
|
||||
_penders[oid] = undefined;
|
||||
var req :PendingRequest = (_penders.remove(oid) as PendingRequest);
|
||||
if (req == null) {
|
||||
Log.warning("Got object, but no one cares?! " +
|
||||
"[oid=" + oid + ", obj=" + obj + "].");
|
||||
@@ -368,7 +367,7 @@ public class ClientDObjectMgr
|
||||
// otherwise we need to create a new request
|
||||
req = new PendingRequest(oid);
|
||||
req.addTarget(target);
|
||||
_penders.put(oid, req);
|
||||
_penders[oid] = req;
|
||||
// Log.info("Registering pending request [oid=" + oid + "].");
|
||||
|
||||
// and issue a request to get things rolling
|
||||
|
||||
@@ -50,9 +50,19 @@ public class Communicator
|
||||
inputFrameReceived);
|
||||
_inStream = new ObjectInputStream();
|
||||
|
||||
addClassTranslations();
|
||||
|
||||
_socket.connect(_client.getHostname(), _client.getPort());
|
||||
}
|
||||
|
||||
private function addClassTranslations () :void
|
||||
{
|
||||
_inStream.addTranslation("com.threerings.presents.dobj.DSet$Entry",
|
||||
"com.threerings.presents.dobj.DSetEntry");
|
||||
_outStream.addTranslation("com.threerings.presents.dobj.DSetEntry",
|
||||
"com.threerings.presents.dobj.DSet$Entry");
|
||||
}
|
||||
|
||||
public function logoff () :void
|
||||
{
|
||||
if (_socket == null) {
|
||||
|
||||
Reference in New Issue
Block a user