Beginnings of the tell (client to client messaging) implementation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@181 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
//
|
||||
// $Id: ChatService.java,v 1.2 2001/08/02 23:46:47 mdb Exp $
|
||||
// $Id: ChatService.java,v 1.3 2001/08/04 02:54:28 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.party.chat;
|
||||
|
||||
import com.threerings.cocktail.cher.client.Client;
|
||||
import com.threerings.cocktail.cher.client.InvocationManager;
|
||||
import com.threerings.cocktail.party.Log;
|
||||
|
||||
/**
|
||||
* The chat services provide a mechanism by which the client can broadcast
|
||||
* chat messages to all clients that are subscribed to a particular place
|
||||
@@ -21,4 +25,33 @@ public class ChatService
|
||||
|
||||
/** The message identifier for a speak notification message. */
|
||||
public static final String SPEAK_NOTIFICATION = "spknot";
|
||||
|
||||
/** The message identifier for a tell request. */
|
||||
public static final String TELL_REQUEST = "Tell";
|
||||
|
||||
/** The message identifier for a tell notification. */
|
||||
public static final String TELL_NOTIFICATION = "Tell";
|
||||
|
||||
/**
|
||||
* Requests that a tell message be delivered to the user with username
|
||||
* equal to <code>target</code>.
|
||||
*
|
||||
* @param client a connected, operational client instance.
|
||||
* @param target the username of the user to which the tell message
|
||||
* should be delivered.
|
||||
* @param message the contents of the message.
|
||||
* @param rsptarget the chat manager reference that will receive the
|
||||
* tell response.
|
||||
*
|
||||
* @return the invocation request id of the generated tell request.
|
||||
*/
|
||||
public static int tell (Client client, String target, String message,
|
||||
ChatManager rsptarget)
|
||||
{
|
||||
InvocationManager invmgr = client.getInvocationManager();
|
||||
Object[] args = new Object[] { target, message };
|
||||
Log.info("Sending tell request [tgt=" + target +
|
||||
", msg=" + message + "].");
|
||||
return invmgr.invoke(MODULE, TELL_REQUEST, args, rsptarget);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user