Unixed import nixage, service regen, some dependency injection.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5205 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -23,14 +23,13 @@ package com.threerings.crowd.server;
|
||||
|
||||
import com.threerings.crowd.data.BodyMarshaller;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.presents.server.InvocationDispatcher;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
|
||||
/**
|
||||
* Dispatches requests to the {@link BodyProvider}.
|
||||
*/
|
||||
public class BodyDispatcher extends InvocationDispatcher
|
||||
public class BodyDispatcher extends InvocationDispatcher<BodyMarshaller>
|
||||
{
|
||||
/**
|
||||
* Creates a dispatcher that may be registered to dispatch invocation
|
||||
@@ -42,7 +41,7 @@ public class BodyDispatcher extends InvocationDispatcher
|
||||
}
|
||||
|
||||
@Override // documentation inherited
|
||||
public InvocationMarshaller createMarshaller ()
|
||||
public BodyMarshaller createMarshaller ()
|
||||
{
|
||||
return new BodyMarshaller();
|
||||
}
|
||||
|
||||
@@ -24,9 +24,7 @@ package com.threerings.crowd.server;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.data.CrowdCodes;
|
||||
@@ -68,8 +66,7 @@ public class BodyManager
|
||||
*/
|
||||
public void updateOccupantInfo (BodyObject body, Place location, OccupantInfoOp occop)
|
||||
{
|
||||
PlaceManager pmgr = (location == null) ? null :
|
||||
CrowdServer.plreg.getPlaceManager(location.placeOid);
|
||||
PlaceManager pmgr = (location == null) ? null : _plreg.getPlaceManager(location.placeOid);
|
||||
if (pmgr == null) {
|
||||
return;
|
||||
}
|
||||
@@ -120,4 +117,7 @@ public class BodyManager
|
||||
log.debug("Setting user idle state [user=" + bobj.username + ", status=" + nstatus + "].");
|
||||
updateOccupantStatus(bobj, bobj.location, nstatus);
|
||||
}
|
||||
|
||||
/** Provides access to place managers. */
|
||||
@Inject protected PlaceRegistry _plreg;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
|
||||
package com.threerings.crowd.server;
|
||||
|
||||
import com.threerings.presents.dobj.AccessController;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import com.threerings.presents.server.PresentsClient;
|
||||
|
||||
import com.threerings.crowd.chat.server.SpeakUtil;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.data.OccupantInfo;
|
||||
import com.threerings.crowd.server.CrowdServer;
|
||||
|
||||
/**
|
||||
* The crowd client extends the presents client with crowd-specific client handling.
|
||||
@@ -42,7 +42,7 @@ public class CrowdClient extends PresentsClient
|
||||
if (_clobj != null) {
|
||||
// note that the user is disconnected
|
||||
BodyObject bobj = (BodyObject)_clobj;
|
||||
CrowdServer.bodyman.updateOccupantStatus(bobj, bobj.location, OccupantInfo.DISCONNECTED);
|
||||
_bodyman.updateOccupantStatus(bobj, bobj.location, OccupantInfo.DISCONNECTED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CrowdClient extends PresentsClient
|
||||
|
||||
// note that the user's active once more
|
||||
BodyObject bobj = (BodyObject)_clobj;
|
||||
CrowdServer.bodyman.updateOccupantStatus(bobj, bobj.location, OccupantInfo.ACTIVE);
|
||||
_bodyman.updateOccupantStatus(bobj, bobj.location, OccupantInfo.ACTIVE);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -68,7 +68,7 @@ public class CrowdClient extends PresentsClient
|
||||
|
||||
// reset our status in case this object remains around until they start their next session
|
||||
// (which could happen very soon)
|
||||
CrowdServer.bodyman.updateOccupantStatus(body, null, OccupantInfo.ACTIVE);
|
||||
_bodyman.updateOccupantStatus(body, null, OccupantInfo.ACTIVE);
|
||||
|
||||
// clear our chat history
|
||||
if (body != null) {
|
||||
@@ -84,6 +84,9 @@ public class CrowdClient extends PresentsClient
|
||||
*/
|
||||
protected void clearLocation (BodyObject bobj)
|
||||
{
|
||||
CrowdServer.locman.leaveOccupiedPlace(bobj);
|
||||
_locman.leaveOccupiedPlace(bobj);
|
||||
}
|
||||
|
||||
@Inject protected BodyManager _bodyman;
|
||||
@Inject protected LocationManager _locman;
|
||||
}
|
||||
|
||||
@@ -24,14 +24,13 @@ package com.threerings.crowd.server;
|
||||
import com.threerings.crowd.client.LocationService;
|
||||
import com.threerings.crowd.data.LocationMarshaller;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.presents.server.InvocationDispatcher;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
|
||||
/**
|
||||
* Dispatches requests to the {@link LocationProvider}.
|
||||
*/
|
||||
public class LocationDispatcher extends InvocationDispatcher
|
||||
public class LocationDispatcher extends InvocationDispatcher<LocationMarshaller>
|
||||
{
|
||||
/**
|
||||
* Creates a dispatcher that may be registered to dispatch invocation
|
||||
@@ -43,7 +42,7 @@ public class LocationDispatcher extends InvocationDispatcher
|
||||
}
|
||||
|
||||
@Override // documentation inherited
|
||||
public InvocationMarshaller createMarshaller ()
|
||||
public LocationMarshaller createMarshaller ()
|
||||
{
|
||||
return new LocationMarshaller();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.threerings.presents.dobj.RootDObjectManager;
|
||||
import com.threerings.presents.server.ClientManager;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
import com.threerings.presents.server.PresentsClient;
|
||||
|
||||
import com.threerings.crowd.client.LocationService;
|
||||
@@ -40,7 +39,6 @@ import com.threerings.crowd.data.LocationCodes;
|
||||
import com.threerings.crowd.data.Place;
|
||||
import com.threerings.crowd.data.PlaceConfig;
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
import com.threerings.crowd.server.CrowdServer;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user