Moved code for sending chat message to place into separate function that
can be called by outside services. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@496 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
//
|
||||
// $Id: ChatProvider.java,v 1.5 2001/10/11 04:07:51 mdb Exp $
|
||||
// $Id: ChatProvider.java,v 1.6 2001/10/18 20:51:59 mdb Exp $
|
||||
|
||||
package com.threerings.crowd.chat;
|
||||
|
||||
import com.threerings.presents.dobj.MessageEvent;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.server.CrowdServer;
|
||||
|
||||
@@ -35,4 +37,22 @@ public class ChatProvider
|
||||
|
||||
sendResponse(source, invid, TELL_SUCCEEDED_RESPONSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a chat notification to the specified place object originating
|
||||
* with the specified speaker and with the supplied message content.
|
||||
*
|
||||
* @param placeOid the place to which to deliver the chat message.
|
||||
* @param speaker the username of the user that generated the message
|
||||
* (or some special speaker name for server messages).
|
||||
* @param message the text of the chat message.
|
||||
*/
|
||||
public static void sendChatMessage (
|
||||
int placeOid, String speaker, String message)
|
||||
{
|
||||
Object[] outargs = new Object[] { speaker, message };
|
||||
MessageEvent nevt = new MessageEvent(
|
||||
placeOid, ChatService.SPEAK_NOTIFICATION, outargs);
|
||||
CrowdServer.omgr.postEvent(nevt);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user