|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.crowd.chat.server.SpeakUtil
public class SpeakUtil
Provides the back-end of the chat speaking facilities.
| Nested Class Summary | |
|---|---|
protected static class |
SpeakUtil.MessageMapper
Used to note the recipients of a chat message. |
static interface |
SpeakUtil.MessageObserver
An interface used to notify external systems whenever a chat message is spoken by one user and heard by another. |
protected static class |
SpeakUtil.MessageObserverOp
Used to notify our SpeakUtil.MessageObservers. |
| Field Summary | |
|---|---|
protected static SpeakUtil.MessageMapper |
_messageMapper
Used to note the recipients of a chat message. |
protected static ObserverList<SpeakUtil.MessageObserver> |
_messageObs
A list of SpeakUtil.MessageObservers. |
protected static SpeakUtil.MessageObserverOp |
_messageOp
Used to notify our SpeakUtil.MessageObservers. |
| Constructor Summary | |
|---|---|
SpeakUtil()
|
|
| Method Summary | |
|---|---|
protected static void |
noteMessage(Name username,
UserMessage msg)
Notes that the specified user was privy to the specified message. |
static void |
registerMessageObserver(SpeakUtil.MessageObserver obs)
Registers a SpeakUtil.MessageObserver to be notified whenever a user-originated chat message
is heard by another user. |
static void |
removeMessageObserver(SpeakUtil.MessageObserver obs)
Removes a registration made previously with registerMessageObserver(com.threerings.crowd.chat.server.SpeakUtil.MessageObserver). |
static void |
sendAttention(DObject speakObj,
String bundle,
String message)
Sends a system ATTENTION message notification to the specified object with the supplied message content. |
static void |
sendFeedback(DObject speakObj,
String bundle,
String message)
Sends a system FEEDBACK message notification to the specified object with the supplied message content. |
static void |
sendInfo(DObject speakObj,
String bundle,
String message)
Sends a system INFO message notification to the specified object with the supplied message content. |
static void |
sendMessage(DObject speakObj,
ChatMessage msg)
Send the specified message on the specified object. |
static void |
sendSpeak(DObject speakObj,
Name speaker,
String bundle,
String message)
Sends a speak notification to the specified place object originating with the specified speaker (the speaker optionally being a server entity that wishes to fake a "speak" message) and with the supplied message content. |
static void |
sendSpeak(DObject speakObj,
Name speaker,
String bundle,
String message,
byte mode)
Sends a speak notification to the specified place object originating with the specified speaker (the speaker optionally being a server entity that wishes to fake a "speak" message) and with the supplied message content. |
protected static void |
sendSystem(DObject speakObj,
String bundle,
String message,
byte level)
Send the specified system message on the specified dobj. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static SpeakUtil.MessageMapper _messageMapper
protected static ObserverList<SpeakUtil.MessageObserver> _messageObs
SpeakUtil.MessageObservers.
protected static SpeakUtil.MessageObserverOp _messageOp
SpeakUtil.MessageObservers.
| Constructor Detail |
|---|
public SpeakUtil()
| Method Detail |
|---|
public static void registerMessageObserver(SpeakUtil.MessageObserver obs)
SpeakUtil.MessageObserver to be notified whenever a user-originated chat message
is heard by another user.
public static void removeMessageObserver(SpeakUtil.MessageObserver obs)
registerMessageObserver(com.threerings.crowd.chat.server.SpeakUtil.MessageObserver).
public static void sendSpeak(DObject speakObj,
Name speaker,
String bundle,
String message)
speakObj - the object on which to generate the speak message.speaker - the username of the user that generated the message (or some special speaker
name for server messages).bundle - null when the message originates from a real human, the bundle identifier that
will be used by the client to translate the message text when the message originates from a
server entity "faking" a chat message.message - the text of the speak message.
public static void sendSpeak(DObject speakObj,
Name speaker,
String bundle,
String message,
byte mode)
speakObj - the object on which to generate the speak message.speaker - the username of the user that generated the message (or some special speaker
name for server messages).bundle - null when the message originates from a real human, the bundle identifier that
will be used by the client to translate the message text when the message originates from a
server entity "faking" a chat message.message - the text of the speak message.mode - the mode of the message, see ChatCodes.DEFAULT_MODE.
public static void sendInfo(DObject speakObj,
String bundle,
String message)
speakObj - the object on which to deliver the message.bundle - the name of the localization bundle that should be used to translate this
system message prior to displaying it to the client.message - the text of the message.
public static void sendFeedback(DObject speakObj,
String bundle,
String message)
speakObj - the object on which to deliver the message.bundle - the name of the localization bundle that should be used to translate this
system message prior to displaying it to the client.message - the text of the message.
public static void sendAttention(DObject speakObj,
String bundle,
String message)
speakObj - the object on which to deliver the message.bundle - the name of the localization bundle that should be used to translate this
system message prior to displaying it to the client.message - the text of the message.
public static void sendMessage(DObject speakObj,
ChatMessage msg)
protected static void noteMessage(Name username,
UserMessage msg)
ChatMessage.timestamp is not already filled in, it will be.
protected static void sendSystem(DObject speakObj,
String bundle,
String message,
byte level)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||