Added support for think and emote.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1599 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2002-07-22 22:26:26 +00:00
parent af8b7bf237
commit 5c5038690b
9 changed files with 82 additions and 25 deletions
@@ -1,5 +1,5 @@
//
// $Id: SpotSceneDirector.java,v 1.14 2002/06/14 01:40:16 ray Exp $
// $Id: SpotSceneDirector.java,v 1.15 2002/07/22 22:26:26 ray Exp $
package com.threerings.whirled.spot.client;
@@ -12,6 +12,7 @@ import com.threerings.presents.dobj.DObjectManager;
import com.threerings.presents.dobj.ObjectAccessException;
import com.threerings.presents.dobj.Subscriber;
import com.threerings.crowd.chat.ChatCodes;
import com.threerings.crowd.chat.ChatDirector;
import com.threerings.crowd.client.LocationAdapter;
import com.threerings.crowd.client.LocationDirector;
@@ -205,6 +206,18 @@ public class SpotSceneDirector
* are not in a valid cluster and refused to deliver the request.
*/
public boolean requestClusterSpeak (String message)
{
return requestClusterSpeak(message, ChatCodes.DEFAULT_MODE);
}
/**
* Sends a chat message to the other users in the cluster to which the
* location that we currently occupy belongs.
*
* @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)
{
// make sure we're currently in a scene
DisplaySpotScene scene = (DisplaySpotScene)_scdir.getScene();
@@ -231,7 +244,7 @@ public class SpotSceneDirector
// we're all clear to go
SpotService.clusterSpeak(
_ctx.getClient(), scene.getId(), _locationId, message, this);
_ctx.getClient(), scene.getId(), _locationId, message, mode, this);
return true;
}
@@ -1,5 +1,5 @@
//
// $Id: SpotService.java,v 1.8 2002/05/15 23:54:34 mdb Exp $
// $Id: SpotService.java,v 1.9 2002/07/22 22:26:26 ray Exp $
package com.threerings.whirled.spot.client;
@@ -56,11 +56,11 @@ public class SpotService implements SpotCodes
*/
public static void clusterSpeak (
Client client, int sceneId, int locationId, String message,
SpotSceneDirector rsptarget)
String mode, SpotSceneDirector rsptarget)
{
InvocationDirector invdir = client.getInvocationDirector();
Object[] args = new Object[] {
new Integer(sceneId), new Integer(locationId), message };
new Integer(sceneId), new Integer(locationId), message, 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.10 2002/06/20 22:38:58 mdb Exp $
// $Id: SpotProvider.java,v 1.11 2002/07/22 22:26:26 ray Exp $
package com.threerings.whirled.spot.server;
@@ -194,10 +194,11 @@ public class SpotProvider extends InvocationProvider
* Handles {@link SpotCodes#CLUSTER_SPEAK_REQUEST} messages.
*/
public void handleClusterSpeakRequest (
BodyObject source, int invid, int sceneId, int locId, String message)
BodyObject source, int invid, int sceneId, int locId, String message,
String mode)
{
sendClusterChatMessage(sceneId, locId, source.getOid(),
source.username, null, message);
source.username, null, message, mode);
}
/**
@@ -221,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 bundle, String message, String mode)
{
// look up the scene manager for the specified scene
SpotSceneManager smgr = (SpotSceneManager)
@@ -237,7 +238,7 @@ public class SpotProvider extends InvocationProvider
// need to check that the location exists and that the speaker
// occupies it and so on
smgr.handleClusterSpeakRequest(
speakerOid, speaker, locId, bundle, message);
speakerOid, speaker, locId, bundle, message, mode);
}
}
@@ -1,5 +1,5 @@
//
// $Id: SpotSceneManager.java,v 1.13 2002/06/20 23:06:40 mdb Exp $
// $Id: SpotSceneManager.java,v 1.14 2002/07/22 22:26:26 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 bundle, String message, String mode)
{
// make sure this user occupies the specified location
int locidx = _sscene.getLocationIndex(locationId);
@@ -243,7 +243,8 @@ public class SpotSceneManager extends SceneManager
// all is well, generate a chat notification
int clusterOid = _clusterOids[clusterIndex];
if (clusterOid > 0) {
ChatProvider.sendChatMessage(clusterOid, source, bundle, message);
ChatProvider.sendChatMessage(
clusterOid, source, bundle, message, mode);
} else {
Log.warning("Have no cluster object for CCREQ " +