Files
narya/src/java/com/threerings/crowd/chat/server/ChatProvider.java
T
Michael Bayne a44e552eb8 Modified invocation services such that providers are responsible for
delivering their own responses. They now have all the information
necessary to do so which means that they can delay the delivery of a
response until some other asynchronous event has taken place (like a
database load completing). Prior to this, they were required to complete
their service immediately and return the response back to the invocation
manager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@216 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-08-11 00:05:58 +00:00

34 lines
1.1 KiB
Java

//
// $Id: ChatProvider.java,v 1.3 2001/08/11 00:05:58 mdb Exp $
package com.threerings.cocktail.party.chat;
import com.threerings.cocktail.cher.server.InvocationProvider;
import com.threerings.cocktail.party.data.BodyObject;
import com.threerings.cocktail.party.server.PartyServer;
public class ChatProvider extends InvocationProvider
{
/**
* Processes a request from a client to deliver a tell message to
* another client.
*/
public void handleTellRequest (
BodyObject source, int invid, String target, String message)
{
// look up the target body object
BodyObject tobj = PartyServer.lookupBody(target);
if (tobj == null) {
sendResponse(source, invid, "TellFailed", "m.player_not_online");
}
// deliver a tell notification to the target player
Object[] args = new Object[] { source.username, message };
PartyServer.invmgr.sendNotification(
tobj.getOid(), ChatService.MODULE, ChatService.TELL_NOTIFICATION,
args);
sendResponse(source, invid, "TellSucceeded");
}
}