|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.tudey.server.ClientLiaison
public class ClientLiaison
Handles interaction with a single client.
| Nested Class Summary | |
|---|---|
protected static class |
ClientLiaison.TickRecord
Contains the state at a single tick. |
| Field Summary | |
|---|---|
protected List<Actor> |
_actorsAdded
Holds actors added on the current tick. |
protected List<Actor> |
_actorsRemoved
Holds actors removed on the current tick. |
protected List<ActorDelta> |
_actorsUpdated
Holds actors updated on the current tick. |
protected IntMap<Actor> |
_added
Stores added actors. |
protected BodyObject |
_bodyobj
The client body object. |
protected PawnLogic |
_controlled
The pawn that the client is controlling. |
protected List<Effect> |
_fired
Stores effects fired. |
protected int |
_lastInput
The timestamp of the last input frame received from the client. |
protected Rect |
_localInterest
The untranslated area of interest. |
protected int |
_ping
The most recent ping time estimate. |
protected TruncatedAverage |
_pingAverage
The trailing average of the ping times. |
protected Set<ActorLogic> |
_previousVisibleActors
The actors in the area of interest at the last update. |
protected boolean |
_receiving
Set when we know that the client will be receiving on the client object. |
protected List<ClientLiaison.TickRecord> |
_records
Records of each update transmitted to the client. |
protected IntMap<Actor> |
_removed
Stores removed actor. |
protected TudeySceneManager |
_scenemgr
The scene manager that created the liaison. |
protected CrowdSession |
_session
The client session. |
protected PawnLogic |
_target
The pawn that the client's camera is tracking. |
protected TudeySceneObject |
_tsobj
The scene object. |
protected IntMap<ActorDelta> |
_updated
Stores updated actor deltas. |
protected Set<ActorLogic> |
_visibleActors
The actors in the area of interest on the current update. |
protected Rect |
_worldInterest
The translated area of interest. |
| Constructor Summary | |
|---|---|
ClientLiaison(TudeySceneManager scenemgr,
BodyObject bodyobj,
CrowdSession session)
Creates a new liaison for the specified client. |
|
| Method Summary | |
|---|---|
void |
bodyUpdated(OccupantInfo info)
Notes that the client's occupant info has been updated. |
void |
enqueueInput(int acknowledge,
int ping,
InputFrame[] frames)
Processes a request to enqueue input received from a client. |
void |
enteredPlace()
Notes that the client has successfully entered the place. |
int |
getControlDelta()
Computes and returns the difference between the time at which the client depicts actors that it controls (its advanced time) and the time at which it depicts all other actors (its delayed time). |
int |
getLastInput()
Returns the timestamp of the last input frame received from the client (or zero if none have yet been received). |
PawnLogic |
getTarget()
Returns a reference to the client's target. |
protected void |
populateVisibleActors()
Populates the set of visible actors. |
void |
postDelta()
Posts the scene delta for this client, informing it any all relevant changes to the scene since its last acknowledged delta. |
void |
setCameraParams(CameraConfig config,
float aspect)
Sets the client's camera parameters. |
void |
setTarget(PawnLogic target)
Sets the client's target actor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TudeySceneManager _scenemgr
protected TudeySceneObject _tsobj
protected BodyObject _bodyobj
protected CrowdSession _session
protected PawnLogic _target
protected PawnLogic _controlled
protected Rect _localInterest
protected Rect _worldInterest
protected List<ClientLiaison.TickRecord> _records
protected boolean _receiving
protected int _ping
protected TruncatedAverage _pingAverage
protected int _lastInput
protected Set<ActorLogic> _previousVisibleActors
protected Set<ActorLogic> _visibleActors
protected List<Actor> _actorsAdded
protected List<ActorDelta> _actorsUpdated
protected List<Actor> _actorsRemoved
protected IntMap<Actor> _added
protected IntMap<ActorDelta> _updated
protected IntMap<Actor> _removed
protected List<Effect> _fired
| Constructor Detail |
|---|
public ClientLiaison(TudeySceneManager scenemgr,
BodyObject bodyobj,
CrowdSession session)
| Method Detail |
|---|
public void bodyUpdated(OccupantInfo info)
public void setTarget(PawnLogic target)
public PawnLogic getTarget()
public void setCameraParams(CameraConfig config,
float aspect)
public int getControlDelta()
public int getLastInput()
public void enteredPlace()
public void enqueueInput(int acknowledge,
int ping,
InputFrame[] frames)
ping - the ping calculated from the current time and the client's time estimate.public void postDelta()
protected void populateVisibleActors()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||