public class LocationDirector extends BasicDirector implements LocationCodes, LocationReceiver
| Modifier and Type | Class and Description |
|---|---|
static interface |
LocationDirector.FailureHandler
Used to recover from a moveTo request that was accepted but resulted in a failed attempt to
fetch the place object to which we were moving.
|
InvocationReceiver.RegistrationALREADY_THERE, MOVE_IN_PROGRESS, NO_SUCH_PLACEACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR| Constructor and Description |
|---|
LocationDirector(CrowdContext ctx)
Constructs a location director which will configure itself for operation using the supplied
context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLocationObserver(LocationObserver observer)
Adds a location observer to the list.
|
void |
addPendingForcedMove(Runnable move) |
boolean |
checkRepeatMove()
Called to test and set a time stamp that we use to determine if a pending moveTo request is
stale.
|
void |
clientDidLogoff(Client client)
Called after the client has been logged off of the server and has disconnected.
|
void |
clientDidLogon(Client client)
Called after the client successfully connected to and authenticated with the server.
|
void |
didLeavePlace()
Called when we're leaving our current location.
|
void |
didMoveTo(int placeId,
PlaceConfig config)
This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other.
|
void |
failedToMoveTo(int placeId,
String reason)
This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other.
|
void |
forcedMove(int placeId)
Used to communicate a required move notification to the client.
|
PlaceObject |
getPlaceObject()
Returns the place object for the location we currently occupy or null if we're not currently
occupying any location.
|
boolean |
leavePlace()
Issues a request to leave our current location.
|
boolean |
mayMoveTo(int placeId,
ResultListener<PlaceConfig> rl)
This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other.
|
boolean |
moveBack()
Requests to move to the room that we last occupied, if such a room exists.
|
boolean |
movePending()
Returns true if there is a pending move request.
|
boolean |
moveTo(int placeId)
Requests that this client be moved to the specified place.
|
void |
removeLocationObserver(LocationObserver observer)
Removes a location observer from the list.
|
void |
setFailureHandler(LocationDirector.FailureHandler handler)
Sets the failure handler which will recover from place object fetching failures.
|
clientObjectDidChange, clientWillLogon, isAvailableInStandalone, setAvailableInStandalonepublic LocationDirector(CrowdContext ctx)
public void addLocationObserver(LocationObserver observer)
public void removeLocationObserver(LocationObserver observer)
public PlaceObject getPlaceObject()
public boolean movePending()
public boolean moveTo(int placeId)
public boolean moveBack()
public boolean leavePlace()
public boolean mayMoveTo(int placeId,
ResultListener<PlaceConfig> rl)
placeId - the place oid of our tentative new location.public void didMoveTo(int placeId,
PlaceConfig config)
placeId - the place oid of our new location.config - the configuration information for the new place.public void didLeavePlace()
public void failedToMoveTo(int placeId,
String reason)
placeId - the place oid to which we failed to move.reason - the reason code given for failure.public boolean checkRepeatMove()
public void clientDidLogon(Client client)
SessionObserverclientDidLogon in interface SessionObserverclientDidLogon in class BasicDirectorpublic void clientDidLogoff(Client client)
SessionObserverclientDidLogoff in interface SessionObserverclientDidLogoff in class BasicDirectorpublic void forcedMove(int placeId)
LocationReceiverLocationService.moveTo(int, com.threerings.crowd.client.LocationService.MoveListener) request to move to the new location.forcedMove in interface LocationReceiverpublic void setFailureHandler(LocationDirector.FailureHandler handler)
public void addPendingForcedMove(Runnable move)
Copyright © 2015. All rights reserved.