Created client-side message objects which are the only thing passed

to the newly simplified ChatDisplay interface, which now has but one method.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1620 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2002-07-26 20:35:02 +00:00
parent ea5e5adbad
commit ef52f31ad4
9 changed files with 231 additions and 259 deletions
@@ -1,5 +1,5 @@
//
// $Id: ChatCodes.java,v 1.9 2002/07/22 22:54:03 ray Exp $
// $Id: ChatCodes.java,v 1.10 2002/07/26 20:35:01 ray Exp $
package com.threerings.crowd.chat;
@@ -13,7 +13,7 @@ public interface ChatCodes extends InvocationCodes
/** The module name for the chat services. */
public static final String MODULE_NAME = "chat";
/** The chat type code for chat messages delivered on the place object
/** The chat localtype code for chat messages delivered on the place object
* currently occupied by the client. This is the only type of chat
* message that will be delivered unless the chat director is
* explicitly provided with other chat message sources via {@link
@@ -29,6 +29,9 @@ public interface ChatCodes extends InvocationCodes
/** The message identifier for a system notification message. */
public static final String SYSTEM_NOTIFICATION = "sysnot";
/** The chat localtype for tells. */
public static final String TELL_CHAT_TYPE = "tellChat";
/** The message identifier for a tell request. */
public static final String TELL_REQUEST = "Tell";
@@ -0,0 +1,30 @@
//
// $Id: ChatMessage.java,v 1.1 2002/07/26 20:35:01 ray Exp $
package com.threerings.crowd.chat;
/**
* The abstract base class of all the client-side ChatMessage objects.
*/
public abstract class ChatMessage
{
/** The actual text of the message. */
public String message;
/** The localtype of this chat, set to the type registered with an
* auxiliary source in the ChatDirector. */
public String localtype;
/** The time that this message was created on the client. */
public long timestamp;
/**
* Construct a ChatMessage.
*/
public ChatMessage (String message, String localtype)
{
this.message = message;
this.localtype = localtype;
timestamp = System.currentTimeMillis();
}
}
@@ -0,0 +1,19 @@
//
// $Id: FeedbackMessage.java,v 1.1 2002/07/26 20:35:01 ray Exp $
package com.threerings.crowd.chat;
/**
* A ChatMessage to indicate to the user that an action they took
* has been processed.
*/
public class FeedbackMessage extends ChatMessage
{
/**
* Construct a FeedbackMessage.
*/
public FeedbackMessage (String message, String localtype)
{
super(message, localtype);
}
}
@@ -0,0 +1,19 @@
//
// $Id: SystemMessage.java,v 1.1 2002/07/26 20:35:01 ray Exp $
package com.threerings.crowd.chat;
/**
* A ChatMessage that represents a message that came from the server
* and did not result from direct user action.
*/
public class SystemMessage extends ChatMessage
{
/**
* Construct a SystemMessage.
*/
public SystemMessage (String message, String localtype)
{
super(message, localtype);
}
}
@@ -0,0 +1,27 @@
//
// $Id: UserMessage.java,v 1.1 2002/07/26 20:35:01 ray Exp $
package com.threerings.crowd.chat;
/**
* A ChatMessage representing a message that came from another user.
*/
public class UserMessage extends ChatMessage
{
/** The user that the message came from. */
public String speaker;
/** The mode of the message. @see ChatCodes.DEFAULT_MODE */
public byte mode;
/**
* Construct a user message.
*/
public UserMessage (String message, String localtype,
String speaker, byte mode)
{
super(message, localtype);
this.speaker = speaker;
this.mode = mode;
}
}