|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.player.Snooper
Sets up snooping, in which a player can view another player or other Commandable.
To use a Snooper: - make sure the player isn't already snooping someone
Field Summary | |
protected Player |
snooper_
|
protected java.lang.String |
snoopType_
|
protected long |
start_
|
protected Commandable |
target_
|
Constructor Summary | |
Snooper(Player snooper,
Commandable target)
Constructs a new Snooper. |
Method Summary | |
protected void |
addListeners()
Sets up listeners on the target for map movement, messages, and leaving the game. |
void |
destroy()
Turns off the snooper. |
void |
disableMessageDisplay()
Turns text-message snooping off. |
void |
disableViewerMovement()
Sets policy of turning off snooping automatically if the viewer moves. |
void |
enableMessageDisplay()
Turns text-message snooping on. |
void |
enableViewerMovement()
Allows agent to move while snooping the target. |
Player |
getSnooper()
Returns the wizard doing the snooping. |
java.lang.String |
getSnoopType()
Returns the type of snooping going on, e.g. |
Commandable |
getTarget()
Returns the player currently being snooped. |
boolean |
isMessageDisplayEnabled()
Returns true if text-message snooping is currently enabled. |
boolean |
isViewerMoveEnabled()
Returns true if the agent can move without automatically discontinuing snooping. |
void |
messageReceived(MessageEvent event)
A player we're tracking received a message. |
void |
pubsubMessage(Message message)
A player quit. |
protected void |
restoreCamera()
Returns control of the camera to the viewer. |
void |
setSnoopType(java.lang.String type)
Sets the type of snooping. |
void |
start()
Starts the snooping, and stuffs a reference to this Snooper object in a property on the agent called "@snooper". |
void |
targetEnteredMap(MapChangeEvent event)
Viewer or viewee entered a map. |
void |
targetLeftMap(MapChangeEvent event)
Viewer or viewee left a map. |
void |
targetMoved(MapMotionEvent event)
Viewer or viewee moved in map. |
void |
vieweeMoved(Player p)
Viewed player moved. |
void |
viewerMoved()
Viewing player moved. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Player snooper_
protected Commandable target_
protected java.lang.String snoopType_
protected long start_
Constructor Detail |
public Snooper(Player snooper, Commandable target)
snooper
- the player doing the snoopingtarget
- the player to snoopMethod Detail |
public void start()
java.lang.IllegalStateException
- if the agent is already snooping
someone, or if this Snooper object has been destroyed.protected void addListeners()
public void enableMessageDisplay()
public void disableMessageDisplay()
public boolean isMessageDisplayEnabled()
public void enableViewerMovement()
public void disableViewerMovement()
public boolean isViewerMoveEnabled()
public Commandable getTarget()
public Player getSnooper()
public java.lang.String getSnoopType()
public void setSnoopType(java.lang.String type)
type
- a type to put in the logspublic void targetEnteredMap(MapChangeEvent event)
targetEnteredMap
in interface MapChangeListener
public void targetLeftMap(MapChangeEvent event)
targetLeftMap
in interface MapChangeListener
public void targetMoved(MapMotionEvent event)
targetMoved
in interface MapMotionListener
public void vieweeMoved(Player p)
p
- the player who movedpublic void viewerMoved()
public void messageReceived(MessageEvent event)
messageReceived
in interface MessageListener
event
- a MessageEvent saying who got the message, and
what it waspublic void pubsubMessage(Message message)
pubsubMessage
in interface Subscriber
message
- the messageprotected void restoreCamera()
public void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |