public class User extends BasicObject implements Deliverer
VIS_CONTAINER, VIS_NONE, VIS_PERSONAL, VIS_PUBLIC
Constructor and Description |
---|
User(String name,
Mod[] mods,
Item[] contents,
String ref,
Position pos)
Direct constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
connectionID()
Obtain this user's connection ID.
|
Context |
context()
Obtain the context this user is currently contained by.
|
JSONLiteral |
encode(EncodeControl control)
Encode this user for transmission or persistence.
|
void |
exitContext(String why,
String whyCode,
boolean reload)
Remove this user from their context.
|
void |
forceDisconnect()
Force this user to actually disconnect from the server.
|
boolean |
isContainer()
Test if this object is a container.
|
Deliverer |
neighbors()
Obtain a message deliverer for sending messages to the other users
in this user's context.
|
void |
pushNewContext(String contextRef)
Begin the sequence of events that will push this user to a different
context.
|
void |
send(JSONLiteral message)
Send a message to this user.
|
void |
sendObjectDescription(Deliverer to,
Referenceable maker)
Transmit a description of this user as a series of 'make' messages,
such that the receiver will be able to construct a local presence of it.
|
void |
sendUserDescription(Deliverer to,
Referenceable maker,
boolean you)
Transmit a description of this user as a series of 'make' messages.
|
String |
toString()
Obtain a printable string representation of this user.
|
User |
user()
Obtain the user this object is currently associated with.
|
baseRef, checkpoint, checkpoint, container, contents, contextor, createItem, findActualTarget, getMod, handleMessage, holder, isClone, isEphemeral, markAsChanged, markAsDeleted, markAsEphemeral, name, noteCodependent, objectIsComplete, position, ref, sendToClones, setName, setPosition, setVisibility, visibleTo
public User(String name, Mod[] mods, Item[] contents, String ref, Position pos)
name
- The name of the user.mods
- Array of mods to attach to the user; can be null if no mods
are to be attached at initial creation time.contents
- Array of inactive items that will be the initial
contents of this user, or null if there are no contents now.pos
- Optional position of the user within its context.public int connectionID()
public Context context()
context
in class BasicObject
public JSONLiteral encode(EncodeControl control)
public void exitContext(String why, String whyCode, boolean reload)
why
- Explanation string to send to this user as the last thing
they see from the context.whyCode
- Machine readable tag encoding 'why'.reload
- true if the client should attempt a reload (i.e.,
immediately try to enter again), false if not.public void forceDisconnect()
public boolean isContainer()
isContainer
in class BasicObject
public Deliverer neighbors()
public void pushNewContext(String contextRef)
contextRef
- The ref of the context to push them to.public void send(JSONLiteral message)
public void sendObjectDescription(Deliverer to, Referenceable maker)
sendObjectDescription
in class BasicObject
to
- Where to send the description.maker
- Maker object to address the message(s) to.public void sendUserDescription(Deliverer to, Referenceable maker, boolean you)
to
- Where to send the description.maker
- Maker object to address message to.you
- If true, user description is being sent to the user being
described.public String toString()
public User user()
user
in class BasicObject
Copyright © 2017. All rights reserved.