diff --git a/src/java/com/threerings/crowd/chat/client/MuteDirector.java b/src/java/com/threerings/crowd/chat/client/MuteDirector.java index a52b0d067..dc2dddaba 100644 --- a/src/java/com/threerings/crowd/chat/client/MuteDirector.java +++ b/src/java/com/threerings/crowd/chat/client/MuteDirector.java @@ -32,7 +32,6 @@ import com.threerings.util.Name; import com.threerings.crowd.util.CrowdContext; import com.threerings.presents.client.BasicDirector; -import com.threerings.presents.client.Client; /** * Manages the mutelist. diff --git a/src/java/com/threerings/crowd/chat/data/ChatCodes.java b/src/java/com/threerings/crowd/chat/data/ChatCodes.java index 421aeac82..48a170681 100644 --- a/src/java/com/threerings/crowd/chat/data/ChatCodes.java +++ b/src/java/com/threerings/crowd/chat/data/ChatCodes.java @@ -24,8 +24,6 @@ package com.threerings.crowd.chat.data; import com.threerings.presents.data.InvocationCodes; import com.threerings.presents.data.Permission; -import com.threerings.crowd.data.BodyObject; - import com.threerings.crowd.chat.client.ChatDirector; import com.threerings.crowd.chat.client.SpeakService; diff --git a/src/java/com/threerings/crowd/chat/data/ChatMarshaller.java b/src/java/com/threerings/crowd/chat/data/ChatMarshaller.java index ab7081014..de4c7036a 100644 --- a/src/java/com/threerings/crowd/chat/data/ChatMarshaller.java +++ b/src/java/com/threerings/crowd/chat/data/ChatMarshaller.java @@ -26,7 +26,6 @@ import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; -import com.threerings.presents.net.Transport; import com.threerings.util.Name; /** diff --git a/src/java/com/threerings/crowd/chat/data/SpeakMarshaller.java b/src/java/com/threerings/crowd/chat/data/SpeakMarshaller.java index cdd814fe0..aa4fd8e86 100644 --- a/src/java/com/threerings/crowd/chat/data/SpeakMarshaller.java +++ b/src/java/com/threerings/crowd/chat/data/SpeakMarshaller.java @@ -24,7 +24,6 @@ package com.threerings.crowd.chat.data; import com.threerings.crowd.chat.client.SpeakService; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link SpeakService} interface diff --git a/src/java/com/threerings/crowd/chat/server/ChatDispatcher.java b/src/java/com/threerings/crowd/chat/server/ChatDispatcher.java index 759eb06ea..ec4e7a966 100644 --- a/src/java/com/threerings/crowd/chat/server/ChatDispatcher.java +++ b/src/java/com/threerings/crowd/chat/server/ChatDispatcher.java @@ -25,7 +25,6 @@ import com.threerings.crowd.chat.client.ChatService; import com.threerings.crowd.chat.data.ChatMarshaller; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.util.Name; @@ -33,7 +32,7 @@ import com.threerings.util.Name; /** * Dispatches requests to the {@link ChatProvider}. */ -public class ChatDispatcher extends InvocationDispatcher +public class ChatDispatcher extends InvocationDispatcher { /** * Creates a dispatcher that may be registered to dispatch invocation @@ -45,7 +44,7 @@ public class ChatDispatcher extends InvocationDispatcher } @Override // documentation inherited - public InvocationMarshaller createMarshaller () + public ChatMarshaller createMarshaller () { return new ChatMarshaller(); } diff --git a/src/java/com/threerings/crowd/chat/server/SpeakDispatcher.java b/src/java/com/threerings/crowd/chat/server/SpeakDispatcher.java index 25fa493e9..1032917f2 100644 --- a/src/java/com/threerings/crowd/chat/server/SpeakDispatcher.java +++ b/src/java/com/threerings/crowd/chat/server/SpeakDispatcher.java @@ -23,14 +23,13 @@ package com.threerings.crowd.chat.server; import com.threerings.crowd.chat.data.SpeakMarshaller; 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 SpeakProvider}. */ -public class SpeakDispatcher extends InvocationDispatcher +public class SpeakDispatcher extends InvocationDispatcher { /** * Creates a dispatcher that may be registered to dispatch invocation @@ -42,7 +41,7 @@ public class SpeakDispatcher extends InvocationDispatcher } @Override // documentation inherited - public InvocationMarshaller createMarshaller () + public SpeakMarshaller createMarshaller () { return new SpeakMarshaller(); } diff --git a/src/java/com/threerings/crowd/chat/server/SpeakUtil.java b/src/java/com/threerings/crowd/chat/server/SpeakUtil.java index 65df555a5..e14bae6a6 100644 --- a/src/java/com/threerings/crowd/chat/server/SpeakUtil.java +++ b/src/java/com/threerings/crowd/chat/server/SpeakUtil.java @@ -30,14 +30,11 @@ import com.google.common.collect.Maps; import com.samskivert.util.ObserverList; import com.threerings.util.Name; -import com.threerings.presents.data.ClientObject; import com.threerings.presents.dobj.DObject; import com.threerings.presents.dobj.RootDObjectManager; -import com.threerings.presents.server.InvocationProvider; import com.threerings.crowd.data.BodyObject; -import com.threerings.crowd.chat.client.SpeakService; import com.threerings.crowd.chat.data.ChatCodes; import com.threerings.crowd.chat.data.ChatMessage; import com.threerings.crowd.chat.data.SpeakObject; diff --git a/src/java/com/threerings/crowd/client/LocationDirector.java b/src/java/com/threerings/crowd/client/LocationDirector.java index dbeaae456..4216a0ceb 100644 --- a/src/java/com/threerings/crowd/client/LocationDirector.java +++ b/src/java/com/threerings/crowd/client/LocationDirector.java @@ -29,7 +29,6 @@ import com.threerings.presents.client.BasicDirector; import com.threerings.presents.client.Client; import com.threerings.presents.util.SafeSubscriber; -import com.threerings.presents.dobj.DObject; import com.threerings.presents.dobj.ObjectAccessException; import com.threerings.presents.dobj.Subscriber; diff --git a/src/java/com/threerings/crowd/client/OccupantDirector.java b/src/java/com/threerings/crowd/client/OccupantDirector.java index 33f85eef2..3970e3579 100644 --- a/src/java/com/threerings/crowd/client/OccupantDirector.java +++ b/src/java/com/threerings/crowd/client/OccupantDirector.java @@ -21,8 +21,6 @@ package com.threerings.crowd.client; -import java.util.Iterator; - import com.samskivert.util.ObserverList; import com.threerings.util.Name; @@ -37,7 +35,6 @@ import com.threerings.crowd.data.OccupantInfo; import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.util.CrowdContext; -import static com.threerings.crowd.Log.log; /** * The occupant director listens for occupants of places to enter and diff --git a/src/java/com/threerings/crowd/data/BodyMarshaller.java b/src/java/com/threerings/crowd/data/BodyMarshaller.java index ea75d9a4d..d13e5f826 100644 --- a/src/java/com/threerings/crowd/data/BodyMarshaller.java +++ b/src/java/com/threerings/crowd/data/BodyMarshaller.java @@ -24,7 +24,6 @@ package com.threerings.crowd.data; import com.threerings.crowd.client.BodyService; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link BodyService} interface diff --git a/src/java/com/threerings/crowd/data/LocationMarshaller.java b/src/java/com/threerings/crowd/data/LocationMarshaller.java index cbbc3c342..114bdb1b5 100644 --- a/src/java/com/threerings/crowd/data/LocationMarshaller.java +++ b/src/java/com/threerings/crowd/data/LocationMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.crowd.client.LocationService; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link LocationService} interface diff --git a/src/java/com/threerings/crowd/peer/data/CrowdPeerMarshaller.java b/src/java/com/threerings/crowd/peer/data/CrowdPeerMarshaller.java index 2896a92bf..b5d180de1 100644 --- a/src/java/com/threerings/crowd/peer/data/CrowdPeerMarshaller.java +++ b/src/java/com/threerings/crowd/peer/data/CrowdPeerMarshaller.java @@ -27,7 +27,6 @@ import com.threerings.crowd.chat.data.UserMessage; import com.threerings.crowd.peer.client.CrowdPeerService; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; import com.threerings.util.Name; /** diff --git a/src/java/com/threerings/crowd/peer/server/CrowdPeerDispatcher.java b/src/java/com/threerings/crowd/peer/server/CrowdPeerDispatcher.java index 3108a77ed..1286e1f82 100644 --- a/src/java/com/threerings/crowd/peer/server/CrowdPeerDispatcher.java +++ b/src/java/com/threerings/crowd/peer/server/CrowdPeerDispatcher.java @@ -25,7 +25,6 @@ import com.threerings.crowd.chat.client.ChatService; import com.threerings.crowd.chat.data.UserMessage; import com.threerings.crowd.peer.data.CrowdPeerMarshaller; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.util.Name; @@ -33,7 +32,7 @@ import com.threerings.util.Name; /** * Dispatches requests to the {@link CrowdPeerProvider}. */ -public class CrowdPeerDispatcher extends InvocationDispatcher +public class CrowdPeerDispatcher extends InvocationDispatcher { /** * Creates a dispatcher that may be registered to dispatch invocation @@ -45,7 +44,7 @@ public class CrowdPeerDispatcher extends InvocationDispatcher } @Override // documentation inherited - public InvocationMarshaller createMarshaller () + public CrowdPeerMarshaller createMarshaller () { return new CrowdPeerMarshaller(); } diff --git a/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java b/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java index 508079a81..e50440dce 100644 --- a/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java +++ b/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java @@ -37,14 +37,12 @@ import com.threerings.presents.peer.server.PeerManager; import com.threerings.presents.peer.server.PeerNode; import com.threerings.crowd.chat.client.ChatService; -import com.threerings.crowd.chat.data.ChatMessage; import com.threerings.crowd.chat.data.UserMessage; import com.threerings.crowd.chat.server.ChatProvider; import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.peer.data.CrowdClientInfo; import com.threerings.crowd.peer.data.CrowdNodeObject; -import com.threerings.crowd.peer.data.CrowdPeerMarshaller; /** * Extends the standard peer manager and bridges certain Crowd services. @@ -148,8 +146,7 @@ public class CrowdPeerManager extends PeerManager // register and initialize our invocation service CrowdNodeObject cnobj = (CrowdNodeObject)_nodeobj; - cnobj.setCrowdPeerService( - (CrowdPeerMarshaller)_invmgr.registerDispatcher(new CrowdPeerDispatcher(this))); + cnobj.setCrowdPeerService(_invmgr.registerDispatcher(new CrowdPeerDispatcher(this))); // register ourselves as a chat forwarder _chatprov.setChatForwarder(this); diff --git a/src/java/com/threerings/crowd/server/BodyDispatcher.java b/src/java/com/threerings/crowd/server/BodyDispatcher.java index 0809fef46..e8b43accd 100644 --- a/src/java/com/threerings/crowd/server/BodyDispatcher.java +++ b/src/java/com/threerings/crowd/server/BodyDispatcher.java @@ -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 { /** * 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(); } diff --git a/src/java/com/threerings/crowd/server/BodyManager.java b/src/java/com/threerings/crowd/server/BodyManager.java index bd5672280..a47b2c54f 100644 --- a/src/java/com/threerings/crowd/server/BodyManager.java +++ b/src/java/com/threerings/crowd/server/BodyManager.java @@ -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; } diff --git a/src/java/com/threerings/crowd/server/CrowdClient.java b/src/java/com/threerings/crowd/server/CrowdClient.java index 7b0e26981..bd8760fba 100644 --- a/src/java/com/threerings/crowd/server/CrowdClient.java +++ b/src/java/com/threerings/crowd/server/CrowdClient.java @@ -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; } diff --git a/src/java/com/threerings/crowd/server/LocationDispatcher.java b/src/java/com/threerings/crowd/server/LocationDispatcher.java index 2e96e6af5..6b1d75609 100644 --- a/src/java/com/threerings/crowd/server/LocationDispatcher.java +++ b/src/java/com/threerings/crowd/server/LocationDispatcher.java @@ -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 { /** * 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(); } diff --git a/src/java/com/threerings/crowd/server/LocationManager.java b/src/java/com/threerings/crowd/server/LocationManager.java index 78ce16a98..65acec8a2 100644 --- a/src/java/com/threerings/crowd/server/LocationManager.java +++ b/src/java/com/threerings/crowd/server/LocationManager.java @@ -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;