From 8233be01e71004d2e9ebc51e5de66d19953d6727 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 31 Jul 2007 06:51:20 +0000 Subject: [PATCH] Added filter(text) to the EZGame API. Untested. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@394 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/as/com/threerings/ezgame/EZGameControl.as | 11 +++++++++++ .../threerings/ezgame/client/GameControlBackend.as | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src/as/com/threerings/ezgame/EZGameControl.as b/src/as/com/threerings/ezgame/EZGameControl.as index 094a174d..69c60424 100644 --- a/src/as/com/threerings/ezgame/EZGameControl.as +++ b/src/as/com/threerings/ezgame/EZGameControl.as @@ -457,6 +457,17 @@ public class EZGameControl extends BaseControl callEZCode("localChat_v1", msg); } + /** + * Run the specified text through the user's chat filter. This is not necessary for sendChat, + * but may be desirable for other user-entered text. + * + * @return the filtered text, or null if it was so bad it's gone. + */ + public function filter (text :String) :String + { + return (callEZCode("filter_v1", text) as String); + } + /** * Returns the player ids of all occupants in the game room. */ diff --git a/src/as/com/threerings/ezgame/client/GameControlBackend.as b/src/as/com/threerings/ezgame/client/GameControlBackend.as index 979df3eb..8ca2e583 100644 --- a/src/as/com/threerings/ezgame/client/GameControlBackend.as +++ b/src/as/com/threerings/ezgame/client/GameControlBackend.as @@ -219,6 +219,7 @@ public class GameControlBackend o["getPlayers_v1"] = getPlayers_v1; o["getPlayerPosition_v1"] = getPlayerPosition_v1; o["getMyPosition_v1"] = getMyPosition_v1; + o["filter_v1"] = filter_v1; o["startTransaction"] = startTransaction_v1; o["commitTransaction"] = commitTransaction_v1; @@ -318,6 +319,11 @@ public class GameControlBackend _ctx.getChatDirector().displayInfo(null, MessageBundle.taint(msg)); } + public function filter_v1 (text :String) :String + { + return _ctx.getChatDirector().filter(text, null, true); + } + public function getOccupants_v1 () :Array { validateConnected();