Let EZGames listen for user chats and pass them on as events to the user code. I'm a little uncertain if we need to do things with e.g. the bundle in the chat message object?

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@283 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Par Winzell
2007-04-27 23:32:43 +00:00
parent 7c28390287
commit fd4b2183ef
3 changed files with 114 additions and 1 deletions
@@ -100,6 +100,13 @@ import flash.display.DisplayObject;
*/
[Event(name="msgReceived", type="com.threerings.ezgame.MessageReceivedEvent")]
/**
* Dispatched when a user chats.
*
* @eventType com.whirled.UserChatEvent.TYPE
*/
[Event(name="UserChat", type="com.threerings.ezgame.UserChatEvent")]
/**
* The single point of control for each client in your multiplayer EZGame.
@@ -541,6 +548,7 @@ public class EZGameControl extends BaseControl
o["roundStateChanged_v1"] = roundStateChanged_v1;
o["dispatchEvent_v1"] = dispatch;
o["occupantChanged_v1"] = occupantChanged_v1;
o["userChat_v1"] = userChat_v1;
}
/**
@@ -604,6 +612,14 @@ public class EZGameControl extends BaseControl
OccupantChangedEvent.OCCUPANT_LEFT, this, occupantId, player));
}
/**
* Private method to post a UserChatEvent.
*/
private function userChat_v1 (speaker :int, message :String) :void
{
dispatch(new UserChatEvent(this, speaker, message));
}
/**
* Sets the properties we received from the EZ game framework on the other side of the security
* boundary.