From e782bacb356551289f8f3c3de00183da35f8d91c Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 26 Feb 2002 05:47:40 +0000 Subject: [PATCH] Modified system message delivery to include a localization bundle identifier which indicates which bundle to use when translating the message for display to the client. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1074 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/crowd/chat/client/ChatDirector.java | 7 ++++--- .../com/threerings/crowd/chat/client/ChatDisplay.java | 7 +++++-- .../com/threerings/crowd/chat/server/ChatProvider.java | 10 +++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/crowd/chat/client/ChatDirector.java b/src/java/com/threerings/crowd/chat/client/ChatDirector.java index 58658b7a7..f45541517 100644 --- a/src/java/com/threerings/crowd/chat/client/ChatDirector.java +++ b/src/java/com/threerings/crowd/chat/client/ChatDirector.java @@ -1,5 +1,5 @@ // -// $Id: ChatDirector.java,v 1.16 2002/02/09 20:47:11 mdb Exp $ +// $Id: ChatDirector.java,v 1.17 2002/02/26 05:47:40 mdb Exp $ package com.threerings.crowd.chat; @@ -245,12 +245,13 @@ public class ChatDirector */ protected void handleSystemMessage (String type, Object[] args) { - String message = (String)args[0]; + String bundle = (String)args[0]; + String message = (String)args[1]; // pass this on to our chat displays for (int i = 0; i < _displays.size(); i++) { ChatDisplay display = (ChatDisplay)_displays.get(i); - display.displaySystemMessage(type, message); + display.displaySystemMessage(type, bundle, message); } } diff --git a/src/java/com/threerings/crowd/chat/client/ChatDisplay.java b/src/java/com/threerings/crowd/chat/client/ChatDisplay.java index 21ab76220..be92c99f5 100644 --- a/src/java/com/threerings/crowd/chat/client/ChatDisplay.java +++ b/src/java/com/threerings/crowd/chat/client/ChatDisplay.java @@ -1,5 +1,5 @@ // -// $Id: ChatDisplay.java,v 1.7 2002/02/03 08:22:38 shaper Exp $ +// $Id: ChatDisplay.java,v 1.8 2002/02/26 05:47:40 mdb Exp $ package com.threerings.crowd.chat; @@ -48,9 +48,12 @@ public interface ChatDisplay * delivered via the place object, or for messages delivered via an * auxiliary chat object, the type code provided when that auxiliary * object was registered. + * @param bundle the bundle identifier to be used when localizing this + * message for display to the client. * @param message the text of the message. */ - public void displaySystemMessage (String type, String message); + public void displaySystemMessage ( + String type, String bundle, String message); /** * Called in response to a chat request (either speak or tell) that diff --git a/src/java/com/threerings/crowd/chat/server/ChatProvider.java b/src/java/com/threerings/crowd/chat/server/ChatProvider.java index e35b18911..4856a36f3 100644 --- a/src/java/com/threerings/crowd/chat/server/ChatProvider.java +++ b/src/java/com/threerings/crowd/chat/server/ChatProvider.java @@ -1,5 +1,5 @@ // -// $Id: ChatProvider.java,v 1.8 2001/12/17 00:52:43 mdb Exp $ +// $Id: ChatProvider.java,v 1.9 2002/02/26 05:47:40 mdb Exp $ package com.threerings.crowd.chat; @@ -66,11 +66,15 @@ public class ChatProvider * that makes it clear that it is a message from the server. * * @param placeOid the place to which to deliver the message. + * @param bundle the name of the localization bundle that should be + * used to translate this system message prior to displaying it to the + * client. * @param message the text of the message. */ - public static void sendSystemMessage (int placeOid, String message) + public static void sendSystemMessage ( + int placeOid, String bundle, String message) { - Object[] outargs = new Object[] { message }; + Object[] outargs = new Object[] { bundle, message }; MessageEvent nevt = new MessageEvent( placeOid, ChatService.SYSTEM_NOTIFICATION, outargs); CrowdServer.omgr.postEvent(nevt);