From 127eebf9a6403b8a849fcf54639db602f028f61c Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 6 Apr 2006 23:15:36 +0000 Subject: [PATCH] Moved to msoy repository. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4002 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/msoy/client/ChatControl.as | 39 -------- .../threerings/msoy/client/ChatTextArea.as | 55 ----------- src/as/com/threerings/msoy/client/MsoyApp.as | 22 ----- .../com/threerings/msoy/client/MsoyClient.as | 71 --------------- .../com/threerings/msoy/client/MsoyContext.as | 91 ------------------- .../msoy/client/SimpleChatController.as | 15 --- .../threerings/msoy/client/SimpleChatPanel.as | 27 ------ .../threerings/msoy/data/MsoyBootstrapData.as | 21 ----- .../threerings/msoy/data/SimpleChatConfig.as | 15 --- 9 files changed, 356 deletions(-) delete mode 100644 src/as/com/threerings/msoy/client/ChatControl.as delete mode 100644 src/as/com/threerings/msoy/client/ChatTextArea.as delete mode 100644 src/as/com/threerings/msoy/client/MsoyApp.as delete mode 100644 src/as/com/threerings/msoy/client/MsoyClient.as delete mode 100644 src/as/com/threerings/msoy/client/MsoyContext.as delete mode 100644 src/as/com/threerings/msoy/client/SimpleChatController.as delete mode 100644 src/as/com/threerings/msoy/client/SimpleChatPanel.as delete mode 100644 src/as/com/threerings/msoy/data/MsoyBootstrapData.as delete mode 100644 src/as/com/threerings/msoy/data/SimpleChatConfig.as diff --git a/src/as/com/threerings/msoy/client/ChatControl.as b/src/as/com/threerings/msoy/client/ChatControl.as deleted file mode 100644 index d05e762a4..000000000 --- a/src/as/com/threerings/msoy/client/ChatControl.as +++ /dev/null @@ -1,39 +0,0 @@ -package com.threerings.msoy.client { - -import flash.events.Event; - -import mx.containers.HBox; - -import mx.controls.Button; -import mx.controls.TextInput; - -public class ChatControl extends HBox -{ - public function ChatControl (ctx :MsoyContext) - { - _ctx = ctx; - - addChild(_txt = new TextInput()); - var but :Button = new Button(); - but.label = "Send"; // TODO: xlate - addChild(but); - - //_txt.addEventListener(FlexEvent.ENTER, sendChat); - //but.addEventListener(FlexEvent.BUTTON_DOWN, sendChat); - _txt.addEventListener("enter", sendChat); - but.addEventListener("buttonDown", sendChat); - } - - protected function sendChat (event :Event) :void - { - var message :String = _txt.text; - _txt.text = ""; - _ctx.getChatDirector().requestChat(null, message, true); - } - - /** Our client-side context. */ - protected var _ctx :MsoyContext; - - protected var _txt :TextInput; -} -} diff --git a/src/as/com/threerings/msoy/client/ChatTextArea.as b/src/as/com/threerings/msoy/client/ChatTextArea.as deleted file mode 100644 index 4f76abf71..000000000 --- a/src/as/com/threerings/msoy/client/ChatTextArea.as +++ /dev/null @@ -1,55 +0,0 @@ -package com.threerings.msoy.client { - -import flash.events.Event; - -import mx.controls.TextArea; - -import com.threerings.crowd.chat.client.ChatDirector; -import com.threerings.crowd.chat.client.ChatDisplay; -import com.threerings.crowd.chat.data.ChatMessage; - -public class ChatTextArea extends TextArea - implements ChatDisplay -{ - public function ChatTextArea (ctx :MsoyContext) - { - _ctx = ctx; - this.editable = false; - - // set up some events to manage how we'll be shown, etc. - addEventListener("creationComplete", checkVis); - addEventListener("show", checkVis); - addEventListener("hide", checkVis); - } - - // documentation inherited from interface ChatDisplay - public function clear () :void - { - this.htmlText = ""; - } - - // documentation inherited from interface ChatDisplay - public function displayMessage (msg :ChatMessage) :void - { - this.htmlText += "<TODO> " + - msg.message; - } - - /** - * Check to see if we should register or unregister ourselves as a - * ChatDisplay. - */ - protected function checkVis (event :Event) :void - { - var chatdir :ChatDirector = _ctx.getChatDirector(); - if (this.visible) { - chatdir.addChatDisplay(this); - } else { - chatdir.removeChatDisplay(this); - } - } - - /** The giver of life. */ - protected var _ctx :MsoyContext; -} -} diff --git a/src/as/com/threerings/msoy/client/MsoyApp.as b/src/as/com/threerings/msoy/client/MsoyApp.as deleted file mode 100644 index aa4560efc..000000000 --- a/src/as/com/threerings/msoy/client/MsoyApp.as +++ /dev/null @@ -1,22 +0,0 @@ -package com.threerings.msoy.client { - -import mx.core.Application; -import mx.events.FlexEvent; - -public class MsoyApp extends Application -{ - public function MsoyApp () - { - super(); - addEventListener(attachApplication, nowShowing); - } - - /** - * Called once we're ready to go. - */ - private function nowShowing (event :FlexEvent) :void - { - removeEventListener(attachApplication, nowShowing); - } -} -} diff --git a/src/as/com/threerings/msoy/client/MsoyClient.as b/src/as/com/threerings/msoy/client/MsoyClient.as deleted file mode 100644 index 7f561fe44..000000000 --- a/src/as/com/threerings/msoy/client/MsoyClient.as +++ /dev/null @@ -1,71 +0,0 @@ -package com.threerings.msoy.client { - -import flash.display.Stage; - -import mx.core.Application; - -import com.threerings.util.Name; -import com.threerings.presents.client.Client; -import com.threerings.presents.dobj.DSet; -import com.threerings.presents.data.ClientObject; -import com.threerings.presents.net.UsernamePasswordCreds; - -import com.threerings.presents.dobj.DObjectManager; - -import com.threerings.presents.net.BootstrapData; - -// imported so that they'll be compiled into the .swf -import com.threerings.presents.data.TimeBaseMarshaller; -import com.threerings.crowd.data.BodyMarshaller; -import com.threerings.crowd.data.LocationMarshaller; -import com.threerings.crowd.chat.data.ChatMarshaller; - -import com.threerings.msoy.Log; -import com.threerings.msoy.data.MsoyBootstrapData; -import com.threerings.msoy.data.SimpleChatConfig; - -public class MsoyClient extends Client -{ - public function MsoyClient (app :Application) - { - super(new UsernamePasswordCreds(new Name("guest"), "guest")); - - _ctx = new MsoyContext(this, app); - - setServer("tasman.sea.earth.threerings.net", DEFAULT_SERVER_PORT); - logon(); - } - -// // documetnation inherited -// public override function gotBootstrap ( -// data :BootstrapData, omgr :DObjectManager) :void -// { -// super.gotBootstrap(data, omgr); -// -// // let's kick things off by going directly to our global chat room -// // TEMP -// _ctx.getLocationDirector().moveTo((data as MsoyBootstrapData).chatOid); -// } - - // documetnation inherited - public override function gotClientObject (clobj :ClientObject) :void - { - super.gotClientObject(clobj); - - _ctx.getLocationDirector().moveTo( - (getBootstrapData() as MsoyBootstrapData).chatOid); - } - - public function fuckingCompiler () :void - { - var i :int = TimeBaseMarshaller.GET_TIME_OID; - i = LocationMarshaller.LEAVE_PLACE; - i = BodyMarshaller.SET_IDLE; - i = ChatMarshaller.AWAY; - - var c :Class = SimpleChatConfig; - } - - protected var _ctx :MsoyContext; -} -} diff --git a/src/as/com/threerings/msoy/client/MsoyContext.as b/src/as/com/threerings/msoy/client/MsoyContext.as deleted file mode 100644 index 1e53942a1..000000000 --- a/src/as/com/threerings/msoy/client/MsoyContext.as +++ /dev/null @@ -1,91 +0,0 @@ -package com.threerings.msoy.client { - -import flash.display.DisplayObject; -import flash.display.Stage; - -import mx.core.Application; - -import com.threerings.util.MessageManager; - -import com.threerings.presents.client.Client; -import com.threerings.presents.dobj.DObjectManager; - -import com.threerings.crowd.client.ChatDirector; -import com.threerings.crowd.client.LocationDirector; -import com.threerings.crowd.client.OccupantDirector; -import com.threerings.crowd.client.PlaceView; -import com.threerings.crowd.util.CrowdContext; - -import com.threerings.crowd.chat.client.ChatDirector; - -public class MsoyContext - implements CrowdContext -{ - public function MsoyContext (client :Client, app :Application) - { - _client = client; - _app = app; - - // TODO: verify params to these constructors - _msgmgr = new MessageManager("rsrc"); - _locdir = new LocationDirector(this); - _chatdir = new ChatDirector(this, _msgmgr, "general"); - } - - // documentation inherited from superinterface PresentsContext - public function getClient () :Client - { - return _client; - } - - // documentation inherited from superinterface PresentsContext - public function getDObjectManager () :DObjectManager - { - return _client.getDObjectManager(); - } - - // documentation inherited from interface CrowdContext - public function getLocationDirector () :LocationDirector - { - return _locdir; - } - - // documentation inherited from interface CrowdContext - public function getOccupantDirector () :OccupantDirector - { - return null; // TODO - } - - // documentation inherited from interface CrowdContext - public function getChatDirector () :ChatDirector - { - return _chatdir; - } - - // documentation inherited from interface CrowdContext - public function setPlaceView (view :PlaceView) :void - { - for (var ii :int = _app.numChildren - 1; ii >= 0; ii--) { - _app.removeChildAt(ii); - } - - _app.addChild(view as DisplayObject); - } - - // documentation inherited from interface CrowdContext - public function clearPlaceView (view :PlaceView) :void - { - _app.removeChild(view as DisplayObject); - } - - protected var _client :Client; - - protected var _app :Application; - - protected var _msgmgr :MessageManager; - - protected var _locdir :LocationDirector; - - protected var _chatdir :ChatDirector; -} -} diff --git a/src/as/com/threerings/msoy/client/SimpleChatController.as b/src/as/com/threerings/msoy/client/SimpleChatController.as deleted file mode 100644 index bb0fa0e76..000000000 --- a/src/as/com/threerings/msoy/client/SimpleChatController.as +++ /dev/null @@ -1,15 +0,0 @@ -package com.threerings.msoy.client { - -import com.threerings.crowd.client.PlaceController; -import com.threerings.crowd.client.PlaceView; -import com.threerings.crowd.util.CrowdContext; - -public class SimpleChatController extends PlaceController -{ - // documentation inherited - protected override function createPlaceView (ctx :CrowdContext) :PlaceView - { - return new SimpleChatPanel(ctx as MsoyContext); - } -} -} diff --git a/src/as/com/threerings/msoy/client/SimpleChatPanel.as b/src/as/com/threerings/msoy/client/SimpleChatPanel.as deleted file mode 100644 index bdc1ed9a9..000000000 --- a/src/as/com/threerings/msoy/client/SimpleChatPanel.as +++ /dev/null @@ -1,27 +0,0 @@ -package com.threerings.msoy.client { - -import mx.containers.VBox; - -import com.threerings.crowd.client.PlaceView; -import com.threerings.crowd.data.PlaceObject; - -public class SimpleChatPanel extends VBox - implements PlaceView -{ - public function SimpleChatPanel (ctx :MsoyContext) - { - addChild(new ChatTextArea(ctx)); - addChild(new ChatControl(ctx)); - } - - // documentation inherited from interface PlaceView - public function willEnterPlace (plobj :PlaceObject) :void - { - } - - // documentation inherited from interface PlaceView - public function didLeavePlace (plobj :PlaceObject) :void - { - } -} -} diff --git a/src/as/com/threerings/msoy/data/MsoyBootstrapData.as b/src/as/com/threerings/msoy/data/MsoyBootstrapData.as deleted file mode 100644 index 5bb4fd5f1..000000000 --- a/src/as/com/threerings/msoy/data/MsoyBootstrapData.as +++ /dev/null @@ -1,21 +0,0 @@ -package com.threerings.msoy.data { - -import com.threerings.presents.net.BootstrapData; - -import com.threerings.io.ObjectInputStream; -import com.threerings.io.ObjectOutputStream; - -public class MsoyBootstrapData extends BootstrapData -{ - /** The oid of the chat room we should join. */ - public var chatOid :int; - - // documentation inherited - public override function readObject (ins :ObjectInputStream) :void - { - super.readObject(ins); - - chatOid = ins.readInt(); - } -} -} diff --git a/src/as/com/threerings/msoy/data/SimpleChatConfig.as b/src/as/com/threerings/msoy/data/SimpleChatConfig.as deleted file mode 100644 index a5e83dcdb..000000000 --- a/src/as/com/threerings/msoy/data/SimpleChatConfig.as +++ /dev/null @@ -1,15 +0,0 @@ -package com.threerings.msoy.data { - -import com.threerings.crowd.data.PlaceConfig; - -import com.threerings.msoy.client.SimpleChatController; - -public class SimpleChatConfig extends PlaceConfig -{ - // documentation inherited - public override function getControllerClass () :Class - { - return SimpleChatController; - } -} -}