Created fooCodes interfaces to go along with invocation service
packages. These contain all the message codes as well as error response codes that are used by a particular invocation service. Also changed client.LocationManager to client.LocationDirector and chat.ChatManager to chat.ChatDirector to go along with the new philosophy of naming the client-side managing entity for an invocation service a director. Also elimitated cocktail.util.Codes since it's no longer used as a central repository for codes (instead they are in InvocationCodes and its derivatives). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@368 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ChatProvider.java,v 1.3 2001/08/11 00:05:58 mdb Exp $
|
||||
// $Id: ChatProvider.java,v 1.4 2001/10/01 22:14:55 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.party.chat;
|
||||
|
||||
@@ -7,7 +7,12 @@ 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
|
||||
/**
|
||||
* The chat provider handles the server side of the chat-related
|
||||
* invocation services.
|
||||
*/
|
||||
public class ChatProvider
|
||||
extends InvocationProvider implements ChatCodes
|
||||
{
|
||||
/**
|
||||
* Processes a request from a client to deliver a tell message to
|
||||
@@ -19,15 +24,15 @@ public class ChatProvider extends InvocationProvider
|
||||
// look up the target body object
|
||||
BodyObject tobj = PartyServer.lookupBody(target);
|
||||
if (tobj == null) {
|
||||
sendResponse(source, invid, "TellFailed", "m.player_not_online");
|
||||
sendResponse(source, invid, TELL_FAILED_RESPONSE,
|
||||
USER_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);
|
||||
tobj.getOid(), MODULE_NAME, TELL_NOTIFICATION, args);
|
||||
|
||||
sendResponse(source, invid, "TellSucceeded");
|
||||
sendResponse(source, invid, TELL_SUCCEEDED_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user