byte'd chat mode code

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1600 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2002-07-22 22:54:04 +00:00
parent 5c5038690b
commit 71c7a488c9
9 changed files with 28 additions and 26 deletions
@@ -1,5 +1,5 @@
//
// $Id: ChatDirector.java,v 1.26 2002/07/22 22:26:26 ray Exp $
// $Id: ChatDirector.java,v 1.27 2002/07/22 22:54:03 ray Exp $
package com.threerings.crowd.chat;
@@ -351,18 +351,19 @@ public class ChatDirector
}
String bundle = null;
String message, mode;
String message;
byte mode;
// determine whether this speak message originated from another
// client or from a server entity
if (args.length == 3) {
message = (String)args[1];
mode = (String) args[2];
mode = ((Byte) args[2]).byteValue();
} else {
bundle = (String)args[1];
message = (String)args[2];
mode = (String) args[3];
mode = ((Byte) args[3]).byteValue();
}
// pass this on to our chat displays
@@ -1,5 +1,5 @@
//
// $Id: ChatDisplay.java,v 1.11 2002/07/22 22:26:26 ray Exp $
// $Id: ChatDisplay.java,v 1.12 2002/07/22 22:54:03 ray Exp $
package com.threerings.crowd.chat;
@@ -33,7 +33,7 @@ public interface ChatDisplay
*/
public void displaySpeakMessage (
String type, String speaker, String bundle, String message,
String mode);
byte mode);
/**
* Called to display a tell message. A tell message is one that is
@@ -1,5 +1,5 @@
//
// $Id: ChatCodes.java,v 1.8 2002/07/22 22:26:26 ray Exp $
// $Id: ChatCodes.java,v 1.9 2002/07/22 22:54:03 ray Exp $
package com.threerings.crowd.chat;
@@ -46,15 +46,15 @@ public interface ChatCodes extends InvocationCodes
public static final String TELL_NOTIFICATION = "Tell";
/** The default mode used by speak requests. */
public static final String DEFAULT_MODE = "default";
public static final byte DEFAULT_MODE = 0;
/** The think mode to indicate that the user is thinking
* what they're saying, or is it that they're saying what they're
* thinking? */
public static final String THINK_MODE = "think";
public static final byte THINK_MODE = 1;
/** The mode to indicate that a speak is actually an emote. */
public static final String EMOTE_MODE = "emote";
public static final byte EMOTE_MODE = 2;
/** An error code delivered when the user targeted for a tell
* notification is not online. */
@@ -1,5 +1,5 @@
//
// $Id: ChatProvider.java,v 1.11 2002/07/22 22:26:26 ray Exp $
// $Id: ChatProvider.java,v 1.12 2002/07/22 22:54:03 ray Exp $
package com.threerings.crowd.chat;
@@ -106,13 +106,13 @@ public class ChatProvider
*/
public static void sendChatMessage (
int placeOid, String speaker, String bundle, String message,
String mode)
byte mode)
{
Object[] outargs = null;
if (bundle == null) {
outargs = new Object[] { speaker, message, mode };
outargs = new Object[] { speaker, message, new Byte(mode) };
} else {
outargs = new Object[] { speaker, bundle, message, mode };
outargs = new Object[] { speaker, bundle, message, new Byte(mode) };
}
MessageEvent nevt = new MessageEvent(
placeOid, ChatService.SPEAK_NOTIFICATION, outargs);
@@ -1,5 +1,5 @@
//
// $Id: ChatPanel.java,v 1.16 2002/07/22 22:26:26 ray Exp $
// $Id: ChatPanel.java,v 1.17 2002/07/22 22:54:04 ray Exp $
package com.threerings.micasa.client;
@@ -226,7 +226,7 @@ public class ChatPanel
// documentation inherited
public void displaySpeakMessage (
String type, String speaker, String bundle, String message, String mode)
String type, String speaker, String bundle, String message, byte mode)
{
// wrap the speaker in brackets
speaker = "<" + speaker + "> ";
@@ -1,5 +1,5 @@
//
// $Id: SpotSceneDirector.java,v 1.15 2002/07/22 22:26:26 ray Exp $
// $Id: SpotSceneDirector.java,v 1.16 2002/07/22 22:54:04 ray Exp $
package com.threerings.whirled.spot.client;
@@ -217,7 +217,7 @@ public class SpotSceneDirector
* @return true if a cluster speak message was delivered, false if we
* are not in a valid cluster and refused to deliver the request.
*/
public boolean requestClusterSpeak (String message, String mode)
public boolean requestClusterSpeak (String message, byte mode)
{
// make sure we're currently in a scene
DisplaySpotScene scene = (DisplaySpotScene)_scdir.getScene();
@@ -1,5 +1,5 @@
//
// $Id: SpotService.java,v 1.9 2002/07/22 22:26:26 ray Exp $
// $Id: SpotService.java,v 1.10 2002/07/22 22:54:04 ray Exp $
package com.threerings.whirled.spot.client;
@@ -56,11 +56,12 @@ public class SpotService implements SpotCodes
*/
public static void clusterSpeak (
Client client, int sceneId, int locationId, String message,
String mode, SpotSceneDirector rsptarget)
byte mode, SpotSceneDirector rsptarget)
{
InvocationDirector invdir = client.getInvocationDirector();
Object[] args = new Object[] {
new Integer(sceneId), new Integer(locationId), message, mode };
new Integer(sceneId), new Integer(locationId), message,
new Byte(mode) };
invdir.invoke(MODULE_NAME, CLUSTER_SPEAK_REQUEST, args, rsptarget);
Log.debug("Sent clusterSpeak request [sceneId=" + sceneId +
", locId=" + locationId + ", message=" + message + "].");
@@ -1,5 +1,5 @@
//
// $Id: SpotProvider.java,v 1.11 2002/07/22 22:26:26 ray Exp $
// $Id: SpotProvider.java,v 1.12 2002/07/22 22:54:04 ray Exp $
package com.threerings.whirled.spot.server;
@@ -195,7 +195,7 @@ public class SpotProvider extends InvocationProvider
*/
public void handleClusterSpeakRequest (
BodyObject source, int invid, int sceneId, int locId, String message,
String mode)
byte mode)
{
sendClusterChatMessage(sceneId, locId, source.getOid(),
source.username, null, message, mode);
@@ -222,7 +222,7 @@ public class SpotProvider extends InvocationProvider
*/
public static void sendClusterChatMessage (
int sceneId, int locId, int speakerOid, String speaker,
String bundle, String message, String mode)
String bundle, String message, byte mode)
{
// look up the scene manager for the specified scene
SpotSceneManager smgr = (SpotSceneManager)
@@ -1,5 +1,5 @@
//
// $Id: SpotSceneManager.java,v 1.14 2002/07/22 22:26:26 ray Exp $
// $Id: SpotSceneManager.java,v 1.15 2002/07/22 22:54:04 ray Exp $
package com.threerings.whirled.spot.server;
@@ -218,7 +218,7 @@ public class SpotSceneManager extends SceneManager
*/
protected void handleClusterSpeakRequest (
int sourceOid, String source, int locationId,
String bundle, String message, String mode)
String bundle, String message, byte mode)
{
// make sure this user occupies the specified location
int locidx = _sscene.getLocationIndex(locationId);