|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.dobj.DObject
com.threerings.presents.data.ClientObject
com.threerings.crowd.data.BodyObject
public class BodyObject
The basic user object class for Crowd users. Bodies have a username, a location and a status.
| Nested Class Summary | |
|---|---|
protected class |
BodyObject.CrowdPermissionPolicy
|
| Nested classes/interfaces inherited from class com.threerings.presents.data.ClientObject |
|---|
ClientObject.PermissionPolicy |
| Nested classes/interfaces inherited from interface com.threerings.crowd.chat.data.SpeakObject |
|---|
SpeakObject.ListenerOp |
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
static String |
AWAY_MESSAGE
The field name of the awayMessage field. |
String |
awayMessage
If non-null, this contains a message to be auto-replied whenever another user delivers a tell message to this user. |
protected static TokenRing |
EMPTY_TOKENS
The default (no tokens) access control. |
Place |
location
Identifies the place currently occupied by this body. null if they currently occupy no place. |
static String |
LOCATION
The field name of the location field. |
byte |
status
The user's current status ( OccupantInfo.ACTIVE, etc.). |
static String |
STATUS
The field name of the status field. |
| Fields inherited from class com.threerings.presents.data.ClientObject |
|---|
_permPolicy, _references, CLOBJ_CHANGED, receivers, RECEIVERS, username, USERNAME |
| Fields inherited from class com.threerings.presents.dobj.DObject |
|---|
_accessors, _atable, _controller, _deathWish, _listeners, _locattrs, _locks, _oid, _omgr, _scount, _subs, _tcancelled, _tcount, _tevent |
| Constructor Summary | |
|---|---|
BodyObject()
|
|
| Method Summary | |
|---|---|
protected void |
addWhoData(StringBuilder buf)
Allows derived classes to add data to the who details. |
void |
applyToListeners(SpeakObject.ListenerOp op)
The speak service will call this every time a chat message is delivered on this speak object to note the listeners that received the message. |
OccupantInfo |
createOccupantInfo(PlaceObject plobj)
Creates a blank occupant info instance that will used to publish information about the various bodies occupying a place. |
protected ClientObject.PermissionPolicy |
createPermissionPolicy()
|
void |
didLeavePlace(PlaceObject plobj)
Called when this body has left its occupied place. |
ClientObject |
getClientObject()
Return the ClientObject that represent our driving user's connection. |
int |
getPlaceOid()
Returns the oid of the place occupied by this body or -1 if we occupy no place. |
protected String |
getStatusTranslation()
Get a translation suffix for this occupant's status. |
TokenRing |
getTokens()
Returns this user's access control tokens. |
Name |
getVisibleName()
Returns the name that should be displayed to other users. |
void |
setAwayMessage(String value)
Requests that the awayMessage field be set to the
specified value. |
void |
setLocation(Place value)
Requests that the location field be set to the
specified value. |
void |
setStatus(byte value)
Requests that the status field be set to the
specified value. |
String |
who()
Returns a short string identifying this client. |
void |
willEnterPlace(Place place,
PlaceObject plobj)
Called when this body is about to enter the specified place. |
| Methods inherited from class com.threerings.presents.data.ClientObject |
|---|
addToReceivers, checkAccess, checkAccess, hasAccess, hasAccess, reference, release, removeFromReceivers, setReceivers, setUsername, updateReceivers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
@Generated(value="com.threerings.presents.tools.GenDObjectTask") public static final String LOCATION
location field.
@Generated(value="com.threerings.presents.tools.GenDObjectTask") public static final String STATUS
status field.
@Generated(value="com.threerings.presents.tools.GenDObjectTask") public static final String AWAY_MESSAGE
awayMessage field.
public Place location
public byte status
OccupantInfo.ACTIVE, etc.).
public String awayMessage
protected static final TokenRing EMPTY_TOKENS
| Constructor Detail |
|---|
public BodyObject()
| Method Detail |
|---|
public int getPlaceOid()
public TokenRing getTokens()
public Name getVisibleName()
ClientObject.username.
public OccupantInfo createOccupantInfo(PlaceObject plobj)
public void willEnterPlace(Place place,
PlaceObject plobj)
location field.
place - the identifying information for the place we are entering.plobj - the distributed object for the place we are entering.public void didLeavePlace(PlaceObject plobj)
location field.
plobj - the distributed object for the place we just departed. This might be null if
the place object has been destroyed.public void applyToListeners(SpeakObject.ListenerOp op)
SpeakObject
applyToListeners in interface SpeakObjectpublic ClientObject getClientObject()
ClientObject that represent our driving user's connection. This is
the reverse operation of BodyLocator.forClient and should match it. The default
implementation assumes the client object and the body object are one and the same.
Do not return null here once this object is in the wild.
public String who()
ClientObject
who in class ClientObject@Generated(value="com.threerings.presents.tools.GenDObjectTask") public void setLocation(Place value)
location field be set to the
specified value. The local value will be updated immediately and an
event will be propagated through the system to notify all listeners
that the attribute did change. Proxied copies of this object (on
clients) will apply the value change when they received the
attribute changed notification.
@Generated(value="com.threerings.presents.tools.GenDObjectTask") public void setStatus(byte value)
status field be set to the
specified value. The local value will be updated immediately and an
event will be propagated through the system to notify all listeners
that the attribute did change. Proxied copies of this object (on
clients) will apply the value change when they received the
attribute changed notification.
@Generated(value="com.threerings.presents.tools.GenDObjectTask") public void setAwayMessage(String value)
awayMessage field be set to the
specified value. The local value will be updated immediately and an
event will be propagated through the system to notify all listeners
that the attribute did change. Proxied copies of this object (on
clients) will apply the value change when they received the
attribute changed notification.
protected void addWhoData(StringBuilder buf)
protected String getStatusTranslation()
protected ClientObject.PermissionPolicy createPermissionPolicy()
createPermissionPolicy in class ClientObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||