Removed the PlaceObject argument from MessageHandler.handleEvent. You
already have that around in 99% of the cases that you're implementing message handlers and you more likely have it casted to the type you're interested in and don't get any use out of that extra argument and have to import PlaceObject when you might not otherwise have had to. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@453 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ChatMessageHandler.java,v 1.2 2001/10/11 04:07:51 mdb Exp $
|
||||
// $Id: ChatMessageHandler.java,v 1.3 2001/10/12 19:30:44 mdb Exp $
|
||||
|
||||
package com.threerings.crowd.chat;
|
||||
|
||||
@@ -17,7 +17,8 @@ import com.threerings.crowd.server.PlaceManager;
|
||||
*/
|
||||
public class ChatMessageHandler implements PlaceManager.MessageHandler
|
||||
{
|
||||
public void handleEvent (MessageEvent event, PlaceObject target)
|
||||
/** Handles {@link ChatCodes#SPEAK_REQUEST} messages. */
|
||||
public void handleEvent (MessageEvent event)
|
||||
{
|
||||
// presently we do no ratification of chat messages, so we just
|
||||
// generate a chat notification with the message and name of the
|
||||
@@ -38,7 +39,7 @@ public class ChatMessageHandler implements PlaceManager.MessageHandler
|
||||
// and generate a chat notification
|
||||
Object[] outargs = new Object[] { source.username, message };
|
||||
MessageEvent nevt = new MessageEvent(
|
||||
target.getOid(), ChatService.SPEAK_NOTIFICATION, outargs);
|
||||
event.getTargetOid(), ChatService.SPEAK_NOTIFICATION, outargs);
|
||||
CrowdServer.omgr.postEvent(nevt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: PlaceManager.java,v 1.18 2001/10/12 00:03:02 mdb Exp $
|
||||
// $Id: PlaceManager.java,v 1.19 2001/10/12 19:30:44 mdb Exp $
|
||||
|
||||
package com.threerings.crowd.server;
|
||||
|
||||
@@ -235,7 +235,7 @@ public class PlaceManager
|
||||
handler = (MessageHandler)_msghandlers.get(event.getName());
|
||||
}
|
||||
if (handler != null) {
|
||||
handler.handleEvent(event, _plobj);
|
||||
handler.handleEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,10 +305,8 @@ public class PlaceManager
|
||||
* Invokes this message handler on the supplied event.
|
||||
*
|
||||
* @param event the message event received.
|
||||
* @param target the place object on which the message event was
|
||||
* received.
|
||||
*/
|
||||
public void handleEvent (MessageEvent event, PlaceObject target);
|
||||
public void handleEvent (MessageEvent event);
|
||||
}
|
||||
|
||||
/** A reference to the place object that we manage. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: GameManager.java,v 1.9 2001/10/12 00:03:03 mdb Exp $
|
||||
// $Id: GameManager.java,v 1.10 2001/10/12 19:30:44 mdb Exp $
|
||||
|
||||
package com.threerings.parlor.game;
|
||||
|
||||
@@ -164,7 +164,7 @@ public class GameManager
|
||||
/** Handles player ready notifications. */
|
||||
protected class PlayerReadyHandler implements MessageHandler
|
||||
{
|
||||
public void handleEvent (MessageEvent event, PlaceObject target)
|
||||
public void handleEvent (MessageEvent event)
|
||||
{
|
||||
int cloid = event.getSourceOid();
|
||||
BodyObject body = (BodyObject)
|
||||
|
||||
Reference in New Issue
Block a user