You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
(26) |
Aug
(85) |
Sep
(141) |
Oct
(85) |
Nov
(60) |
Dec
(29) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(38) |
Feb
(78) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <duc...@us...> - 2008-08-09 01:18:20
|
Revision: 800
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=800&view=rev
Author: ducheneaut
Date: 2008-08-09 01:18:28 +0000 (Sat, 09 Aug 2008)
Log Message:
-----------
Fleshed out the Flash viewer:
- basic FlashViewer container (with a debugging console)
- basic Comet client
Note that the messaging system is less fancy than its Java ancestor, no support for multiple wire and message encoders (yet). Lots to do still, esp. actually processing the events when they come back :)
Modified Paths:
--------------
maven/trunk/ogoglio-viewer/.actionScriptProperties
maven/trunk/ogoglio-viewer/.flexProperties
maven/trunk/ogoglio-viewer/build.xml
maven/trunk/ogoglio-viewer/main.mxml
Added Paths:
-----------
maven/trunk/ogoglio-viewer/.settings/com.adobe.flexbuilder.project.prefs
maven/trunk/ogoglio-viewer/com/ogoglio/client/
maven/trunk/ogoglio-viewer/com/ogoglio/client/CometClient.as
maven/trunk/ogoglio-viewer/com/ogoglio/client/MessageFactory.as
maven/trunk/ogoglio-viewer/com/ogoglio/client/OgoglioView3D.as
maven/trunk/ogoglio-viewer/com/ogoglio/client/SpaceClient.as
maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIDescriptor.as
maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIUtil.as
maven/trunk/ogoglio-viewer/com/ogoglio/util/
maven/trunk/ogoglio-viewer/com/ogoglio/util/ArgumentUtils.as
maven/trunk/ogoglio-viewer/com/ogoglio/util/DebugInfo.as
maven/trunk/ogoglio-viewer/com/ogoglio/util/IllegalArgumentException.as
maven/trunk/ogoglio-viewer/com/ogoglio/util/SpaceClientException.as
maven/trunk/ogoglio-viewer/com/ogoglio/util/URLParser.as
maven/trunk/ogoglio-viewer/com/ogoglio/util/WebConstants.as
maven/trunk/ogoglio-viewer/com/ogoglio/viewer/FlashViewer.as
maven/trunk/ogoglio-viewer/resources/
maven/trunk/ogoglio-viewer/resources/body.jpg
maven/trunk/ogoglio-viewer/resources/jane.jpg
maven/trunk/ogoglio-viewer/resources/jane.obj
maven/trunk/ogoglio-viewer/resources/space.html
maven/trunk/ogoglio-viewer/resources/test.mtl
maven/trunk/ogoglio-viewer/resources/test.obj
Removed Paths:
-------------
maven/trunk/ogoglio-viewer/OgoglioView3D.as
maven/trunk/ogoglio-viewer/body.jpg
maven/trunk/ogoglio-viewer/jane.jpg
maven/trunk/ogoglio-viewer/jane.obj
maven/trunk/ogoglio-viewer/test.mtl
maven/trunk/ogoglio-viewer/test.obj
Property Changed:
----------------
maven/trunk/ogoglio-viewer/
Property changes on: maven/trunk/ogoglio-viewer
___________________________________________________________________
Modified: svn:ignore
- target
+ target
generated
Modified: maven/trunk/ogoglio-viewer/.actionScriptProperties
===================================================================
--- maven/trunk/ogoglio-viewer/.actionScriptProperties 2008-07-27 03:03:24 UTC (rev 799)
+++ maven/trunk/ogoglio-viewer/.actionScriptProperties 2008-08-09 01:18:28 UTC (rev 800)
@@ -1,24 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
-<actionScriptProperties mainApplicationPath="main.mxml" version="1">
-<compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.0" htmlPlayerVersionCheck="true" outputFolderPath="bin" strict="true" warn="true">
+<actionScriptProperties mainApplicationPath="main.mxml" version="3">
+<compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" enableModuleDebug="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.0" htmlPlayerVersionCheck="true" outputFolderPath="bin" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
<compilerSourcePath/>
-<libraryPath>
-<libraryPathEntry kind="3" linkType="2" path="${FRAMEWORKS}/libs/playerglobal.swc"/>
-<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/utilities.swc"/>
-<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/flex.swc" sourcepath="${FRAMEWORKS}/source"/>
-<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/framework.swc" sourcepath="${FRAMEWORKS}/source"/>
-<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/rpc.swc"/>
-<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/charts.swc" sourcepath="${FRAMEWORKS}/source"/>
-<libraryPathEntry kind="1" linkType="1" path="${FRAMEWORKS}/locale/{locale}"/>
+<libraryPath defaultLinkType="1">
+<libraryPathEntry kind="4" path="">
+<modifiedEntries>
+<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="true"/>
+</modifiedEntries>
+<excludedEntries>
+<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
+<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
+<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
+<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
+</excludedEntries>
+</libraryPathEntry>
</libraryPath>
<sourceAttachmentPath>
-<sourceAttachmentPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/flex.swc" sourcepath="${FRAMEWORKS}/source"/>
-<sourceAttachmentPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/framework.swc" sourcepath="${FRAMEWORKS}/source"/>
-<sourceAttachmentPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/charts.swc" sourcepath="${FRAMEWORKS}/source"/>
+<sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="false"/>
+<sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="false"/>
+<sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="false"/>
</sourceAttachmentPath>
</compiler>
<applications>
<application path="main.mxml"/>
</applications>
+<modules/>
<buildCSSFiles/>
</actionScriptProperties>
Modified: maven/trunk/ogoglio-viewer/.flexProperties
===================================================================
--- maven/trunk/ogoglio-viewer/.flexProperties 2008-07-27 03:03:24 UTC (rev 799)
+++ maven/trunk/ogoglio-viewer/.flexProperties 2008-08-09 01:18:28 UTC (rev 800)
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<flexProperties flexServerType="0" toolCompile="true" version="1"/>
+<flexProperties flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
Added: maven/trunk/ogoglio-viewer/.settings/com.adobe.flexbuilder.project.prefs
===================================================================
--- maven/trunk/ogoglio-viewer/.settings/com.adobe.flexbuilder.project.prefs (rev 0)
+++ maven/trunk/ogoglio-viewer/.settings/com.adobe.flexbuilder.project.prefs 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,3 @@
+#Fri Aug 01 13:42:57 PDT 2008
+eclipse.preferences.version=1
+upgradeSDK/fb3=
Deleted: maven/trunk/ogoglio-viewer/OgoglioView3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/OgoglioView3D.as 2008-07-27 03:03:24 UTC (rev 799)
+++ maven/trunk/ogoglio-viewer/OgoglioView3D.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -1,84 +0,0 @@
-package
-{
- import away3d.materials.BitmapFileMaterial;
- import away3d.core.math.Number3D;
- import away3d.containers.View3D;
- import away3d.primitives.Cube;
-
- import flash.events.Event;
-
- import mx.core.UIComponent;
- import away3d.core.base.Object3D;
- import away3d.loaders.Obj;
- import away3d.loaders.Object3DLoader;
- import away3d.containers.ObjectContainer3D;
- import away3d.loaders.MaterialLibrary;
-
- public class OgoglioView3D extends UIComponent
- {
- private var view:View3D;
-
- private var objLoader:Object3DLoader;
-
- private var janeLoader:Object3DLoader;
-
- public function OgoglioView3D()
- {
- super();
- this.addEventListener(Event.ENTER_FRAME, onFrameEnter);
- }
-
- override protected function createChildren():void
- {
- super.createChildren();
-
- if(!this.view)
- {
- this.view = new View3D();
-
- this.view.camera.moveTo(new Number3D(0, 0, -300));
- this.view.camera.lookAt(new Number3D(0, 0, 0));
- }
- this.addChild(this.view);
-
- if(!this.objLoader){
- this.objLoader = Obj.load("test.obj", { material:new BitmapFileMaterial("body.jpg"), name:"joe", scaling:10 } );
- this.objLoader.rotationY = 180;
- this.objLoader.rotationX = -90;
- }
- this.view.scene.addChild(this.objLoader);
-
- if(!this.janeLoader){
- this.janeLoader = Obj.load("jane.obj", { material:new BitmapFileMaterial("jane.jpg"), name:"jane", scaling:10 } );
- this.janeLoader.rotationY = 180;
- this.janeLoader.rotationX = -90;
- }
- this.view.scene.addChild(this.janeLoader);
-
- }
-
- override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
- {
- super.updateDisplayList(unscaledWidth, unscaledHeight);
-
- if(this.width / 2 != this.view.x)
- this.view.x = this.width / 2;
- if(this.height / 2 != this.view.y)
- this.view.y = this.height / 2;
- }
-
- private function onFrameEnter(event:Event):void
- {
- if(this.view && this.view.stage)
- {
- this.objLoader.result.transform.tx = -100;
- this.objLoader.result.rotationY += 1;
-
- this.janeLoader.result.rotationY -= 1;
- this.janeLoader.result.transform.tx = 100;
-
- this.view.render();
- }
- }
- }
-}
\ No newline at end of file
Modified: maven/trunk/ogoglio-viewer/build.xml
===================================================================
--- maven/trunk/ogoglio-viewer/build.xml 2008-07-27 03:03:24 UTC (rev 799)
+++ maven/trunk/ogoglio-viewer/build.xml 2008-08-09 01:18:28 UTC (rev 800)
@@ -2,25 +2,29 @@
<project name="ogoglio-viewer" default="wrapper" basedir=".">
- <property name="FLEX_HOME" value="/Users/trevor/Code/flex_sdk_3"/>
- <property name="APP_ROOT" value="/Users/trevor/Code/MavenWorkspace/ogoglio-viewer"/>
+ <property name="FLEX_HOME" value="/Users/nicolas/Dev/flex3sdk"/>
+ <property name="APP_ROOT" value="/Users/nicolas/Dev/workspace-ogoglio/ogoglio-viewer"/>
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<target name="build">
<mkdir dir="target" />
- <mxmlc file="${APP_ROOT}/Main.mxml" keep-generated-actionscript="true" output="${APP_ROOT}/target/Main.swf">
+ <mxmlc file="${APP_ROOT}/main.mxml" keep-generated-actionscript="true" output="${APP_ROOT}/target/Main.swf">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
</mxmlc>
- </target>
-
- <target name="wrapper" depends="build">
+ </target>
+
+ <!-- You cannot set flashVars with this ant task... kinda lame.
+ So we use it to generate the css and js needed by the wrapper, but dont run
+ the generated HTML - use the provided space.html instead
+ (and edit the flashvars to whatever you need them to be) -->
+ <target name="wrapper" depends="clean, build">
<html-wrapper
- title="ogoglio-viewer"
- file="ogoglio-viewer-index.html"
- height="300"
- width="400"
+ title="html-without-flashvars"
+ file="do-not-use.html"
+ height="768"
+ width="1024"
bgcolor="white"
application="app"
swf="Main"
@@ -29,7 +33,11 @@
version-revision="0"
history="true"
template="express-installation"
- output="${APP_ROOT}/target/"/>
+ output="${APP_ROOT}/target/"/>
+
+ <copy todir="${APP_ROOT}/target">
+ <fileset dir="resources"/>
+ </copy>
</target>
<target name="clean">
Added: maven/trunk/ogoglio-viewer/com/ogoglio/client/CometClient.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/client/CometClient.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/client/CometClient.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,235 @@
+package com.ogoglio.client {
+
+import com.adobe.utils.IntUtil;
+import com.ogoglio.util.URLParser;
+import com.ogoglio.client.MessageFactory;
+
+import flash.errors.*;
+import flash.events.*;
+import flash.net.*;
+import flash.utils.ByteArray;
+import flash.utils.Timer;
+
+import mx.rpc.*;
+import mx.rpc.events.*;
+import mx.rpc.http.*;
+import mx.utils.*;
+
+public class CometClient extends Socket
+{
+ private var host:String;
+ private var port:uint;
+ private var path:String;
+ private var spaceID:Number;
+ private var authCookie:String;
+ private var callback:Function;
+
+ private var dollar:RegExp = /\$/;
+
+ private var heartbeatInterval:Number = 5000;
+ private var heartbeatTimer:Timer;
+
+
+ public function CometClient(cometURI:String, spaceID:Number, authCookie:String) {
+ super();
+
+ URLParser.parse(cometURI);
+ this.host = URLParser.host;
+ this.port = parseInt(URLParser.port);
+ this.path = URLParser.path;
+
+ this.spaceID = spaceID;
+ this.authCookie = authCookie;
+
+ this.configureListeners();
+
+ trace("Connection to host: " + host + " at port: " + port);
+ this.connect(host, port);
+ }
+
+ public function set messageHandler(handler:Function):void {
+ this.callback = handler;
+ }
+
+ private function configureListeners():void {
+ addEventListener(Event.CLOSE, closeHandler);
+ addEventListener(Event.CONNECT, connectHandler);
+ addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
+ addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+ addEventListener(ProgressEvent.SOCKET_DATA, initialResponseHandler);
+ }
+
+ private function connectHandler(event:Event):void {
+
+ trace("connectHandler(): sending initial GET");
+
+ writeln("GET "+ path +" HTTP/1.1");
+ writeln("Host: " + host);
+ writeln("Transfer-encoding: chunked");
+ writeln("");
+ }
+
+ private function initialResponseHandler(event:ProgressEvent):void {
+ var response:String = readUTFBytes(bytesAvailable);
+ trace("initialResponseHandler() data:\n" + response);
+
+ if (!response.match("HTTP/1.1 200")) {
+ throw new Error("Problem connecting to server. HTTP Response:" + response);
+ }
+ if (!response.substring(response.length - 8, response.length).match("\r\n\r\n")) {
+ throw new Error("Problem connecting to server, no empty line! HTTP Response:" + response);
+ }
+
+ // If we made contact, switch to main stream processor
+ this.removeEventListener(ProgressEvent.SOCKET_DATA, initialResponseHandler);
+ this.addEventListener(ProgressEvent.SOCKET_DATA, streamProcessor);
+
+ // Fire off an authentication message
+ this.sendMessage(MessageFactory.createAuthenticationMessage(host, port.toString(), spaceID.toString(), authCookie));
+ }
+
+ private function writeln(str:String):void {
+ str += "\r\n";
+ try {
+ writeUTFBytes(str);
+ }
+ catch(e:IOError) {
+ trace("IOError: " + e);
+ }
+ }
+
+ private function sendMessage(message:String):void {
+ var encodedMessage:ByteArray = this.encodeMessage(message);
+ this.sendNetworkMessage(encodedMessage);
+ }
+
+ private function encodeMessage(message:String):ByteArray {
+ // This basically does nothing
+ // It's here as a placeholder for the WireEncoder we had in the former Java implementation
+ var encoded:ByteArray = new ByteArray();
+ encoded.writeUTFBytes(message);
+ return encoded;
+ }
+
+ private function sendNetworkMessage(message:ByteArray):void {
+
+ // Encode the message length into a message header.
+ var messageHeader:ByteArray = this.encodeMessageLength(message.length);
+
+ // Get length of data chunk and encode it.
+ // Note that we add the size of the message header.
+ var dataLength:int = message.length + messageHeader.length;
+ var lengthHexStr:String = IntUtil.toHex(dataLength, true); // careful with BigEndian here...
+ var lengthHexBytes:ByteArray = new ByteArray();
+ lengthHexBytes.writeUTFBytes(lengthHexStr);
+
+ // Now that we know the length of the data length string, start writing to the buffer.
+ // The size is the length of the hex data plus the length of the buffer plus
+ // 4 bytes for the two \r\n pairs plus the size of the message header (which is
+ // redundant but necessary when sending data to a Comet server).
+ var dataBuffer:ByteArray = new ByteArray();
+
+ // Copy in the length string
+ dataBuffer.writeBytes(lengthHexBytes);
+
+ // Insert the first \r\n
+ dataBuffer.writeUTFBytes("\r");
+ dataBuffer.writeUTFBytes("\n");
+
+ // Write in the message size
+ dataBuffer.writeBytes(messageHeader);
+
+ // Copy in the data
+ dataBuffer.writeBytes(message);
+
+ // Add the final \r\n
+ dataBuffer.writeUTFBytes("\r");
+ dataBuffer.writeUTFBytes("\n");
+
+ // Send the message
+ this.writeBytes(dataBuffer);
+ this.flush();
+ }
+
+ private function streamProcessor(event:ProgressEvent):void {
+ var stream:String = readUTFBytes(bytesAvailable);
+ var chunks:Array = stream.split("\r\n");
+ for (var i:int = 0; i < chunks.length; i += 2) {
+ if (chunks[i] == "") {
+ break;
+ }
+ var xmlMessage:XML = this.extractXML(chunks[i], chunks[i+1]);
+
+ if (this.callback != null && xmlMessage != null) {
+ callback(xmlMessage);
+ }
+ }
+ }
+
+ /**
+ * Note that we assume that all messages we get are in XML.
+ * This is in fact the case in the current servlet implementation but makes no provision for
+ * other formats, unlike the more flexible (but more complicated) implementation we had in Java.
+ */
+ private function extractXML(length:String, message:String):XML {
+ // Parse the chunked message length
+ var overallMessageLength:int = parseInt(length, 16);
+
+ // If the chunked message length is 0, we've been disconnected
+ if (overallMessageLength == 0) {
+ trace("EOC received while processing stream");
+ return null;
+ }
+
+ var headerAndBody:Array = message.split(dollar);
+ var internalMessageLength:int = parseInt(headerAndBody[0], 16);
+ var xmlString:String = headerAndBody[1];
+
+ // Check if we agree on size
+ if (xmlString.length != internalMessageLength) {
+ trace("Mismatch between buffered length and actual length of string - content might be corrupted");
+ }
+
+ return new XML(xmlString);
+ }
+
+ /**
+ * Encode the given message length into a hex string followed by a "$"
+ * delimiter, and return the string as a byte array.
+ */
+ private function encodeMessageLength(messageLength:int):ByteArray {
+ var lengthHex:String = IntUtil.toHex(messageLength, true); // Careful, make sure to set BigEndian
+ var encodedLength:ByteArray = new ByteArray();
+ encodedLength.writeUTFBytes(lengthHex + "$");
+ return encodedLength;
+ }
+
+ public function startHeartbeat():void {
+ this.heartbeatTimer = new Timer(this.heartbeatInterval, 0);
+ heartbeatTimer.addEventListener("timer", heartbeatHandler);
+ heartbeatTimer.start();
+
+ // Send a message right away to prevent timeout
+ this.sendMessage(MessageFactory.createHeartbeatMessage(host, port.toString(), spaceID.toString()));
+ }
+
+ private function heartbeatHandler(event:TimerEvent):void {
+ var heartbeatMessage:String = MessageFactory.createHeartbeatMessage(host, port.toString(), spaceID.toString());
+ this.sendMessage(heartbeatMessage);
+ }
+
+ private function closeHandler(event:Event):void {
+ trace("closeHandler(): " + event.toString());
+ }
+
+ private function ioErrorHandler(event:IOErrorEvent):void {
+ trace("IOErrorHandler(): "+ event.toString());
+ }
+
+ private function securityErrorHandler(event:SecurityErrorEvent):void {
+ trace("securityErrorHandler(): " + event.toString());
+ }
+}
+
+}
+
Added: maven/trunk/ogoglio-viewer/com/ogoglio/client/MessageFactory.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/client/MessageFactory.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/client/MessageFactory.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,32 @@
+package com.ogoglio.client
+{
+ public class MessageFactory
+ {
+
+ public static function createAuthenticationMessage(host:String, port:String, spaceID:String, authCookie:String):String {
+ var authRequestXML:XML = <Message/>;
+ authRequestXML.@destination="comet://" + host + ":" + port + "/og/comet/proxy";
+ authRequestXML.@origin="comet://UNKNOWN@127.0.0.1:0000/"; // bogus string, server will get data from request
+ authRequestXML.@spaceID=spaceID;
+ authRequestXML.Payload.AuthenticationRequest.@loginCookie=authCookie;
+ authRequestXML.Payload.AuthenticationRequest.@spaceID=spaceID;
+
+ trace("MessageFactory: created:\n" + authRequestXML.toXMLString());
+
+ return authRequestXML.toXMLString();
+ }
+
+ public static function createHeartbeatMessage(host:String, port:String, spaceID:String):String {
+ var heartbeatXML:XML = <Message/>;
+ heartbeatXML.@destination="comet://" + host + ":" + port + "/og/comet/proxy";
+ heartbeatXML.@origin="comet://UNKNOWN@127.0.0.1:0000/"; // bogus string, server will get data from request
+ heartbeatXML.@spaceID=spaceID;
+ heartbeatXML.Payload="";
+ heartbeatXML.Payload.HeartbeatPayload="";
+
+ //trace("MessageFactory: created:\n" + heartbeatXML.toXMLString());
+
+ return heartbeatXML.toXMLString();
+ }
+ }
+}
\ No newline at end of file
Copied: maven/trunk/ogoglio-viewer/com/ogoglio/client/OgoglioView3D.as (from rev 799, maven/trunk/ogoglio-viewer/OgoglioView3D.as)
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/client/OgoglioView3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/client/OgoglioView3D.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,82 @@
+package com.ogoglio.client
+{
+ import away3d.containers.View3D;
+ import away3d.core.math.Number3D;
+ import away3d.loaders.Obj;
+ import away3d.loaders.Object3DLoader;
+ import away3d.materials.BitmapFileMaterial;
+
+ import com.ogoglio.client.SpaceClient;
+
+ import flash.events.Event;
+
+ import mx.core.UIComponent;
+
+ public class OgoglioView3D extends UIComponent
+ {
+ private var view:View3D;
+
+ private var objLoader:Object3DLoader;
+
+ private var janeLoader:Object3DLoader;
+
+ public function OgoglioView3D()
+ {
+ super();
+ this.addEventListener(Event.ENTER_FRAME, onFrameEnter);
+ }
+
+ override protected function createChildren():void
+ {
+ super.createChildren();
+
+ if(!this.view)
+ {
+ this.view = new View3D();
+
+ this.view.camera.moveTo(new Number3D(0, 0, -300));
+ this.view.camera.lookAt(new Number3D(0, 0, 0));
+ }
+ this.addChild(this.view);
+
+ if(!this.objLoader){
+ this.objLoader = Obj.load("test.obj", { material:new BitmapFileMaterial("body.jpg"), name:"joe", scaling:10 } );
+ this.objLoader.rotationY = 180;
+ this.objLoader.rotationX = -90;
+ }
+ this.view.scene.addChild(this.objLoader);
+
+ if(!this.janeLoader){
+ this.janeLoader = Obj.load("jane.obj", { material:new BitmapFileMaterial("jane.jpg"), name:"jane", scaling:10 } );
+ this.janeLoader.rotationY = 180;
+ this.janeLoader.rotationX = -90;
+ }
+ this.view.scene.addChild(this.janeLoader);
+
+ }
+
+ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if(this.width / 2 != this.view.x)
+ this.view.x = this.width / 2;
+ if(this.height / 2 != this.view.y)
+ this.view.y = this.height / 2;
+ }
+
+ private function onFrameEnter(event:Event):void
+ {
+ if(this.view && this.view.stage)
+ {
+ this.objLoader.result.transform.tx = -100;
+ this.objLoader.result.rotationY += 1;
+
+ this.janeLoader.result.rotationY -= 1;
+ this.janeLoader.result.transform.tx = 100;
+
+ this.view.render();
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: maven/trunk/ogoglio-viewer/com/ogoglio/client/OgoglioView3D.as
___________________________________________________________________
Added: svn:mergeinfo
+
Added: maven/trunk/ogoglio-viewer/com/ogoglio/client/SpaceClient.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/client/SpaceClient.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/client/SpaceClient.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,142 @@
+package com.ogoglio.client
+{
+ import com.ogoglio.util.*;
+
+ import mx.rpc.events.*;
+ import mx.rpc.http.*;
+
+
+ public class SpaceClient {
+
+ private var spaceID:int;
+ private var authCookie:String;
+ private var descriptor:WebAPIDescriptor;
+ private var listener:Function;
+
+ private var username:String;
+ private var cachedAccountDocument:XML;
+ private var spaceDocument:XML;
+
+ private var messageChannel:CometClient;
+
+ public function SpaceClient(spaceID:int, serviceURI:String, authCookie:String, listener:Function) {
+ ArgumentUtils.assertNotNegative(spaceID);
+ this.spaceID = spaceID;
+ ArgumentUtils.assertNotNull(authCookie);
+ this.authCookie = authCookie;
+ ArgumentUtils.assertNotNull(serviceURI);
+ this.descriptor = new WebAPIDescriptor(serviceURI);
+ ArgumentUtils.assertNotNull(listener);
+ this.listener = listener;
+
+ listener(new DebugInfo("* SpaceClient: Started with spaceID: " + spaceID + "; serviceURI: " + serviceURI + "; cookie: " + authCookie));
+
+ listener(new DebugInfo("* SpaceClient: Authenticating..."));
+ // Deal with guests first
+ if (authCookie.match("guest")) {
+ this.cachedAccountDocument = new XML();
+ cachedAccountDocument["username"] = authCookie;
+ this.username = authCookie;
+
+ listener(new DebugInfo(" SpaceClient: Authenticated as guest from cookie: " + this.authCookie));
+
+ listener(new DebugInfo("* SpaceClient: Asking for space document..."));
+ this.getXML(descriptor.getSpaceAndChildrenURI(this.spaceID), spaceDocumentHandler);
+
+ // If not a guest get the account document
+ } else {
+ this.getXML(descriptor.getMeAuthURI(), authDocHandler);
+ }
+ }
+
+ private function authDocHandler(resultEvent:ResultEvent):void {
+ var authDoc:XML = new XML(resultEvent.result);
+
+ if(authDoc == null) {
+ listener(new SpaceClientException("! SpaceClient: Could not authenticate with server."));
+ return;
+ }
+ if (authDoc.attribute("authenticated") != "true") {
+ listener(new SpaceClientException("! SpaceClient: Could not authenticate via cookie."));
+ return;
+ }
+ this.username = authDoc.attribute("username");
+
+ listener(new DebugInfo(" SpaceClient: Authenticated with username: " + this.username));
+
+ listener(new DebugInfo("* SpaceClient: Asking for authentication document..."));
+ this.getXML(descriptor.getAccountURI(username), accountDocHandler);
+ }
+
+ private function accountDocHandler(resultEvent:ResultEvent):void {
+ cachedAccountDocument = new XML(resultEvent.result);
+
+ if(cachedAccountDocument == null) {
+ listener(new SpaceClientException("! SpaceClient: Could not retrieve account document."));
+ return;
+ }
+
+ listener(new DebugInfo(" SpaceClient: Retrieved account document for username: " + cachedAccountDocument.attribute("username")
+ + " - First name: " + cachedAccountDocument.attribute("firstname")
+ + " Last name: " + cachedAccountDocument.attribute("lastname")));
+
+ listener(new DebugInfo("* SpaceClient: Asking for space document..."));
+ this.getXML(descriptor.getSpaceAndChildrenURI(this.spaceID), spaceDocumentHandler);
+ }
+
+ private function spaceDocumentHandler(resultEvent:ResultEvent):void {
+ spaceDocument = new XML(resultEvent.result);
+
+ if(spaceDocument == null) {
+ listener(new SpaceClientException("! SpaceClient: Could not retrieve space document."));
+ return;
+ }
+
+ listener(new DebugInfo(" SpaceClient: Retrieved space document: spaceID: " + spaceDocument.attribute("spaceid")
+ + " Owner username: " + spaceDocument.attribute("ownerusername")
+ + " Display name: " + spaceDocument.attribute("displayname")));
+
+ // TODO: eventually we'll create a space model here
+ // For now we just setup the messaging system
+
+ this.messageChannel = new CometClient(descriptor.getCometProxyURI(), spaceID, authCookie);
+ this.messageChannel.messageHandler = handleMessageFromService;
+ }
+
+ private function getXML(uri:String, resultHandler:Function):void {
+ var connection:HTTPService = new HTTPService();
+ connection.url = uri;
+ connection.method = "get";
+ connection.resultFormat = "e4x";
+ connection.requestTimeout = 5;
+
+ var parameters:Object = new Object();
+ if (authCookie != null) {
+ parameters["Cookie"] = WebConstants.AUTH_COOKIE + "=" + authCookie;
+ }
+
+ connection.addEventListener(ResultEvent.RESULT, resultHandler);
+ connection.addEventListener(FaultEvent.FAULT, failureHandler);
+
+ connection.send(parameters);
+ }
+
+ private function failureHandler(faultEvent:FaultEvent):void {
+ var faultString:String = faultEvent.fault.faultDetail;
+ listener(new SpaceClientException("! SpaceClient: " + faultString));
+ }
+
+ private function handleMessageFromService(message:XML):void {
+ listener(new DebugInfo(" SpaceClient.CometMessageHandler: received\n" + message));
+
+ // Start heartbeat if we authenticated successfully
+ if (message.Payload.AuthenticationSuccess.@username == this.username) {
+ listener(new DebugInfo(" SpaceClient.CometMessageHandler: successful authentication, starting heartbeat"));
+ messageChannel.startHeartbeat();
+ } else {
+ // Lots to do here... move over everything from the original handleMessageFromService
+ listener(message);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIDescriptor.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIDescriptor.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIDescriptor.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,210 @@
+package com.ogoglio.client
+{
+ import com.ogoglio.util.WebConstants;
+ import com.ogoglio.util.ArgumentUtils;
+
+ public class WebAPIDescriptor
+ {
+ private var serviceURI:String = null;
+
+ public function WebAPIDescriptor(serviceURI:String) {
+ ArgumentUtils.assertNotNull(serviceURI);
+ this.serviceURI = serviceURI;
+ }
+
+ public function getSpacesURI():String {
+ return WebAPIUtil.appendToURI(serviceURI, "space/");
+ }
+
+ public function getSpaceSimURIServersOnly():String {
+ return WebAPIUtil.appendToURI(getSpacesURI(), "sim/?serversOnly=true");
+ }
+
+ public function getSpaceSimURI(id:Number):String {
+ return WebAPIUtil.appendToURI(getSpacesURI(), "sim/"+id);
+ }
+
+ public function getSpaceURI(spaceID:Number):String {
+ return WebAPIUtil.appendToURI(serviceURI, "space/" + spaceID);
+ }
+
+ public function getSpaceAndChildrenURI(spaceID:Number):String {
+ return WebAPIUtil.appendToURI(getSpaceURI(spaceID), "?" + WebConstants.SPACE_INCLUDE_CHILDREN_PARAM + "=true");
+ }
+
+ public function getSpaceMemberURI(spaceID:Number):String {
+ return WebAPIUtil.appendToURI(getSpaceURI(spaceID), "member/");
+ }
+
+ public function getSpaceMemberURIForUsername(spaceID:Number, memberUsername:String):String {
+ return WebAPIUtil.appendToURI(getSpaceMemberURI(spaceID), memberUsername + "/");
+ }
+
+ public function getUsersSpaceMembershipsURI(username:String):String {
+ return WebAPIUtil.appendToURI(getAccountURI(username), "membership/");
+ }
+
+ public function getAccountBaseURI():String {
+ return WebAPIUtil.appendToURI(serviceURI, "account/");
+ }
+
+ public function getAccountURI(username:String):String {
+ return WebAPIUtil.appendToURI(getAccountBaseURI(), username + "/");
+ }
+
+ public function getAccountPhotoURI(username:String):String {
+ return WebAPIUtil.appendToURI(getAccountURI(username), "photo/");
+ }
+
+ public function getPossessionsURI(username:String):String {
+ return WebAPIUtil.appendToURI(getAccountURI(username), "possession/");
+ }
+
+ public function getPossessionURI(username:String, possessionID:Number):String {
+ return WebAPIUtil.appendToURI(getPossessionsURI(username), possessionID + "/");
+ }
+
+ public function getMeAuthURI():String {
+ return WebAPIUtil.appendToURI(getAuthURI(), "me/");
+ }
+
+ public function getAuthURI():String {
+ return WebAPIUtil.appendToURI(serviceURI, "auth/");
+ }
+
+ public function getAuthGuestURI():String {
+ return WebAPIUtil.appendToURI(getAuthURI(), "guest/");
+ }
+
+ public function getAccountSpacesURI(username:String):String {
+ return WebAPIUtil.appendToURI(getAccountURI(username), "space/");
+ }
+
+ public function getTemplatesURI(username:String):String {
+ return WebAPIUtil.appendToURI(getAccountURI(username), "template/");
+ }
+
+ public function getTemplateURI(username:String, templateID:Number):String {
+ return WebAPIUtil.appendToURI(getTemplatesURI(username), templateID + "/");
+ }
+
+ public function getAttachmentTemplatesURI():String {
+ return WebAPIUtil.appendToURI(getAccountBaseURI(), "template/attachment/");
+ }
+
+ public function getDoorsURI(spaceID:Number):String {
+ return WebAPIUtil.appendToURI(getSpaceURI(spaceID), "door/");
+ }
+
+ public function getDoorURI(spaceID:Number, doorID:Number):String {
+ return WebAPIUtil.appendToURI(getDoorsURI(spaceID), doorID + "/");
+ }
+
+ public function getThingsURI(spaceID:Number):String {
+ return WebAPIUtil.appendToURI(getSpaceURI(spaceID), "thing/");
+ }
+
+ public function getThingURI(spaceID:Number, thingID:Number):String {
+ return WebAPIUtil.appendToURI(getThingsURI(spaceID), thingID + "/");
+ }
+
+ public function getThingServiceURI(spaceID:Number, thingID:Number):String {
+ return WebAPIUtil.appendToURI(getThingURI(spaceID, thingID), "service/");
+ }
+
+ public function getReloadThingURI(spaceID:Number, thingID:Number):String {
+ return WebAPIUtil.appendToURI(getThingsURI(spaceID), thingID + "/?reload=true");
+ }
+
+ public function getUserURI(spaceID:Number, username:String):String {
+ return WebAPIUtil.appendToURI(getUsersURI(spaceID), username + "/");
+ }
+
+ public function getUsersURI(spaceID:Number):String {
+ return WebAPIUtil.appendToURI(getSpaceURI(spaceID), "user/");
+ }
+
+ public function getBodiesURI():String {
+ return WebAPIUtil.appendToURI(getSpacesURI(), "body/");
+ }
+
+ public function getBodyDataDocumentURI(bodyDataID:String):String {
+ return WebAPIUtil.appendToURI(getBodiesURI(), bodyDataID + "/");
+ }
+
+ public function getBodyDataURI(fileName:String):String {
+ return WebAPIUtil.appendToURI(serviceURI, fileName);
+ }
+
+ public function getBodyConfigurationsURI(username:String):String {
+ return WebAPIUtil.appendToURI(getAccountURI(username), "body/");
+ }
+
+ public function getBodyConfigurationURI(username:String, bodyConfigurationID:Number):String {
+ return WebAPIUtil.appendToURI(getBodyConfigurationsURI(username), bodyConfigurationID + "/");
+ }
+
+ public function getBodyTextureURI(username:String, bodyConfigurationID:Number):String {
+ return WebAPIUtil.appendToURI(getBodyConfigurationURI(username, bodyConfigurationID), "texture");
+ }
+ public function getDefaultBodyConfiguration(username:String):String {
+ return WebAPIUtil.appendToURI(getBodyConfigurationsURI(username), "default/");
+ }
+
+ public function getPagesURI(spaceID:Number, thingID:Number):String {
+ return WebAPIUtil.appendToURI(getThingURI(spaceID, thingID), "page/");
+ }
+
+ public function getPageURI(spaceID:Number, thingID:Number, pageID:Number):String {
+ return WebAPIUtil.appendToURI(getPagesURI(spaceID, thingID), pageID + "/");
+ }
+
+ public function getPageContentsURI(spaceID:Number, thingID:Number, pageID:Number):String {
+ return WebAPIUtil.appendToURI(getPageURI(spaceID, thingID, pageID), "content");
+ }
+
+ public function getSettingsURI(spaceID:Number):String {
+ return WebAPIUtil.appendToURI(getSpaceURI(spaceID), "setting/");
+ }
+
+ public function getSettingURI(spaceID:Number, key:String):String {
+ return WebAPIUtil.appendToURI(getSettingsURI(spaceID), key + "/");
+ }
+
+ public function getTemplateScriptURI(ownerUsername:String, templateID:Number):String {
+ return WebAPIUtil.appendToURI(getTemplateURI(ownerUsername, templateID), "script/");
+ }
+
+ public function getTemplateGeometryURI(ownerUsername:String, templateID:Number, lodIndex:Number):String {
+ return WebAPIUtil.appendToURI(getTemplateURI(ownerUsername, templateID), "geometry/data/" + lodIndex);
+ }
+
+ public function getTemplateResourceURI(ownerUsername:String, templateID:Number, fileName:String):String {
+ return WebAPIUtil.appendToURI(getTemplateURI(ownerUsername, templateID), "geometry/" + fileName);
+ }
+
+ public function getServiceURI():String {
+ return serviceURI;
+ }
+
+ public function getServiceStateURI():String {
+ return WebAPIUtil.appendToURI(getSpacesURI(), "state/");
+ }
+
+ public function getCometProxyURI():String {
+ return WebAPIUtil.appendToURI(serviceURI, "comet/"+getCometProxyPath());
+ }
+
+ public function getCometSimURI():String {
+ return WebAPIUtil.appendToURI(serviceURI, "comet/"+getCometSimPath());
+ }
+
+ public function getCometProxyPath():String {
+ return "proxy";
+ }
+
+ public function getCometSimPath():String {
+ return "sim";
+ }
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIUtil.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIUtil.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/client/WebAPIUtil.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,15 @@
+package com.ogoglio.client
+{
+ import com.ogoglio.util.WebConstants;
+
+ public class WebAPIUtil
+ {
+ public static function appendToURI(uri:String, suffix:String):String {
+ if (!uri.charAt(uri.length - 1).match("/")) {
+ uri += "/";
+ }
+ uri += suffix;
+ return uri;
+ }
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/util/ArgumentUtils.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/util/ArgumentUtils.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/util/ArgumentUtils.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,23 @@
+package com.ogoglio.util
+{
+ public class ArgumentUtils
+ {
+ public static function assertNotEmpty(value:String):void {
+ if (value == null) {
+ throw new IllegalArgumentException("String was empty.");
+ }
+ }
+
+ public static function assertNotNull(object:Object):void {
+ if (object == null) {
+ throw new IllegalArgumentException("Argument was null");
+ }
+ }
+
+ public static function assertNotNegative(value:Number):void {
+ if (value < 0) {
+ throw new IllegalArgumentException("Argument was less than zero");
+ }
+ }
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/util/DebugInfo.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/util/DebugInfo.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/util/DebugInfo.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,13 @@
+package com.ogoglio.util
+{
+ public class DebugInfo
+ {
+ public var message:String;
+
+ public function DebugInfo(message:String)
+ {
+ this.message = message;
+ }
+
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/util/IllegalArgumentException.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/util/IllegalArgumentException.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/util/IllegalArgumentException.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,11 @@
+package com.ogoglio.util
+{
+ public class IllegalArgumentException extends Error
+ {
+ public function IllegalArgumentException(message:String = "Illegal argument specified")
+ {
+ super(message);
+ }
+
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/util/SpaceClientException.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/util/SpaceClientException.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/util/SpaceClientException.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,10 @@
+package com.ogoglio.util
+{
+ public class SpaceClientException extends Error
+ {
+ public function SpaceClientException(message:String = "Could not initialize SpaceClient") {
+ super(message);
+ }
+
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/util/URLParser.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/util/URLParser.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/util/URLParser.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,41 @@
+package com.ogoglio.util
+{
+ public class URLParser
+ {
+ public static var url:String;
+ public static var host:String = "";
+ public static var port:String = "";
+ public static var protocol:String = "";
+ public static var path:String = "";
+ public static var parameters:Object;
+
+ public static function parse( url:String ) : void {
+
+ URLParser.url = url;
+ var reg:RegExp = /(?P<protocol>[a-zA-Z]+) : \/\/ (?P<host>[^:\/]*) (:(?P<port>\d+))? ((?P<path>[^?]*))? ((?P<parameters>.*))? /x;
+ var results:Array = reg.exec(url);
+
+ protocol = results.protocol
+ host = results.host;
+ port = results.port;
+ path = results.path;
+
+ var paramsStr:String = results.parameters;
+
+ if(paramsStr!="") {
+ parameters = null;
+ parameters = new Object();
+
+ if(paramsStr.charAt(0) == "?") {
+ paramsStr = paramsStr.substring(1);
+ }
+
+ var params:Array = paramsStr.split("&");
+ for each(var paramStr:String in params) {
+ var param:Array = paramStr.split("=");
+ parameters[param[0]] = param[1];
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/util/WebConstants.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/util/WebConstants.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/util/WebConstants.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,23 @@
+package com.ogoglio.util
+{
+ public class WebConstants
+ {
+ public static const AUTH_USERNAME_PARAM:String = "username";
+
+ public static const AUTH_PASS_PARAM:String = "password";
+
+ public static const AUTH_COOKIE:String = "loginCookie";
+
+ public static const SPACE_INCLUDE_CHILDREN_PARAM:String = "children";
+
+ public static const GUEST_COOKIE_PREFIX:String = "guest";
+
+ public static const REQUESTED_GUEST_NAME_PARAMETER:String = "requestedGuestName";
+
+ public static const GUEST_DISPLAY_NAME_PREFIX:String = "Guest";
+
+ public static const GUEST_BODY_FILE_NAME:String = "ogoglio-body-guest.jar";
+
+ public static const INCOMING_CHAT_SOUND_PATH:String = "incomingChat.wav";
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/com/ogoglio/viewer/FlashViewer.as
===================================================================
--- maven/trunk/ogoglio-viewer/com/ogoglio/viewer/FlashViewer.as (rev 0)
+++ maven/trunk/ogoglio-viewer/com/ogoglio/viewer/FlashViewer.as 2008-08-09 01:18:28 UTC (rev 800)
@@ -0,0 +1,94 @@
+package com.ogoglio.viewer
+{
+ import com.ogoglio.client.OgoglioView3D;
+ import com.ogoglio.client.SpaceClient;
+ import com.ogoglio.util.DebugInfo;
+
+ import mx.containers.Panel;
+ import mx.containers.VDividedBox;
+ import mx.controls.TextArea;
+ import mx.core.Application;
+
+
+ public class FlashViewer extends Panel {
+
+ private var mainContainer:VDividedBox;
+ private var debugConsole:TextArea = new TextArea();
+
+ private var authCookie:String;
+ private var spaceID:String;
+ private var serviceURI:String;
+ private var serverIP:String;
+
+ private var spaceClient:SpaceClient;
+
+ private var enableChat:Boolean = false;
+ private var enableDebugConsole:Boolean = true;
+
+ public function FlashViewer(authCookie:String, spaceID:String, serviceURI:String, serverIP:String) {
+
+ this.title = "Ogoglio Flash Viewer";
+ this.authCookie = authCookie;
+ this.spaceID = spaceID;
+ this.serviceURI = serviceURI;
+ this.serverIP = serverIP;
+
+ mainContainer = new VDividedBox();
+ mainContainer.percentWidth = 100;
+ mainContainer.percentHeight = 100;
+ this.addChild(mainContainer);
+
+ if (authCookie == null) {
+ mainContainer.addChild(errorPanel("I can't authenticate. Perhaps you aren't logged in?"));
+ return;
+ }
+
+ if (spaceID == null || serviceURI == null) {
+ mainContainer.addChild(errorPanel("I can't find the space ID and service URI."));
+ return;
+ }
+
+ if (serverIP == null) {
+ mainContainer.addChild(errorPanel("I can't find the server IP."));
+ return;
+ }
+
+ var spaceIDInt:int = parseInt(spaceID);
+ this.spaceClient = new SpaceClient(spaceIDInt, serviceURI, authCookie, spaceClientListener);
+
+ // Eventually we'll create a real viewer here...
+ var viewer:OgoglioView3D = new OgoglioView3D();
+ viewer.percentHeight = 100;
+ viewer.percentWidth = 100;
+ mainContainer.addChild(viewer);
+
+ if (enableDebugConsole) {
+ viewer.percentHeight = 70;
+ debugConsole.percentHeight = 30;
+ debugConsole.percentWidth = 100;
+ debugConsole.text = "Debugging console turned on:\n";
+ mainContainer.addChild(debugConsole);
+ }
+ }
+
+ public function spaceClientListener(callback:Object):void {
+ if (callback is Error) {
+ var error:Error = Error(callback);
+ debugConsole.text += error.message + "\n";
+ } else if (callback is DebugInfo) {
+ var debug:DebugInfo = DebugInfo(callback);
+ debugConsole.text += debug.message + "\n";
+ }
+ }
+
+ private function errorPanel(message:String):TextArea {
+ var errorPanel:TextArea = new TextArea();
+ errorPanel.percentHeight = 100;
+ errorPanel.percentWidth = 100;
+ errorPanel.htmlText = "<b><font size='20'>" + message + "</font></b>";
+ errorPanel.setStyle("textAlign", "center");
+
+ return errorPanel;
+ }
+ }
+}
\ No newline at end of file
Deleted: maven/trunk/ogoglio-viewer/jane.obj
===================================================================
--- maven/trunk/ogoglio-viewer/jane.obj 2008-07-27 03:03:24 UTC (rev 799)
+++ maven/trunk/ogoglio-viewer/jane.obj 2008-08-09 01:18:28 UTC (rev 800)
@@ -1,9308 +0,0 @@
-# Height scale: 0.999856
-# Y Change: -1.2772213
-# created by Ogoglio Obj library: http://ogoglio.com/
-# num vertices: 1750
-# num faces: 3446
-# num groups: 20
-# num smoothing groups: 3
-# num material groups: 0
-v -0.028693866 0.61399424 0.086478546
-v -0.047523156 0.61399424 0.086479545
-v -0.0569368 0.5989244 0.086478546
-v -0.047523156 0.5838556 0.086478546
-v -0.028693866 0.5838556 0.086479545
-v -0.019279223 0.5989244 0.086479545
-v -0.029954687 0.61197865 0.09494833
-v -0.046261337 0.61197865 0.09494833
-v -0.05441416 0.59892845 0.09494833
-v -0.046261337 0.5858784 0.09494833
-v -0.029954687 0.5858784 0.09494833
-v -0.02180186 0.59892845 0.09494833
-v -0.03340119 0.60646033 0.09992461
-v -0.042814836 0.60646033 0.09992461
-v -0.047522157 0.5989264 0.09992461
-v -0.042815834 0.59139144 0.09992461
-v -0.03340119 0.59139144 0.09992461
-v -0.028693866 0.5989264 0.09992461
-v -0.038108513 0.59892845 0.10174634
-v 0.04750016 0.61399424 0.086478546
-v 0.02867087 0.61399424 0.086479545
-v 0.019256227 0.5989244 0.086478546
-v 0.02867087 0.5838556 0.086478546
-v 0.04750016 0.5838556 0.086479545
-v 0.056914803 0.5989244 0.086479545
-v 0.04623834 0.61197865 0.09494833
-v 0.029932689 0.61197865 0.09494833
-v 0.021778863 0.59892845 0.09494833
-v 0.02993169 0.5858784 0.09494833
-v 0.04623834 0.5858784 0.09494833
-v 0.054392166 0.59892845 0.09494833
-v 0.042792838 0.60646033 0.09992461
-v 0.033378195 0.60646033 0.09992461
-v 0.02867087 0.5989264 0.09992461
-v 0.033378195 0.59139144 0.09992461
-v 0.042792838 0.59139144 0.09992461
-v 0.04750016 0.5989264 0.09992461
-v 0.038085517 0.59892845 0.10174634
-v 0.0 0.47002506 0.09726999
-v 0.0 0.50386715 0.11709413
-v 0.0 0.53018534 0.124467075
-v 0.0 0.5120599 0.12098257
-v 0.0 0.48805737 0.12247336
-v 0.0 0.4776219 0.115745336
-v 0.0 0.57006156 0.13850404
-v 0.0 0.56339455 0.14061674
-v 0.0 0.54998446 0.12283231
-v 0.0 0.5162864 0.11918783
-v 0.0 0.525699 0.12498599
-v 0.0 0.519078 0.12098857
-v 0.0 0.53470075 0.121441506
-v 0.0 0.5436684 0.1229343
-v 0.0 0.5549277 0.1339807
-v 0.019081252 0.47336555 0.09612816
-v 0.011234382 0.5037911 0.11669219
-v 0.06971195 0.5241393 0.008369795
-v 0.055462014 0.5343617 -0.05368227
-v 0.084585816 0.56104493 0.008136828
-v 0.064348735 0.5696347 -0.07717788
-v 0.010568478 0.6000873 0.10944723
-v 0.08929214 0.5922904 0.012639179
-v 0.07248756 0.61297846 -0.09068894
-v 0.020126102 0.62373483 0.11642024
-v 0.08968008 0.61848664 0.019487193
-v 0.057520714 0.6575279 -0.09672107
-v 0.025426337 0.6961734 0.0708358
-v 0.080925345 0.664165 -0.0035514885
-v 0.05513206 0.69226706 -0.061813097
-v 0.02632221 0.7130619 0.040310197
-v 0.06432174 0.6962795 -0.0040594153
-v 0.033712145 0.4899192 0.1006625
-v 0.022170808 0.5619458 0.11092803
-v 0.057935655 0.59979737 0.08863223
-v 0.060247324 0.62396383 0.09277164
-v 0.05290838 0.68634796 0.051427595
-v 0.028568886 0.518834 0.106226705
-v 0.07816074 0.53994596 0.009228671
-v 0.02095798 0.52823174 0.11649922
-v 0.023353636 0.51326585 0.11409657
-v 0.011274376 0.47984958 0.113307685
-v 0.01882129 0.55523276 0.113462664
-v 0.0047863107 0.57964325 0.12650578
-v 0.012582188 0.57048965 0.12539594
-v 0.0036004814 0.6042677 0.11077405
-v 0.00784287 0.62098837 0.11889688
-v 0.0043783695 0.5502595 0.121296525
-v 0.0050542722 0.57029057 0.13757119
-v 0.007470924 0.56405044 0.13915396
-v 0.0070079905 0.53235114 0.12617083
-v 0.004865299 0.5204358 0.11747008
-v 0.01985814 0.5575514 0.119289815
-v 0.010037554 0.50983226 0.12169348
-v 0.017622462 0.5661262 0.116165265
-v 0.016914563 0.5193529 0.113379665
-v 0.00840579 0.5179491 0.12114255
-v 0.02172687 0.51769006 0.114736475
-v 0.026423195 0.5195509 0.1076145
-v 0.02117395 0.52486014 0.118065
-v 0.011535338 0.52701175 0.12469304
-v 0.02770001 0.5096803 0.10634568
-v 0.068489134 0.616259 0.07807076
-v 0.011888288 0.6971954 0.07493021
-v 0.014009981 0.7157166 0.034932967
-v 0.014572901 0.48894227 0.12016869
-v 0.05159257 0.5247042 0.081273295
-v 0.06679938 0.56478345 0.081620246
-v 0.07401134 0.58255684 0.06365184
-v 0.0735644 0.6024369 0.06915104
-v 0.06650842 0.67693424 0.03317722
-v 0.021212945 0.59816456 0.10187533
-v 0.053730264 0.59381616 0.09614915
-v 0.028598882 0.59287035 0.10408701
-v 0.04596838 0.59195554 0.10379105
-v 0.054344174 0.6034589 0.09377849
-v 0.031211505 0.6058794 0.10498388
-v 0.045079507 0.6075473 0.10190532
-v 0.042720847 0.62744236 0.11012114
-v 0.039819267 0.6924349 0.062143046
-v 0.016607609 0.5980426 0.10456694
-v 0.026142236 0.5876671 0.108196415
-v 0.044038657 0.58402157 0.10337812
-v 0.05602493 0.58634126 0.09163581
-v 0.062317025 0.595266 0.08000048
-v 0.06022633 0.602528 0.08060039
-v 0.056080922 0.61091876 0.087935336
-v 0.04323677 0.61662495 0.100659505
-v 0.029670727 0.61236846 0.10381105
-v 0.0478971 0.56112194 0.105471805
-v 0.052195482 0.5000347 0.068554126
-v 0.026717152 0.4806435 0.06393979
-v 0.010712457 0.6640581 0.10426798
-v 0.026830135 0.6651869 0.0999986
-v 0.04809707 0.6637981 0.087809354
-v 0.06600549 0.65772593 0.069165036
-v 0.07325745 0.6524478 0.049881812
-v 0.08222216 0.6432171 0.033581164
-v 0.035455894 0.71179616 0.024221512
-v 0.04819606 0.7043663 0.013741021
-v 0.07066082 0.5484437 -0.029196795
-v 0.07613403 0.5763788 -0.035887834
-v 0.08153726 0.6208663 -0.043704703
-v 0.0812533 0.6634021 -0.050644707
-v 0.042852826 0.7122381 -0.01166432
-v 0.017251516 0.72276556 -0.011920284
-v 0.030535603 0.7032974 -0.068113185
-v 0.028503895 0.6636311 -0.10531983
-v 0.03443704 0.61052275 -0.11487945
-v 0.032315347 0.56211376 -0.09958666
-v 0.013972987 0.5514643 0.117016144
-v 0.08175423 0.560557 0.031395476
-v 0.0680012 0.54055583 0.055227045
-v 0.06270397 0.50978327 0.04693624
-v 0.005708178 0.5218705 0.1207676
-v 0.016897565 0.52098465 0.11629325
-v 0.026474187 0.5202228 0.10873734
-v 0.028366916 0.52142763 0.10780247
-v 0.031153513 0.5222975 0.104126
-v 0.03899538 0.5242772 0.09984862
-v 0.039101366 0.51291084 0.09555624
-v 0.031029532 0.51735425 0.10329212
-v 0.0076808934 0.53680634 0.12208242
-v 0.020113103 0.533236 0.111116
-v 0.055866953 0.5998273 0.08739742
-v 0.053273328 0.60297084 0.08739742
-v 0.0541362 0.5941062 0.08739742
-v 0.022100817 0.5981035 0.08727643
-v 0.029246788 0.5933273 0.08739742
-v 0.045587435 0.5924134 0.08739742
-v 0.032045383 0.6053606 0.08720544
-v 0.044771552 0.6067084 0.08724743
-v 0.044345614 0.6112397 0.10318214
-v 0.030395623 0.608976 0.10602473
-v 0.019685166 0.5980426 0.10225427
-v 0.026336208 0.5909016 0.107289545
-v 0.045008518 0.588004 0.1048819
-v 0.056343887 0.5900637 0.09571022
-v 0.060196333 0.5967158 0.08359896
-v 0.05928646 0.6009562 0.084510826
-v 0.055350028 0.6069374 0.09109788
-v 0.017173527 0.5827558 0.11362164
-v 0.012687173 0.58527243 0.1152744
-v 0.0050492724 0.58995676 0.11875489
-v 0.069161035 0.59837854 0.074789226
-v 0.0652516 0.60730326 0.0805364
-v 0.059231468 0.6142303 0.08937713
-v 0.04387968 0.62007344 0.10316614
-v 0.023764577 0.6146722 0.1076235
-v 0.014009981 0.5989274 0.10666664
-v 0.020239085 0.5852884 0.11130897
-v 0.026814139 0.57715666 0.11151994
-v 0.04458258 0.57367814 0.10574477
-v 0.06364284 0.5763937 0.08817729
-v 0.06925302 0.5893619 0.07549613
-v 0.008705746 0.6341394 0.11934681
-v 0.02458546 0.6393876 0.118437946
-v 0.04612636 0.64085245 0.10934925
-v 0.06345886 0.6371609 0.089331135
-v 0.07068782 0.62790024 0.06508463
-v 0.076133035 0.61413825 0.05401822
-v 0.0826901 0.5994464 0.04562543
-v 0.078858644 0.5858073 0.04477455
-v 0.07822473 0.5713285 0.050881673
-v 0.06815618 0.5511594 0.070701815
-v 0.050809685 0.5434544 0.09590618
-v 0.03235234 0.54560614 0.10525884
-v 0.02861088 0.54485834 0.10571877
-v 0.016147673 0.54334736 0.11365263
-v 0.0045043514 0.5440644 0.12238937
-v 0.0058201617 0.5559497 0.13315682
-v 0.011367363 0.56070995 0.13547349
-v 0.008595762 0.57120645 0.1312291
-v 0.029000824 0.4787817 0.10089547
-v 0.040651143 0.48712754 0.07047785
-v 0.050167773 0.49341273 0.040372185
-v 0.006088123 0.553295 0.12275832
-v 0.011826296 0.55860424 0.13183601
-v 0.015426778 0.5569415 0.120435655
-v 0.020601032 0.560374 0.11284775
-v 0.01785243 0.5674989 0.12446108
-v 0.012064262 0.5658512 0.13413069
-v 0.006957998 0.55935216 0.1382031
-v 0.0 0.55724657 0.13806012
-v 0.049935807 0.52114964 -0.02922579
-v 0.028730862 0.5297384 -0.06689837
-v 0.0 0.5806651 0.12642679
-v 0.0 0.5909786 0.11867491
-v 0.0 0.6042677 0.11077405
-v 0.0 0.62098837 0.11889688
-v 0.0 0.6341394 0.11934681
-v 0.0 0.6971954 0.07493021
-v 0.0 0.7157166 0.034932967
-v 0.0 0.6640581 0.10426798
-v 0.0 0.72276556 -0.011920284
-v 0.0 0.7032974 -0.068113185
-v 0.0 0.6636311 -0.10531983
-v 0.0 0.61052275 -0.11487945
-v 0.0 0.56211376 -0.09958666
-v -0.0 0.5295105 -0.06785122
-v 0.0 0.519032 0.11758106
-v -0.0 0.44994688 0.040620152
-v 0.0 0.47673702 0.06481166
-v 0.0 0.50697565 -0.06294293
-v 0.0 0.4741894 -0.06978695
-v 0.0249924 0.5002047 -0.057468724
-v 0.015009838 0.45507312 0.036163792
-v 0.045891393 0.48438096 0.0066620405
-v 0.029453758 0.47164178 0.021286935
-v 0.039893255 0.4922378 -0.028499894
-v 0.05242245 0.49898183 0.012868146
-v 0.037607584 0.48819542 0.037046667
-v 0.03276528 0.4387486 0.025140379
-v 0.04967085 0.4534254 0.005234246
-v 0.055098064 0.46700346 -0.023695588
-v 0.025027396 0.47037804 -0.0652736
-v 0.0 0.46781242 0.050298754
-v 0.017488481 0.47525728 0.040635146
-v 0.015255803 0.4789647 0.06431374
-v -0.019081252 0.47336555 0.09612816
-v -0.011234382 0.5037911 0.11669219
-v -0.06971195 0.5241393 0.008369795
-v -0.055462014 0.5343617 -0.05368227
-v -0.084585816 0.56104493 0.008136828
-v -0.064348735 0.5696347 -0.07717788
-v -0.010568478 0.6000873 0.10944723
-v -0.08929214 0.5922904 0.012639179
-v -0.07248756 0.61297846 -0.09068894
-v -0.020126102 0.62373483 0.11642024
-v -0.08968008 0.61848664 0.019487193
-v -0.057520714 0.6575279 -0.09672107
-v -0.025426337 0.6961734 0.0708358
-v -0.080925345 0.664165 -0.0035514885
-v -0.05513206 0.69226706 -0.061813097
-v -0.02632221 0.7130619 0.040310197
-v -0.06432174 0.6962795 -0.0040594153
-v -0.033712145 0.4899192 0.1006625
-v -0.022170808 0.5619458 0.11092803
-v -0.057935655 0.59979737 0.08863223
-v -0.060247324 0.62396383 0.09277164
-v -0.05290838 0.68634796 0.051427595
-v -0.028568886 0.518834 0.106226705
-v -0.07816074 0.53994596 0.009228671
-v -0.02095798 0.52823174 0.11649922
-v -0.023353636 0.51326585 0.11409657
-v -0.011274376 0.47984958...
[truncated message content] |
|
From: <tre...@us...> - 2008-07-27 03:03:14
|
Revision: 799
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=799&view=rev
Author: trevorolio
Date: 2008-07-27 03:03:24 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
Added a build.xml which uses the flex 3 sdk. Need to move hardcoded paths into a properties file.
Added Paths:
-----------
maven/trunk/ogoglio-viewer/build.xml
Property Changed:
----------------
maven/trunk/ogoglio-viewer/
Property changes on: maven/trunk/ogoglio-viewer
___________________________________________________________________
Added: svn:ignore
+ target
Added: maven/trunk/ogoglio-viewer/build.xml
===================================================================
--- maven/trunk/ogoglio-viewer/build.xml (rev 0)
+++ maven/trunk/ogoglio-viewer/build.xml 2008-07-27 03:03:24 UTC (rev 799)
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+
+<project name="ogoglio-viewer" default="wrapper" basedir=".">
+
+ <property name="FLEX_HOME" value="/Users/trevor/Code/flex_sdk_3"/>
+ <property name="APP_ROOT" value="/Users/trevor/Code/MavenWorkspace/ogoglio-viewer"/>
+ <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
+
+ <target name="build">
+ <mkdir dir="target" />
+ <mxmlc file="${APP_ROOT}/Main.mxml" keep-generated-actionscript="true" output="${APP_ROOT}/target/Main.swf">
+ <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
+ <source-path path-element="${FLEX_HOME}/frameworks"/>
+ </mxmlc>
+
+ </target>
+
+ <target name="wrapper" depends="build">
+ <html-wrapper
+ title="ogoglio-viewer"
+ file="ogoglio-viewer-index.html"
+ height="300"
+ width="400"
+ bgcolor="white"
+ application="app"
+ swf="Main"
+ version-major="9"
+ version-minor="0"
+ version-revision="0"
+ history="true"
+ template="express-installation"
+ output="${APP_ROOT}/target/"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="target" />
+ <delete dir="generated" />
+ <!-- Clean up VIM and Emacs backup files -->
+ <delete>
+ <fileset dir="." includes="**/*~" defaultexcludes="false" />
+ </delete>
+ </target>
+
+</project>
Property changes on: maven/trunk/ogoglio-viewer/build.xml
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-07-15 03:38:01
|
Revision: 798
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=798&view=rev
Author: trevorolio
Date: 2008-07-14 20:38:05 -0700 (Mon, 14 Jul 2008)
Log Message:
-----------
Framed out the new Flash based 3D viewer. Does not actually do anything yet.
Added Paths:
-----------
maven/trunk/ogoglio-viewer/
maven/trunk/ogoglio-viewer/.actionScriptProperties
maven/trunk/ogoglio-viewer/.flexProperties
maven/trunk/ogoglio-viewer/.project
maven/trunk/ogoglio-viewer/.settings/
maven/trunk/ogoglio-viewer/.settings/org.eclipse.core.resources.prefs
maven/trunk/ogoglio-viewer/OgoglioView3D.as
maven/trunk/ogoglio-viewer/away3d/
maven/trunk/ogoglio-viewer/away3d/animation/
maven/trunk/ogoglio-viewer/away3d/animation/Animator.as
maven/trunk/ogoglio-viewer/away3d/away3d-license.txt
maven/trunk/ogoglio-viewer/away3d/cameras/
maven/trunk/ogoglio-viewer/away3d/cameras/Camera3D.as
maven/trunk/ogoglio-viewer/away3d/cameras/HoverCamera3D.as
maven/trunk/ogoglio-viewer/away3d/cameras/TargetCamera3D.as
maven/trunk/ogoglio-viewer/away3d/containers/
maven/trunk/ogoglio-viewer/away3d/containers/DebugObjectContainer3D.as
maven/trunk/ogoglio-viewer/away3d/containers/ILODObject.as
maven/trunk/ogoglio-viewer/away3d/containers/IPhysicsScene.as
maven/trunk/ogoglio-viewer/away3d/containers/LODObject.as
maven/trunk/ogoglio-viewer/away3d/containers/ObjectContainer3D.as
maven/trunk/ogoglio-viewer/away3d/containers/Scene3D.as
maven/trunk/ogoglio-viewer/away3d/containers/View3D.as
maven/trunk/ogoglio-viewer/away3d/core/
maven/trunk/ogoglio-viewer/away3d/core/arcane.as
maven/trunk/ogoglio-viewer/away3d/core/base/
maven/trunk/ogoglio-viewer/away3d/core/base/Animation.as
maven/trunk/ogoglio-viewer/away3d/core/base/AnimationFrame.as
maven/trunk/ogoglio-viewer/away3d/core/base/BaseMesh.as
maven/trunk/ogoglio-viewer/away3d/core/base/BaseMeshElement.as
maven/trunk/ogoglio-viewer/away3d/core/base/Face.as
maven/trunk/ogoglio-viewer/away3d/core/base/Frame.as
maven/trunk/ogoglio-viewer/away3d/core/base/IAnimation.as
maven/trunk/ogoglio-viewer/away3d/core/base/IFrame.as
maven/trunk/ogoglio-viewer/away3d/core/base/IMeshElement.as
maven/trunk/ogoglio-viewer/away3d/core/base/Mesh.as
maven/trunk/ogoglio-viewer/away3d/core/base/Morpher.as
maven/trunk/ogoglio-viewer/away3d/core/base/Object3D.as
maven/trunk/ogoglio-viewer/away3d/core/base/Segment.as
maven/trunk/ogoglio-viewer/away3d/core/base/UV.as
maven/trunk/ogoglio-viewer/away3d/core/base/Vertex.as
maven/trunk/ogoglio-viewer/away3d/core/base/VertexPosition.as
maven/trunk/ogoglio-viewer/away3d/core/base/WireMesh.as
maven/trunk/ogoglio-viewer/away3d/core/block/
maven/trunk/ogoglio-viewer/away3d/core/block/Blocker.as
maven/trunk/ogoglio-viewer/away3d/core/block/BlockerArray.as
maven/trunk/ogoglio-viewer/away3d/core/block/ConvexBlock.as
maven/trunk/ogoglio-viewer/away3d/core/block/ConvexBlocker.as
maven/trunk/ogoglio-viewer/away3d/core/block/IBlockerConsumer.as
maven/trunk/ogoglio-viewer/away3d/core/block/IBlockerProvider.as
maven/trunk/ogoglio-viewer/away3d/core/draw/
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawBitmap.as
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawDisplayObject.as
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawFog.as
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawGroup.as
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawPrimitive.as
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawScaledBitmap.as
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawSegment.as
maven/trunk/ogoglio-viewer/away3d/core/draw/DrawTriangle.as
maven/trunk/ogoglio-viewer/away3d/core/draw/IPrimitiveConsumer.as
maven/trunk/ogoglio-viewer/away3d/core/draw/IPrimitiveProvider.as
maven/trunk/ogoglio-viewer/away3d/core/draw/Line2D.as
maven/trunk/ogoglio-viewer/away3d/core/draw/Plane3D.as
maven/trunk/ogoglio-viewer/away3d/core/draw/PrimitiveArray.as
maven/trunk/ogoglio-viewer/away3d/core/draw/PrimitiveQuadrantTree.as
maven/trunk/ogoglio-viewer/away3d/core/draw/PrimitiveQuadrantTreeNode.as
maven/trunk/ogoglio-viewer/away3d/core/draw/PrimitiveVolumeBlock.as
maven/trunk/ogoglio-viewer/away3d/core/draw/PrimitiveVolumeBlockList.as
maven/trunk/ogoglio-viewer/away3d/core/draw/ScreenVertex.as
maven/trunk/ogoglio-viewer/away3d/core/filter/
maven/trunk/ogoglio-viewer/away3d/core/filter/AnotherRivalFilter.as
maven/trunk/ogoglio-viewer/away3d/core/filter/FogFilter.as
maven/trunk/ogoglio-viewer/away3d/core/filter/IPrimitiveFilter.as
maven/trunk/ogoglio-viewer/away3d/core/filter/IPrimitiveQuadrantFilter.as
maven/trunk/ogoglio-viewer/away3d/core/filter/IPrimitiveVolumeBlockFilter.as
maven/trunk/ogoglio-viewer/away3d/core/filter/QuadrantRiddleFilter.as
maven/trunk/ogoglio-viewer/away3d/core/filter/ZDepthFilter.as
maven/trunk/ogoglio-viewer/away3d/core/filter/ZSortFilter.as
maven/trunk/ogoglio-viewer/away3d/core/light/
maven/trunk/ogoglio-viewer/away3d/core/light/AbstractLightSource.as
maven/trunk/ogoglio-viewer/away3d/core/light/AmbientLightSource.as
maven/trunk/ogoglio-viewer/away3d/core/light/DirectionalLightSource.as
maven/trunk/ogoglio-viewer/away3d/core/light/ILightConsumer.as
maven/trunk/ogoglio-viewer/away3d/core/light/ILightProvider.as
maven/trunk/ogoglio-viewer/away3d/core/light/LightArray.as
maven/trunk/ogoglio-viewer/away3d/core/light/PointLightSource.as
maven/trunk/ogoglio-viewer/away3d/core/math/
maven/trunk/ogoglio-viewer/away3d/core/math/Matrix3D.as
maven/trunk/ogoglio-viewer/away3d/core/math/Number2D.as
maven/trunk/ogoglio-viewer/away3d/core/math/Number3D.as
maven/trunk/ogoglio-viewer/away3d/core/math/Quaternion.as
maven/trunk/ogoglio-viewer/away3d/core/render/
maven/trunk/ogoglio-viewer/away3d/core/render/AbstractRenderSession.as
maven/trunk/ogoglio-viewer/away3d/core/render/BasicRenderer.as
maven/trunk/ogoglio-viewer/away3d/core/render/BitmapRenderSession.as
maven/trunk/ogoglio-viewer/away3d/core/render/Clipping.as
maven/trunk/ogoglio-viewer/away3d/core/render/FindHit.as
maven/trunk/ogoglio-viewer/away3d/core/render/IRenderer.as
maven/trunk/ogoglio-viewer/away3d/core/render/Projection.as
maven/trunk/ogoglio-viewer/away3d/core/render/QuadrantRenderer.as
maven/trunk/ogoglio-viewer/away3d/core/render/RectangleClipping.as
maven/trunk/ogoglio-viewer/away3d/core/render/Renderer.as
maven/trunk/ogoglio-viewer/away3d/core/render/SpriteRenderSession.as
maven/trunk/ogoglio-viewer/away3d/core/stats/
maven/trunk/ogoglio-viewer/away3d/core/stats/Stats.as
maven/trunk/ogoglio-viewer/away3d/core/traverse/
maven/trunk/ogoglio-viewer/away3d/core/traverse/BlockerTraverser.as
maven/trunk/ogoglio-viewer/away3d/core/traverse/PrimitiveTraverser.as
maven/trunk/ogoglio-viewer/away3d/core/traverse/ProjectionTraverser.as
maven/trunk/ogoglio-viewer/away3d/core/traverse/TickTraverser.as
maven/trunk/ogoglio-viewer/away3d/core/traverse/Traverser.as
maven/trunk/ogoglio-viewer/away3d/core/utils/
maven/trunk/ogoglio-viewer/away3d/core/utils/Cast.as
maven/trunk/ogoglio-viewer/away3d/core/utils/CastError.as
maven/trunk/ogoglio-viewer/away3d/core/utils/Color.as
maven/trunk/ogoglio-viewer/away3d/core/utils/Debug.as
maven/trunk/ogoglio-viewer/away3d/core/utils/FaceDictionaryVO.as
maven/trunk/ogoglio-viewer/away3d/core/utils/FaceVO.as
maven/trunk/ogoglio-viewer/away3d/core/utils/IClonable.as
maven/trunk/ogoglio-viewer/away3d/core/utils/Init.as
maven/trunk/ogoglio-viewer/away3d/core/utils/LazyEventDispatcher.as
maven/trunk/ogoglio-viewer/away3d/core/utils/ValueObject.as
maven/trunk/ogoglio-viewer/away3d/events/
maven/trunk/ogoglio-viewer/away3d/events/FaceEvent.as
maven/trunk/ogoglio-viewer/away3d/events/MeshElementEvent.as
maven/trunk/ogoglio-viewer/away3d/events/MouseEvent3D.as
maven/trunk/ogoglio-viewer/away3d/events/Object3DEvent.as
maven/trunk/ogoglio-viewer/away3d/events/SegmentEvent.as
maven/trunk/ogoglio-viewer/away3d/extrusions/
maven/trunk/ogoglio-viewer/away3d/extrusions/CollisionMap.as
maven/trunk/ogoglio-viewer/away3d/extrusions/Elevation.as
maven/trunk/ogoglio-viewer/away3d/extrusions/ElevationReader.as
maven/trunk/ogoglio-viewer/away3d/extrusions/Lathe.as
maven/trunk/ogoglio-viewer/away3d/extrusions/PathExtrude.as
maven/trunk/ogoglio-viewer/away3d/extrusions/SegmentsExtrude.as
maven/trunk/ogoglio-viewer/away3d/extrusions/SkinExtrude.as
maven/trunk/ogoglio-viewer/away3d/lights/
maven/trunk/ogoglio-viewer/away3d/lights/AmbientLight3D.as
maven/trunk/ogoglio-viewer/away3d/lights/DirectionalLight3D.as
maven/trunk/ogoglio-viewer/away3d/lights/PointLight3D.as
maven/trunk/ogoglio-viewer/away3d/loaders/
maven/trunk/ogoglio-viewer/away3d/loaders/Ase.as
maven/trunk/ogoglio-viewer/away3d/loaders/Collada.as
maven/trunk/ogoglio-viewer/away3d/loaders/CubeLoader.as
maven/trunk/ogoglio-viewer/away3d/loaders/Kmz.as
maven/trunk/ogoglio-viewer/away3d/loaders/MaterialLibrary.as
maven/trunk/ogoglio-viewer/away3d/loaders/Max3DS.as
maven/trunk/ogoglio-viewer/away3d/loaders/Md2.as
maven/trunk/ogoglio-viewer/away3d/loaders/Md2still.as
maven/trunk/ogoglio-viewer/away3d/loaders/Obj.as
maven/trunk/ogoglio-viewer/away3d/loaders/Object3DLoader.as
maven/trunk/ogoglio-viewer/away3d/loaders/data/
maven/trunk/ogoglio-viewer/away3d/loaders/data/ContainerData.as
maven/trunk/ogoglio-viewer/away3d/loaders/data/FaceData.as
maven/trunk/ogoglio-viewer/away3d/loaders/data/MaterialData.as
maven/trunk/ogoglio-viewer/away3d/loaders/data/MeshData.as
maven/trunk/ogoglio-viewer/away3d/loaders/data/MeshMaterialData.as
maven/trunk/ogoglio-viewer/away3d/loaders/data/ObjectData.as
maven/trunk/ogoglio-viewer/away3d/loaders/utils/
maven/trunk/ogoglio-viewer/away3d/loaders/utils/TextureLoadQueue.as
maven/trunk/ogoglio-viewer/away3d/loaders/utils/TextureLoader.as
maven/trunk/ogoglio-viewer/away3d/materials/
maven/trunk/ogoglio-viewer/away3d/materials/AlphaBitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/AnimatedBitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/BitmapFileMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/BitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/BitmapMaterialContainer.as
maven/trunk/ogoglio-viewer/away3d/materials/CenterLightingMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/ColorMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/CompositeMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/Dot3BitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/Dot3BitmapMaterialCache.as
maven/trunk/ogoglio-viewer/away3d/materials/Dot3MovieMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/EnviroBitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/EnviroBitmapMaterialCache.as
maven/trunk/ogoglio-viewer/away3d/materials/EnviroColorMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/IFogMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/ILayerMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/IMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/ISegmentMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/ITriangleMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/IUVMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/IUpdatingMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/MovieMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/PhongBitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/PhongBitmapMaterialCache.as
maven/trunk/ogoglio-viewer/away3d/materials/PhongColorMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/PhongColorMaterialCache.as
maven/trunk/ogoglio-viewer/away3d/materials/PhongMovieMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/ShadingColorMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/TransformBitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/TransparentMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/WhiteShadingBitmapMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/WireColorMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/WireframeMaterial.as
maven/trunk/ogoglio-viewer/away3d/materials/shaders/
maven/trunk/ogoglio-viewer/away3d/materials/shaders/AbstractShader.as
maven/trunk/ogoglio-viewer/away3d/materials/shaders/AmbientShader.as
maven/trunk/ogoglio-viewer/away3d/materials/shaders/DiffuseDot3Shader.as
maven/trunk/ogoglio-viewer/away3d/materials/shaders/DiffusePhongShader.as
maven/trunk/ogoglio-viewer/away3d/materials/shaders/EnviroShader.as
maven/trunk/ogoglio-viewer/away3d/materials/shaders/SpecularPhongShader.as
maven/trunk/ogoglio-viewer/away3d/primitives/
maven/trunk/ogoglio-viewer/away3d/primitives/Cone.as
maven/trunk/ogoglio-viewer/away3d/primitives/Cube.as
maven/trunk/ogoglio-viewer/away3d/primitives/Cylinder.as
maven/trunk/ogoglio-viewer/away3d/primitives/GeodesicSphere.as
maven/trunk/ogoglio-viewer/away3d/primitives/GridPlane.as
maven/trunk/ogoglio-viewer/away3d/primitives/LineSegment.as
maven/trunk/ogoglio-viewer/away3d/primitives/LogoCube.as
maven/trunk/ogoglio-viewer/away3d/primitives/Plane.as
maven/trunk/ogoglio-viewer/away3d/primitives/RegularPolygon.as
maven/trunk/ogoglio-viewer/away3d/primitives/SeaTurtle.as
maven/trunk/ogoglio-viewer/away3d/primitives/Skybox.as
maven/trunk/ogoglio-viewer/away3d/primitives/Skybox6.as
maven/trunk/ogoglio-viewer/away3d/primitives/Sphere.as
maven/trunk/ogoglio-viewer/away3d/primitives/Torus.as
maven/trunk/ogoglio-viewer/away3d/primitives/Triangle.as
maven/trunk/ogoglio-viewer/away3d/primitives/Trident.as
maven/trunk/ogoglio-viewer/away3d/primitives/WireCircle.as
maven/trunk/ogoglio-viewer/away3d/primitives/WireCone.as
maven/trunk/ogoglio-viewer/away3d/primitives/WireCube.as
maven/trunk/ogoglio-viewer/away3d/primitives/WireCylinder.as
maven/trunk/ogoglio-viewer/away3d/primitives/WirePlane.as
maven/trunk/ogoglio-viewer/away3d/primitives/WireSphere.as
maven/trunk/ogoglio-viewer/away3d/primitives/WireTorus.as
maven/trunk/ogoglio-viewer/away3d/sprites/
maven/trunk/ogoglio-viewer/away3d/sprites/MovieClipSprite.as
maven/trunk/ogoglio-viewer/away3d/sprites/Sprite2D.as
maven/trunk/ogoglio-viewer/away3d/sprites/Sprite2DDir.as
maven/trunk/ogoglio-viewer/away3d/sprites/dof/
maven/trunk/ogoglio-viewer/away3d/sprites/dof/DofCache.as
maven/trunk/ogoglio-viewer/away3d/sprites/dof/DofSprite2D.as
maven/trunk/ogoglio-viewer/away3d/test/
maven/trunk/ogoglio-viewer/away3d/test/BaseDemo.as
maven/trunk/ogoglio-viewer/away3d/test/Button.as
maven/trunk/ogoglio-viewer/away3d/test/Panel.as
maven/trunk/ogoglio-viewer/away3d/test/Slide.as
maven/trunk/ogoglio-viewer/body.jpg
maven/trunk/ogoglio-viewer/com/
maven/trunk/ogoglio-viewer/com/ogoglio/
maven/trunk/ogoglio-viewer/com/ogoglio/viewer/
maven/trunk/ogoglio-viewer/html-template/
maven/trunk/ogoglio-viewer/html-template/AC_OETags.js
maven/trunk/ogoglio-viewer/html-template/history.htm
maven/trunk/ogoglio-viewer/html-template/history.js
maven/trunk/ogoglio-viewer/html-template/history.swf
maven/trunk/ogoglio-viewer/html-template/index.template.html
maven/trunk/ogoglio-viewer/html-template/playerProductInstall.swf
maven/trunk/ogoglio-viewer/jane.jpg
maven/trunk/ogoglio-viewer/jane.obj
maven/trunk/ogoglio-viewer/main.mxml
maven/trunk/ogoglio-viewer/nochump/
maven/trunk/ogoglio-viewer/nochump/lgpl.txt
maven/trunk/ogoglio-viewer/nochump/util/
maven/trunk/ogoglio-viewer/nochump/util/zip/
maven/trunk/ogoglio-viewer/nochump/util/zip/CRC32.as
maven/trunk/ogoglio-viewer/nochump/util/zip/Deflater.as
maven/trunk/ogoglio-viewer/nochump/util/zip/Inflater.as
maven/trunk/ogoglio-viewer/nochump/util/zip/ZipConstants.as
maven/trunk/ogoglio-viewer/nochump/util/zip/ZipEntry.as
maven/trunk/ogoglio-viewer/nochump/util/zip/ZipError.as
maven/trunk/ogoglio-viewer/nochump/util/zip/ZipFile.as
maven/trunk/ogoglio-viewer/nochump/util/zip/ZipOutput.as
maven/trunk/ogoglio-viewer/test.mtl
maven/trunk/ogoglio-viewer/test.obj
Added: maven/trunk/ogoglio-viewer/.actionScriptProperties
===================================================================
--- maven/trunk/ogoglio-viewer/.actionScriptProperties (rev 0)
+++ maven/trunk/ogoglio-viewer/.actionScriptProperties 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<actionScriptProperties mainApplicationPath="main.mxml" version="1">
+<compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.0" htmlPlayerVersionCheck="true" outputFolderPath="bin" strict="true" warn="true">
+<compilerSourcePath/>
+<libraryPath>
+<libraryPathEntry kind="3" linkType="2" path="${FRAMEWORKS}/libs/playerglobal.swc"/>
+<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/utilities.swc"/>
+<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/flex.swc" sourcepath="${FRAMEWORKS}/source"/>
+<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/framework.swc" sourcepath="${FRAMEWORKS}/source"/>
+<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/rpc.swc"/>
+<libraryPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/charts.swc" sourcepath="${FRAMEWORKS}/source"/>
+<libraryPathEntry kind="1" linkType="1" path="${FRAMEWORKS}/locale/{locale}"/>
+</libraryPath>
+<sourceAttachmentPath>
+<sourceAttachmentPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/flex.swc" sourcepath="${FRAMEWORKS}/source"/>
+<sourceAttachmentPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/framework.swc" sourcepath="${FRAMEWORKS}/source"/>
+<sourceAttachmentPathEntry kind="3" linkType="1" path="${FRAMEWORKS}/libs/charts.swc" sourcepath="${FRAMEWORKS}/source"/>
+</sourceAttachmentPath>
+</compiler>
+<applications>
+<application path="main.mxml"/>
+</applications>
+<buildCSSFiles/>
+</actionScriptProperties>
Added: maven/trunk/ogoglio-viewer/.flexProperties
===================================================================
--- maven/trunk/ogoglio-viewer/.flexProperties (rev 0)
+++ maven/trunk/ogoglio-viewer/.flexProperties 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flexProperties flexServerType="0" toolCompile="true" version="1"/>
Added: maven/trunk/ogoglio-viewer/.project
===================================================================
--- maven/trunk/ogoglio-viewer/.project (rev 0)
+++ maven/trunk/ogoglio-viewer/.project 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ogoglio-viewer</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.adobe.flexbuilder.project.flexbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.adobe.flexbuilder.project.flexnature</nature>
+ <nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+ </natures>
+</projectDescription>
Added: maven/trunk/ogoglio-viewer/.settings/org.eclipse.core.resources.prefs
===================================================================
--- maven/trunk/ogoglio-viewer/.settings/org.eclipse.core.resources.prefs (rev 0)
+++ maven/trunk/ogoglio-viewer/.settings/org.eclipse.core.resources.prefs 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,3 @@
+#Mon Jul 14 19:41:27 PDT 2008
+eclipse.preferences.version=1
+encoding/<project>=utf-8
Added: maven/trunk/ogoglio-viewer/OgoglioView3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/OgoglioView3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/OgoglioView3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,84 @@
+package
+{
+ import away3d.materials.BitmapFileMaterial;
+ import away3d.core.math.Number3D;
+ import away3d.containers.View3D;
+ import away3d.primitives.Cube;
+
+ import flash.events.Event;
+
+ import mx.core.UIComponent;
+ import away3d.core.base.Object3D;
+ import away3d.loaders.Obj;
+ import away3d.loaders.Object3DLoader;
+ import away3d.containers.ObjectContainer3D;
+ import away3d.loaders.MaterialLibrary;
+
+ public class OgoglioView3D extends UIComponent
+ {
+ private var view:View3D;
+
+ private var objLoader:Object3DLoader;
+
+ private var janeLoader:Object3DLoader;
+
+ public function OgoglioView3D()
+ {
+ super();
+ this.addEventListener(Event.ENTER_FRAME, onFrameEnter);
+ }
+
+ override protected function createChildren():void
+ {
+ super.createChildren();
+
+ if(!this.view)
+ {
+ this.view = new View3D();
+
+ this.view.camera.moveTo(new Number3D(0, 0, -300));
+ this.view.camera.lookAt(new Number3D(0, 0, 0));
+ }
+ this.addChild(this.view);
+
+ if(!this.objLoader){
+ this.objLoader = Obj.load("test.obj", { material:new BitmapFileMaterial("body.jpg"), name:"joe", scaling:10 } );
+ this.objLoader.rotationY = 180;
+ this.objLoader.rotationX = -90;
+ }
+ this.view.scene.addChild(this.objLoader);
+
+ if(!this.janeLoader){
+ this.janeLoader = Obj.load("jane.obj", { material:new BitmapFileMaterial("jane.jpg"), name:"jane", scaling:10 } );
+ this.janeLoader.rotationY = 180;
+ this.janeLoader.rotationX = -90;
+ }
+ this.view.scene.addChild(this.janeLoader);
+
+ }
+
+ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if(this.width / 2 != this.view.x)
+ this.view.x = this.width / 2;
+ if(this.height / 2 != this.view.y)
+ this.view.y = this.height / 2;
+ }
+
+ private function onFrameEnter(event:Event):void
+ {
+ if(this.view && this.view.stage)
+ {
+ this.objLoader.result.transform.tx = -100;
+ this.objLoader.result.rotationY += 1;
+
+ this.janeLoader.result.rotationY -= 1;
+ this.janeLoader.result.transform.tx = 100;
+
+ this.view.render();
+ }
+ }
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/away3d/animation/Animator.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/animation/Animator.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/animation/Animator.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,145 @@
+package away3d.animation
+{
+ import away3d.core.base.*;
+
+ import flash.utils.Dictionary;
+
+ public class Animator extends Mesh
+ {
+ private var varr:Array = [];
+ private var uvarr:Array = [];
+ private var fnarr:Array = [];
+
+
+ public function Animator(baseObject:Mesh, aFrames:Array, init:Object = null, doloop:Boolean = false)
+ {
+ super(init);
+ generate(baseObject, aFrames, doloop);
+
+ type = "Animator";
+ url = "Mesh";
+
+ }
+
+ //Array aFrames properties: vertices:Array[vertex.x,y and z positions], prefix:String
+ public function generate(baseObject:Mesh, aFrames:Array, doloop:Boolean):void
+ {
+ var i:int ;
+ var j:int ;
+ var k:int ;
+
+ // export requirement
+ indexes = new Array();
+
+ if(doloop){
+ var fr:Object = new Object();
+ fr.vertices = aFrames[0].vertices;
+ fr.prefix = aFrames[0].prefix;
+ var pref:String = "";
+ for(i=0; i<fr.prefix.length;i++){
+ if(isNaN(fr.prefix.substring(i,i+1)) ){
+ pref += fr.prefix.substring(i,i+1);
+ } else{
+ break;
+ }
+ }
+ fr.prefix = pref+(aFrames.length+1);
+ aFrames.push(fr);
+ }
+
+ var face:Face;
+ varr = varr.concat(baseObject.vertices);
+
+ for(i=0;i<baseObject.faces.length;i++){
+ face = baseObject.faces[i];
+ uvarr.push(face.uv0, face.uv1, face.uv2);
+ addFace(face);
+ }
+
+ frames = new Dictionary();
+ framenames = new Dictionary();
+ fnarr = [];
+ var oFrames:Object = new Object();
+ var arr:Array;
+
+ for(i=0;i<aFrames.length;i++){
+ oFrames[aFrames[i].prefix]=new Array();
+ fnarr.push(aFrames[i].prefix);
+ arr = aFrames[i].vertices;
+ for(j=0;j<arr.length;j++){
+ oFrames[aFrames[i].prefix].push(arr[j], arr[j], arr[j]);
+ }
+
+ }
+
+ var frame:Frame;
+ for(i = 0;i<fnarr.length; i++){
+ trace("[ "+fnarr[i]+" ]");
+ frame = new Frame();
+ framenames[fnarr[i]] = i;
+ frames[i] = frame;
+ k=0;
+ for (j = 0; j < oFrames[fnarr[i]].length; j+=3){
+ var vp:VertexPosition = new VertexPosition(varr[k]);
+ k++;
+ vp.x = oFrames[fnarr[i]][j].x;
+ vp.y = oFrames[fnarr[i]][j+1].y;
+ vp.z = oFrames[fnarr[i]][j+2].z;
+ frame.vertexpositions.push(vp);
+ }
+
+ if (i == 0)
+ frame.adjust();
+ }
+
+ }
+
+ public function get framelist():Array{
+ return fnarr;
+ }
+
+
+ // not tested yet, should allow to add a frame or more at runtime too... array
+ // contains same object vertices and prefix as constructor.
+ public function addFrames(aFrames:Array):void
+ {
+ var i:int ;
+ var j:int ;
+ var k:int ;
+ var oFrames:Object = new Object();
+ var arr:Array;
+
+ for(i=0;i<aFrames.length;i++){
+ oFrames[aFrames[i].prefix]=new Array();
+ fnarr.push(aFrames[i].prefix);
+ arr = aFrames[i].vertices;
+ for(j=0;j<arr.length;j++){
+ oFrames[aFrames[i].prefix].push(arr[j], arr[j], arr[j]);
+ }
+ }
+
+ var frame:Frame;
+ for(i = 0;i<fnarr.length; i++){
+ trace("[ "+fnarr[i]+" ]");
+ frame = new Frame();
+ framenames[fnarr[i]] = i;
+ frames[i] = frame;
+ k=0;
+ for (j = 0; j < oFrames[fnarr[i]].length; j+=3){
+ var vp:VertexPosition = new VertexPosition(varr[k]);
+ k++;
+ vp.x = oFrames[fnarr[i]][j].x;
+ vp.y = oFrames[fnarr[i]][j+1].y;
+ vp.z = oFrames[fnarr[i]][j+2].z;
+ frame.vertexpositions.push(vp);
+ }
+
+ if (i == 0)
+ frame.adjust();
+ }
+
+ }
+
+
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/away3d-license.txt
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/away3d-license.txt (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/away3d-license.txt 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,13 @@
+Copyright 2007 Alexander Zadorozhny
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
Added: maven/trunk/ogoglio-viewer/away3d/cameras/Camera3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/cameras/Camera3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/cameras/Camera3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,148 @@
+package away3d.cameras
+{
+ import away3d.core.*;
+ import away3d.core.base.*;
+ import away3d.core.draw.*;
+ import away3d.core.math.*;
+ import away3d.core.render.*;
+ import away3d.core.utils.*;
+ import away3d.sprites.dof.DofCache;
+
+ /** Camera in 3D-space */
+ public class Camera3D extends Object3D
+ {
+ public var zoom:Number;
+
+
+ // Depth of field parameters
+ private var _aperture:Number = 22;
+ private var _focus:Number;
+
+ public function set aperture(value:Number):void
+ {
+ _aperture = value;
+ DofCache.aperture = _aperture;
+ }
+
+ public function get aperture():Number
+ {
+ return _aperture;
+ }
+
+ public function set focus(value:Number):void
+ {
+ _focus = value;
+ DofCache.focus = _focus;
+ }
+
+ public function get focus():Number
+ {
+ return _focus;
+ }
+
+
+ public var maxblur:Number = 150;
+ public var doflevels:Number = 16;
+ public var usedof:Boolean = false;
+
+ private var _view:Matrix3D = new Matrix3D();
+
+ public function Camera3D(init:Object = null)
+ {
+ super(init);
+
+ init = Init.parse(init);
+ zoom = (init as Init).getNumber("zoom", 10);
+ focus = (init as Init).getNumber("focus", 100);
+ usedof = (init as Init).getBoolean("dof", false);
+ if(usedof)
+ {
+ aperture = (init as Init).getNumber("aperture", 22);
+ maxblur = (init as Init).getNumber("maxblur", 150);
+ doflevels = (init as Init).getNumber("doflevels", 16);
+ enableDof();
+ }
+ else
+ {
+ disableDof();
+ }
+
+ var lookat:Number3D = (init as Init).getPosition("lookat");
+
+ _flipY.syy = -1;
+
+ if (lookat != null)
+ lookAt(lookat);
+ }
+
+ public function enableDof():void
+ {
+ DofCache.doflevels = doflevels;
+ DofCache.aperture = aperture;
+ DofCache.maxblur = maxblur;
+ DofCache.focus = focus;
+ DofCache.resetDof(true);
+ }
+
+ public function disableDof():void
+ {
+ DofCache.resetDof(false);
+ }
+
+ public var invView:Matrix3D;
+
+ public function get view():Matrix3D
+ {
+ _view.multiply(sceneTransform, _flipY);
+ invView = _view.clone();
+ _view.inverse(invView);
+ return _view;
+ }
+
+ internal var screenProjection:Projection = new Projection();
+
+ public function screen(object:Object3D, vertex:Vertex = null):ScreenVertex
+ {
+ use namespace arcane;
+
+ if (vertex == null)
+ vertex = new Vertex(0,0,0);
+ object.viewTransform.multiply(view, object.sceneTransform);
+ screenProjection.view = object.viewTransform;
+ screenProjection.focus = focus;
+ screenProjection.zoom = zoom;
+ return vertex.project(screenProjection);
+ }
+
+ private var _flipY:Matrix3D = new Matrix3D();
+
+ /**
+ * Rotate the camera in its vertical plane.
+ * Tilting the camera results in a motion similar to someone nodding their head "yes".
+ * @param angle Angle to tilt the camera.
+ */
+ public function tilt(angle:Number):void
+ {
+ super.pitch(angle);
+ }
+
+ /**
+ * Rotate the camera in its horizontal plane.
+ * Panning the camera results in a motion similar to someone shaking their head "no".
+ * @param angle Angle to pan the camera.
+ */
+ public function pan(angle:Number):void
+ {
+ super.yaw(angle);
+ }
+
+ public override function clone(object:* = null):*
+ {
+ var camera:Camera3D = object || new Camera3D();
+ super.clone(camera);
+ camera.zoom = zoom;
+ camera.focus = focus;
+ return camera;
+ }
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/cameras/HoverCamera3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/cameras/HoverCamera3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/cameras/HoverCamera3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,71 @@
+package away3d.cameras
+{
+ import away3d.core.base.*;
+ import away3d.core.utils.*;
+
+ /** Camera that hovers around an object */
+ public class HoverCamera3D extends TargetCamera3D
+ {
+ public var yfactor:Number = 2;
+
+ /** Distance the camera keeps to the target */
+ public var distance:Number = 400;
+ public var panangle:Number = 0;
+ public var tiltangle:Number = 90;
+ public var targetpanangle:Number = 0;
+ public var targettiltangle:Number = 90;
+ public var mintiltangle:Number = 0;
+ public var maxtiltangle:Number = 90;
+ public var steps:Number = 8;
+
+ public function HoverCamera3D(init:Object = null)
+ {
+ super(init);
+
+ init = Init.parse(init);
+
+ distance = (init as Init).getNumber("distance", 800);
+
+ update();
+ }
+
+ /** Hover camera around the object @return <code>true</code> if camera changed position */
+ public function hover():Boolean
+ {
+ if ((targettiltangle == tiltangle) && (targetpanangle == panangle))
+ return update();
+
+ targettiltangle = Math.max(mintiltangle, Math.min(maxtiltangle, targettiltangle));
+ tiltangle += (targettiltangle - tiltangle) / (steps + 1);
+ panangle += (targetpanangle - panangle) / (steps + 1);
+
+ if ((Math.abs(targettiltangle - tiltangle) < 0.01) && (Math.abs(targetpanangle - panangle) < 0.01))
+ {
+ tiltangle = targettiltangle;
+ panangle = targetpanangle;
+ }
+
+ return update();
+ }
+
+ /** Update camera position @return <code>true</code> if camera changed position */
+ public function update():Boolean
+ {
+ var gx:Number = distance * Math.sin(panangle * toRADIANS) * Math.cos(tiltangle * toRADIANS);
+ var gz:Number = distance * Math.cos(panangle * toRADIANS) * Math.cos(tiltangle * toRADIANS);
+ var gy:Number = distance * Math.sin(tiltangle * toRADIANS) * yfactor;
+
+ if ((x == gx) && (y == gy) && (z == gz))
+ return false;
+
+ x = gx;
+ y = gy;
+ z = gz;
+
+ return true;
+ }
+
+ static private var toRADIANS:Number = Math.PI / 180;
+ }
+
+}
Added: maven/trunk/ogoglio-viewer/away3d/cameras/TargetCamera3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/cameras/TargetCamera3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/cameras/TargetCamera3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,39 @@
+package away3d.cameras
+{
+ import away3d.containers.*;
+ import away3d.core.base.*;
+ import away3d.core.math.*;
+ import away3d.core.utils.*;
+
+ /** Camera that targets an object */
+ public class TargetCamera3D extends Camera3D
+ {
+ /** Object the camera always targets */
+ public var target:Object3D;
+
+ public function TargetCamera3D(init:Object = null)
+ {
+ super(init);
+
+ init = Init.parse(init);
+
+ target = (init as Init).getObject3D("target") || new Object3D();
+ }
+
+ public override function get view():Matrix3D
+ {
+ if (target != null)
+ lookAt(target.scene ? target.scenePosition : target.position);
+
+ return super.view;
+ }
+
+ public override function set parent(value:ObjectContainer3D):void
+ {
+ if (value != null)
+ throw new Error("TargetCamera can't be parented");
+ }
+
+ }
+
+}
Added: maven/trunk/ogoglio-viewer/away3d/containers/DebugObjectContainer3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/containers/DebugObjectContainer3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/containers/DebugObjectContainer3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,76 @@
+package away3d.containers
+{
+ import away3d.core.base.*;
+ import away3d.core.draw.*;
+ import away3d.core.render.*;
+ import away3d.primitives.*;
+
+ public class DebugObjectContainer3D extends ObjectContainer3D implements IPrimitiveProvider
+ {
+ public var debugbb:Boolean = false;
+ public var debugbs:Boolean = false;
+
+ public function DebugObjectContainer3D(init:Object = null, ...childarray)
+ {
+ if (init != null)
+ if (init is Object3D)
+ {
+ addChild(init as Object3D);
+ init = null;
+ }
+
+ super(init);
+
+ for each (var child:Object3D in childarray)
+ addChild(child);
+ }
+
+ private var _debugboundingbox:WireCube;
+ private var _debugboundingsphere:WireSphere;
+
+ override public function primitives(consumer:IPrimitiveConsumer, session:AbstractRenderSession):void
+ {
+ if (children.length == 0)
+ return;
+
+ super.primitives(consumer, session);
+
+ if (debugbb)
+ {
+ if (_debugboundingbox == null)
+ _debugboundingbox = new WireCube({material:"#cyan|2"});
+ _debugboundingbox.v000.x = minX;
+ _debugboundingbox.v001.x = minX;
+ _debugboundingbox.v010.x = minX;
+ _debugboundingbox.v011.x = minX;
+ _debugboundingbox.v100.x = maxX;
+ _debugboundingbox.v101.x = maxX;
+ _debugboundingbox.v110.x = maxX;
+ _debugboundingbox.v111.x = maxX;
+ _debugboundingbox.v000.y = minY;
+ _debugboundingbox.v001.y = minY;
+ _debugboundingbox.v010.y = maxY;
+ _debugboundingbox.v011.y = maxY;
+ _debugboundingbox.v100.y = minY;
+ _debugboundingbox.v101.y = minY;
+ _debugboundingbox.v110.y = maxY;
+ _debugboundingbox.v111.y = maxY;
+ _debugboundingbox.v000.z = minZ;
+ _debugboundingbox.v001.z = maxZ;
+ _debugboundingbox.v010.z = minZ;
+ _debugboundingbox.v011.z = maxZ;
+ _debugboundingbox.v100.z = minZ;
+ _debugboundingbox.v101.z = maxZ;
+ _debugboundingbox.v110.z = minZ;
+ _debugboundingbox.v111.z = maxZ;
+ _debugboundingbox.primitives(consumer, session);
+ }
+
+ if (debugbs)
+ {
+ _debugboundingsphere = new WireSphere({material:"#cyan", radius:radius, segmentsW:16, segmentsH:12});
+ _debugboundingsphere.primitives(consumer, session);
+ }
+ }
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/containers/ILODObject.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/containers/ILODObject.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/containers/ILODObject.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,9 @@
+package away3d.containers
+{
+
+ /** Interface for object that can toggle their visibily depending on view and distance to camera */
+ public interface ILODObject
+ {
+ function matchLOD(view:View3D):Boolean;
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/containers/IPhysicsScene.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/containers/IPhysicsScene.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/containers/IPhysicsScene.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,7 @@
+package away3d.containers
+{
+ public interface IPhysicsScene
+ {
+ function updateTime(time:int):void
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/containers/LODObject.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/containers/LODObject.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/containers/LODObject.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,38 @@
+package away3d.containers
+{
+ import away3d.core.base.*;
+ import away3d.core.math.*;
+ import away3d.core.utils.*;
+
+ /** Container that is drawn only if its scaling to to perspective fall within given range */
+ public class LODObject extends ObjectContainer3D implements ILODObject
+ {
+ public var maxp:Number;
+ public var minp:Number;
+
+ public function LODObject(init:Object = null, ...childarray)
+ {
+ super(init);
+
+ init = Init.parse(init);
+ maxp = (init as Init).getNumber("maxp", Infinity);
+ minp = (init as Init).getNumber("minp", 0);
+
+ for each (var child:Object3D in childarray)
+ addChild(child);
+ }
+
+ public function matchLOD(view:View3D):Boolean
+ {
+ var z:Number = viewTransform.tz;
+ var persp:Number = view.camera.zoom / (1 + z / view.camera.focus);
+
+ if (persp < minp)
+ return false;
+ if (persp >= maxp)
+ return false;
+
+ return true;
+ }
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/containers/ObjectContainer3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/containers/ObjectContainer3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/containers/ObjectContainer3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,462 @@
+package away3d.containers
+{
+ import away3d.core.*;
+ import away3d.core.base.*;
+ import away3d.core.draw.*;
+ import away3d.core.math.*;
+ import away3d.core.traverse.*;
+ import away3d.events.*;
+
+ /** Container node for other objects of the scene */
+ public class ObjectContainer3D extends Object3D implements IPrimitiveProvider
+ {
+ use namespace arcane;
+
+ private var _children:Array = new Array();
+
+ public function get children():Array
+ {
+ return _children;
+ }
+
+ private var _radiusChild:Object3D = null;
+ private var _radiusDirty:Boolean = false;
+ private var _radius:Number = 0;
+
+ public override function get radius():Number
+ {
+ if (_radiusDirty)
+ {
+ _radiusChild = null;
+ var mr:Number = 0;
+ for each (var child:Object3D in _children)
+ {
+ var r:Number = child.parentradius;
+ if (r > mr)
+ {
+ mr = r;
+ _radiusChild = child;
+ }
+ }
+ _radius = mr;
+ _radiusDirty = false;
+ }
+ return _radius;
+ }
+
+ private var _maxXChild:Object3D = null;
+ private var _maxXDirty:Boolean = false;
+ private var _maxX:Number = -Infinity;
+
+ public override function get maxX():Number
+ {
+ if (_maxXDirty)
+ {
+ _maxXChild = null;
+ var extrval:Number = -Infinity;
+ for each (var child:Object3D in _children)
+ {
+ var val:Number = child.parentmaxX;
+ if (val > extrval)
+ {
+ extrval = val;
+ _maxXChild = child;
+ }
+ }
+ _maxX = extrval;
+ _maxXDirty = false;
+ }
+ return _maxX;
+ }
+
+ private var _minXChild:Object3D = null;
+ private var _minXDirty:Boolean = false;
+ private var _minX:Number = Infinity;
+
+ public override function get minX():Number
+ {
+ if (_minXDirty)
+ {
+ _minXChild = null;
+ var extrval:Number = Infinity;
+ for each (var child:Object3D in _children)
+ {
+ var val:Number = child.parentminX;
+ if (val < extrval)
+ {
+ extrval = val;
+ _minXChild = child;
+ }
+ }
+ _minX = extrval;
+ _minXDirty = false;
+ }
+ return _minX;
+ }
+
+ private var _maxYChild:Object3D = null;
+ private var _maxYDirty:Boolean = false;
+ private var _maxY:Number = -Infinity;
+
+ public override function get maxY():Number
+ {
+ if (_maxYDirty)
+ {
+ var extrval:Number = -Infinity;
+ _maxYChild = null;
+ for each (var child:Object3D in _children)
+ {
+ var val:Number = child.parentmaxY;
+ if (val > extrval)
+ {
+ extrval = val;
+ _maxYChild = child;
+ }
+ }
+ _maxY = extrval;
+ _maxYDirty = false;
+ }
+ return _maxY;
+ }
+
+ private var _minYChild:Object3D = null;
+ private var _minYDirty:Boolean = false;
+ private var _minY:Number = Infinity;
+
+ public override function get minY():Number
+ {
+ if (_minYDirty)
+ {
+ var extrval:Number = Infinity;
+ _minYChild = null;
+ for each (var child:Object3D in _children)
+ {
+ var val:Number = child.parentminY;
+ if (val < extrval)
+ {
+ extrval = val;
+ _minYChild = child;
+ }
+ }
+ _minY = extrval;
+ _minYDirty = false;
+ }
+ return _minY;
+ }
+
+ private var _maxZChild:Object3D = null;
+ private var _maxZDirty:Boolean = false;
+ private var _maxZ:Number = -Infinity;
+
+ public override function get maxZ():Number
+ {
+ if (_maxZDirty)
+ {
+ var extrval:Number = -Infinity;
+ _maxZChild = null;
+ for each (var child:Object3D in _children)
+ {
+ var val:Number = child.parentmaxZ;
+ if (val > extrval)
+ {
+ extrval = val;
+ _maxZChild = child;
+ }
+ }
+ _maxZ = extrval;
+ _maxZDirty = false;
+ }
+ return _maxZ;
+ }
+
+ private var _minZChild:Object3D = null;
+ private var _minZDirty:Boolean = false;
+ private var _minZ:Number = Infinity;
+
+ public override function get minZ():Number
+ {
+ if (_minZDirty)
+ {
+ var extrval:Number = Infinity;
+ _minZChild = null;
+ for each (var child:Object3D in _children)
+ {
+ var val:Number = child.parentminZ;
+ if (val < extrval)
+ {
+ extrval = val;
+ _minZChild = child;
+ }
+ }
+ _minZ = extrval;
+ _minZDirty = false;
+ }
+ return _minZ;
+ }
+
+ public function ObjectContainer3D(init:Object = null, ...childarray)
+ {
+ if (init != null)
+ if (init is Object3D)
+ {
+ addChild(init as Object3D);
+ init = null;
+ }
+
+ super(init);
+
+ for each (var child:Object3D in childarray)
+ addChild(child);
+ }
+
+ public override function scale(scale:Number):void
+ {
+ for each (var child:Object3D in children)
+ {
+ child.x *= scale;
+ child.y *= scale;
+ child.z *= scale;
+ child.scale(scale);
+ }
+ }
+
+ public function addChildren(...childarray):void
+ {
+ for each (var child:Object3D in childarray)
+ addChild(child);
+ }
+
+ public function movePivot(dx:Number, dy:Number, dz:Number):void
+ {
+
+ for each (var child:Object3D in _children)
+ {
+ child.x -= dx;
+ child.y -= dy;
+ child.z -= dz;
+ }
+
+ var dV:Number3D = new Number3D(dx, dy, dz);
+ dV.rotate(dV.clone(), _transform);
+ dV.add(dV, position);
+ moveTo(dV);
+ }
+
+ public function addChild(child:Object3D):void
+ {
+ if (child == null)
+ throw new Error("ObjectContainer3D.addChild(null)");
+ if (child.parent == this)
+ return;
+ child.parent = this;
+ }
+
+ public function removeChild(child:Object3D):void
+ {
+ if (child == null)
+ throw new Error("ObjectContainer3D.removeChild(null)");
+ if (child.parent != this)
+ return;
+ child.parent = null;
+ }
+
+ arcane function internalAddChild(child:Object3D):void
+ {
+ _children.push(child);
+
+ child.addOnTransformChange(onChildChange);
+ child.addOnRadiusChange(onChildChange);
+
+ rememberChild(child);
+
+ launchNotifies();
+ }
+
+ arcane function internalRemoveChild(child:Object3D):void
+ {
+ var index:int = children.indexOf(child);
+ if (index == -1)
+ return;
+
+ forgetChild(child);
+
+ child.removeOnTransformChange(onChildChange);
+ child.removeOnRadiusChange(onChildChange);
+
+ _children.splice(index, 1);
+
+ launchNotifies();
+ }
+
+ private var _needNotifyRadiusChange:Boolean = false;
+ private var _needNotifyDimensionsChange:Boolean = false;
+
+ private function launchNotifies():void
+ {
+ if (_needNotifyRadiusChange)
+ {
+ _needNotifyRadiusChange = false;
+ notifyRadiusChange();
+ }
+ if (_needNotifyDimensionsChange)
+ {
+ _needNotifyDimensionsChange = false;
+ notifyDimensionsChange();
+ }
+ }
+
+ private function onChildChange(event:Object3DEvent):void
+ {
+ var child:Object3D = event.object;
+
+ forgetChild(child);
+ rememberChild(child);
+
+ launchNotifies();
+ }
+
+ private function forgetChild(child:Object3D):void
+ {
+ if (child == _radiusChild)
+ {
+ _radiusChild = null;
+ _radiusDirty = true;
+ _needNotifyRadiusChange = true;
+ }
+ if (child == _maxXChild)
+ {
+ _maxXChild = null;
+ _maxXDirty = true;
+ _needNotifyDimensionsChange = true;
+ }
+ if (child == _minXChild)
+ {
+ _minXChild = null;
+ _minXDirty = true;
+ _needNotifyDimensionsChange = true;
+ }
+ if (child == _maxYChild)
+ {
+ _maxYChild = null;
+ _maxYDirty = true;
+ _needNotifyDimensionsChange = true;
+ }
+ if (child == _minYChild)
+ {
+ _minYChild = null;
+ _minYDirty = true;
+ _needNotifyDimensionsChange = true;
+ }
+ if (child == _maxZChild)
+ {
+ _maxZChild = null;
+ _maxZDirty = true;
+ _needNotifyDimensionsChange = true;
+ }
+ if (child == _minZChild)
+ {
+ _minZChild = null;
+ _minZDirty = true;
+ _needNotifyDimensionsChange = true;
+ }
+ }
+
+ private function rememberChild(child:Object3D):void
+ {
+ var r:Number = child.parentradius;
+ if (r > _radius)
+ {
+ _radius = r;
+ _radiusChild = child;
+ _radiusDirty = false;
+ _needNotifyRadiusChange = true;
+ }
+ var mxX:Number = child.parentmaxX;
+ if (mxX > _maxX)
+ {
+ _maxX = mxX;
+ _maxXChild = child;
+ _maxXDirty = false;
+ _needNotifyDimensionsChange = true;
+ }
+ var mnX:Number = child.parentminX;
+ if (mnX < _minX)
+ {
+ _minX = mnX;
+ _minXChild = child;
+ _minXDirty = false;
+ _needNotifyDimensionsChange = true;
+ }
+ var mxY:Number = child.parentmaxY;
+ if (mxY > _maxY)
+ {
+ _maxY = mxY;
+ _maxYChild = child;
+ _maxYDirty = false;
+ _needNotifyDimensionsChange = true;
+ }
+ var mnY:Number = child.parentminY;
+ if (mnY < _minY)
+ {
+ _minY = mnY;
+ _minYChild = child;
+ _minYDirty = false;
+ _needNotifyDimensionsChange = true;
+ }
+ var mxZ:Number = child.parentmaxZ;
+ if (mxZ > _maxZ)
+ {
+ _maxZ = mxZ;
+ _maxZChild = child;
+ _maxZDirty = false;
+ _needNotifyDimensionsChange = true;
+ }
+ var mnZ:Number = child.parentminZ;
+ if (mnZ < _minZ)
+ {
+ _minZ = mnZ;
+ _minZChild = child;
+ _minZDirty = false;
+ _needNotifyDimensionsChange = true;
+ }
+ }
+
+ public function getChildByName(name:String):Object3D
+ {
+ for each (var child:Object3D in children)
+ if (child.name == name)
+ return child;
+
+ return null;
+ }
+
+ public function removeChildByName(name:String):void
+ {
+ removeChild(getChildByName(name));
+ }
+
+ public override function traverse(traverser:Traverser):void
+ {
+ if (traverser.match(this))
+ {
+ traverser.enter(this);
+ traverser.apply(this);
+ for each (var child:Object3D in children)
+ child.traverse(traverser);
+ traverser.leave(this);
+ }
+ }
+
+ public override function clone(object:* = null):*
+ {
+ var container:ObjectContainer3D = object || new ObjectContainer3D();
+ super.clone(container);
+
+ for each (var child:Object3D in children)
+ container.addChild(child.clone());
+
+ return container;
+ }
+
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/containers/Scene3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/containers/Scene3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/containers/Scene3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,67 @@
+package away3d.containers
+{
+ import away3d.core.math.*;
+ import away3d.core.base.*;
+ import away3d.core.traverse.*;
+ import away3d.core.utils.*;
+
+ import flash.utils.getTimer;
+
+ /** Scene that gets rendered */
+ public class Scene3D extends ObjectContainer3D
+ {
+ public var physics:IPhysicsScene;
+ public var tickTraverser:TickTraverser = new TickTraverser();
+
+ public function Scene3D(init:Object = null, ...objects)
+ {
+ if (init != null)
+ if (init is Object3D)
+ {
+ addChild(init as Object3D);
+ init = null;
+ }
+
+ var ini:Init = Init.parse(init);
+
+ var ph:Object = ini.getObject("physics");
+ if (ph is IPhysicsScene)
+ physics = ph as IPhysicsScene;
+ if (ph is Boolean)
+ if (ph == true)
+ physics = null; // new RobPhysicsEngine();
+ if (ph is Object)
+ physics = null; // new RobPhysicsEngine(ph); // ph - init object
+
+ for each (var object:Object3D in objects)
+ addChild(object);
+ }
+
+ public function updateTime(time:int = -1):void
+ {
+ //set current time
+ if (time == -1)
+ time = getTimer();
+
+ //traverser scene ticks
+ tickTraverser.now = time;
+ traverse(tickTraverser);
+
+
+ if (physics != null)
+ physics.updateTime(time);
+ }
+
+ public override function set parent(value:ObjectContainer3D):void
+ {
+ if (value != null)
+ throw new Error("Scene can't be parented");
+ }
+
+ public override function get sceneTransform():Matrix3D
+ {
+ return transform;
+ }
+
+ }
+}
Added: maven/trunk/ogoglio-viewer/away3d/containers/View3D.as
===================================================================
--- maven/trunk/ogoglio-viewer/away3d/containers/View3D.as (rev 0)
+++ maven/trunk/ogoglio-viewer/away3d/containers/View3D.as 2008-07-15 03:38:05 UTC (rev 798)
@@ -0,0 +1,330 @@
+package away3d.containers
+{
+ import away3d.cameras.*;
+ import away3d.core.*;
+ import away3d.core.base.*;
+ import away3d.core.render.*;
+ import away3d.core.stats.Stats;
+ import away3d.core.utils.*;
+ import away3d.events.*;
+ import away3d.materials.*;
+
+ import flash.display.Bitmap;
+ import flash.display.BitmapData;
+ import flash.display.BlendMode;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.EventPhase;
+ import flash.events.MouseEvent;
+
+ public class View3D extends Sprite
+ {
+ use namespace arcane;
+
+ internal var _session:AbstractRenderSession;
+ internal var _renderer:IRenderer;
+
+ /** Background under the rendered scene */
+ public var background:Sprite = new Sprite();
+ /** container for interactive materials over the scene */
+ public var interactiveLayer:Sprite = new Sprite();
+ /** Head up display over the scene */
+ public var hud:Sprite = new Sprite();
+
+ /** Enables/Disables stats panel */
+ public var stats:Boolean;
+ /** Determines whether stats panel is currently open */
+ public var statsOpen:Boolean;
+ /** Sprite instance for stats panel */
+ public var statsPanel:Stats;
+ /** string for storing source url */
+ public var sourceURL:String;
+
+ public var primitives:Array;
+
+ /** Fire mouse move events even in case mouse pointer doesn't move */
+ p...
[truncated message content] |
|
From: <tre...@us...> - 2008-07-09 03:04:16
|
Revision: 797
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=797&view=rev
Author: trevorolio
Date: 2008-07-08 20:04:26 -0700 (Tue, 08 Jul 2008)
Log Message:
-----------
Tag a revision before tearing out the Java3D client and replacing it with Flash
Added Paths:
-----------
maven/tags/pre-client-rewhack/
Copied: maven/tags/pre-client-rewhack (from rev 796, maven/trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-03-25 00:01:54
|
Revision: 796
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=796&view=rev
Author: trevorolio
Date: 2008-03-24 17:01:57 -0700 (Mon, 24 Mar 2008)
Log Message:
-----------
Added a handy extension to the velocity dev-plugin
Modified Paths:
--------------
maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java
Modified: maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java
===================================================================
--- maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java 2008-03-24 19:53:28 UTC (rev 795)
+++ maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java 2008-03-25 00:01:57 UTC (rev 796)
@@ -29,6 +29,11 @@
*/
private File targetDirectory;
+ /**
+ * @parameter
+ */
+ private String projectName;
+
public void execute() throws MojoExecutionException {
if (templateDirectory==null) {
getLog().warn("No velocity templates configured!");
@@ -51,7 +56,11 @@
engine.init();
VelocityContext velocityContext = new VelocityContext();
-
+ if(projectName != null){
+ velocityContext.put("projectName", projectName);
+ } else {
+ velocityContext.put("projectName", "No Name");
+ }
File[] children = templateDirectory.listFiles();
for (int i = 0; children != null && i < children.length; i++) {
if (children[i].getName().endsWith(".html")) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-03-24 19:53:40
|
Revision: 795
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=795&view=rev
Author: trevorolio
Date: 2008-03-24 12:53:28 -0700 (Mon, 24 Mar 2008)
Log Message:
-----------
Introducing a fast binary message encoder from Matt Kimmel at the Electric Sheep Company.
He also refactored the event code which was long in the tooth and needed a good kick.
Thanks, Matt!
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/loadtest/MultiuserTests.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Payload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/PayloadFactory.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackFactory.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackType.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceEvent.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/MessageStackTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/XMLMessageEncoderTest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SimMessageHandler.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticatedPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationFailurePayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationRequestPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationSuccessPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/HeartbeatPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LoggedOutPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LogoutPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/ProxiedSpaceEventPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/SpaceEventPayload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoEncodable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoMessageEncoder.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/BinaryMementoMessageEncoderTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/test/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/test/MessageBinaryMementoTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/test/PayloadBinaryMementoTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/SpaceEventBinaryMementoTest.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2008-03-21 22:44:46 UTC (rev 794)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -15,6 +15,7 @@
import com.ogoglio.client.model.*;
import com.ogoglio.message.*;
+import com.ogoglio.message.payload.*;
import com.ogoglio.message.plugin.MessageStackFactory;
import com.ogoglio.util.ArgumentUtils;
import com.ogoglio.util.Log;
@@ -230,7 +231,7 @@
private void attemptToSendSpaceEventToServer(SpaceEvent event) {
try {
- Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new PayloadFactory.SpaceEventPayload(event));
+ Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new SpaceEventPayload(event));
messageChannel.sendMessage(message);
} catch (NoSuchDestinationException e) {
e.printStackTrace();
@@ -283,7 +284,7 @@
event.setProperty(SpaceEvent.USERNAME, accountDoc.getUsername());
event.setProperty(SpaceEvent.SOURCE, accountDoc.getUsername());
event.setSplinePath(newPath);
- Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new PayloadFactory.SpaceEventPayload(event));
+ Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new SpaceEventPayload(event));
try {
messageChannel.sendMessage(message);
} catch (NoSuchDestinationException e) {
@@ -309,7 +310,7 @@
}
private void sendSpaceEvent(SpaceEvent event) {
- Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new PayloadFactory.SpaceEventPayload(event));
+ Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new SpaceEventPayload(event));
try {
messageChannel.sendMessage(message);
} catch (NoSuchDestinationException e) {
@@ -349,8 +350,8 @@
}
private void handleMessageFromService(Message message) {
- if (message.getPayload() instanceof PayloadFactory.SpaceEventPayload) {
- SpaceEvent event = ((PayloadFactory.SpaceEventPayload) message.getPayload()).getSpaceEvent();
+ if (message.getPayload() instanceof SpaceEventPayload) {
+ SpaceEvent event = ((SpaceEventPayload) message.getPayload()).getSpaceEvent();
if (SpaceEvent.ADD_USER_EVENT.equals(event.getName())) {
BodyConfigurationDocument bodyConfigDoc = event.getBodyConfigurationDocument();
BodyConfiguration bodyConfig = null;
@@ -667,7 +668,7 @@
} else {
Log.warn("Client received (and ignored) event: " + event);
}
- } else if (message.getPayload() instanceof PayloadFactory.HeartbeatPayload) {
+ } else if (message.getPayload() instanceof HeartbeatPayload) {
//ignore it
} else {
Log.error("Client received (and ignored) message: " + message);
@@ -693,12 +694,12 @@
public void handleMessage(Message message, TCPChannel sourceChannel) throws NoSuchDestinationException {
synchronized (this) {
if (waiting) {
- if (message.getPayload() instanceof PayloadFactory.AuthenticationSuccessPayload) {
+ if (message.getPayload() instanceof AuthenticationSuccessPayload) {
authStatus = SUCCESS_STATUS;
return;
- } else if (message.getPayload() instanceof PayloadFactory.AuthenticationFailurePayload) {
+ } else if (message.getPayload() instanceof AuthenticationFailurePayload) {
authStatus = FAILED_STATUS;
- errorMessage = ((PayloadFactory.AuthenticationFailurePayload) message.getPayload()).getMessage();
+ errorMessage = ((AuthenticationFailurePayload) message.getPayload()).getMessage();
return;
}
waitingMessages.add(message);
@@ -721,7 +722,7 @@
void authenticate(String authCookie) throws IOException {
try {
- Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new PayloadFactory.AuthenticationRequestPayload(authCookie, space.getSpaceID()));
+ Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new AuthenticationRequestPayload(authCookie, space.getSpaceID()));
messageChannel.sendMessage(message);
} catch (NoSuchDestinationException e) {
throw new IOException("Could not send authentication message");
@@ -737,7 +738,7 @@
}
public void heartbeat() throws IOException {
- Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new PayloadFactory.HeartbeatPayload());
+ Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new HeartbeatPayload());
try {
messageChannel.sendMessage(message);
} catch (NoSuchDestinationException e) {
@@ -794,7 +795,7 @@
cleanedUp = true;
try {
Log.info("In space client cleanup, about to send logout message:" + accountDoc.getUsername());
- messageChannel.sendMessage(new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new PayloadFactory.LogoutPayload(accountDoc.getUsername())));
+ messageChannel.sendMessage(new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new LogoutPayload(accountDoc.getUsername())));
Log.info("Success sending logout message");
} catch (Exception e) {
Log.error("Problem sending logout message:" + e.getMessage());
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/loadtest/MultiuserTests.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/loadtest/MultiuserTests.java 2008-03-21 22:44:46 UTC (rev 794)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/loadtest/MultiuserTests.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -46,6 +46,7 @@
}
public static void main(String[] args) {
+ org.apache.log4j.BasicConfigurator.configure();
if (args.length != 4) {
Log.error("usage: ... spaceID serviceURI numRobots duration");
return;
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java 2008-03-21 22:44:46 UTC (rev 794)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -1,6 +1,7 @@
package com.ogoglio.message;
import com.ogoglio.message.plugin.MessageStack;
+import com.ogoglio.message.payload.HeartbeatPayload;
import java.util.*;
@@ -68,7 +69,7 @@
try {
Long me = new Long(Thread.currentThread().getId());
while (true) {
- p = new PayloadFactory.HeartbeatPayload();
+ p = new HeartbeatPayload();
long id = r.nextLong();
m = new Message(channel.getLocalLocator(), channel.getRemoteLocator(), id, p);
timeMap.put(new Long(id), new Long(System.currentTimeMillis()));
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java 2008-03-21 22:44:46 UTC (rev 794)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -17,10 +17,15 @@
import nanoxml.XMLElement;
import com.ogoglio.message.proto.Locator;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.Log;
-public class Message {
+import java.io.*;
+public class Message implements BinaryMementoEncodable {
+
public static final String MESSAGE = "Message";
private static final String PROXY = "proxy";
@@ -41,6 +46,10 @@
private long spaceID = -1;
+ // Default constructor required for memento pattern
+ public Message() {
+ }
+
public Message(Locator origin, Locator proxy, Locator destination, long spaceID, Payload payload) {
ArgumentUtils.assertNotNull(origin);
this.origin = origin;
@@ -131,4 +140,95 @@
public void setOrigin(Locator origin) {
this.origin = origin;
}
+
+ public String getMementoClassID() {
+ return MESSAGE;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // Before doing anything else, ensure that our payload is encodable. If not, throw
+ // an exception.
+ if (!(payload instanceof BinaryMementoEncodable)) {
+ throw new MessagingException("Attempted to get memento for Message with non-mementoable payload: " + payload);
+ }
+
+ // Create a ByteArrayOutputStream, wrap it in a DataOutputStream and serialize into it.
+ // TODO: Decrease number of buffer allocs/copies?
+ ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+ DataOutputStream dataOutput = new DataOutputStream(byteStream);
+
+ // Write data
+ try {
+ dataOutput.writeUTF(origin.toString());
+ // If there's a proxy, write a boolean true and the proxy;
+ // otherwise, write a boolean false
+ if (proxy != null) {
+ dataOutput.writeBoolean(true);
+ dataOutput.writeUTF(proxy.toString());
+ } else {
+ dataOutput.writeBoolean(false);
+ }
+ dataOutput.writeUTF(destination.toString());
+ dataOutput.writeLong(spaceID);
+ BinaryMementoEncodable encodablePayload = (BinaryMementoEncodable) payload;
+ byte[] payloadMemento = encodablePayload.getBinaryMemento();
+ dataOutput.writeUTF(encodablePayload.getMementoClassID());
+ dataOutput.writeInt(payloadMemento.length);
+ dataOutput.write(payloadMemento);
+ dataOutput.flush();
+ } catch (IOException e) {
+ Log.error("Encountered IOException while encoding message: " + e);
+ throw new MessagingException("Encountered IOException while encoding message", e);
+ }
+
+ return byteStream.toByteArray();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Create a ByteArrayInputStream, wrap it in a DataInputStream, and deserialize from it.
+ ByteArrayInputStream byteStream = new ByteArrayInputStream(memento);
+ DataInputStream dataInput = new DataInputStream(byteStream);
+
+ // Read data
+ String originString;
+ String proxyString;
+ String destinationString;
+ long incomingSpaceID;
+ String payloadClassID;
+ byte[] payloadMemento;
+ try {
+ originString = dataInput.readUTF();
+ boolean containsProxy = dataInput.readBoolean();
+ if (containsProxy) {
+ proxyString = dataInput.readUTF();
+ } else {
+ proxyString = null;
+ }
+ destinationString = dataInput.readUTF();
+ incomingSpaceID = dataInput.readLong();
+ payloadClassID = dataInput.readUTF();
+ int payloadMementoSize = dataInput.readInt();
+ payloadMemento = new byte[payloadMementoSize];
+ dataInput.read(payloadMemento);
+ } catch (IOException e) {
+ Log.error("Encountered IOException while decoding message: " + e);
+ throw new MessagingException("Encountered IOException while decoding message", e);
+ }
+
+ // Decode payload
+ Payload incomingPayload = PayloadFactory.createPayloadFromMementoID(payloadClassID);
+
+ ((BinaryMementoEncodable) incomingPayload).setBinaryMemento(payloadMemento);
+
+ // Now that everything's in place, populate the object
+ setOrigin(new Locator(originString));
+ if (proxyString != null) {
+ setProxy(new Locator(proxyString));
+ } else {
+ setProxy(null);
+ }
+ setDestination(new Locator(destinationString));
+ setSpaceID(incomingSpaceID);
+ payload = incomingPayload;
+ }
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Payload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Payload.java 2008-03-21 22:44:46 UTC (rev 794)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Payload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -15,30 +15,34 @@
package com.ogoglio.message;
import nanoxml.XMLElement;
+import com.ogoglio.message.payload.AuthenticatedPayload;
+import com.ogoglio.util.Log;
-public class Payload {
+public abstract class Payload {
public static final String PAYLOAD = "Payload";
- private XMLElement data = null;
-
- public Payload(XMLElement data) {
- if (data == null) {
- throw new IllegalArgumentException("bad data: " + data);
- }
- if (data.getName().equals(PAYLOAD)) {
- throw new IllegalStateException("Cannot nest payloads: " + data);
- }
- this.data = data;
+ public Payload() {
+ // Does nothing for now
}
+
+ /**
+ * Parse the given Payload XML into variables in the implementing class.
+ *
+ * @param data XML data to parse
+ */
+ public abstract void parseData(XMLElement data);
- public XMLElement getData() {
- return data;
- }
+ /**
+ * Create Payload XML data on the fly from variables in the implementing class.
+ *
+ * @return XML data representing data contained in class
+ */
+ public abstract XMLElement getData();
public XMLElement toElement() {
XMLElement element = new XMLElement(PAYLOAD);
- element.addChild(data);
+ element.addChild(getData());
return element;
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/PayloadFactory.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/PayloadFactory.java 2008-03-21 22:44:46 UTC (rev 794)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/PayloadFactory.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -14,7 +14,9 @@
package com.ogoglio.message;
-import com.ogoglio.xml.SpaceEvent;
+import com.ogoglio.message.payload.*;
+import com.ogoglio.message.plugin.MessagingException;
+import com.ogoglio.util.Log;
import nanoxml.XMLElement;
@@ -55,230 +57,40 @@
}
}
- public static class HeartbeatPayload extends Payload {
- public static final String NAME = "HeartbeatPayload";
-
- public HeartbeatPayload() {
- super(new XMLElement(NAME));
+ /**
+ * Instantiate a subclass of Payload based on the supplied payloadClassID (as returned
+ * by BinaryMementoEncodable.getMementoClassID), using the default constructor.
+ *
+ * TODO: Make this a dynamic repository so new class IDs can be added without code change.
+ *
+ * @param payloadClassID Memento class ID of Payload to instantiate
+ * @return An instance of the Payload subclass corresponding to payloadClassID.
+ * @throws com.ogoglio.message.plugin.MessagingException if the payloadClassID is unrecognized.
+ */
+ public static Payload createPayloadFromMementoID(String payloadClassID) throws MessagingException {
+ Payload payload;
+ if (payloadClassID.equals(AuthenticatedPayload.NAME)) {
+ payload = new AuthenticatedPayload();
+ } else if (payloadClassID.equals(AuthenticationFailurePayload.NAME)) {
+ payload = new AuthenticationFailurePayload();
+ } else if (payloadClassID.equals(AuthenticationRequestPayload.NAME)) {
+ payload = new AuthenticationRequestPayload();
+ } else if (payloadClassID.equals(AuthenticationSuccessPayload.NAME)) {
+ payload = new AuthenticationSuccessPayload();
+ } else if (payloadClassID.equals(HeartbeatPayload.NAME)) {
+ payload = new HeartbeatPayload();
+ } else if (payloadClassID.equals(LoggedOutPayload.NAME)) {
+ payload = new LoggedOutPayload();
+ } else if (payloadClassID.equals(LogoutPayload.NAME)) {
+ payload = new LogoutPayload();
+ } else if (payloadClassID.equals(ProxiedSpaceEventPayload.NAME)) {
+ payload = new ProxiedSpaceEventPayload();
+ } else if (payloadClassID.equals(SpaceEventPayload.NAME)) {
+ payload = new SpaceEventPayload();
+ } else {
+ Log.error("Received Message with unknown class ID: " + payloadClassID);
+ throw new MessagingException("Received Message with unknown class ID: " + payloadClassID);
}
-
- public HeartbeatPayload(XMLElement data) {
- super(data);
- }
+ return payload;
}
-
- public static class SpaceEventPayload extends Payload {
- public static final String NAME = "SpaceEventPayload";
-
- public SpaceEventPayload(SpaceEvent spaceEvent) {
- super(create(spaceEvent));
- }
-
- public SpaceEventPayload(XMLElement data) {
- super(data);
- }
-
- public SpaceEvent getSpaceEvent() {
- return new SpaceEvent(getData().getChild(SpaceEvent.SPACE_EVENT));
- }
-
- public static XMLElement create(SpaceEvent spaceEvent) {
- XMLElement data = new XMLElement(NAME);
- data.addChild(spaceEvent.toElement());
- return data;
- }
-
- public void setSpaceEvent(SpaceEvent event) {
- getData().removeChildren(SpaceEvent.SPACE_EVENT);
- getData().addChild(event.toElement());
- }
- }
-
- public static class ProxiedSpaceEventPayload extends Payload {
- public static final String NAME = "ProxiedSpaceEventPayload";
-
- public static final String USERNAME = "username";
-
- public ProxiedSpaceEventPayload(String username, SpaceEvent spaceEvent) {
- super(create(username, spaceEvent));
- }
-
- public ProxiedSpaceEventPayload(XMLElement data) {
- super(data);
- }
-
- public SpaceEvent getSpaceEvent() {
- return new SpaceEvent(getData().getChild(SpaceEvent.SPACE_EVENT));
- }
-
- public static XMLElement create(String username, SpaceEvent spaceEvent) {
- XMLElement data = new XMLElement(NAME);
- data.setAttribute(USERNAME, username);
- data.addChild(spaceEvent.toElement());
- return data;
- }
-
- public String getUsername() {
- return getData().getStringAttribute(USERNAME);
- }
-
- public void setSpaceEvent(SpaceEvent event) {
- getData().removeChildren(SpaceEvent.SPACE_EVENT);
- getData().addChild(event.toElement());
- }
- }
-
- public static class LogoutPayload extends Payload {
- public static final String NAME = "Logout";
-
- public static final String USERNAME = "username";
-
- public LogoutPayload() {
- super(create(null));
- }
-
- public LogoutPayload(String username) {
- super(create(username));
- }
-
- public LogoutPayload(XMLElement data) {
- super(data);
- }
-
- public static XMLElement create(String username) {
- XMLElement data = new XMLElement(NAME);
- if (username != null) {
- data.setAttribute(USERNAME, username);
- }
- return data;
- }
- }
-
- public static class AuthenticationRequestPayload extends Payload {
- public static final String NAME = "AuthenticationRequest";
-
- public static final String LOGIN_COOKIE = "loginCookie";
-
- public static final String SPACE_ID = "spaceID";
-
- public AuthenticationRequestPayload(XMLElement element) {
- super(element);
- }
-
- public AuthenticationRequestPayload(String loginCookie, long spaceID) {
- super(create(loginCookie, spaceID));
- }
-
- public String getLoginCookie() {
- return getData().getStringAttribute(LOGIN_COOKIE);
- }
-
- public long getSpaceID() {
- return getData().getLongAttribute(SPACE_ID);
- }
-
- public static XMLElement create(String loginCookie, long spaceID) {
- XMLElement element = new XMLElement(NAME);
- element.setAttribute(LOGIN_COOKIE, loginCookie);
- element.setAttribute(SPACE_ID, spaceID);
- return element;
- }
- }
-
- public static class AuthenticationSuccessPayload extends Payload {
- public static final String NAME = "AuthenticationSuccess";
-
- public static final String USERNAME = "username";
-
- public AuthenticationSuccessPayload(String username) {
- super(create(username));
- }
-
- public AuthenticationSuccessPayload(XMLElement data) {
- super(data);
- }
-
- public String getUsername() {
- return getData().getStringAttribute(USERNAME);
- }
-
- public static XMLElement create(String username) {
- XMLElement data = new XMLElement(NAME);
- data.setAttribute(USERNAME, username);
- return data;
- }
- }
-
- public static class AuthenticationFailurePayload extends Payload {
- public static final String NAME = "AuthenticationFailure";
- public static final String MESSAGE = "message";
-
- public AuthenticationFailurePayload(String message) {
- super(create(message));
- }
-
- public AuthenticationFailurePayload(XMLElement element) {
- super(element);
- }
-
- private static XMLElement create(String message) {
- XMLElement element = new XMLElement(NAME);
- element.setAttribute(MESSAGE, message);
- return element;
- }
-
- public String getMessage() {
- return getData().getStringAttribute(MESSAGE);
- }
- }
-
- // This is sent to the space simulator when a client is authenticated
- public static class AuthenticatedPayload extends Payload {
- public static final String NAME = "Authenticated";
-
- public static final String USERNAME = "username";
-
- public AuthenticatedPayload(String username) {
- super(create(username));
- }
-
- public AuthenticatedPayload(XMLElement data) {
- super(data);
- }
-
- public String getUsername() {
- return getData().getStringAttribute(USERNAME);
- }
-
- public static XMLElement create(String username) {
- XMLElement data = new XMLElement(NAME);
- data.setAttribute(USERNAME, username);
- return data;
- }
- }
-
- // This is sent to the space simulator when a client logs out
- public static class LoggedOutPayload extends Payload {
- public static final String NAME = "LoggedOut";
-
- public static final String USERNAME = "username";
-
- public LoggedOutPayload(String username) {
- super(create(username));
- }
-
- public LoggedOutPayload(XMLElement data) {
- super(data);
- }
-
- public String getUsername() {
- return getData().getStringAttribute(USERNAME);
- }
-
- public static XMLElement create(String username) {
- XMLElement data = new XMLElement(NAME);
- data.setAttribute(USERNAME, username);
- return data;
- }
- }
}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticatedPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticatedPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticatedPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,77 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import nanoxml.XMLElement;
+
+// This is sent to the space simulator when a client is authenticated
+public class AuthenticatedPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "Authenticated";
+
+ public static final String USERNAME = "username";
+
+ protected String username = "";
+
+ public AuthenticatedPayload() {
+ }
+
+ public AuthenticatedPayload(String username) {
+ this.username = username;
+ }
+
+ public AuthenticatedPayload(XMLElement data) {
+ parseData(data);
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public static XMLElement create(String username) {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(USERNAME, username);
+ return data;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // The memento is just the username as bytes
+ return getUsername().getBytes();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Just create a string from the memento
+ setUsername(new String(memento));
+ }
+
+ public void parseData(XMLElement data) {
+ username = data.getStringAttribute(USERNAME);
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(USERNAME, username);
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationFailurePayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationFailurePayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationFailurePayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,69 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import nanoxml.XMLElement;
+
+public class AuthenticationFailurePayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "AuthenticationFailure";
+ public static final String MESSAGE = "message";
+
+ protected String message = "";
+
+ public AuthenticationFailurePayload() {
+ }
+
+ public AuthenticationFailurePayload(String message) {
+ this.message = message;
+ }
+
+ public AuthenticationFailurePayload(XMLElement element) {
+ parseData(element);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // The memento is just the message as bytes
+ return getMessage().getBytes();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Just create a string from the memento
+ setMessage(new String(memento));
+ }
+
+ public void parseData(XMLElement data) {
+ message = data.getStringAttribute(MESSAGE);
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(MESSAGE, message);
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationRequestPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationRequestPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationRequestPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,118 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import com.ogoglio.util.Log;
+import nanoxml.XMLElement;
+
+import java.io.*;
+
+/**
+ * @author Matt Kimmel
+*/
+public class AuthenticationRequestPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "AuthenticationRequest";
+
+ public static final String LOGIN_COOKIE = "loginCookie";
+
+ public static final String SPACE_ID = "spaceID";
+
+ protected String loginCookie = "invalid";
+ protected long spaceID = -1;
+
+ public AuthenticationRequestPayload() {
+ }
+
+ public AuthenticationRequestPayload(XMLElement element) {
+ parseData(element);
+ }
+
+ public AuthenticationRequestPayload(String loginCookie, long spaceID) {
+ this.loginCookie = loginCookie;
+ this.spaceID = spaceID;
+ }
+
+ public String getLoginCookie() {
+ return loginCookie;
+ }
+
+ public void setLoginCookie(String loginCookie) {
+ this.loginCookie = loginCookie;
+ }
+
+ public long getSpaceID() {
+ return spaceID;
+ }
+
+ public void setSpaceID(long spaceID) {
+ this.spaceID = spaceID;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // Create a ByteArrayOutputStream and wrap it in a DataOutputStream
+ ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+ DataOutputStream dataOutput = new DataOutputStream(byteStream);
+
+ // Write the data
+ try {
+ dataOutput.writeLong(getSpaceID());
+ dataOutput.writeUTF(getLoginCookie());
+ dataOutput.flush();
+ } catch (IOException e) {
+ Log.error("IOException while encoding AuthenticationRequestPayload: " + e);
+ throw new MessagingException("IOException while encoding AuthenticationRequestPayload", e);
+ }
+
+ return byteStream.toByteArray();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Create a ByteArrayInputStream and wrap it in a DataInputStream
+ ByteArrayInputStream byteStream = new ByteArrayInputStream(memento);
+ DataInputStream dataInput = new DataInputStream(byteStream);
+
+ // Read the data
+ long spaceID;
+ String loginCookie;
+ try {
+ spaceID = dataInput.readLong();
+ loginCookie = dataInput.readUTF();
+ } catch (IOException e) {
+ Log.error("IOException while decoding AuthenticationRequestPayload: " + e);
+ throw new MessagingException("IOException while decoding AuthenticationRequestPayload", e);
+ }
+
+ setSpaceID(spaceID);
+ setLoginCookie(loginCookie);
+ }
+
+ public void parseData(XMLElement data) {
+ loginCookie = data.getStringAttribute(LOGIN_COOKIE);
+ spaceID = data.getLongAttribute(SPACE_ID);
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(LOGIN_COOKIE, loginCookie);
+ data.setAttribute(SPACE_ID, spaceID);
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationSuccessPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationSuccessPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/AuthenticationSuccessPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,70 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import nanoxml.XMLElement;
+
+public class AuthenticationSuccessPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "AuthenticationSuccess";
+
+ public static final String USERNAME = "username";
+
+ protected String username = "";
+
+ public AuthenticationSuccessPayload() {
+ }
+
+ public AuthenticationSuccessPayload(String username) {
+ this.username = username;
+ }
+
+ public AuthenticationSuccessPayload(XMLElement data) {
+ parseData(data);
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // The memento is just the username as bytes
+ return getUsername().getBytes();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Just create a string from the memento
+ setUsername(new String(memento));
+ }
+
+ public void parseData(XMLElement data) {
+ username = data.getStringAttribute(USERNAME);
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(USERNAME, username);
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/HeartbeatPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/HeartbeatPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/HeartbeatPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,52 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import nanoxml.XMLElement;
+
+public class HeartbeatPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "HeartbeatPayload";
+
+ public HeartbeatPayload() {
+ }
+
+ public HeartbeatPayload(XMLElement data) {
+ parseData(data);
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // Nothing to encode!
+ return new byte[0];
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Nothing to decode.
+ }
+
+ public void parseData(XMLElement data) {
+ // Does nothing
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LoggedOutPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LoggedOutPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LoggedOutPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,77 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import nanoxml.XMLElement;
+
+// This is sent to the space simulator when a client logs out
+public class LoggedOutPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "LoggedOut";
+
+ public static final String USERNAME = "username";
+
+ protected String username = "";
+
+ public LoggedOutPayload() {
+ }
+
+ public LoggedOutPayload(String username) {
+ this.username = username;
+ }
+
+ public LoggedOutPayload(XMLElement data) {
+ parseData(data);
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public static XMLElement create(String username) {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(USERNAME, username);
+ return data;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // The memento is just the username as bytes
+ return getUsername().getBytes();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Just create a string from the memento
+ setUsername(new String(memento));
+ }
+
+ public void parseData(XMLElement data) {
+ username = data.getStringAttribute(USERNAME);
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(USERNAME, username);
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LogoutPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LogoutPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/LogoutPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,84 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import nanoxml.XMLElement;
+
+public class LogoutPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "Logout";
+
+ public static final String USERNAME = "username";
+
+ protected String username = null;
+
+ public LogoutPayload() {
+ }
+
+ public LogoutPayload(String username) {
+ this.username = username;
+ }
+
+ public LogoutPayload(XMLElement data) {
+ parseData(data);
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // The memento is a single zero byte if no username;
+ // otherwise it's the username converted to bytes
+ if (getUsername() == null) {
+ byte[] memento = new byte[1];
+ memento[0] = 0;
+ return memento;
+ } else {
+ return getUsername().getBytes();
+ }
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // If the memento starts with a zero, there's no username.
+ // Otherwise decode the bytes into a string.
+ if (memento[0] == 0) {
+ setUsername(null);
+ } else {
+ setUsername(new String(memento));
+ }
+ }
+
+ public void parseData(XMLElement data) {
+ username = data.getStringAttribute(USERNAME, null);
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ if (username != null) {
+ data.setAttribute(USERNAME, username);
+ }
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/ProxiedSpaceEventPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/ProxiedSpaceEventPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/ProxiedSpaceEventPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,115 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import com.ogoglio.xml.SpaceEvent;
+import com.ogoglio.util.Log;
+import nanoxml.XMLElement;
+
+import java.io.*;
+
+public class ProxiedSpaceEventPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "ProxiedSpaceEventPayload";
+
+ public static final String USERNAME = "username";
+
+ protected String username = "";
+ protected SpaceEvent event = null;
+
+ public ProxiedSpaceEventPayload() {
+ }
+
+ public ProxiedSpaceEventPayload(String username, SpaceEvent spaceEvent) {
+ this.username = username;
+ this.event = spaceEvent;
+ }
+
+ public ProxiedSpaceEventPayload(XMLElement data) {
+ parseData(data);
+ }
+
+ public SpaceEvent getSpaceEvent() {
+ return event;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public void setSpaceEvent(SpaceEvent event) {
+ this.event = event;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // Create a ByteArrayOutputStream and wrap it in a DataOutputStream
+ ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+ DataOutputStream dataOutput = new DataOutputStream(byteStream);
+
+ // Write the data
+ try {
+ dataOutput.writeUTF(getUsername());
+ getSpaceEvent().encodeMemento(dataOutput);
+ dataOutput.flush();
+ } catch (IOException e) {
+ Log.error("IOException while encoding ProxiedSpaceEventPayload: " + e);
+ throw new MessagingException("IOException while encoding ProxiedSpaceEventPayload", e);
+ }
+
+ return byteStream.toByteArray();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Create a ByteArrayInputStream and wrap it in a DataInputStream
+ ByteArrayInputStream byteStream = new ByteArrayInputStream(memento);
+ DataInputStream dataInput = new DataInputStream(byteStream);
+
+ // Read the data
+ String username;
+ SpaceEvent event;
+ try {
+ username = dataInput.readUTF();
+ event = new SpaceEvent();
+ event.decodeMemento(dataInput);
+ } catch (IOException e) {
+ Log.error("IOException while decoding ProxiedSpaceEventPayload: " + e);
+ throw new MessagingException("IOException while decoding ProxiedSpaceEventPayload", e);
+ }
+
+ setUsername(username);
+ setSpaceEvent(event);
+ }
+
+ public void parseData(XMLElement data) {
+ username = data.getStringAttribute(USERNAME);
+ event = new SpaceEvent(data.getChild(SpaceEvent.SPACE_EVENT));
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ data.setAttribute(USERNAME, username);
+ data.addChild(event.toElement());
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/SpaceEventPayload.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/SpaceEventPayload.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/payload/SpaceEventPayload.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,71 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.payload;
+
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.plugin.BinaryMementoEncodable;
+import com.ogoglio.message.plugin.MessagingException;
+import com.ogoglio.xml.SpaceEvent;
+import nanoxml.XMLElement;
+
+public class SpaceEventPayload extends Payload implements BinaryMementoEncodable {
+ public static final String NAME = "SpaceEventPayload";
+
+ protected SpaceEvent event = null;
+
+ public SpaceEventPayload() {
+ }
+
+ public SpaceEventPayload(SpaceEvent spaceEvent) {
+ this.event = spaceEvent;
+ }
+
+ public SpaceEventPayload(XMLElement data) {
+ parseData(data);
+ }
+
+ public SpaceEvent getSpaceEvent() {
+ return event;
+ }
+
+ public void setSpaceEvent(SpaceEvent event) {
+ this.event = event;
+ }
+
+ public String getMementoClassID() {
+ return NAME;
+ }
+
+ public byte[] getBinaryMemento() throws MessagingException {
+ // The only data we have is the SpaceEvent, so just pass back the SpaceEvent's memento
+ return getSpaceEvent().getBinaryMemento();
+ }
+
+ public void setBinaryMemento(byte[] memento) throws MessagingException {
+ // Just create a new SpaceEvent with the memento data
+ SpaceEvent newEvent = new SpaceEvent();
+ newEvent.setBinaryMemento(memento);
+ setSpaceEvent(newEvent);
+ }
+
+ public void parseData(XMLElement data) {
+ event = new SpaceEvent(data.getChild(SpaceEvent.SPACE_EVENT));
+ }
+
+ public XMLElement getData() {
+ XMLElement data = new XMLElement(NAME);
+ data.addChild(event.toElement());
+ return data;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoEncodable.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoEncodable.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoEncodable.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,56 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+/**
+ * This interface should be implemented by any class that wishes to be encoded/decoded by the
+ * BinaryMementoMessageEncoder. In addition to implementing this interface, the class must
+ * have a default constructor.
+ *
+ * As a note, this is the first encoder to use the Memento Pattern. In the future, we may want
+ * to implement a "Grand Memento" encoding system that uses a single Memento interface for multiple
+ * encodings. Or we may just want to use Memento for specific encodings where applicable.
+ *
+ * @author Matt Kimmel
+ */
+public interface BinaryMementoEncodable {
+ /**
+ * Return a string used to uniquely identify the implementing class. This is used when decoding
+ * a memento, to determine which class to instantiate. Note that this string must be unique within
+ * the app.
+ *
+ * @return String uniquely identifying the implementing class.
+ */
+ public String getMementoClassID();
+
+ /**
+ * Get a binary-encoded memento (as a byte array) that reflects the current state of the object.
+ * If the object contains other objects, it is responsible for encoding those objects into the
+ * memento, even for contained objects that implement this interface.
+ *
+ * @return Byte array containing the binary-encoded current state of the object.
+ * @throws MessagingException if an error was encountered while creating the memento.
+ */
+ public byte[] getBinaryMemento() throws MessagingException;
+
+ /**
+ * Set the state of the object to the state encoded in the provided binary-encoded memento.
+ * This includes the states of any contained objects, the states of which should have been
+ * encoded into the memento returned by getBinaryMemento.
+ *
+ * @param memento Binary-encoded memento from which to set the object's state.
+ * @throws MessagingException if an error was encountered while decoding the memento.
+ */
+ public void setBinaryMemento(byte[] memento) throws MessagingException;
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoMessageEncoder.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoMessageEncoder.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/BinaryMementoMessageEncoder.java 2008-03-24 19:53:28 UTC (rev 795)
@@ -0,0 +1,48 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+import com.ogoglio.message.Message;
+import com.ogoglio.util.Log;
+
+/**
+ * This MessageEncoder plug-in class uses the memento pattern, as expressed by the BinaryMementoEncodable
+ * interface, to encode and decode messages in a binary format. This has the trade-off of reducing the
+ * encode/decode time (in particular, the time spent writing and parsing XML) versus potentially being
+ * less friendly to some firewalls.
+ *
+ * @author Matt Kimmel...
[truncated message content] |
|
From: <ian...@us...> - 2008-03-21 22:45:00
|
Revision: 794
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=794&view=rev
Author: iansmith
Date: 2008-03-21 15:44:46 -0700 (Fri, 21 Mar 2008)
Log Message:
-----------
Improved error handling in PopulateMojo (detect more error cases).
Fixed small possible bug in SpaceDuplicator (negative value).
Added some better error information who object insertion into a space goes wrong (better error messages).
Modified Paths:
--------------
maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
Modified: maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java
===================================================================
--- maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java 2008-03-19 03:05:25 UTC (rev 793)
+++ maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java 2008-03-21 22:44:46 UTC (rev 794)
@@ -131,6 +131,10 @@
ThingDocument thing = things[j];
PossessionDocument possDoc = client.createPossession(templateIdMap.get(thing.getTemplateID()));
possDoc = client.addPossessionToSpace(possDoc.getPossessionID(), realSpaceDoc.getSpaceID());
+ if ((possDoc.getSpaceID()==PossessionDocument.NO_SPACE)||
+ (possDoc.getThingID()==PossessionDocument.NO_THING)) {
+ throw new MojoExecutionException("Unable to make a copy of possession [adding]:"+possDoc);
+ }
ThingDocument newThingDoc = client.getThingDocument(realSpaceDoc.getSpaceID(), possDoc.getThingID());
newThingDoc.setOrientation(thing.getOrientation());
newThingDoc.setTranslation(thing.getTranslation());
@@ -151,6 +155,7 @@
getLog().info("Patched up space " + realSpaceDoc.getDisplayName() + " [" + realSpaceDoc.getSpaceID() + "]");
} catch (IOException e) {
+ e.printStackTrace();
throw new MojoExecutionException("IOException patching space", e);
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java 2008-03-19 03:05:25 UTC (rev 793)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java 2008-03-21 22:44:46 UTC (rev 794)
@@ -56,7 +56,7 @@
PossessionDocument[] possDocuments = client.getPossessionDocuments();
PossessionDocument possToUse = null;
for (int j = 0; j < possDocuments.length; j++) {
- if (possDocuments[j].getThingID() == -1 && possDocuments[j].getTemplateID() == thingDocs[i].getTemplateID()) {
+ if (possDocuments[j].getThingID() == PossessionDocument.NO_THING && possDocuments[j].getTemplateID() == thingDocs[i].getTemplateID()) {
possToUse = possDocuments[j];
break;
}
@@ -108,27 +108,49 @@
}
public static void emptySpace(long spaceID, WebAPIClient client, boolean deleteRemovedPossessions) throws IOException {
- ThingDocument[] thingDocs = client.getThingDocuments(spaceID);
- for (int i = 0; i < thingDocs.length; i++) {
- long possessionID = thingDocs[i].getPossessionID();
- client.removePossessionFromSpace(thingDocs[i].getPossessionID());
- if(deleteRemovedPossessions){
- client.deletePossession(possessionID);
+ ThingDocument[] thingDocs;
+ try {
+ thingDocs = client.getThingDocuments(spaceID);
+ } catch (IOException e) {
+ thingDocs =null;
+ System.err.println("Trying to empty space, but can't find any things! Ignoring IOException!");
+ }
+ if (thingDocs!=null){
+ for (int i = 0; i < thingDocs.length; i++) {
+ long possessionID = thingDocs[i].getPossessionID();
+ client.removePossessionFromSpace(thingDocs[i].getPossessionID());
+ if(deleteRemovedPossessions){
+ client.deletePossession(possessionID);
+ }
}
}
-
- DoorDocument[] doorDocs = client.getDoorDocuments(spaceID);
- for (int i = 0; i < doorDocs.length; i++) {
- client.deleteDoor(spaceID, doorDocs[i].getDoorID());
+ DoorDocument[] doorDocs;
+ try {
+ doorDocs = client.getDoorDocuments(spaceID);
+ } catch (IOException e) {
+ doorDocs =null;
+ System.err.println("Trying to empty space, but can't find any doors! Ignoring IOException!");
}
-
- Map settings = client.getSpaceSettings(spaceID);
- String[] keys = (String[]) settings.keySet().toArray(new String[0]);
- for (int i = 0; i < keys.length; i++) {
- client.removeSpaceSetting(spaceID, keys[i]);
+ if (doorDocs!=null) {
+ for (int i = 0; i < doorDocs.length; i++) {
+ client.deleteDoor(spaceID, doorDocs[i].getDoorID());
+ }
}
+ Map settings;
+ try {
+ settings = client.getSpaceSettings(spaceID);
+ } catch (IOException e) {
+ settings=null;
+ System.err.println("Trying to empty space, but can't find any settings! Ignoring IOException!");
+ }
+ if (settings!=null) {
+ String[] keys = (String[]) settings.keySet().toArray(new String[0]);
+ for (int i = 0; i < keys.length; i++) {
+ client.removeSpaceSetting(spaceID, keys[i]);
+ }
+ }
+
}
-
public static void main(String[] args) {
if (args.length != 4) {
printUsage();
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-03-19 03:05:25 UTC (rev 793)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-03-21 22:44:46 UTC (rev 794)
@@ -957,7 +957,6 @@
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
-
PossessionDocument updatedDoc = new PossessionDocument(parseXML(request.getInputStream()));
long oldSpaceID = record.getSpaceID();
long oldThingID = record.getThingID();
@@ -965,7 +964,6 @@
sendStringResponse(DocumentFactory.documentFromRecord(record).toString(), "text/xml", response);
return;
}
-
if (oldSpaceID != PossessionDocument.NO_SPACE) {
SpaceRecord oldSpaceRecord = SpacePersistTasks.findSpaceBySpaceID(oldSpaceID, getSessionFactory());
if (oldSpaceRecord != null) {
@@ -984,12 +982,12 @@
}
}
}
-
record = PossessionPersistTasks.update(record, updatedDoc, getSessionFactory());
if (record.getSpaceID() != PossessionDocument.NO_SPACE) {
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(record.getSpaceID(), getSessionFactory());
if (spaceRecord == null) {
+ Log.error("Whoa! Space record was null when looking for spaceID:"+record.getSpaceID()+"!");
record.setSpaceID(-1);
record = PossessionPersistTasks.update(record, updatedDoc, getSessionFactory());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
@@ -997,27 +995,27 @@
}
SimRecord simRecord = SpacePersistTasks.findOrAssignSim(spaceRecord, getSessionFactory());
if (simRecord == null) {
+ Log.error("Whoa! Sim record was null when trying to get a sim for "+spaceRecord.getSpaceID());
record.setSpaceID(-1);
record = PossessionPersistTasks.update(record, updatedDoc, getSessionFactory());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
-
TemplateRecord templateRecord = TemplatePersistTasks.findTemplateByTemplateID(record.getTemplateID(), sessionFactory);
if (templateRecord == null) {
+ Log.error("Whoa! Template record was null when looking for:"+record.getTemplateID());
record.setSpaceID(-1);
record = PossessionPersistTasks.update(record, updatedDoc, getSessionFactory());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
-
URI thingsURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + record.getSpaceID() + "/thing/");
ThingDocument thingDoc = new ThingDocument(-1, templateRecord.getDisplayName(), templateRecord.getTemplateID(), templateRecord.getOwnerUsername(), record.getOwnerUsername(), record.getPossessionID(), new Transform3D(), null);
try {
XMLElement element = new WebAPIClientWire().sendAuthenticatedXML(thingsURI, thingDoc.toString(), "POST", null);
long thingID = element.getLongAttribute(ThingDocument.THING_ID, -1);
if (thingID == -1) {
- Log.error("Received a -1 thingID for some reason, bailing: " + element);
+ Log.error("Whoa! thing id was -1 in thing doc:"+element);
record.setSpaceID(-1);
record = PossessionPersistTasks.update(record, updatedDoc, getSessionFactory());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
@@ -1026,6 +1024,7 @@
record.setThingID(thingID);
PossessionPersistTasks.update(record, getSessionFactory());
} catch (IOException e) {
+ Log.error("IOException putting thing in space:"+e.getMessage());
record.setSpaceID(PossessionDocument.NO_SPACE);
record = PossessionPersistTasks.update(record, updatedDoc, getSessionFactory());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-03-19 03:05:20
|
Revision: 793
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=793&view=rev
Author: trevorolio
Date: 2008-03-18 20:05:25 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
Another bug fix in the chunked network code, this time from Matt K. at the Electric Sheep Company.
Thanks, Matt!
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java 2008-03-17 20:41:15 UTC (rev 792)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java 2008-03-19 03:05:25 UTC (rev 793)
@@ -104,6 +104,12 @@
// Parse the chunked message length
int overallMessageLength = Integer.parseInt(messageLengthBuffer.toString(), 16);
+ // If the chunked message length is 0, we've been disconnected. Throw a
+ // NegativeReadValueException.
+ if (overallMessageLength == 0) {
+ throw new NegativeReadValueException("EOC received in ChunkedStreamNetworkTransporter");
+ }
+
// Read in the message length header to get the true message length.
int messageLength = decodeMessageLength();
@@ -127,17 +133,11 @@
throw new MessagingException("Amount of data read does not match message length:" +
totalBytes + " vs "+messageLength);
}
-
- // Eat the closing \r\n
- inputStream.read();
- inputStream.read();
}
- // If the message length is 0, we've been disconnected. Throw a
- // NegativeReadValueException.
- if (messageLength == 0) {
- throw new NegativeReadValueException("EOC received in ChunkedStreamNetworkTransporter");
- }
+ // Eat the closing \r\n
+ inputStream.read();
+ inputStream.read();
return buffer;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2008-03-17 20:41:14
|
Revision: 792
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=792&view=rev
Author: iansmith
Date: 2008-03-17 13:41:15 -0700 (Mon, 17 Mar 2008)
Log Message:
-----------
Fixed the read of packets from network streams to read in a loop in case the whole
message doesn't come in one fell swoop.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/StreamNetworkTransporter.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java 2008-03-14 21:43:02 UTC (rev 791)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java 2008-03-17 20:41:15 UTC (rev 792)
@@ -110,17 +110,29 @@
// Now allocate a buffer of the proper size and read the data into it,
// blocking if necessary.
byte[] buffer = new byte[messageLength];
+ int totalBytes=0;
if (messageLength > 0) {
- int bytesRead = inputStream.read(buffer);
- if (bytesRead != messageLength) {
- throw new MessagingException("Amount of data read does not match message length");
+ do {
+ int bytesRead = inputStream.read(buffer,totalBytes,messageLength-totalBytes);
+ if (bytesRead<=0) {
+ throw new MessagingException("Unexpected value from read:" + bytesRead);
+ } else {
+ if (bytesRead!=messageLength) {
+ Log.info("Partial read:"+bytesRead+" (total size="+messageLength+")");
+ }
+ totalBytes+=bytesRead;
+ }
+ } while (totalBytes<messageLength);
+ if (totalBytes!= messageLength) { //testing for too big
+ throw new MessagingException("Amount of data read does not match message length:" +
+ totalBytes + " vs "+messageLength);
}
+
+ // Eat the closing \r\n
+ inputStream.read();
+ inputStream.read();
}
- // Eat the closing \r\n
- b = inputStream.read();
- b = inputStream.read();
-
// If the message length is 0, we've been disconnected. Throw a
// NegativeReadValueException.
if (messageLength == 0) {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java 2008-03-14 21:43:02 UTC (rev 791)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java 2008-03-17 20:41:15 UTC (rev 792)
@@ -15,6 +15,7 @@
import com.ogoglio.message.Message;
import com.ogoglio.message.proto.Locator;
+import com.ogoglio.util.Log;
import java.io.IOException;
@@ -138,6 +139,7 @@
// Decode the message
return messageEncoder.decodeMessage(encodedMessage);
} catch (MessagingException e) {
+ Log.error("Underlying messaging exception!",e);
// TODO: Widen interface to throw this directly
throw new IOException("MessagingException encountered in readMessage: " + e.toString());
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/StreamNetworkTransporter.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/StreamNetworkTransporter.java 2008-03-14 21:43:02 UTC (rev 791)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/StreamNetworkTransporter.java 2008-03-17 20:41:15 UTC (rev 792)
@@ -99,11 +99,24 @@
// Now we know the message length. Allocate an appropriately-sized buffer and
// read the message (again, blocking if necessary).
byte[] buffer = new byte[messageLength];
- int bytesRead = inputStream.read(buffer);
+ int bytesRead=0,newBytes;
+
+ do {
+ newBytes = inputStream.read(buffer,bytesRead,messageLength-bytesRead);
+ bytesRead+=newBytes;
+ if (newBytes<=0){
+ throw new MessagingException("Unexpected return value from inputStream read():"+newBytes);
+ }
+ if (bytesRead!=messageLength) {
+ Log.info("Partial read of stream data:"+newBytes+ " bytes!");
+ }
+ } while (bytesRead<messageLength);
+ // note: this is ALSO a check for too many bytes, so we have kept it
if (bytesRead != messageLength) {
- throw new MessagingException("Incorrect number of bytes read");
+ throw new MessagingException("Incorrect number of bytes read " +
+ bytesRead +" vs expected "+messageLength);
}
-
+
return buffer;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-03-14 21:43:02
|
Revision: 791
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=791&view=rev
Author: trevorolio
Date: 2008-03-14 14:43:02 -0700 (Fri, 14 Mar 2008)
Log Message:
-----------
Fixed up the populate mojo so that it's smarter about updating templates and spaces which already exist instead of deleting them and building a new one from scratch.
Also, fixed a shutdown error caused due to a bad cast in CometChannelManager.
Modified Paths:
--------------
maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java
Modified: maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java
===================================================================
--- maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java 2008-03-13 22:05:00 UTC (rev 790)
+++ maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java 2008-03-14 21:43:02 UTC (rev 791)
@@ -7,7 +7,6 @@
import java.io.InputStream;
import java.text.DateFormat;
import java.text.ParseException;
-import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
@@ -22,6 +21,7 @@
import org.apache.maven.plugin.MojoExecutionException;
+import com.ogoglio.client.SpaceDuplicator;
import com.ogoglio.client.WebAPIClient;
import com.ogoglio.util.StreamUtils;
import com.ogoglio.xml.DoorDocument;
@@ -29,7 +29,6 @@
import com.ogoglio.xml.SettingDocument;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.TemplateDocument;
-import com.ogoglio.xml.TemplateSupportFileDocument;
import com.ogoglio.xml.ThingDocument;
/**
@@ -37,7 +36,9 @@
*/
public class PopulateMojo extends OgServiceMojoBase {
public static final String PROPERTIES_FILE_NAME = "template.properties";
-
+
+ public static final String[] RESOURCE_FILES_EXTENSIONS = { "js", "gif", "jpg", "png", "mtl" };
+
private Map<Long, Long> templateIdMap = new HashMap<Long, Long>();
private Map<Long, SpaceDocument> localSpaces = new HashMap<Long, SpaceDocument>();
@@ -65,9 +66,9 @@
for (int i = 0; i < templates.length; ++i) {
File candidate = templates[i];
if (candidate.getName().startsWith(TEMPLATE_PREFIX)) {
- uploadTemplate(client, candidate, existingServerTemplates);
+ handleTemplate(client, candidate, existingServerTemplates);
} else if (candidate.getName().startsWith(SPACE_PREFIX)) {
- readSpace(client, candidate, i);
+ handleSpace(client, candidate, i);
} else {
if (!candidate.getName().equals(".svn")) {
getLog().warn("Unable to process in populate:" + candidate.getAbsolutePath());
@@ -103,38 +104,28 @@
}
private void patchSpaces(WebAPIClient client) throws MojoExecutionException {
- SpaceDocument fakeSpaceDoc, realSpaceDoc;
Iterator<Long> iter = localSpaces.keySet().iterator();
while (iter.hasNext()) {
try {
long localModTime = iter.next();
- fakeSpaceDoc = localSpaces.get(localModTime);
- if (serverSpaceNameToSpaceDoc.containsKey(fakeSpaceDoc.getDisplayName())) {
- realSpaceDoc = serverSpaceNameToSpaceDoc.get(fakeSpaceDoc.getDisplayName());
-
- Date fileModified = new Date(localModTime);
- Date serverModified = TemplateSupportFileDocument.fmt.parse(realSpaceDoc.getLastModifiedAsUTC());
- if (fileModified.before(serverModified)) {
- getLog().info("Not patching space document " + realSpaceDoc.getDisplayName() + ". Server copy is newer.");
- continue;
- } else {
- //need to torch the server version b/c it's too old
- client.deleteSpace(realSpaceDoc.getSpaceID());
- getLog().info("Deleted old server version of " + realSpaceDoc.getDisplayName() + " [" + realSpaceDoc.getSpaceID() + "]");
+ SpaceDocument fakeSpaceDoc = localSpaces.get(localModTime);
+ SpaceDocument realSpaceDoc = serverSpaceNameToSpaceDoc.get(fakeSpaceDoc.getDisplayName());
+ if (realSpaceDoc != null) {
+ SpaceDuplicator.emptySpace(realSpaceDoc.getSpaceID(), client, true);
+ } else {
+ realSpaceDoc = client.createSpace(fakeSpaceDoc.getDisplayName());
+ if (realSpaceDoc == null) {
+ throw new MojoExecutionException("Could not create a space for population: " + fakeSpaceDoc.getDisplayName());
}
}
- realSpaceDoc = client.createSpace(fakeSpaceDoc.getDisplayName());
- if (realSpaceDoc == null) {
- throw new MojoExecutionException("Could not create a space for population: " + fakeSpaceDoc.getDisplayName());
- }
long realSpaceID = realSpaceDoc.getSpaceID();
client.setSpaceMaxGuests(realSpaceID, fakeSpaceDoc.getMaxGuests());
client.setSpacePublished(realSpaceID, fakeSpaceDoc.isPublished());
client.setSpaceSeaLevel(realSpaceID, fakeSpaceDoc.getSeaLevel());
client.setSpaceDisplaySea(realSpaceID, fakeSpaceDoc.getDisplaySea());
client.setSpaceBackgroundColor(realSpaceID, fakeSpaceDoc.getBackgroundColor());
-
+
ThingDocument things[] = fakeSpaceDoc.getThingDocuments();
for (int j = 0; j < things.length; ++j) {
ThingDocument thing = things[j];
@@ -159,15 +150,13 @@
}
getLog().info("Patched up space " + realSpaceDoc.getDisplayName() + " [" + realSpaceDoc.getSpaceID() + "]");
- } catch (ParseException e) {
- throw new MojoExecutionException("Parse exception patching space", e);
} catch (IOException e) {
throw new MojoExecutionException("IOException patching space", e);
}
}
}
- private void readSpace(WebAPIClient client, File candidate, int fileNumber) throws MojoExecutionException {
+ private void handleSpace(WebAPIClient client, File candidate, int fileNumber) throws MojoExecutionException {
String name = candidate.getName();
String num = name.substring(SPACE_PREFIX.length());
int spaceFakeId = -189;
@@ -184,10 +173,10 @@
String docContent = StreamUtils.readInput(inputStream);
SpaceDocument doc = new SpaceDocument(XMLElement.parseElementFromString(docContent));
long timeStamp = candidate.lastModified();
- if(localSpaces.get(timeStamp) != null){
- // Rare occurrence: sometimes files checked out by SVN on MacOS X end up having exactly the same timestamp
- // Simply increment it by a few milliseconds and use the new value for the index
- timeStamp = candidate.lastModified() + fileNumber;
+ if (localSpaces.get(timeStamp) != null) {
+ // Rare occurrence: sometimes files checked out by SVN on MacOS X end up having exactly the same timestamp
+ // Simply increment it by a few milliseconds and use the new value for the index
+ timeStamp = candidate.lastModified() + fileNumber;
}
localSpaces.put(timeStamp, doc);
inputStream.close();
@@ -197,69 +186,59 @@
}
- private void uploadTemplate(WebAPIClient client, File candidate, Map<String, TemplateDocument> existing) throws MojoExecutionException {
- String name = candidate.getName();
- long templateFakeId = dirNameToTemplateNumber(candidate);
+ private void handleTemplate(WebAPIClient client, File candidate, Map<String, TemplateDocument> existing) throws MojoExecutionException {
+ try {
+ long templateFakeId = dirNameToTemplateNumber(candidate);
- File[] objs = candidate.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(".obj");
+ File[] objs = candidate.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".obj");
+ }
+ });
+ if (objs.length != 1) {
+ throw new MojoExecutionException("Badly formed directory " + candidate.getName() + ". Should have 1 obj file but has " + objs.length);
}
- });
- if (objs.length != 1) {
- throw new MojoExecutionException("Badly formed directory " + name + ". Should have 1 obj file but has " + objs.length);
- }
- String templateVisibleName = fileToTemplateName(objs[0]);
- if (!checkFileTemplateIsNewer(client, candidate, existing, templateVisibleName)) {
- getLog().info("Not uploading template " + templateVisibleName + ". Server copy is newer.");
- templateIdMap.put(templateFakeId, existing.get(templateVisibleName).getTemplateID());
- return;
- } else {
- getLog().info("Uploading template #" + templateFakeId + " to " + serviceURI);
- }
+ String templateVisibleName = fileToTemplateName(objs[0]);
+ long templateRealID = checkForExistingTemplate(client, existing, templateVisibleName);
+ TemplateDocument doc = null;
+ if (templateRealID == -1) {
+ doc = fileNameToTemplateDocument(client, objs[0]);
+ getLog().info("Uploading new template with fakeID [" + templateFakeId + "] (" + templateVisibleName + ") to " + serviceURI);
+ } else {
+ doc = client.getTemplateDocument(client.getAuthenticator().getUsername(), templateRealID);
+ getLog().info("Updating existing template with fakeID [" + templateFakeId + "] (" + templateVisibleName + ") to " + serviceURI);
+ //TODO delete the files we no longer need from the existing template
+ }
- try {
- TemplateDocument doc = fileNameToTemplateDocument(client, objs[0]);
-
+ templateIdMap.put(templateFakeId, doc.getTemplateID());
+ Properties templateProperties = new Properties();
File propertiesFile = new File(candidate, PROPERTIES_FILE_NAME);
if (propertiesFile.exists() && propertiesFile.canRead()) {
- Properties templateProperties = new Properties();
templateProperties.load(new FileInputStream(propertiesFile));
- if (templateProperties.size() > 0) {
- updateTemplateDoc(client, doc, templateProperties);
- }
}
+ updateTemplateDoc(client, doc, templateProperties);
InputStream objStream = new FileInputStream(objs[0]);
client.uploadTemplateGeometryStream(username, doc.getTemplateID(), 0, objStream);
- templateIdMap.put(templateFakeId, doc.getTemplateID());
- getLog().info("Created template from " + objs[0].getName() + " [" + templateFakeId + " -> " + doc.getTemplateID() + "]");
-
- File[] notObjs = candidate.listFiles(new FilenameFilter() {
+ File[] resourceFiles = candidate.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
- return !name.endsWith(".obj");
+ for (int i = 0; i < RESOURCE_FILES_EXTENSIONS.length; i++) {
+ if (name != null && name.endsWith("." + RESOURCE_FILES_EXTENSIONS[i])) {
+ return true;
+ }
+ }
+ return false;
}
});
- for (int i = 0; i < notObjs.length; ++i) {
- File supportFile = notObjs[i];
- String supportName = supportFile.getName();
- if (supportFile.getName().endsWith(".js")) {
- String script = StreamUtils.readInput(new FileInputStream(supportFile));
+ for (int i = 0; i < resourceFiles.length; ++i) {
+ if (resourceFiles[i].getName().endsWith(".js")) {
+ String script = StreamUtils.readInput(new FileInputStream(resourceFiles[i]));
client.updateTemplateScript(username, doc.getTemplateID(), script);
- getLog().info("Uploaded script file:" + supportName);
} else {
- if ((!(supportName.endsWith(".gif"))) && (!(supportName.endsWith(".jpg"))) && (!(supportName.endsWith(".png"))) && (!(supportName.endsWith(".mtl")))) {
-
- if ((!(supportName.endsWith(".blend"))) && (!(supportName.endsWith(".3DS"))) && (!(supportName.endsWith(".txt"))) && (!(supportName.equals(".svn"))) && !supportName.equals(PROPERTIES_FILE_NAME)) {
- getLog().warn("Don't know what to do with file " + supportName + ". Ignoring.");
- }
- continue;
- }
- FileInputStream supportStream = new FileInputStream(supportFile);
- client.uploadTemplateResourceStream(username, doc.getTemplateID(), supportName, supportStream);
- getLog().info("Uploaded support file:" + supportName);
+ FileInputStream supportStream = new FileInputStream(resourceFiles[i]);
+ client.uploadTemplateResourceStream(username, doc.getTemplateID(), resourceFiles[i].getName(), supportStream);
}
}
@@ -269,151 +248,54 @@
}
private void updateTemplateDoc(WebAPIClient client, TemplateDocument doc, Properties templateProperties) throws IOException {
- String[] keys = (String[])templateProperties.keySet().toArray(new String[0]);
- double rotX = 0, rotY = 0, rotZ = 0;
-
- for (int i = 0; i < keys.length; i++) {
- if("seat".equals(keys[i])){
- doc.setSeat("true".equals(templateProperties.get(keys[i])));
- } else if("seatX".equals(keys[i])){
- doc.setSeatPosition(Double.parseDouble((String)templateProperties.get(keys[i])), doc.getSeatPosition().y, doc.getSeatPosition().z);
- } else if("seatY".equals(keys[i])){
- doc.setSeatPosition(doc.getSeatPosition().x, Double.parseDouble((String)templateProperties.get(keys[i])), doc.getSeatPosition().z);
- } else if("seatZ".equals(keys[i])){
- doc.setSeatPosition(doc.getSeatPosition().x, doc.getSeatPosition().y, Double.parseDouble((String)templateProperties.get(keys[i])));
- } else if("seatRotX".equals(keys[i])){
- rotX = Double.parseDouble(templateProperties.getProperty(keys[i]));
- } else if("seatRotY".equals(keys[i])){
- rotY = Double.parseDouble(templateProperties.getProperty(keys[i]));
- } else if("seatRotZ".equals(keys[i])){
- rotZ = Double.parseDouble(templateProperties.getProperty(keys[i]));
- } else if("attachment".equals(keys[i])){
- doc.setAttachment("true".equals(templateProperties.get(keys[i])));
- } else {
- System.err.println("Unknown properties in template.properties: " + keys[i]);
- }
- }
-
- if(rotX != 0 || rotY != 0 || rotZ != 0){
- Transform3D transform = new Transform3D();
- transform.setEuler(new Vector3d(rotX, rotY, rotZ));
- Quat4d quat = new Quat4d();
- transform.get(quat);
- doc.setSeatRotation(quat);
- }
+ if (templateProperties == null) {
+ doc.setAttachment(false);
+ doc.setSeat(false);
+ doc.setSeatPosition(0, 0, 0);
+ doc.setSeatRotation(0, 0, 0, 0);
+ } else {
+ String[] keys = (String[]) templateProperties.keySet().toArray(new String[0]);
+ double rotX = 0, rotY = 0, rotZ = 0;
- getLog().info("Updating template " + doc.getDisplayName() + " with properties from template.properties");
- client.updateTemplate(doc);
- }
-
- private boolean checkFileTemplateIsNewer(WebAPIClient client, File candidate, Map<String, TemplateDocument> existing, String displayName) throws MojoExecutionException {
- //is it even on server?
- if (!existing.containsKey(displayName)) {
- return true;
- }
-
- TemplateDocument serverCopy = existing.get(displayName);
-
- //first check support files
- File[] notObjs = candidate.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return !name.endsWith(".obj");
+ for (int i = 0; i < keys.length; i++) {
+ if ("seat".equals(keys[i])) {
+ doc.setSeat("true".equals(templateProperties.get(keys[i])));
+ } else if ("seatX".equals(keys[i])) {
+ doc.setSeatPosition(Double.parseDouble((String) templateProperties.get(keys[i])), doc.getSeatPosition().y, doc.getSeatPosition().z);
+ } else if ("seatY".equals(keys[i])) {
+ doc.setSeatPosition(doc.getSeatPosition().x, Double.parseDouble((String) templateProperties.get(keys[i])), doc.getSeatPosition().z);
+ } else if ("seatZ".equals(keys[i])) {
+ doc.setSeatPosition(doc.getSeatPosition().x, doc.getSeatPosition().y, Double.parseDouble((String) templateProperties.get(keys[i])));
+ } else if ("seatRotX".equals(keys[i])) {
+ rotX = Double.parseDouble(templateProperties.getProperty(keys[i]));
+ } else if ("seatRotY".equals(keys[i])) {
+ rotY = Double.parseDouble(templateProperties.getProperty(keys[i]));
+ } else if ("seatRotZ".equals(keys[i])) {
+ rotZ = Double.parseDouble(templateProperties.getProperty(keys[i]));
+ } else if ("attachment".equals(keys[i])) {
+ doc.setAttachment("true".equals(templateProperties.get(keys[i])));
+ } else {
+ System.err.println("Unknown properties in template.properties: " + keys[i]);
+ }
}
- });
- //walk support files
- for (int i = 0; i < notObjs.length; ++i) {
- File supportFile = notObjs[i];
- String supportName = supportFile.getName();
- String modTime = null;
- if (supportName.endsWith(".js")) {
- if (!serverCopy.hasScriptFile()) {
- getLog().info("You have added a javascript file since the last server update.");
- return true;
- }
- modTime = serverCopy.getScriptModifiedTime();
- } else if ((!(supportName.endsWith(".gif"))) && (!(supportName.endsWith(".jpg"))) && (!(supportName.endsWith(".png"))) && (!(supportName.endsWith(".mtl")))) {
- continue;
- } else {
- modTime = serverCopy.getSupportFileModifiedTime(supportName);
+ if (rotX != 0 || rotY != 0 || rotZ != 0) {
+ Transform3D transform = new Transform3D();
+ transform.setEuler(new Vector3d(rotX, rotY, rotZ));
+ Quat4d quat = new Quat4d();
+ transform.get(quat);
+ doc.setSeatRotation(quat);
}
- try {
- //if there is no modtime, then the file doesn't exist on the server
- if (modTime == null) {
- getLog().info("Added support file " + supportName + " to template since server copy created");
- client.deleteTemplate(serverCopy.getTemplateID());
- return true;
- }
- //modtime is now set to what the server thinks the modtime is
- Date serverTime = fmt.parse(modTime);
- if (serverTime.before(new Date(supportFile.lastModified()))) {
- getLog().info("File " + supportFile + " has been modified since last upload to server...");
- client.deleteTemplate(serverCopy.getTemplateID());
- return true; //we can bail out now
- }
- } catch (IOException e) {
- throw new MojoExecutionException("unable to delete server copy of template " + serverCopy.getDisplayName(), e);
- } catch (ParseException e) {
- throw new MojoExecutionException("unable to comprehend modified time", e);
- }
}
+ client.updateTemplate(doc);
+ }
- //at this point we've checked the files that exist on the client side, but we might
- //have deleted one
- boolean destroyServerTemplate = false;
- //special case for js
- if (serverCopy.hasScriptFile()) {
- File[] jsFiles = candidate.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(".js");
- }
- });
- if (jsFiles.length > 1) {
- throw new MojoExecutionException("Only one script file is allowed per template (" + candidate.getPath() + ")");
- }
- if (jsFiles.length == 0) {
- getLog().info("Javascript file removed since last server update.");
- destroyServerTemplate = true;
- }
+ private long checkForExistingTemplate(WebAPIClient client, Map<String, TemplateDocument> existing, String displayName) throws MojoExecutionException {
+ TemplateDocument doc = existing.get(displayName);
+ if (doc != null) {
+ return doc.getTemplateID();
}
- //now support files
- String name[] = serverCopy.getAllSupportFileNames();
- for (int i = 0; i < name.length; ++i) {
- File f = new File(candidate, name[i]);
- if (!f.exists()) {
- getLog().info("You have removed the file " + name[i] + " from the template.");
- destroyServerTemplate = true;
- break;
- }
- }
- //check the obj file
- File[] objs = candidate.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(".obj");
- }
- });
- if (objs.length != 1) {
- throw new MojoExecutionException("You should have exactly one object (geometry) file per template directory (was " + objs.length + ")");
- }
- try {
- Date fileMod = new Date(objs[0].lastModified());
- Date onServerMod = fmt.parse(serverCopy.getGeometryModifiedTime(0));
- if (onServerMod.before(fileMod)) {
- getLog().info("Local geometry file is newer than server copy.");
- destroyServerTemplate = true;
- }
- //implement destruction
- if (destroyServerTemplate) {
- client.deleteTemplate(serverCopy.getTemplateID());
- return true;
- } else {
- return false;
- }
- } catch (IOException e) {
- throw new MojoExecutionException("unable to delete server copy of template " + serverCopy.getDisplayName(), e);
- } catch (ParseException e) {
- throw new MojoExecutionException("unable to comprehend modified time", e);
- }
+ return -1;
}
}
\ No newline at end of file
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java 2008-03-13 22:05:00 UTC (rev 790)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java 2008-03-14 21:43:02 UTC (rev 791)
@@ -104,9 +104,17 @@
}
public static void emptySpace(long spaceID, WebAPIClient client) throws IOException {
+ emptySpace(spaceID, client, false);
+ }
+
+ public static void emptySpace(long spaceID, WebAPIClient client, boolean deleteRemovedPossessions) throws IOException {
ThingDocument[] thingDocs = client.getThingDocuments(spaceID);
for (int i = 0; i < thingDocs.length; i++) {
+ long possessionID = thingDocs[i].getPossessionID();
client.removePossessionFromSpace(thingDocs[i].getPossessionID());
+ if(deleteRemovedPossessions){
+ client.deletePossession(possessionID);
+ }
}
DoorDocument[] doorDocs = client.getDoorDocuments(spaceID);
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java 2008-03-13 22:05:00 UTC (rev 790)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java 2008-03-14 21:43:02 UTC (rev 791)
@@ -93,7 +93,7 @@
public void shutdown() {
Iterator iter = sessionToChannel.keySet().iterator();
while (iter.hasNext()) {
- String key = (String) iter.next();
+ CometEvent key = (CometEvent)iter.next();
TCPChannel channel = (TCPChannel) sessionToChannel.get(key);
channel.cleanup();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-03-11 23:18:50
|
Revision: 789
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=789&view=rev
Author: trevorolio
Date: 2008-03-11 16:18:53 -0700 (Tue, 11 Mar 2008)
Log Message:
-----------
Pleased as punch to check in the first contribution from Matt Kimmel at the Electric Sheep Company (http://www.electricsheepcompany.com/)
Matt's introduced a way to plug in new message codecs and wire protocols for world events. Not all scenarios work well with XML over Comet, so being able to negotiate between different protocols depending on firewalls and applications will be a Good Thing.
Thanks, Matt!
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/SenderQueue.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProto.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoFactory.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/CometClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/CometProto.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/Locator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsync.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncClientReady.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoServerFactory.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoShutdownHandle.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketAsyncServer.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketWaiterThread.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageEncoder.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackFactory.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackType.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessagingException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/NetworkTransporter.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/NullWireFormatEncoder.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/StreamNetworkTransporter.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/WireFormatEncoder.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/XMLMessageEncoder.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/ChunkedStreamNetworkTransporterTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/MessageStackTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/NullWireFormatEncoderTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/StreamNetworkTransporterTest.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/message/plugin/test/XMLMessageEncoderTest.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2008-03-11 17:41:45 UTC (rev 788)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -13,6 +13,17 @@
limitations under the License. */
package com.ogoglio.client;
+import com.ogoglio.client.model.*;
+import com.ogoglio.message.*;
+import com.ogoglio.message.plugin.MessageStackFactory;
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.Log;
+import com.ogoglio.util.WebConstants;
+import com.ogoglio.xml.*;
+
+import javax.media.j3d.Transform3D;
+import javax.vecmath.Color3f;
+import javax.vecmath.Point3d;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
@@ -22,45 +33,6 @@
import java.util.Vector;
import java.util.zip.ZipInputStream;
-import javax.media.j3d.Transform3D;
-import javax.vecmath.Color3f;
-import javax.vecmath.Point3d;
-
-import com.ogoglio.client.model.Attachment;
-import com.ogoglio.client.model.BodyConfiguration;
-import com.ogoglio.client.model.BodyDataProvider;
-import com.ogoglio.client.model.Door;
-import com.ogoglio.client.model.Page;
-import com.ogoglio.client.model.Shape;
-import com.ogoglio.client.model.Space;
-import com.ogoglio.client.model.SplinePath;
-import com.ogoglio.client.model.Template;
-import com.ogoglio.client.model.TemplateDataProvider;
-import com.ogoglio.client.model.Thing;
-import com.ogoglio.client.model.User;
-import com.ogoglio.message.Message;
-import com.ogoglio.message.MessageHandler;
-import com.ogoglio.message.NoSuchDestinationException;
-import com.ogoglio.message.PayloadFactory;
-import com.ogoglio.message.TCPChannel;
-import com.ogoglio.message.proto.AsyncProtoFactory;
-import com.ogoglio.util.ArgumentUtils;
-import com.ogoglio.util.Log;
-import com.ogoglio.util.WebConstants;
-import com.ogoglio.xml.AccountDocument;
-import com.ogoglio.xml.AttachmentDocument;
-import com.ogoglio.xml.BodyConfigurationDocument;
-import com.ogoglio.xml.BodyDataDocument;
-import com.ogoglio.xml.BodySettingDocument;
-import com.ogoglio.xml.DoorDocument;
-import com.ogoglio.xml.PageDocument;
-import com.ogoglio.xml.ShapeDocument;
-import com.ogoglio.xml.SpaceDocument;
-import com.ogoglio.xml.SpaceEvent;
-import com.ogoglio.xml.TemplateDocument;
-import com.ogoglio.xml.ThingDocument;
-import com.ogoglio.xml.UserDocument;
-
public class SpaceClient implements UserInputListener, Space.Context {
private static final long START_UP_WAIT_MS = 30000;
@@ -117,7 +89,7 @@
space = new Space(this, spaceDoc.getSpaceID(), spaceDoc.getDisplayName(), spaceDoc.getOwnerUsername(), spaceDoc.getDisplaySea(), spaceDoc.getSeaLevel(), backgroundColor);
//create the event channel and start queuing events
- messageChannel = new TCPChannel(AsyncProtoFactory.getDefaultClient(descriptor, true), messenger, true, new ChannelListener(), true, "space-client");
+ messageChannel = new TCPChannel(MessageStackFactory.getDefaultStack(descriptor, true), messenger, true, new ChannelListener(), true, "space-client");
messenger.authenticate(authCookie);
long startWait = System.currentTimeMillis();
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java 2008-03-11 17:41:45 UTC (rev 788)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -1,46 +1,48 @@
package com.ogoglio.message;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
+import com.ogoglio.message.plugin.MessageStack;
-import com.ogoglio.message.proto.AsyncProto;
-import com.ogoglio.message.proto.AsyncProtoFactory;
+import java.util.*;
-
public class MeasPerfClient extends Thread implements MessageHandler, TCPChannel.Listener {
- private static final double THRESHOLD_DANGER= 2.0; //make a note if it takes longer than this
- private static final int MAX_SLEEP_TIME_MS= 5000; //avg 2.5secs
- private static final int RAMP_UP_TIME= 250; //time btwn two thread creations
+ private static final double THRESHOLD_DANGER = 2.0; //make a note if it takes longer than this
+
+ private static final int MAX_SLEEP_TIME_MS = 5000; //avg 2.5secs
+
+ private static final int RAMP_UP_TIME = 250; //time btwn two thread creations
+
private static final int THRESHOLD_TERMINATE = 10; //we start culling senders if we see this many over THRESHOLD_DANGER
-
+
private TCPChannel channel;
- private static Map timeMap=Collections.synchronizedMap(new HashMap());
- private static Map senderMap=new HashMap();
- private static List deathList=Collections.synchronizedList(new ArrayList());
+ private static Map timeMap = Collections.synchronizedMap(new HashMap());
+
+ private static Map senderMap = new HashMap();
+
+ private static List deathList = Collections.synchronizedList(new ArrayList());
+
private static double totalTime = 0.0;
- private static double totalSamples=0.0;
- private static Object totalTimeLock=new Object();
- private static int warningCounter =0;
+ private static double totalSamples = 0.0;
+
+ private static Object totalTimeLock = new Object();
+
+ private static int warningCounter = 0;
+
private static Object warningCounterLock = new Object();
-
- private Random r=new Random();
-
+
+ private Random r = new Random();
+
public static void main(String[] argv) {
int n = Integer.parseInt(argv[0]);
try {
for (int i = 0; i < n; ++i) {
-// AsyncProto proto=AsyncProtoFactory.getDefaultClient(argv[1], AsyncProtoFactory.getDefaultInfo().getSimSpecificSelector());
- AsyncProto proto=null;/*AsyncProtoFactory.getDefaultClient(argv[1], "/fart/poop");*/
- Thread t =new MeasPerfClient(proto);
+ // AsyncProto proto=AsyncProtoFactory.getDefaultClient(argv[1], AsyncProtoFactory.getDefaultInfo().getSimSpecificSelector());
+ // AsyncProto proto=null;/*AsyncProtoFactory.getDefaultClient(argv[1], "/fart/poop");*/
+ MessageStack stack = null;
+ Thread t = new MeasPerfClient(stack);
t.start();
try {
Thread.sleep(RAMP_UP_TIME);
@@ -53,26 +55,26 @@
}
}
- public MeasPerfClient(AsyncProto proto) {
- System.out.println("FOUND A CLIENT PROTO:"+(proto!=null));
- channel = new TCPChannel(proto,this,false,this,true,"measure-perf-client");
+ public MeasPerfClient(MessageStack stack) {
+ System.out.println("FOUND A CLIENT PROTO:" + (stack != null));
+ channel = new TCPChannel(stack, this, false, this, true, "measure-perf-client");
}
public void run() {
while (true) {
- Payload p ;
+ Payload p;
Message m;
-
+
try {
- Long me=new Long(Thread.currentThread().getId());
+ Long me = new Long(Thread.currentThread().getId());
while (true) {
- p=new PayloadFactory.HeartbeatPayload();
- long id=r.nextLong();
- m=new Message(channel.getLocalLocator(),channel.getRemoteLocator(),id,p);
- timeMap.put(new Long(id),new Long(System.currentTimeMillis()));
- senderMap.put(new Long(id),me);
+ p = new PayloadFactory.HeartbeatPayload();
+ long id = r.nextLong();
+ m = new Message(channel.getLocalLocator(), channel.getRemoteLocator(), id, p);
+ timeMap.put(new Long(id), new Long(System.currentTimeMillis()));
+ senderMap.put(new Long(id), me);
channel.sendMessage(m);
- int ms=r.nextInt(MAX_SLEEP_TIME_MS);
+ int ms = r.nextInt(MAX_SLEEP_TIME_MS);
Thread.yield();
Thread.sleep(ms);
synchronized (deathList) {
@@ -82,7 +84,7 @@
}
}
//did somebody close this?
- if (channel==null) {
+ if (channel == null) {
return;
}
}
@@ -95,34 +97,34 @@
}
public void handleMessage(Message message, TCPChannel sourceChannel) throws NoSuchDestinationException {
- Long id=new Long(message.getSpaceID());
- long now=System.currentTimeMillis();
+ Long id = new Long(message.getSpaceID());
+ long now = System.currentTimeMillis();
if (!timeMap.containsKey(id)) {
- System.out.println("Can't find id in time map! Ignoring id:"+id);
+ System.out.println("Can't find id in time map! Ignoring id:" + id);
return;
}
- Long before=(Long)timeMap.get(id);
- long diff = now-before.longValue();
- double secs = ((double)diff)/1000.0;
+ Long before = (Long) timeMap.get(id);
+ long diff = now - before.longValue();
+ double secs = ((double) diff) / 1000.0;
synchronized (totalTimeLock) {
- totalTime+=secs;
- totalSamples+=1.0;
+ totalTime += secs;
+ totalSamples += 1.0;
}
- if (r.nextInt(100)==0) {
+ if (r.nextInt(100) == 0) {
double avg;
synchronized (totalTimeLock) {
- avg=totalTime/totalSamples;
+ avg = totalTime / totalSamples;
}
- System.out.println(""+ channel.getLocalLocator() +" Sample Turnaround time on heartbeat:"+secs+" and avg:"+avg);
- }
- if (secs>THRESHOLD_DANGER) {
- boolean cull=false;
-
+ System.out.println("" + channel.getLocalLocator() + " Sample Turnaround time on heartbeat:" + secs + " and avg:" + avg);
+ }
+ if (secs > THRESHOLD_DANGER) {
+ boolean cull = false;
+
synchronized (warningCounterLock) {
warningCounter++;
- if (warningCounter>THRESHOLD_TERMINATE) {
- cull=true;
- warningCounter=0;
+ if (warningCounter > THRESHOLD_TERMINATE) {
+ cull = true;
+ warningCounter = 0;
}
}
//not enough to convince us to blow up somebody?
@@ -130,10 +132,10 @@
return;
}
//ok, the sender of the message should die if it took too long...
- Long die = (Long)senderMap.get(id);
+ Long die = (Long) senderMap.get(id);
synchronized (deathList) {
if (!deathList.contains(die)) {
- System.out.println("Killing sender "+die+" because of too much time elapsed:"+secs);
+ System.out.println("Killing sender " + die + " because of too much time elapsed:" + secs);
deathList.add(die);
}
}
@@ -141,6 +143,6 @@
}
public void channelClosed(TCPChannel channel) {
- System.out.println("Got a message about closing channel:"+channel.hashCode()+ " vs. "+this.channel.hashCode());
+ System.out.println("Got a message about closing channel:" + channel.hashCode() + " vs. " + this.channel.hashCode());
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/SenderQueue.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/SenderQueue.java 2008-03-11 17:41:45 UTC (rev 788)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/SenderQueue.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -14,26 +14,25 @@
package com.ogoglio.message;
+import com.ogoglio.message.plugin.MessageStack;
+import com.ogoglio.util.BlockingQueue;
+
import java.io.IOException;
-import com.ogoglio.message.proto.AsyncProto;
-import com.ogoglio.util.BlockingQueue;
-import com.ogoglio.util.Log;
-
public class SenderQueue {
private SenderThread senderThread = new SenderThread();
private BlockingQueue messageQueue = new BlockingQueue();
- private AsyncProto clientProto;
+ private MessageStack clientStack;
private boolean cleaned = false;
- public SenderQueue(AsyncProto clientProto, int maxSize) {
+ public SenderQueue(MessageStack clientStack, int maxSize) {
messageQueue.setMaxSize(maxSize);
- this.clientProto = clientProto;
+ this.clientStack = clientStack;
try {
- this.clientProto.prepareOutput();
+ this.clientStack.prepareOutput();
} catch (IOException e) {
throw new IllegalStateException("Could not get socket output stream: " + e);
}
@@ -46,7 +45,7 @@
public void cleanup() {
cleaned = true;
- clientProto.shutdown();
+ clientStack.shutdown();
if (messageQueue != null) {
messageQueue.close();
}
@@ -57,10 +56,11 @@
}
private void unsafeSendMessage(Message message) {
- String messageString = message.toString();
- Command command = new Command(Command.MESSAGE, messageString.length());
+// String messageString = message.toString();
+// Command command = new Command(Command.MESSAGE, messageString.length());
try {
- clientProto.sendMessage(command.toString(),messageString);
+// clientStack.sendMessage(command.toString(),messageString);
+ clientStack.sendMessage(message);
} catch (IOException e) {
if (!cleaned) {
throw new IllegalStateException("Error writing to client:" + message);
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java 2008-03-11 17:41:45 UTC (rev 788)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -14,15 +14,15 @@
package com.ogoglio.message;
-import com.ogoglio.message.proto.AsyncProto;
+import com.ogoglio.message.plugin.MessageStack;
import com.ogoglio.message.proto.Locator;
-import com.ogoglio.util.Log;
import com.ogoglio.util.BlockingQueue.QueueClosedException;
import com.ogoglio.util.BlockingQueue.QueueOverflowException;
+import com.ogoglio.util.Log;
public class TCPChannel implements TCPMessageReader.Listener {
- private AsyncProto clientProto = null;
+ private MessageStack clientStack = null;
// private String remoteHostName = null;
@@ -40,12 +40,12 @@
private boolean ensureOrigin = false;
- public TCPChannel(AsyncProto proto, MessageHandler message_handler, boolean ensureOrigin,
+ public TCPChannel(MessageStack stack, MessageHandler message_handler, boolean ensureOrigin,
Listener listener, boolean needAReaderThread, String debugInfo) {
- this.clientProto= proto;
- //remoteHostName = clientProto.getRemoteAddress().getAddress().getHostAddress();
- //remoteHostPort = clientProto.getRemoteAddress().getPort();
+ this.clientStack = stack;
+ //remoteHostName = clientStack.getRemoteAddress().getAddress().getHostAddress();
+ //remoteHostPort = clientStack.getRemoteAddress().getPort();
if (message_handler == null) {
throw new IllegalArgumentException("bad message handler " + message_handler);
}
@@ -57,14 +57,14 @@
this.listener = listener;
// TODO Don't spand two threads for each socket! No effing way!
- senderQueue = new SenderQueue(clientProto, 1000); //TODO what should the max queue size be?
+ senderQueue = new SenderQueue(clientStack, 1000); //TODO what should the max queue size be?
senderQueue.start(debugInfo);
//this is a wee bit hairy. all clients need a reader thread. servers need a reader
//thread depending on their protocol.
if (needAReaderThread) {
- readerThread = new TCPMessageReader(clientProto, message_handler, this);
+ readerThread = new TCPMessageReader(clientStack, message_handler, this);
readerThread.setName("tcp-reader-"+debugInfo+"-"+readerThread.getId());
readerThread.start();
}
@@ -72,19 +72,19 @@
this.messageHandler=message_handler;
}
- public void clientReady(AsyncProto newlyConnectedProto) {
- Log.debug("Client connected from: "+newlyConnectedProto.getRemoteLocator());
+ public void clientReady(MessageStack newlyConnectedStack) {
+ Log.debug("Client connected from: "+newlyConnectedStack.getRemoteLocator());
}
public interface Listener {
public void channelClosed(TCPChannel channel);
}
public Locator getLocalLocator() {
- return clientProto.getLocalLocator();
+ return clientStack.getLocalLocator();
}
public Locator getRemoteLocator() {
- return clientProto.getRemoteLocator();
+ return clientStack.getRemoteLocator();
}
public void cleanup() {
@@ -108,26 +108,26 @@
public void sendMessage(Message message) throws NoSuchDestinationException {
if(message.getProxy() != null) {
- if (!message.getProxy().equals(clientProto.getRemoteLocator())) {
+ if (!message.getProxy().equals(clientStack.getRemoteLocator())) {
throw new NoSuchDestinationException("Passed a message to a TCPChannel with the wrong proxy: " + message.getProxy());
}
- } else if (!message.getDestination().equals(clientProto.getRemoteLocator())){
- throw new NoSuchDestinationException("Passed a message to a TCPChannel with the wrong destination: " + message.getDestination() + " but should be " + clientProto.getRemoteLocator());
+ } else if (!message.getDestination().equals(clientStack.getRemoteLocator())){
+ throw new NoSuchDestinationException("Passed a message to a TCPChannel with the wrong destination: " + message.getDestination() + " but should be " + clientStack.getRemoteLocator());
}
try {
senderQueue.sendMessage(message);
} catch (QueueOverflowException e) {
- Log.error("Queue overflow: " + clientProto.getRemoteLocator(),e);
+ Log.error("Queue overflow: " + clientStack.getRemoteLocator(),e);
cleanup();
} catch (QueueClosedException e) {
- Log.error("Queue closed: " + clientProto.getRemoteLocator(),e);
+ Log.error("Queue closed: " + clientStack.getRemoteLocator(),e);
cleanup();
}
}
public String toString() {
- return "TCPChannel from " + clientProto.getLocalLocator() + " to " +clientProto.getRemoteLocator();
+ return "TCPChannel from " + clientStack.getLocalLocator() + " to " + clientStack.getRemoteLocator();
}
public void socketClosed() {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java 2008-03-11 17:41:45 UTC (rev 788)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -14,12 +14,12 @@
package com.ogoglio.message;
-import java.io.IOException;
-
-import com.ogoglio.message.proto.AsyncProto;
+import com.ogoglio.message.plugin.MessageStack;
import com.ogoglio.message.proto.NegativeReadValueException;
import com.ogoglio.util.Log;
+import java.io.IOException;
+
public class TCPMessageReader extends Thread {
private boolean cleaned = false;
@@ -32,16 +32,16 @@
//private int remotePort = -1;
- private AsyncProto clientProto=null;
+ private MessageStack clientStack =null;
- public TCPMessageReader(AsyncProto clientProto, MessageHandler messageHandler, TCPChannel channel) {
+ public TCPMessageReader(MessageStack clientStack, MessageHandler messageHandler, TCPChannel channel) {
super("TCPMessageReader");
setDaemon(true);
- if (clientProto == null) {
- throw new IllegalArgumentException("bad protocol to TCPMessageReader" + clientProto);
+ if (clientStack == null) {
+ throw new IllegalArgumentException("bad protocol to TCPMessageReader" + clientStack);
}
- //remoteHostName = clientProto.getRemoteAddress().getAddress().getHostAddress();
- //remotePort = clientProto.getRemoteAddress().getPort();
+ //remoteHostName = clientStack.getRemoteAddress().getAddress().getHostAddress();
+ //remotePort = clientStack.getRemoteAddress().getPort();
if (messageHandler == null) {
throw new IllegalArgumentException("bad message handler: " + messageHandler);
}
@@ -50,10 +50,10 @@
throw new IllegalArgumentException("bad listener " + channel);
}
this.channel = channel;
- this.clientProto = clientProto;
+ this.clientStack = clientStack;
try {
- this.clientProto.prepareInput();
+ this.clientStack.prepareInput();
} catch (IOException e) {
throw new IllegalStateException("Couldn't get client socket input stream " + e);
}
@@ -67,28 +67,27 @@
public void cleanup() {
cleaned = true;
- clientProto.shutdown();
+ clientStack.shutdown();
}
public void run() {
try {
while (!cleaned) {
- String msg=clientProto.readLine();
- if (msg!=null) {
- //Log.info("TCP Message Reader:"+msg);
- Message message = Message.parseMessage(msg);
- if (channel.ensureOrigin()) {
- message.setOrigin(clientProto.getRemoteLocator());
- //message.getOrigin().setHost(remoteHostName);
- //message.getOrigin().setPort(remotePort);
- }
- try {
- messageHandler.handleMessage(message, channel);
- } catch (Throwable e) {
- Log.error("Error handling our message",e);
- e.printStackTrace();
- }
+// String msg=clientStack.readLine();
+ //Log.info("TCP Message Reader:"+msg);
+// Message message = Message.parseMessage(msg);
+ Message message = clientStack.readMessage();
+ if (channel.ensureOrigin()) {
+ message.setOrigin(clientStack.getRemoteLocator());
+ //message.getOrigin().setHost(remoteHostName);
+ //message.getOrigin().setPort(remotePort);
}
+ try {
+ messageHandler.handleMessage(message, channel);
+ } catch (Throwable e) {
+ Log.error("Error handling our message",e);
+ e.printStackTrace();
+ }
}
} catch (NegativeReadValueException e) {
//Log.info("Negative value from read, assuming server closed connection!");
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/ChunkedStreamNetworkTransporter.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -0,0 +1,132 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+import com.ogoglio.message.proto.NegativeReadValueException;
+import com.ogoglio.util.Log;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * A NetworkTransporter plugin class that uses arbitrary input/output streams to read and write
+ * network traffic. HTTP chunking information is written and parsed in order to communicate message
+ * lengths.
+ *
+ * @author Matt Kimmel
+ */
+public class ChunkedStreamNetworkTransporter extends StreamNetworkTransporter {
+ /**
+ * Construct an instance of ChunkedStreamNetworkTransporter using the given streams.
+ *
+ * @param input Stream to read incoming network traffic from.
+ * @param output Stream to write outgoing network traffic to.
+ */
+ public ChunkedStreamNetworkTransporter(InputStream input, OutputStream output) {
+ super(input, output);
+ }
+
+ public void sendNetworkMessage(byte[] message) throws MessagingException, IOException {
+ // Throw exception on null data
+ if (message == null) {
+ throw new MessagingException("null data passed to sendNetworkMessage");
+ }
+
+ // Encode the message length into a message header.
+ byte[] messageHeader = encodeMessageLength(message.length);
+
+ // Get length of data chunk and encode it.
+ // Note that we add the size of the message header.
+ int dataLength = message.length + messageHeader.length;
+ String lengthHexStr = Integer.toHexString(dataLength);
+
+ // Now that we know the length of the data length string, allocate the buffer.
+ // The size is the length of the hex data plus the length of the buffer plus
+ // 4 bytes for the two \r\n pairs plus the size of the message header (which is
+ // redundant but necessary when sending data to a Comet server).
+ int bufferLength = lengthHexStr.length() + message.length + messageHeader.length + 4;
+ byte[] dataBuffer = new byte[bufferLength];
+
+ // Copy in the length string
+ int offset = 0;
+ byte[] lengthHexBytes = lengthHexStr.getBytes();
+ System.arraycopy(lengthHexBytes, 0, dataBuffer, offset, lengthHexBytes.length);
+ offset += lengthHexBytes.length;
+
+ // Insert the first \r\n
+ dataBuffer[offset] = '\r';
+ dataBuffer[offset + 1] = '\n';
+ offset += 2;
+
+ // Write in the message size
+ System.arraycopy(messageHeader, 0, dataBuffer, offset, messageHeader.length);
+ offset += messageHeader.length;
+
+ // Copy in the data
+ System.arraycopy(message, 0, dataBuffer, offset, message.length);
+ offset += message.length;
+
+ // Add the final \r\n
+ dataBuffer[offset] = '\r';
+ dataBuffer[offset + 1] = '\n';
+
+ // Send the message
+ outputStream.write(dataBuffer);
+ outputStream.flush();
+ }
+
+ public byte[] receiveNetworkMessage() throws MessagingException, IOException {
+ // Read the length of the chunk, blocking if necessary.
+ StringBuilder messageLengthBuffer = new StringBuilder();
+ int b = inputStream.read();
+ while ((b >= 0) && ((char) b != '\r')) {
+ messageLengthBuffer.append((char) b);
+ b = inputStream.read();
+ }
+ if (b < 0) {
+ Log.info("Negative number returned by InputStream.read in receiveNetworkMessage--possible disconnection");
+ throw new NegativeReadValueException("Got a negative number from InputStream.read in ChunkedStreamNetworkTransporter");
+ }
+ b = inputStream.read(); // Eat the \n
+
+ // Parse the chunked message length
+ int overallMessageLength = Integer.parseInt(messageLengthBuffer.toString(), 16);
+
+ // Read in the message length header to get the true message length.
+ int messageLength = decodeMessageLength();
+
+ // Now allocate a buffer of the proper size and read the data into it,
+ // blocking if necessary.
+ byte[] buffer = new byte[messageLength];
+ if (messageLength > 0) {
+ int bytesRead = inputStream.read(buffer);
+ if (bytesRead != messageLength) {
+ throw new MessagingException("Amount of data read does not match message length");
+ }
+ }
+
+ // Eat the closing \r\n
+ b = inputStream.read();
+ b = inputStream.read();
+
+ // If the message length is 0, we've been disconnected. Throw a
+ // NegativeReadValueException.
+ if (messageLength == 0) {
+ throw new NegativeReadValueException("EOC received in ChunkedStreamNetworkTransporter");
+ }
+
+ return buffer;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageEncoder.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageEncoder.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageEncoder.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -0,0 +1,44 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+import com.ogoglio.message.Message;
+
+/**
+ * This interface must be implemented by any class that wishes to act as a plug-in at the message encoding
+ * layer of the messaging stack. Its implementors are responsible for encoding and decoding Message objects,
+ * including their Payloads and other information.
+ *
+ * @author Matt Kimmel
+ */
+public interface MessageEncoder {
+ /**
+ * Encodes the given Message object into a byte array suitable to be passed to the WireFormatEncoder,
+ * and suitable to be decoded by the decodeMessage method.
+ *
+ * @param message Message to encode.
+ * @return Byte array containing the encoded representation of the message.
+ * @throws MessagingException if the message cannot be encoded.
+ */
+ public byte[] encodeMessage(Message message) throws MessagingException;
+
+ /**
+ * Decode a message as encoded by encodeMessage into a Message object.
+ *
+ * @param messageData Byte array representation of message, as produced by encodeMessage.
+ * @return Decoded Message object.
+ * @throws MessagingException if the message cannot be decoded.
+ */
+ public Message decodeMessage(byte[] messageData) throws MessagingException;
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStack.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -0,0 +1,242 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+import com.ogoglio.message.Message;
+import com.ogoglio.message.proto.Locator;
+
+import java.io.IOException;
+
+/**
+ * This class encapsulates an entire pluggable message stack--a MessageEncoder, a WireFormatEncoder,
+ * and a NetworkTransporter. It provides an interface for sending and receiving Message objects using
+ * the stack, as well as an interface for sending and receiving raw data (at the WireFormatEncoder
+ * level).
+ *
+ * MessageStack is beginning its lifespan as a more-or-less drop-in replacement for AsyncProto.
+ * The two interfaces will probably diverge over time.
+ *
+ * @author Matt Kimmel
+ */
+public class MessageStack {
+ /**
+ * Local locator.
+ */
+ protected Locator localLocator;
+
+ /**
+ * Remote locator.
+ */
+ protected Locator remoteLocator;
+
+ /**
+ * MessageEncoder plugin for this stack.
+ */
+ protected MessageEncoder messageEncoder;
+
+ /**
+ * WireFormatEncoder plugin for this stack.
+ */
+ protected WireFormatEncoder wireFormatEncoder;
+
+ /**
+ * NetworkTransporter plugin for this stack.
+ */
+ protected NetworkTransporter networkTransporter;
+
+ /**
+ * Construct a new MessageStack object from the given parameters.
+ *
+ * @param messageEncoder MessageEncoder object to use in this stack.
+ * @param wireFormatEncoder WireFormatEncoder object to use in this stack.
+ * @param networkTransporter NetworkTransporter object to use in this stack.
+ * @param localLocator Locator for localLocator side of connection.
+ * @param remoteLocator Locator for remoteLocator side of connection.
+ */
+ MessageStack(MessageEncoder messageEncoder, WireFormatEncoder wireFormatEncoder, NetworkTransporter networkTransporter, Locator localLocator, Locator remoteLocator) {
+ this.messageEncoder = messageEncoder;
+ this.wireFormatEncoder = wireFormatEncoder;
+ this.networkTransporter = networkTransporter;
+ this.localLocator = localLocator;
+ this.remoteLocator = remoteLocator;
+ }
+
+ /**
+ * Return the local Locator for this connection. This is a holdover from
+ * AsyncProto; it may be deprecated eventually, or Locater may be decoupled
+ * from URIs.
+ *
+ * @return Local Locator for this connection.
+ */
+ public Locator getLocalLocator() {
+ return localLocator;
+ }
+
+ /**
+ * Return the remote Locator for this connection. This is a holdover from
+ * AsyncProto; it may be deprecated eventually, or Locater may be decoupled
+ * from URIs.
+ *
+ * @return Remote Locator for this connection.
+ */
+ public Locator getRemoteLocator() {
+ return remoteLocator;
+ }
+
+ /**
+ * Send a message to the network, through the stack. The message will be
+ * encoded, the result will be encoded for the wire, and the final message
+ * will be sent using the NetworkTransporter.
+ *
+ * @param message The Message object to send
+ * @throws IOException on a low-level I/O error (typically from the underlying network)
+ */
+ public void sendMessage(Message message) throws IOException {
+ try {
+ // First encode the message
+ byte[] encodedMessage = messageEncoder.encodeMessage(message);
+
+ // Now encode it for the wire
+ byte[] wireEncodedMessage = wireFormatEncoder.encodeForWire(encodedMessage);
+
+ // Finally, send it to the network
+ networkTransporter.sendNetworkMessage(wireEncodedMessage);
+ } catch (MessagingException e) {
+ // TODO: Widen interface to throw this directly
+ throw new IOException("MessagingException encountered in sendMessage: " + e.toString());
+ }
+ }
+
+ /**
+ * Receive a single message from the network, through the stack. The message
+ * will be read from the underlying network, any needed wire-format decoding will
+ * be done, and the message will be decoded from its original encoding and returned.
+ * This method will block until a message is received.
+ *
+ * @return Decoded message. The method will throw an exception rather than return a null Message.
+ * @throws IOException on a low-level I/O error (typically from the underlying network)
+ */
+ public Message readMessage() throws IOException {
+ try {
+ // Read raw data from the network, blocking if necessary
+ byte[] networkData = networkTransporter.receiveNetworkMessage();
+
+ // Decode any wire format from the data
+ byte[] encodedMessage = wireFormatEncoder.decodeFromWire(networkData);
+
+ // Decode the message
+ return messageEncoder.decodeMessage(encodedMessage);
+ } catch (MessagingException e) {
+ // TODO: Widen interface to throw this directly
+ throw new IOException("MessagingException encountered in readMessage: " + e.toString());
+ }
+ }
+
+ /**
+ * Send a series of bytes, unencoded, bypassing the MessageEncoder. This is used
+ * for real-time protocols that don't want the overhead of representing their
+ * messages as objects.
+ *
+ * @param message Bytes to send
+ * @throws IOException on a low-level I/O error (typically from the underlying network)
+ */
+ public void sendUnencodedMessage(byte[] message) throws IOException {
+ try {
+ // Encode the message for the wire
+ byte[] wireEncodedMessage = wireFormatEncoder.encodeForWire(message);
+
+ // Now send it to the network
+ networkTransporter.sendNetworkMessage(wireEncodedMessage);
+ } catch (MessagingException e) {
+ // TODO: Widen interface to throw this directly
+ throw new IOException("MessagingException encountered in sendUnencodedMessage: " + e.toString());
+ }
+ }
+
+ /**
+ * Receive a series of bytes, unencoded, as sent by sendUnencodedMessage. This is used
+ * for real-time protocols that don't want the overhead of representing their
+ * messages as objects.
+ *
+ * @return Unencoded byte array. This method will throw an exception rather than return null.
+ * @throws IOException on a low-level I/O error (typically from the underlying network)
+ */
+ public byte[] readUnencodedMessage() throws IOException {
+ try {
+ // Read raw data from the network, blocking if necessary
+ byte[] networkData = networkTransporter.receiveNetworkMessage();
+
+ // Decode any wire format from the data and return it
+ return wireFormatEncoder.decodeFromWire(networkData);
+ } catch (MessagingException e) {
+ // TODO: Widen interface to throw this directly
+ throw new IOException("MessagingException encountered in readUnencodedMessage: " + e.toString());
+ }
+ }
+
+ /**
+ * Shut down the Message Stack. This will disconnect the NetworkTransporter, if possible.
+ */
+ public void shutdown() {
+ try {
+ networkTransporter.closeNetworkConnection();
+ } catch (IOException e) {
+ // Do nothing with this for now
+ }
+ }
+
+ /**
+ * Attempt to set a new output object for this message stack, assuming the NetworkTransporter
+ * supports it and the object is of a type understood by the NetworkTransporter.
+ *
+ * @param outputObject New output object.
+ * @throws MessagingException if the NetworkTransporter does not support this operation or does not understand the object
+ */
+ public void setOutputObject(Object outputObject) throws MessagingException {
+ // Really just delegated to the NetworkTransporter
+ networkTransporter.setOutputObject(outputObject);
+ }
+
+ /**
+ * Attempt to set a new input object for this message stack, assuming the NetworkTransporter
+ * supports it and the object is of a type understood by the NetworkTransporter.
+ *
+ * @param inputObject New input object.
+ * @throws MessagingException if the NetworkTransporter does not support this operation or does not understand the object
+ */
+ public void setInputObject(Object inputObject) throws MessagingException {
+ // Really just delegated to the NetworkTransporter
+ networkTransporter.setInputObject(inputObject);
+ }
+
+ /**
+ * Check whether data is ready to be read without blocking. Note that this
+ * does not mean that there is an entire message ready to be read without
+ * blocking.
+ *
+ * @return true if data is available; false if not
+ * @throws IOException if the NetworkTransporter does not support this operation or if a low-level I/O error occurs
+ */
+ public boolean isDataReady() throws IOException {
+ return networkTransporter.isDataReady();
+ }
+
+ public void prepareOutput() throws IOException {
+ // Does nothing in this class
+ }
+
+ public void prepareInput() throws IOException {
+ // Does nothing in this class
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackFactory.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackFactory.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackFactory.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -0,0 +1,153 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.message.proto.CometClient;
+import com.ogoglio.message.proto.Locator;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.URI;
+
+/**
+ * This is a factory class that produces MessageStacks based on MessageStackTypes and
+ * arbitrary connection objects. At the moment it's a fairly simplistic mechanism for
+ * configuring MessageStacks, but it should evolve over time into a sophisticated and
+ * configurable paradigm.
+ *
+ * The USE_SIMPLE_SOCKET variable and associated methods have been moved here from
+ * AsyncProtoFactory. The default port definitions have been moved here from SimpleSocketAsync.
+ *
+ * @author Matt Kimmel
+ */
+public class MessageStackFactory {
+ /**
+ * This variable determines whether Comet or Simple Socket protocols will be used.
+ */
+ private static final boolean USE_SIMPLE_SOCKET = false;
+
+ /**
+ * Default port to use for message proxy
+ */
+ public static final int DEFAULT_PROXY_PORT = 49355;
+
+ /**
+ * Default port to use for sim
+ */
+ public static final int DEFAULT_SIM_PORT = 8922;
+
+ /**
+ * Create a message stack configured with plugins appropriate to the provided MessageStackType.
+ * Use the arbitrary inputObject and outputObject parameters (which should actually be instances
+ * of objects appropriate to the MessageStack--for example, an InputStream and OutputStream for
+ * a stream-based stack) and the Locators in construction of the stack.
+ *
+ * @param type Enumerated type of MessageStack to build
+ * @param inputObject MessageStack-type appropriate object to use for network input
+ * @param outputObject MessageStack-type appropriate object to use for network output
+ * @param localLocator Locator describing local side of connection
+ * @param remoteLocator Locator describing remote side of connection
+ * @return A fully configured MessageStack object
+ * @throws MessagingException if the MessageStack could not be created
+ */
+ static public MessageStack createMessageStack(MessageStackType type, Object inputObject, Object outputObject, Locator localLocator, Locator remoteLocator) throws MessagingException {
+ MessageEncoder messageEncoder;
+ WireFormatEncoder wireFormatEncoder;
+ NetworkTransporter networkTransporter;
+
+ if (type == MessageStackType.DEFAULT_COMET_CLIENT) {
+ if (!(inputObject instanceof InputStream) || !(outputObject instanceof OutputStream)) {
+ throw new MessagingException("Invalid input/output objects in createMessageStack");
+ }
+
+ messageEncoder = new XMLMessageEncoder();
+ wireFormatEncoder = new NullWireFormatEncoder();
+ networkTransporter = new ChunkedStreamNetworkTransporter((InputStream) inputObject, (OutputStream) outputObject);
+ } else if (type == MessageStackType.DEFAULT_COMET_SERVER) {
+ if (((inputObject != null) && !(inputObject instanceof InputStream)) || ((outputObject != null) && !(outputObject instanceof OutputStream))) {
+ throw new MessagingException("Invalid input/output objects in createMessageStack");
+ }
+
+ messageEncoder = new XMLMessageEncoder();
+ wireFormatEncoder = new NullWireFormatEncoder();
+ networkTransporter = new StreamNetworkTransporter((InputStream) inputObject, (OutputStream) outputObject);
+ } else if (type == MessageStackType.DEFAULT_SIMPLESOCKET) {
+ if (!(inputObject instanceof InputStream) || !(outputObject instanceof OutputStream)) {
+ throw new MessagingException("Invalid input/output objects in createMessageStack");
+ }
+
+ messageEncoder = new XMLMessageEncoder();
+ wireFormatEncoder = new NullWireFormatEncoder();
+ networkTransporter = new StreamNetworkTransporter((InputStream) inputObject, (OutputStream) outputObject);
+ } else {
+ throw new MessagingException("Unknown Message Stack Type passed to createMessageStack");
+ }
+
+ return new MessageStack(messageEncoder, wireFormatEncoder, networkTransporter, localLocator, remoteLocator);
+ }
+
+ static public MessageStack getDefaultStack(WebAPIDescriptor descriptor, boolean wantProxy) throws IOException {
+ if (USE_SIMPLE_SOCKET) {
+ if (wantProxy) {
+ return createSimpleSocketStack(descriptor.getServiceStateURI().getHost(), DEFAULT_PROXY_PORT);
+ } else {
+ return createSimpleSocketStack(descriptor.getServiceStateURI().getHost(), DEFAULT_SIM_PORT);
+ }
+ } else {
+ if (wantProxy) {
+ return CometClient.getStack(descriptor.getCometProxyURI());
+ } else {
+ return CometClient.getStack(descriptor.getCometSimURI());
+ }
+ }
+ }
+
+ static public MessageStack getDefaultStack(URI uri) throws IOException {
+ if (USE_SIMPLE_SOCKET) {
+ return createSimpleSocketStack(uri.getHost(), uri.getPort());
+ } else {
+ return CometClient.getStack(uri);
+ }
+ }
+
+ static public String getScheme() {
+ if (USE_SIMPLE_SOCKET) {
+ return "og";
+ } else {
+ return "comet";
+ }
+ }
+
+ private static MessageStack createSimpleSocketStack(String host, int port) throws IOException {
+ Socket simpleSocket = new Socket(host, port);
+ InetSocketAddress addr = (InetSocketAddress) simpleSocket.getLocalSocketAddress();
+ Locator localLocator = sockAddrToScheme(addr);
+ addr = (InetSocketAddress) simpleSocket.getRemoteSocketAddress();
+ Locator remoteLocator = sockAddrToScheme(addr);
+ try {
+ return createMessageStack(MessageStackType.DEFAULT_SIMPLESOCKET, simpleSocket.getInputStream(), simpleSocket.getOutputStream(), localLocator, remoteLocator);
+ } catch (MessagingException e) {
+ throw new IOException("Caught MessagingException while constructing stack: " + e.toString());
+ }
+ }
+
+ static public Locator sockAddrToScheme(InetSocketAddress addr) {
+ String scheme = getScheme();
+ return new Locator(scheme + "://" + addr.getHostName() + ":" + addr.getPort());
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackType.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackType.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessageStackType.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -0,0 +1,91 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+/**
+ * This is a Java 1.4-style enum class, enumerating the configurations of MessageStack
+ * that MessageStackFactory will build.
+ *
+ * @author Matt Kimmel
+ */
+public final class MessageStackType {
+ /**
+ * Default Ogoglio client-side stack (XML/Null/Chunked)
+ */
+ static public final MessageStackType DEFAULT_COMET_CLIENT = new MessageStackType("DEFAULT_COMET_CLIENT", 0);
+
+ /**
+ * Default Ogoglio server-side stack (XML/Null/Comet)
+ */
+ static public final MessageStackType DEFAULT_COMET_SERVER = new MessageStackType("DEFAULT_COMET_SERVER", 1);
+
+ /**
+ * Default Ogoglio "simple socket" stack (XML/Null/SizedData)
+ */
+ static public final MessageStackType DEFAULT_SIMPLESOCKET = new MessageStackType("DEFAULT_SIMPLESOCKET", 2);
+
+ /**
+ * Array listing all possible MessageStackTypes (used by valueOf methods below).
+ */
+ static public MessageStackType[] values = {DEFAULT_COMET_CLIENT, DEFAULT_COMET_SERVER, DEFAULT_SIMPLESOCKET};
+
+ /**
+ * Name of this MessageStackType--should be the same as its identifier.
+ */
+ private final String name;
+
+ /**
+ * Ordinal value of this MessageStackType--must be unique.
+ */
+ private final int ordinal;
+
+ /**
+ * Construct a MessageStackType from a name and ordinal, both of which must be unique.
+ *
+ * @param name Name of MessageStackType--should be the same as its identifier.
+ * @param ordinal Ordinal value of MessageStackType--must be unique.
+ */
+ private MessageStackType(String name, int ordinal) {
+ this.name = name;
+ this.ordinal = ordinal;
+ }
+
+ public String toString() {
+ return name;
+ }
+
+ public int getOrdinal() {
+ return ordinal;
+ }
+
+ static public MessageStackType valueOf(String name) {
+ for (int i = 0; i < values.length; ++i) {
+ if (name.equals(values[i].toString())) {
+ return values[i];
+ }
+ }
+
+ return null;
+ }
+
+ static public MessageStackType valueOf(int ordinal) {
+ for (int i = 0; i < values.length; ++i) {
+ if (ordinal == values[i].getOrdinal()) {
+ return values[i];
+ }
+ }
+
+ return null;
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessagingException.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessagingException.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/MessagingException.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -0,0 +1,37 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+/**
+ * Base exception thrown by various methods in message plugin interfaces when encoding/decoding fails.
+ *
+ * @author Matt Kimmel
+ */
+public class MessagingException extends Exception {
+ public MessagingException() {
+ super();
+ }
+
+ public MessagingException(String message) {
+ super(message);
+ }
+
+ public MessagingException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public MessagingException(Throwable cause) {
+ super(cause);
+ }
+}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/NetworkTransporter.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/NetworkTransporter.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/plugin/NetworkTransporter.java 2008-03-11 23:18:53 UTC (rev 789)
@@ -0,0 +1,84 @@
+/* Copyright 2008, The Electric Sheep Company, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.message.plugin;
+
+import java.io.IOException;
+
+/**
+ * This interface must be implemented by any class that wishes to act as a plug-in at the Network Trans...
[truncated message content] |
|
From: <tre...@us...> - 2008-03-11 17:42:00
|
Revision: 788
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=788&view=rev
Author: trevorolio
Date: 2008-03-11 10:41:45 -0700 (Tue, 11 Mar 2008)
Log Message:
-----------
Added a larger landscape so people can get some elbow room.
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/resources/populate/space-4
maven/trunk/ogoglio-server/src/main/resources/populate/template-117/
maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.psd
Added: maven/trunk/ogoglio-server/src/main/resources/populate/space-4
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/space-4 (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/space-4 2008-03-11 17:41:45 UTC (rev 788)
@@ -0,0 +1 @@
+<space displaysea="false" maxguests="0" displayname="The Big Island" simid="1" published="true" spaceid="3" bgred="0.101500" bgblue="0.847600" bggreen="0.597600" sealevel="0.000000" ownerusername="ogoglio"><thing templateid="117" rz="0.000000" ry="0.000000" rx="0.000000" rw="1.000000" scalez="1.000000" displayname="The Big Island" scaley="1.000000" templateowner="ogoglio" scalex="1.000000" possessionid="1" thingid="1" z="0.000000" y="0.000000" x="0.000000" ownerusername="ogoglio"/></space>
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.blend
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.blend
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.jpg
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.mtl
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.mtl (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.mtl 2008-03-11 17:41:45 UTC (rev 788)
@@ -0,0 +1,13 @@
+# Blender3D MTL File: TheBigIsland.blend
+# Material Count: 1
+newmtl Material_TheBigIsland.jpg
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.460894 0.600199 0.440994
+Ks 0.000000 0.000000 0.000000
+Ni 1.000000
+d 1.000000
+illum 2
+map_Kd TheBigIsland.jpg
+
+
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.obj
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.obj (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-117/TheBigIsland.obj 2008-03-11 17:41:45 UTC (rev 788)
@@ -0,0 +1,59011 @@
+# Blender3D v243 OBJ File: TheBigIsland.blend
+# www.blender3d.org
+mtllib TheBigIsland.mtl
+o Grid
+v 544.824158 -41.391373 546.681274
+v 533.805115 -41.385666 546.677795
+v 522.975281 -41.369682 546.668030
+v 512.303223 -41.345089 546.653076
+v 501.757812 -41.313587 546.633911
+v 491.307983 -41.276882 546.611572
+v 480.921997 -41.236679 546.587158
+v 470.568512 -41.194698 546.561523
+v 460.215759 -41.152691 546.536011
+v 449.832245 -41.112385 546.511475
+v 439.386139 -41.075520 546.489014
+v 428.846130 -41.043816 546.469666
+v 418.180664 -41.018974 546.454468
+v 407.358643 -41.002697 546.444397
+v 396.349121 -40.996647 546.440674
+v 385.225403 -40.996639 546.440674
+v 374.101501 -40.996639 546.440674
+v 362.977570 -40.996639 546.440674
+v 351.853668 -40.996639 546.440674
+v 340.729767 -40.996639 546.440674
+v 329.605835 -40.996639 546.440674
+v 318.481934 -40.996639 546.440674
+v 307.358063 -40.996639 546.440674
+v 296.232941 -40.996677 546.440979
+v 285.104462 -40.996815 546.442200
+v 273.973846 -40.997009 546.443909
+v 262.842499 -40.997231 546.445862
+v 251.711609 -40.997444 546.447693
+v 240.582016 -40.997612 546.449158
+v 229.454453 -40.997719 546.450073
+v 218.329285 -40.997753 546.450500
+v 207.206650 -40.997719 546.450073
+v 196.086441 -40.997612 546.449158
+v 184.968216 -40.997444 546.447693
+v 173.851334 -40.997231 546.445862
+v 162.734879 -40.997009 546.443909
+v 151.617676 -40.996815 546.442200
+v 140.498428 -40.996677 546.440979
+v 129.375641 -40.996635 546.440674
+v 118.251755 -40.996574 546.440674
+v 107.127853 -40.996510 546.440674
+v 96.003944 -40.996487 546.440674
+v 84.880051 -40.996510 546.440674
+v 73.756142 -40.996567 546.440674
+v 62.632240 -40.996037 546.440674
+v 51.508343 -40.991627 546.440674
+v 40.384449 -40.983414 546.440674
+v 29.260551 -40.972042 546.440674
+v 18.136650 -40.958134 546.440674
+v 7.012749 -40.942329 546.440674
+v -4.111152 -40.925228 546.440674
+v -15.235053 -40.907440 546.440674
+v -26.358953 -40.889561 546.440674
+v -37.482853 -40.872143 546.440674
+v -48.606750 -40.855747 546.440674
+v -59.730656 -40.840870 546.440674
+v -70.854553 -40.827984 546.440674
+v -81.978455 -40.817497 546.440674
+v -93.102364 -40.809742 546.440674
+v -104.226265 -40.804989 546.440674
+v -115.350174 -40.803383 546.440674
+v -126.474068 -40.804989 546.440674
+v -137.597961 -40.809742 546.440674
+v -148.721863 -40.817497 546.440674
+v -159.845764 -40.827984 546.440674
+v -170.969666 -40.840870 546.440674
+v -182.093552 -40.855747 546.440674
+v -193.217438 -40.872143 546.440674
+v -204.341339 -40.889561 546.440674
+v -215.465240 -40.907440 546.440674
+v -226.589127 -40.925228 546.440674
+v -237.713028 -40.942329 546.440674
+v -248.836929 -40.958134 546.440674
+v -259.960815 -40.970558 546.440674
+v -271.084717 -40.977352 546.440674
+v -282.208618 -40.978516 546.440674
+v -293.332520 -40.973877 546.440674
+v -304.456421 -40.963799 546.440674
+v -315.580353 -40.951912 546.440674
+v -326.704254 -40.939236 546.440674
+v -337.828156 -40.926159 546.440674
+v -348.952057 -40.913094 546.440674
+v -360.075989 -40.900414 546.440674
+v -371.199921 -40.888504 546.440674
+v -382.323822 -40.877716 546.440674
+v -393.447723 -40.868378 546.440674
+v -404.571625 -40.861225 546.440674
+v -415.695526 -40.858078 546.440674
+v -426.819427 -40.859234 546.440674
+v -437.943329 -40.864536 546.440674
+v -449.067261 -40.873501 546.440674
+v -460.191162 -40.885315 546.440674
+v -471.315094 -40.898918 546.440674
+v -482.438934 -40.913170 546.440674
+v -493.562897 -40.926670 546.440674
+v -504.686798 -40.938313 546.440674
+v -515.810669 -40.947323 546.440674
+v -526.934631 -40.953476 546.440674
+v -538.058533 -40.957230 546.440674
+v -549.182373 -40.959106 546.440674
+v -549.182373 -40.943443 545.990845
+v -538.057312 -40.939270 545.989746
+v -526.933472 -40.932888 545.989685
+v -515.809509 -40.922466 545.989563
+v -504.685699 -40.907120 545.989441
+v -493.561798 -40.886890 545.989075
+v -482.437836 -40.862461 545.988525
+v -471.314056 -40.835300 545.987732
+v -460.190094 -40.808067 545.986755
+v -449.066223 -40.783344 545.985535
+v -437.942322 -40.764267 545.984497
+v -426.818420 -40.753239 545.983887
+v -415.694580 -40.751507 545.983765
+v -404.570679 -40.759052 545.984253
+v -393.446808 -40.774158 545.985107
+v -382.322968 -40.792488 545.986023
+v -371.199097 -40.812958 545.986816
+v -360.075226 -40.834747 545.987610
+v -348.951294 -40.857140 545.988220
+v -337.827423 -40.879478 545.988770
+v -326.703552 -40.901173 545.989197
+v -315.579651 -40.921711 545.989441
+v -304.455750 -40.940586 545.989685
+v -293.331879 -40.954456 545.989685
+v -282.208008 -40.960110 545.989746
+v -271.084106 -40.957523 545.989685
+v -259.960236 -40.946636 545.989685
+v -248.836380 -40.927090 545.989441
+v -237.712509 -40.899712 545.988953
+v -226.588654 -40.868298 545.988220
+v -215.464783 -40.833534 545.987061
+v -204.340881 -40.796162 545.985168
+v -193.217010 -40.759186 545.983032
+v -182.093124 -40.723034 545.980286
+v -170.969254 -40.685467 545.976807
+v -159.845367 -40.646069 545.972046
+v -148.721466 -40.612167 545.967285
+v -137.597595 -40.588024 545.963684
+v -126.473724 -40.572632 545.961243
+v -115.349854 -40.567345 545.960327
+v -104.225983 -40.572632 545.961243
+v -93.102127 -40.588024 545.963684
+v -81.978264 -40.612167 545.967285
+v -70.854401 -40.646069 545.972046
+v -59.730537 -40.685467 545.976807
+v -48.606667 -40.723034 545.980286
+v -37.482800 -40.759186 545.983032
+v -26.358932 -40.796162 545.985168
+v -15.235059 -40.833534 545.987061
+v -4.111183 -40.868298 545.988220
+v 7.012693 -40.899712 545.988953
+v 18.136568 -40.927261 545.989441
+v 29.260445 -40.950535 545.989685
+v 40.384315 -40.968941 545.989807
+v 51.508186 -40.982346 545.989868
+v 62.632061 -40.990417 545.989868
+v 73.755936 -40.992802 545.989868
+v 84.879814 -40.992439 545.989868
+v 96.003685 -40.992317 545.989868
+v 107.127586 -40.992466 545.989868
+v 118.250069 -40.992916 545.990845
+v 129.366837 -40.993809 545.995850
+v 140.479309 -40.995029 546.003540
+v 151.589279 -40.996376 546.011780
+v 162.698471 -40.997578 546.019958
+v 173.808258 -40.998344 546.027344
+v 184.919891 -40.998871 546.033691
+v 196.034317 -40.999271 546.038330
+v 207.152222 -40.999531 546.041321
+v 218.274063 -40.999619 546.042358
+v 229.399963 -40.999519 546.041321
+v 240.529770 -40.999271 546.038330
+v 251.663132 -40.998871 546.033691
+v 262.799255 -40.998344 546.027344
+v 273.937225 -40.997730 546.019958
+v 285.075775 -40.997097 546.011780
+v 296.213531 -40.996490 546.003540
+v 307.348877 -40.995972 545.995850
+v 318.479828 -40.995651 545.990845
+v 329.605072 -40.995602 545.989868
+v 340.728943 -40.995602 545.989868
+v 351.852844 -40.995602 545.989868
+v 362.976715 -40.995602 545.989868
+v 374.100616 -40.995602 545.989868
+v 385.224487 -40.995602 545.989868
+v 396.348206 -40.995602 545.989868
+v 407.357697 -41.001671 545.995789
+v 418.179688 -41.017971 546.011414
+v 428.845154 -41.042862 546.035034
+v 439.385162 -41.074619 546.065186
+v 449.831329 -41.111553 546.100098
+v 460.214905 -41.151920 546.138367
+v 470.567688 -41.193989 546.178101
+v 480.921234 -41.236023 546.217896
+v 491.307220 -41.276272 546.255859
+v 501.757111 -41.313023 546.290710
+v 512.302551 -41.344559 546.320618
+v 522.974609 -41.369175 546.343872
+v 533.804443 -41.385181 546.359070
+v 544.824158 -41.391384 546.365051
+v 544.824158 -41.391388 545.392517
+v 533.794739 -41.377460 545.372498
+v 522.964783 -41.361156 545.341980
+v 512.292358 -41.336056 545.294922
+v 501.746552 -41.303894 545.234802
+v 491.296204 -41.266357 545.164673
+v 480.909637 -41.225197 545.087769
+v 470.555481 -41.182167 545.007507
+v 460.202118 -41.139030 544.927246
+v 449.818054 -41.097588 544.850098
+v 439.371399 -41.059631 544.779419
+v 428.831116 -41.026939 544.718567
+v 418.165405 -41.001301 544.670715
+v 407.343445 -40.984482 544.639282
+v 396.334167 -40.978222 544.627258
+v 385.210846 -40.978218 544.627258
+v 374.087372 -40.978218 544.627258
+v 362.963837 -40.978218 544.627258
+v 351.840332 -40.978218 544.627258
+v 340.716705 -40.978230 544.627319
+v 329.587708 -40.978867 544.638367
+v 318.451263 -40.980339 544.663513
+v 307.309662 -40.982384 544.698547
+v 296.164764 -40.984737 544.737793
+v 285.018555 -40.987095 544.775085
+v 273.872650 -40.989326 544.808960
+v 262.728699 -40.991310 544.838318
+v 251.587799 -40.992966 544.862122
+v 240.451096 -40.994198 544.879578
+v 229.319336 -40.994957 544.890320
+v 218.192978 -40.995216 544.893860
+v 207.072159 -40.994961 544.890320
+v 195.956741 -40.994190 544.879578
+v 184.846283 -40.992462 544.862122
+v 173.740036 -40.988956 544.838379
+v 162.636993 -40.984303 544.809082
+v 151.535873 -40.979149 544.775146
+v 140.435211 -40.974007 544.737732
+v 129.333206 -40.969299 544.698486
+v 118.228058 -40.965412 544.663330
+v 107.117638 -40.962753 544.638123
+v 95.999786 -40.961685 544.627136
+v 84.876350 -40.962021 544.627014
+v 73.752853 -40.962101 544.627014
+v 62.629349 -40.954781 544.626770
+v 51.505852 -40.937458 544.626038
+v 40.382347 -40.910149 544.624329
+v 29.258846 -40.873055 544.620972
+v 18.135336 -40.826103 544.614563
+v 7.011831 -40.770256 544.603760
+v -4.111667 -40.706192 544.587341
+v -15.235146 -40.633526 544.563416
+v -26.358593 -40.549404 544.529358
+v -37.481983 -40.449486 544.481140
+v -48.605270 -40.327820 544.414246
+v -59.728401 -40.177212 544.323975
+v -70.851265 -39.990883 544.207397
+v -81.973770 -39.766518 544.065979
+v -93.095787 -39.512341 543.908325
+v -104.217911 -39.358795 543.816711
+v -115.340485 -39.315636 543.791687
+v -126.463570 -39.358795 543.816711
+v -137.587494 -39.512341 543.908325
+v -148.712296 -39.766518 544.065979
+v -159.836990 -39.990887 544.207397
+v -170.961441 -40.177212 544.323975
+v -182.085678 -40.327816 544.414246
+v -193.209732 -40.449490 544.481140
+v -204.333633 -40.549404 544.529358
+v -215.457443 -40.633530 544.563416
+v -226.581146 -40.706192 544.587341
+v -237.704803 -40.770256 544.603760
+v -248.828415 -40.825737 544.614441
+v -259.951965 -40.864861 544.619873
+v -271.075500 -40.887276 544.622314
+v -282.199036 -40.894005 544.623108
+v -293.322510 -40.885685 544.622559
+v -304.445953 -40.862663 544.620605
+v -315.569397 -40.826057 544.615967
+v -326.692810 -40.784039 544.608765
+v -337.816132 -40.738300 544.598755
+v -348.939392 -40.691433 544.586426
+v -360.062653 -40.642624 544.571167
+v -371.185760 -40.591656 544.552673
+v -382.308807 -40.538654 544.530579
+v -393.431702 -40.482483 544.504028
+v -404.554657 -40.437244 544.481262
+v -415.677704 -40.410015 544.466431
+v -426.801117 -40.411232 544.466309
+v -437.924896 -40.442383 544.482117
+v -449.049133 -40.506535 544.514893
+v -460.173370 -40.578854 544.547913
+v -471.297455 -40.645874 544.573425
+v -482.421356 -40.707169 544.592590
+v -493.545258 -40.763477 544.606567
+v -504.668945 -40.807766 544.614929
+v -515.792542 -40.840370 544.619690
+v -526.916138 -40.862255 544.622131
+v -538.039612 -40.875584 544.623474
+v -549.182373 -40.900032 544.641541
+v -549.182373 -40.831745 541.678589
+v -537.927856 -40.684479 541.554749
+v -526.806213 -40.657269 541.545654
+v -515.684143 -40.612076 541.527771
+v -504.561188 -40.542782 541.493774
+v -493.437012 -40.444431 541.434021
+v -482.311249 -40.318481 541.343872
+v -471.183289 -40.152142 541.210449
+v -460.052490 -39.935577 541.026367
+v -448.919098 -39.671719 540.800476
+v -437.784912 -39.391666 540.565979
+v -426.657928 -39.245422 540.448975
+v -415.539368 -39.262371 540.464966
+v -404.426392 -39.398308 540.576538
+v -393.317108 -39.630714 540.770752
+v -382.205475 -39.831398 540.940125
+v -371.091736 -40.002361 541.084412
+v -359.976379 -40.150093 541.206726
+v -348.859650 -40.276894 541.307434
+v -337.741852 -40.386166 541.388062
+v -326.623169 -40.481285 541.450867
+v -315.503754 -40.564980 541.498230
+v -304.383636 -40.630913 541.528320
+v -293.262939 -40.667812 541.540833
+v -282.141937 -40.678463 541.543274
+v -271.020630 -40.662464 541.536499
+v -259.899048 -40.618450 541.517761
+v -248.777039 -40.544361 541.480408
+v -237.654190 -40.426838 541.405884
+v -226.530380 -40.267429 541.285400
+v -215.405350 -40.051594 541.106079
+v -204.278534 -39.746181 540.845520
+v -193.149078 -39.301109 540.476685
+v -182.015732 -38.647827 539.971191
+v -170.876770 -37.706779 539.306580
+v -159.730347 -36.412220 538.477966
+v -148.575836 -34.759525 537.513306
+v -137.416336 -32.864300 536.488281
+v -126.268448 -31.283527 535.677734
+v -115.156364 -30.898521 535.486206
+v -104.063210 -31.283569 535.677734
+v -92.988823 -32.864353 536.488220
+v -81.907440 -34.759571 537.513306
+v -70.811874 -36.412254 538.477966
+v -59.705544 -37.706799 539.306580
+v -48.592400 -38.647858 539.971313
+v -37.475368 -39.301125 540.476685
+v -26.356226 -39.746193 540.845520
+v -15.235964 -40.051601 541.106018
+v -4.115125 -40.267441 541.285400
+v 7.005988 -40.423096 541.402832
+v 18.127201 -40.536190 541.474792
+v 29.248449 -40.624973 541.520447
+v 40.369694 -40.696781 541.548706
+v 51.490921 -40.752499 541.564819
+v 62.612099 -40.789005 541.572449
+v 73.733261 -40.807545 541.575500
+v 84.853676 -40.811073 541.578857
+v 95.965599 -40.813641 541.615601
+v 107.068932 -40.821239 541.686890
+v 118.166008 -40.832706 541.782410
+v 129.259125 -40.846863 541.892700
+v 140.350281 -40.862511 542.006470
+v 151.441284 -40.878559 542.111267
+v 162.533890 -40.894337 542.203979
+v 173.629654 -40.909134 542.282410
+v 184.729874 -40.922020 542.345154
+v 195.835541 -40.931850 542.390747
+v 206.947449 -40.937351 542.418335
+v 218.066055 -40.938351 542.427673
+v 229.191406 -40.937534 542.418335
+v 240.323303 -40.935062 542.390503
+v 251.461212 -40.931076 542.344666
+v 262.604370 -40.925655 542.281860
+v 273.751587 -40.918892 542.203491
+v 284.901489 -40.910992 542.111084
+v 296.052460 -40.902180 542.007019
+v 307.202698 -40.892796 541.894165
+v 318.350494 -40.883667 541.784790
+v 329.494110 -40.875690 541.690125
+v 340.631592 -40.869671 541.619324
+v 351.761108 -40.866547 541.582703
+v 362.882904 -40.866302 541.579895
+v 374.004059 -40.866302 541.579895
+v 385.125183 -40.866299 541.579895
+v 396.246155 -40.866310 541.579895
+v 407.253693 -40.873596 541.601501
+v 418.075043 -40.893124 541.658813
+v 428.740967 -40.922806 541.745544
+v 439.282501 -40.960499 541.855957
+v 449.730865 -41.004089 541.984131
+v 460.117249 -41.051430 542.123901
+v 470.473083 -41.100452 542.269470
+v 480.829773 -41.149101 542.414734
+v 491.218811 -41.195415 542.553772
+v 501.671326 -41.237442 542.680542
+v 512.218872 -41.273338 542.789429
+v 522.892212 -41.301231 542.874268
+v 533.722351 -41.319321 542.929504
+v 544.824158 -41.391361 543.020874
+v 544.824158 -41.391277 538.694397
+v 533.418579 -41.069084 538.333069
+v 522.589417 -41.044872 538.243896
+v 511.914490 -41.007374 538.106689
+v 501.363464 -40.958851 537.930786
+v 490.906036 -40.901630 537.725708
+v 480.511292 -40.838097 537.500916
+v 470.148468 -40.770798 537.265869
+v 459.786896 -40.702400 537.030212
+v 449.395691 -40.635807 536.803711
+v 438.943817 -40.574013 536.596069
+v 428.400696 -40.520191 536.416992
+v 417.735626 -40.477345 536.276306
+v 406.917999 -40.447292 536.183472
+v 395.917389 -40.433872 536.148193
+v 384.805206 -40.431168 536.148132
+v 373.692871 -40.429264 536.148071
+v 362.579865 -40.429661 536.155762
+v 351.460724 -40.440971 536.232788
+v 340.334839 -40.462662 536.377686
+v 329.203186 -40.491581 536.572144
+v 318.066681 -40.524487 536.798889
+v 306.926483 -40.557999 537.042480
+v 295.783630 -40.588425 537.285400
+v 284.639252 -40.615288 537.506714
+v 273.495361 -40.638584 537.701111
+v 262.353638 -40.658226 537.864990
+v 251.215714 -40.674076 537.995605
+v 240.082932 -40.685982 538.090271
+v 228.956253 -40.693783 538.147705
+v 217.836456 -40.695900 538.166931
+v 206.723923 -40.686695 538.148621
+v 195.618683 -40.667252 538.092407
+v 184.520340 -40.639549 537.998657
+v 173.428253 -40.605228 537.868225
+v 162.341476 -40.565628 537.702820
+v 151.258774 -40.522400 537.505432
+v 140.178711 -40.476681 537.279663
+v 129.099625 -40.429550 537.030884
+v 118.020119 -40.383930 536.780090
+v 106.938377 -40.343178 536.546692
+v 95.852348 -40.310738 536.347656
+v 84.759758 -40.289944 536.201172
+v 73.657730 -40.262714 536.118408
+v 62.546276 -40.215675 536.088806
+v 51.433407 -40.133350 536.043335
+v 40.320312 -40.014652 535.962891
+v 29.207104 -39.855843 535.835876
+v 18.093937 -39.640587 535.643738
+v 6.981061 -39.332054 535.353394
+v -4.131077 -38.844299 534.894348
+v -15.241207 -38.046478 534.183594
+v -26.346666 -36.811287 533.184265
+v -37.442253 -34.846661 531.765808
+v -48.516140 -31.720407 529.761414
+v -59.542107 -26.851641 526.961487
+v -70.467705 -19.633516 523.140503
+v -81.256943 -11.234211 518.890686
+v -91.881470 -2.242853 514.396118
+v -102.409103 5.462419 510.525085
+v -113.173615 7.329748 509.584229
+v -124.175285 5.465849 510.526093
+v -135.629898 -2.238362 514.397400
+v -147.218063 -11.230618 518.891724
+v -158.777603 -19.631289 523.141113
+v -170.251694 -26.850510 526.961792
+v -181.581924 -31.719755 529.761536
+v -192.822098 -34.846264 531.765869
+v -204.011108 -36.811008 533.184326
+v -215.171600 -38.046257 534.183655
+v -226.316376 -38.849506 534.899658
+v -237.451096 -39.382179 535.404907
+v -248.577026 -39.708534 535.712097
+v -259.696106 -39.884644 535.864746
+v -270.811829 -39.981045 535.941895
+v -281.925415 -40.020508 535.972961
+v -293.037048 -40.007584 535.967529
+v -304.146332 -39.942196 535.924072
+v -315.251678 -39.810646 535.819763
+v -326.351318 -39.606327 535.637817
+v -337.445557 -39.347466 535.396301
+v -348.532806 -39.017265 535.086853
+v -359.611053 -38.596184 534.702271
+v -370.677887 -38.065224 534.238403
+v -381.730927 -37.412247 533.698486
+v -392.766418 -36.617527 533.078613
+v -403.772888 -35.595016 532.325806
+v -414.808228 -34.950493 531.873108
+v -425.890289 -34.796108 531.762634
+v -437.058441 -35.445557 532.210327
+v -448.280060 -36.585449 533.043030
+v -459.497833 -37.681984 533.911011
+v -470.692932 -38.541054 534.653625
+v -481.862488 -39.134026 535.203430
+v -493.011810 -39.522404 535.572937
+v -504.147156 -39.777767 535.807129
+v -515.273254 -39.945946 535.946106
+v -526.392822 -40.048592 536.019165
+v -537.508789 -40.107571 536.055359
+v -549.182373 -40.742317 536.566650
+v -549.182373 -40.636414 528.955811
+v -537.367676 -39.784107 528.307129
+v -525.283081 -38.449509 527.341736
+v -514.159302 -38.181618 527.127197
+v -503.005371 -37.721355 526.726929
+v -491.804504 -36.958996 526.049255
+v -480.528534 -35.691711 524.969177
+v -469.138184 -33.646374 523.372070
+v -457.597198 -30.638645 521.256836
+v -445.923462 -26.900085 518.865662
+v -434.249176 -23.272169 516.698242
+v -422.869354 -21.299671 515.565002
+v -411.986115 -22.039547 515.995911
+v -401.353394 -24.351854 517.346802
+v -390.824188 -27.636608 519.339539
+v -380.135010 -30.216959 520.989685
+v -369.349091 -32.353821 522.441895
+v -358.486694 -34.079765 523.695862
+v -347.563324 -35.424831 524.741577
+v -336.593506 -36.447811 525.587646
+v -325.588928 -37.214394 526.251770
+v -314.557434 -37.773693 526.744812
+v -303.498260 -38.087307 527.010803
+v -292.422119 -38.228840 527.119995
+v -281.335602 -38.240749 527.122620
+v -270.240540 -38.131317 527.026306
+v -259.135468 -37.873119 526.800842
+v -248.013855 -37.369423 526.354614
+v -236.857742 -36.349873 525.462036
+v -225.660416 -34.648029 524.075439
+v -214.401703 -31.913511 522.069336
+v -203.034241 -27.502312 519.179443
+v -191.469055 -20.446135 515.008484
+v -179.560028 -9.491724 508.996002
+v -167.139862 6.435538 500.527191
+v -154.190125 27.028812 489.451782
+v -141.212128 48.494854 477.600098
+v -128.997498 65.448807 468.276825
+v -117.612411 77.443016 462.042999
+v -107.180611 80.176102 460.712769
+v -97.152695 77.443863 462.043243
+v -87.685440 65.455414 468.278687
+v -78.327209 48.505024 477.602997
+v -68.802185 27.016552 489.448364
+v -58.741516 6.413720 500.520935
+v -48.176323 -9.503716 508.992615
+v -37.317699 -20.452574 515.006653
+v -26.321098 -27.506189 519.178406
+v -15.265687 -31.916161 522.068542
+v -4.186437 -34.540836 523.987732
+v 6.901196 -36.029285 525.179565
+v 17.992287 -36.964924 525.978210
+v 29.084999 -37.601612 526.541565
+v 40.178261 -38.053612 526.942505
+v 51.271217 -38.373970 527.215637
+v 62.362373 -38.597958 527.402466
+v 73.444275 -38.761406 527.622742
+v 84.517227 -38.877777 527.902222
+v 95.583260 -38.964424 528.249573
+v 106.646324 -39.072327 528.669373
+v 117.708458 -39.196529 529.133301
+v 128.771179 -39.327667 529.613525
+v 139.835541 -39.457203 530.079041
+v 150.901886 -39.576241 530.497192
+v 161.971542 -39.682869 530.859558
+v 173.045593 -39.776779 531.160950
+v 184.124969 -39.857315 531.397156
+v 195.210312 -39.923248 531.565552
+v 206.301956 -39.972645 531.664795
+v 217.399979 -40.002777 531.695435
+v 228.504059 -40.010372 531.658386
+v 239.613647 -39.993206 531.556091
+v 250.727417 -39.961994 531.387573
+v 261.844025 -39.920574 531.154968
+v 272.961578 -39.869267 530.861694
+v 284.078217 -39.804119 530.516235
+v 295.191833 -39.723415 530.124329
+v 306.300446 -39.630360 529.690308
+v 317.403900 -39.531384 529.241943
+v 328.502686 -39.432400 528.805359
+v 339.596680 -39.338654 528.404114
+v 350.686859 -39.258961 528.065247
+v 361.774902 -39.203072 527.818604
+v 372.862640 -39.178661 527.694092
+v 383.951660 -39.184753 527.685791
+v 395.040741 -39.197590 527.687683
+v 406.021820 -39.233074 527.742615
+v 416.827301 -39.300377 527.882812
+v 427.486511 -39.390091 528.093506
+v 438.028992 -39.493252 528.360535
+v 448.484283 -39.602200 528.670044
+v 458.881775 -39.714596 529.007507
+v 469.253632 -39.831493 529.372925
+v 479.625214 -39.943535 529.721985
+v 490.026703 -40.046936 530.043335
+v 500.490967 -40.141212 530.348511
+v 511.045776 -40.220715 530.610168
+v 521.720154 -40.281879 530.814331
+v 533.082947 -40.785900 531.394836
+v 544.824158 -41.391121 532.044495
+v 544.824158 -41.390911 522.889893
+v 533.082947 -40.785580 522.238525
+v 520.312744 -39.000153 520.477783
+v 509.129578 -38.413666 519.772827
+v 498.582947 -38.281170 519.442261
+v 488.127197 -38.128513 519.078613
+v 477.723450 -37.950783 518.645264
+v 467.344574 -37.754349 518.160400
+v 456.962433 -37.539288 517.642761
+v 446.549164 -37.300217 517.111206
+v 436.086273 -37.056583 516.633057
+v 425.551422 -36.828854 516.254028
+v 414.908508 -36.624031 515.948853
+v 404.129852 -36.462692 515.738220
+v 393.188202 -36.367237 515.646179
+v 382.146240 -36.325085 515.636719
+v 371.119598 -36.349659 515.785950
+v 360.110199 -36.457775 516.142578
+v 349.110229 -36.628967 516.661438
+v 338.112274 -36.837654 517.295532
+v 327.111023 -37.070751 518.003052
+v 316.102478 -37.315613 518.745056
+v 305.084167 -37.560436 519.485962
+v 294.053772 -37.792931 520.187500
+v 283.009827 -38.000828 520.810059
+v 271.954956 -38.178806 521.346497
+v 260.892059 -38.321632 521.796204
+v 249.823929 -38.423584 522.161438
+v 238.752884 -38.488647 522.431763
+v 227.681091 -38.502556 522.600525
+v 216.610168 -38.468334 522.663025
+v 205.541229 -38.391586 522.614197
+v 194.475143 -38.276749 522.450806
+v 183.412460 -38.126808 522.171509
+v 172.353470 -37.943394 521.778198
+v 161.298294 -37.727112 521.274841
+v 150.246750 -37.478027 520.667664
+v 139.198593 -37.196350 519.964905
+v 128.153351 -36.883167 519.178650
+v 117.112328 -36.548939 518.352600
+v 106.076172 -36.214764 517.532837
+v 95.045105 -35.911686 516.768860
+v 84.017113 -35.635639 516.092773
+v 72.984604 -35.242943 515.441223
+v 61.945229 -34.688210 514.778381
+v 50.897907 -33.964512 514.112122
+v 39.844086 -33.052849 513.412354
+v 28.790375 -31.807690 512.477539
+v 17.739183 -30.077179 511.222473
+v 6.693477 -27.563845 509.486877
+v -4.340734 -23.632900 506.931122
+v -15.345613 -16.851990 502.812531
+v -26.258711 -5.170526 496.150574
+v -36.934967 12.098625 486.613953
+v -47.141449 35.016159 473.857391
+v -56.718792 60.744644 459.362885
+v -65.985992 84.823822 447.263245
+v -75.757584 105.795471 441.707886
+v -85.858604 119.456322 440.105499
+v -95.959618 127.619072 439.505066
+v -106.060623 129.545807 439.431946
+v -116.161636 127.619072 439.505066
+v -126.262642 119.456322 440.105499
+v -136.363647 105.795471 441.707886
+v -147.211487 84.823807 447.263245
+v -160.003174 60.739548 459.361450
+v -173.811325 35.013054 473.856445
+v -187.391357 12.118413 486.619476
+v -200.208862 -5.141955 496.158752
+v -212.345291 -16.852726 502.829224
+v -224.041290 -24.368923 507.419189
+v -235.480835 -29.083218 510.563080
+v -246.751907 -31.816303 512.532898
+v -257.905426 -33.178318 513.553467
+v -269.000854 -33.864227 514.072937
+v -280.062225 -34.161377 514.301331
+v -291.096252 -34.164623 514.315491
+v -302.096252 -33.846256 514.094299
+v -313.042938 -33.101494 513.546204
+v -323.896942 -31.693094 512.499329
+v -334.653076 -29.687580 511.056274
+v -345.285187 -27.007442 509.225891
+v -355.747833 -23.509117 506.970581
+v -365.986603 -19.088593 504.272278
+v -375.946930 -13.779679 501.142792
+v -385.581482 -7.594985 497.616760
+v -394.753174 -0.223653 493.502136
+v -404.166077 5.348984 490.419617
+v -414.409302 7.383043 489.288940
+v -426.271149 3.481122 491.427521
+v -439.249512 -4.585763 495.888611
+v -452.430145 -13.808189 501.115143
+v -465.186493 -21.759775 505.868622
+v -477.358734 -27.384489 509.504761
+v -489.077271 -30.917658 511.975708
+v -500.510925 -33.008484 513.531006
+v -511.774780 -34.232777 514.450684
+v -524.353699 -36.900291 516.173340
+v -537.367371 -39.620182 518.023010
+v -549.182373 -40.519470 518.692627
+v -549.182373 -40.397549 505.830658
+v -537.366943 -39.448975 505.131256
+v -524.348022 -36.558876 503.199921
+v -510.340637 -31.455544 500.032532
+v -496.003540 -24.653700 495.903198
+v -483.968170 -19.654583 492.952667
+v -471.189636 -12.026590 488.336029
+v -457.277100 -0.540395 481.710236
+v -442.166473 14.256014 473.354614
+v -426.792206 29.175751 464.914093
+v -412.627319 40.335560 458.563385
+v -400.699951 44.943764 455.942963
+v -391.209961 42.001488 457.636444
+v -383.148773 34.132481 462.138000
+v -375.709137 23.377756 468.258087
+v -367.771454 13.224835 473.983673
+v -359.339325 3.726244 479.311981
+v -350.369202 -4.640118 484.054810
+v -340.890259 -11.591456 488.084930
+v -330.991119 -17.110716 491.387115
+v -320.771515 -21.345093 494.006775
+v -310.285889 -24.288671 495.868744
+v -299.562805 -25.832474 496.829559
+v -288.707245 -26.477730 497.211304
+v -277.765198 -26.428892 497.163147
+v -266.752594 -25.738430 496.717987
+v -255.650879 -24.192039 495.733063
+v -244.393127 -21.147205 493.812744
+v -232.808350 -15.081052 490.094574
+v -220.758148 -5.021766 484.186493
+v -208.074982 9.910296 475.711761
+v -194.607376 30.320547 464.177429
+v -180.682953 54.604267 450.347046
+v -167.529938 79.212906 437.736145
+v -156.565674 102.719398 431.469482
+v -146.464661 121.369888 429.444183
+v -136.363647 134.149246 429.292877
+v -126.262642 143.165543 429.292877
+v -116.161636 149.287491 429.292877
+v -106.060623 151.038361 429.292877
+v -95.959618 149.287491 429.292877
+v -85.858604 143.165466 429.292877
+v -75.757584 134.149292 429.292877
+v -65.656570 121.369865 429.444183
+v -55.555565 102.719383 431.469482
+v -45.682823 79.212761 437.736176
+v -36.076988 54.604706 450.347321
+v -26.034229 30.322824 464.178223
+v -15.481421 10.352216 475.455475
+v -4.661029 -2.210757 482.539642
+v 6.255660 -10.093295 487.063782
+v 17.211039 -15.403829 490.193237
+v 28.185696 -19.236275 492.517670
+v 39.170994 -22.129522 494.321014
+v 50.161129 -24.469263 495.909973
+v 61.152832 -26.451784 497.485260
+v 72.141937 -28.013193 498.945099
+v 83.123199 -29.109865 500.231171
+v 94.098587 -29.843088 501.412262
+v 105.085411 -30.575119 502.674713
+v 116.086021 -31.331953 503.989807
+v 127.098396 -32.073704 505.297516
+v 138.119370 -32.771076 506.538483
+v 149.144592 -33.399128 507.650146
+v 160.172485 -33.952526 508.611877
+v 171.201660 -34.430061 509.409607
+v 182.230759 -34.832539 510.033508
+v 193.258362 -35.161369 510.477875
+v 204.282883 -35.416924 510.740814
+v 215.302780 -35.597584 510.824585
+v 226.316147 -35.698849 510.735382
+v 237.321259 -35.710304 510.484924
+v 248.317474 -35.586075 510.109955
+v 259.301300 -35.323982 509.609619
+v 270.267426 -34.980301 508.964783
+v 281.210907 -34.568901 508.169647
+v 292.127289 -34.097439 507.227905
+v 303.013336 -33.575348 506.153931
+v 313.873260 -33.026852 505.005371
+v 324.713226 -32.479027 503.839600
+v 335.540222 -31.959991 502.710480
+v 346.363831 -31.499207 501.674744
+v 357.195740 -31.124277 500.790131
+v 368.049042 -30.862598 500.110291
+v 378.939331 -30.746187 499.696106
+v 389.884308 -30.824642 499.613434
+v 400.767944 -31.089216 499.788269
+v 411.509613 -31.491398 500.125824
+v 422.130066 -31.972420 500.581451
+v 432.665771 -32.501678 501.176605
+v 443.141449 -33.039700 501.884735
+v 453.557739 -33.529274 502.585541
+v 463.941284 -33.956291 503.263519
+v 474.318207 -34.315022 503.900085
+v 484.714355 -34.612949 504.472351
+v 495.154480 -34.867298 504.954346
+v 506.780487 -36.126591 506.224670
+v 520.312622 -38.999287 508.827362
+v 533.082947 -40.785240 510.585876
+v 544.824158 -41.390694 511.236084
+v 544.824158 -41.390503 497.276031
+v 533.082947 -40.784946 496.629852
+v 520.312378 -38.998665 494.881836
+v 506.780304 -36.126785 492.364136
+v 492.719025 -32.409420 489.158020
+v 479.476654 -29.240068 486.294464
+v 469.107880 -28.716650 485.576630
+v 458.748688 -28.046503 484.776550
+v 448.373566 -27.222359 483.912811
+v 437.955750 -26.249645 482.995239
+v 427.467773 -25.150290 482.031067
+v 416.886749 -23.969637 481.038910
+v 406.263153 -22.880280 480.295563
+v 395.536499 -21.929386 479.691498
+v 384.720123 -21.299454 479.382812
+v 373.945007 -21.178787 479.659332
+v 363.257416 -21.339994 480.337708
+v 352.636383 -21.761389 481.360962
+v 342.063202 -22.431396 482.676514
+v 331.516876 -23.314314 484.219208
+v 320.974884 -24.353476 485.911316
+v 310.415985 -25.479927 487.667328
+v 299.822571 -26.623671 489.400482
+v 289.179932 -27.719498 491.019379
+v 278.477997 -28.714527 492.435303
+v 267.719421 -29.587296 493.616241
+v 256.910553 -30.326584 494.548950
+v 246.058578 -30.849688 495.234924
+v 235.173767 -31.109646 495.708374
+v 224.264771 -31.112959 495.993286
+v 213.335037 -30.870424 496.083252
+v 202.385025 -30.468069 495.924744
+v 191.417587 -29.923874 495.499603
+v 180.435913 -29.234396 494.803223
+v 169.443512 -28.394058 493.837494
+v 158.444138 -27.398510 492.611694
+v 147.441986 -26.248180 491.142548
+v 136.441864 -24.952684 489.456451
+v 125.449333 -23.534693 487.591553
+v 114.474442 -22.054749 485.639862
+v 103.525124 -20.583281 483.690796
+v 92.606491 -19.190229 481.825104
+v 81.703453 -17.608139 479.948486
+v 70.782875 -15.139531 477.713531
+v 59.850266 -11.693949 475.062897
+v 48.929466 -7.536457 472.183990
+v 38.034000 -2.781219 469.202026
+v 27.178148 2.383309 466.259399
+v 16.364586 8.629880 462.759460
+v 5.613566 16.641901 458.269592
+v -5.028538 27.495272 452.151733
+v -15.455522 42.677876 443.532715
+v -25.496813 63.239094 432.252014
+v -35.374138 86.241226 423.397980
+v -45.454552 107.766106 419.933746
+v -55.555565 123.798996 419.191833
+v -65.656570 137.073898 419.191833
+v -75.757584 148.629272 419.191833
+v -85.858604 157.380798 419.191833
+v -95.959618 163.344574 419.191833
+v -106.060623 165.184982 419.191833
+v -116.161636 163.344574 419.191833
+v -126.262642 157.380753 419.191833
+v -136.363647 148.629349 419.191833
+v -146.464661 137.073944 419.191833
+v -156.565674 123.799004 419.191833
+v -166.666656 107.766190 419.933716
+v -176.875275 86.241295 423.397980
+v -188.802292 63.239128 432.251984
+v -202.211166 41.068089 444.457092
+v -215.691895 21.045229 455.843353
+v -228.560059 5.375692 464.693115
+v -240.672089 -5.000856 470.557678
+v -252.135712 -10.477884 473.647980
+v -263.272736 -13.322334 475.240814
+v -274.223816 -14.631596 475.972229
+v -285.027405 -14.770987 476.066345
+v -295.655212 -13.673272 475.488190
+v -306.020386 -11.012407 474.025726
+v -315.923065 -5.986630 471.204285
+v -325.312012 1.086848 467.222321
+v -334.158142 9.812671 462.324280
+v -342.397125 20.006582 456.574097
+v -350.082672 31.204678 450.220978
+v -357.436371 42.645920 443.715240
+v -364.788208 53.562462 437.568756
+v -372.401276 63.849163 432.089172
+v -381.016266 71.157455 428.697021
+v -390.680847 73.794647 427.590088
+v -401.635132 69.708420 429.301697
+v -414.459900 59.262245 434.402039
+v -429.574951 43.832260 442.991150
+v -446.344482 24.282347 453.653229
+v -462.368866 6.329776 463.150360
+v -479.174896 -9.747096 472.261871
+v -495.290619 -22.230783 479.438202
+v -510.302307 -30.705629 484.513672
+v -524.341553 -36.220818 487.892334
+v -537.366577 -39.280109 489.905792
+v -549.182373 -40.277061 490.635925
+v -549.182373 -40.164516 473.584229
+v -537.366150 -39.123585 472.835938
+v -524.335266 -35.910770 470.777985
+v -510.263977 -30.020412 467.273285
+v -495.132294 -20.722092 461.914581
+v -478.683044 -6.726570 454.231079
+v -460.869354 12.053496 444.123932
+v -441.812744 34.639919 431.992767
+v -423.485718 56.912758 420.222534
+v -409.548370 75.493935 413.560638
+v -398.989990 87.919243 411.493927
+v -388.888977 91.838783 410.945496
+v -378.787964 89.913132 411.248016
+v -368.706482 83.759834 412.293671
+v -359.112274 74.554413 414.597229
+v -350.257019 64.369049 418.217651
+v -342.092621 53.387589 423.168671
+v -334.344879 42.155087 429.076874
+v -326.581970 31.031025 435.201965
+v -318.464813 20.626144 440.920013
+v -309.835571 11.512825 445.855347
+v -300.556122 4.674023 449.458130
+v -290.607635 0.918486 451.351837
+v -280.256012 -0.630116 452.092560
+v -269.625336 -0.366231 451.937592
+v -258.754608 1.643517 450.913300
+v -247.589111 5.859732 448.732605
+v -235.937958 13.602770 444.616547
+v -223.470428 27.041306 437.271301
+v -210.495071 44.696060 427.537170
+v -197.921829 64.769928 417.913544
+v -186.868683 85.780807 411.825928
+v -176.767670 104.788223 409.368896
+v -166.666656 120.019333 409.090820
+v -156.565674 133.806305 409.090820
+v -146.464661 146.312378 409.090820
+v -136.363647 157.407806 409.090820
+v -126.262642 165.874374 409.090820
+v -116.161636 171.520126 409.090820
+v -106.060623 173.336868 409.090820
+v -95.959618 171.520126 409.090820
+v -85.858604 165.874374 409.090820
+v -75.757584 157.407791 409.090820
+v -65.656570 146.312347 409.090820
+v -55.555565 133.806259 409.090820
+v -45.454552 120.019287 409.090820
+v -35.353546 104.788177 409.368896
+v -25.252533 85.816620 411.819885
+v -15.198737 67.952820 416.675323
+v -5.083318 54.324371 422.513580
+v 5.169169 44.035809 427.805420
+v 15.555635 35.853668 432.259521
+v 26.051075 28.921089 436.056366
+v 36.640087 22.366283 439.817108
+v 47.326897 15.719793 443.944702
+v 58.095871 9.401481 448.111328
+v 68.917862 3.801840 452.051941
+v 79.737183 -0.386817 455.372345
+v 90.511192 -2.836077 457.923370
+v 101.311363 -4.985184 460.419189
+v 112.173759 -7.400624 463.092529
+v 123.089897 -9.952110 465.828278
+v 134.044968 -12.496696 468.492401
+v 145.019745 -14.898803 470.947083
+v 156.000305 -17.081192 473.119446
+v 166.974716 -19.000410 474.956940
+v 177.933090 -20.639677 476.425446
+v 188.867386 -22.001198 477.507538
+v 199.771149 -23.097174 478.199860
+v 210.638092 -23.900419 478.515381
+v 221.462845 -24.258917 478.506531
+v 232.243469 -24.183355 478.199768
+v 242.970688 -23.677948 477.580261
+v 253.627228 -22.721678 476.605164
+v 264.187500 -21.266876 475.211823
+v 274.641266 -19.459873 473.407318
+v 284.986511 -17.405922 471.244446
+v 295.225677 -15.167058 468.794403
+v 305.384308 -12.874072 466.205505
+v 315.499664 -10.690891 463.635162
+v 325.615540 -8.785731 461.230896
+v 335.777466 -7.304232 459.122711
+v 346.025208 -6.342062 457.409058
+v 356.387329 -5.933267 456.151184
+v 366.880524 -6.058743 455.375916
+v 377.510040 -6.635272 455.094391
+v 388.262115 -7.914197 455.543182
+v 399.065735 -9.977214 456.660889
+v 409.823364 -12.323376 458.054016
+v 420.503571 -14.679862 459.558441
+v 431.055847 -16.818426 460.937775
+v 441.500336 -18.659494 462.173737
+v 451.869385 -20.175455 463.277954
+v 463.741058 -22.949619 465.508453
+v 478.318787 -27.986814 469.688080
+v 492.715118 -32.367207 473.439362
+v 506.780182 -36.127995 476.593506
+v 520.312317 -38.998646 479.035706
+v 533.082947 -40.784794 480.750610
+v 544.824158 -41.390400 481.389618
+v 544.824158 -41.390430 464.144043
+v 533.082947 -40.784866 463.515076
+v 520.312378 -38.999599 461.872192
+v 506.779907 -36.127228 459.469360
+v 492.710052 -32.295502 456.372070
+v 478.304474 -27.783649 452.671967
+v 463.703674 -22.457081 448.530945
+v 449.043427 -16.387575 444.007050
+v 434.454102 -9.719165 439.113708
+v 423.076385 -5.604355 436.657349
+v 412.377594 -1.815693 434.628662
+v 401.495789 2.384748 432.330505
+v 390.498016 6.632511 430.004700
+v 379.550262 10.289780 428.194702
+v 368.772186 12.793047 427.381622
+v 358.159210 14.478240 427.303406
+v 347.737213 15.476165 427.825409
+v 337.524902 15.610805 429.003723
+v 327.527954 14.760193 430.869019
+v 317.731415 12.886343 433.405365
+v 308.093506 10.063371 436.529175
+v 298.545166 6.488722 440.080170
+v 288.999908 2.462438 443.832214
+v 279.370087 -1.676469 447.510620
+v 269.585358 -5.604631 450.847778
+v 259.613861 -9.091108 453.670502
+v 249.421341 -11.685534 455.777740
+v 239.049454 -13.411942 457.221405
+v 228.544235 -14.390012 458.096649
+v 217.936920 -14.673301 458.470490
+v 207.246521 -14.263733 458.378448
+v 196.480133 -13.108856 457.810272
+v 185.637009 -11.159922 456.702759
+v 174.741501 -8.725663 455.056427
+v 163.809753 -5.859815 452.892365
+v 152.859100 -2.594110 450.252808
+v 141.911636 0.990641 447.213135
+v 130.993134 4.760525 443.880066
+v 120.130180 8.535930 440.389191
+v 109.350861 12.080332 436.937805
+v 98.671310 15.181571 433.699890
+v 88.094070 17.684027 430.808868
+v 77.564392 20.367092 427.938904
+v 66.996696 25.144115 424.175934
+v 56.456013 31.553099 419.755615
+v 46.011238 38.381779 415.476288
+v 35.665802 45.293575 411.670166
+v 25.407738 51.812035 408.651459
+v 15.208483 58.052231 406.345093
+v 5.059640 65.175468 404.123749
+v -5.050766 73.904510 402.050873
+v -15.151525 84.817604 400.350952
+v -25.252533 97.769798 399.097046
+v -35.353546 111.958046 398.989777
+v -45.454552 125.887146 398.989777
+v -55.555565 138.887253 398.989777
+v -65.656570 150.858505 398.989777
+v -75.757584 161.235367 398.989777
+v -85.858604 169.045959 398.989777
+v -95.959618 174.117157 398.989777
+v -106.060623 175.755997 398.989777
+v -116.161636 174.117157 398.989777
+v -126.262642 169.045944 398.989777
+v -136.363647 161.235428 398.989777
+v -146.464661 150.858551 398.989777
+v -156.565674 138.887299 398.989777
+v -166.666656 125.887184 398.989777
+v -176.767670 111.958092 398.989777
+v -186.868683 97.307022 399.121155
+v -196.969681 79.975166 401.065430
+v -207.565140 61.092175 405.455200
+v -219.313858 43.345478 412.397003
+v -231.379059 29.096750 419.190460
+v -242.935776 20.225647 423.557037
+v -254.023834 15.018148 426.029480
+v -264.768921 12.433710 427.223297
+v -275.218933 12.027573 427.428375
+v -285.335785 13.833679 426.643890
+v -294.996124 18.215219 424.624451
+v -303.984528 25.869120 420.914062
+v -312.508240 35.449566 416.202148
+v -320.912567 46.014500 411.352722
+v -329.517883 57.067032 406.956573
+v -338.652283 67.970612 403.563293
+v -348.484894 78.082809 401.461853
+v -358.585907 86.807671 400.183777
+v -368.686951 93.968979 399.400238
+v -378.787964 98.306999 399.099609
+v -388.888977 99.138084 399.052063
+v -398.989990 94.076820 399.205078
+v -409.141693 81.130035 399.933014
+v -422.517456 61.889839 404.745575
+v -440.627808 39.308819 414.958801
+v -460.062683 15.662745 426.385345
+v -478.326752 -4.495330 436.239380
+v -495.014038 -19.566044 443.812317
+v -510.234131 -29.479013 449.119324
+v -524.330139 -35.654099 452.582611
+v -537.365845 -38.988991 454.609192
+v -549.182373 -40.066177 455.349670
+v -549.182373 -39.987789 436.786652
+v -537.365601 -38.884991 436.088715
+v -524.327332 -35.472618 434.189117
+v -510.220917 -29.162216 430.982971
+v -494.982086 -19.052336 426.167053
+v -478.249939 -3.691950 419.361786
+v -459.685333 17.087124 410.457031
+v -440.221893 40.727440 400.551880
+v -422.304138 62.957253 392.159882
+v -409.123993 81.845512 388.919983
+v -398.989990 94.647118 388.888794
+v -388.888977 100.049225 388.888794
+v -378.787964 99.736328 388.888794
+v -368.686951 96.256729 388.888794
+v -358.585907 90.468063 388.890015
+v -348.484894 83.417999 389.171051
+v -338.383881 74.932831 389.984497
+v -328.283081 65.260376 391.302490
+v -318.470917 54.960598 393.350616
+v -309.103333 44.667362 396.179077
+v -299.955841 34.902149 399.357880
+v -290.718353 26.738529 402.196686
+v -281.064423 21.951183 403.848267
+v -271.055603 19.995607 404.492096
+v -260.766479 20.527908 404.290100
+v -250.228592 23.541611 403.234589
+v -239.437241 29.467443 401.147125
+v -228.411865 39.232906 397.803040
+v -217.405838 53.847309 393.522705
+v -207.070679 70.343948 390.488708
+v -196.969681 86.256081 388.976257
+v -186.868683 100.604515 388.888794
+v -176.767670 114.400795 388.888794
+v -166.666656 127.567116 388.888794
+v -156.565674 139.973877 388.888794
+v -146.464661 151.160660 388.888794
+v -136.363647 160.618820 388.888794
+v -126.262642 167.636505 388.888794
+v -116.161636 172.076660 388.888794
+v -106.060623 173.524689 388.888794
+v -95.959618 172.076660 388.888794
+v -85.858604 167.636459 388.888794
+v -75.757584 160.618835 388.888794
+v -65.656570 151.160660 388.888794
+v -55.555565 139.973877 388.888794
+v -45.454552 127.567078 388.888794
+v -35.353546 114.400749 388.888794
+v -25.252533 102.026154 388.888794
+v -15.151525 92.432823 388.888794
+v -5.050514 84.900040 389.024719
+v 5.050496 78.739700 389.461243
+v 15.151506 73.524452 389.996399
+v 25.246328 68.598610 390.685120
+v 35.319946 63.006145 391.891235
+v 45.407314 56.745720 393.807068
+v 55.545296 50.192554 396.410309
+v 65.744087 44.258747 399.379974
+v 75.973625 39.958500 402.211151
+v 86.186493 37.792465 404.547729
+v 96.447632 35.525425 407.105438
+v 106.807648 32.409191 410.154205
+v 117.285469 28.570024 413.637054
+v 127.886406 24.213364 417.424866
+v 138.600555 19.550508 421.295837
+v 149.406189 14.771711 425.032318
+v 160.264755 10.132826 428.442963
+v 171.134995 5.843923 431.367859
+v 181.977921 2.071782 433.689178
+v 192.720825 -0.528514 435.225586
+v 203.349274 -1.904201 436.029480
+v 213.861038 -2.202287 436.156555
+v 224.238541 -1.477197 435.592468
+v 234.450363 0.289766 434.279053
+v 244.451981 3.182909 432.129913
+v 254.185028 7.362543 429.039490
+v 263.588043 13.010036 424.916901
+v 272.775116 19.266794 420.190857
+v 281.902466 25.364740 415.361206
+v 291.103790 30.890738 410.898438
+v 300.486755 35.399464 407.110107
+v 310.099182 38.576138 404.120300
+v 319.938385 40.284962 401.929230
+v 329.978973 40.538170 400.477966
+v 340.196808 39.452446 399.698303
+v 350.577789 37.216156 399.532013
+v 361.115326 34.068119 399.930634
+v 371.785217 30.064945 400.909760
+v 382.631256 24.524019 403.023102
+v 393.615814 18.112631 405.961365
+v 405.439056 10.811507 409.868195
+v 419.645752 1.545377 415.770233
+v 434.216125 -7.185321 421.321533
+v 448.925964 -14.969626 426.379913
+v 463.652557 -21.752405 430.938660
+v 478.285278 -27.483242 435.046661
+v 492.704529 -32.197388 438.689911
+v 506.778900 -36.107986 441.733734
+v 520.312378 -39.000595 444.097473
+v 533.082947 -40.785206 445.677246
+v 544.824158 -41.390614 446.293549
+v 544.824158 -41.390972 428.779510
+v 533.082886 -40.785782 428.177582
+v 520.312195 -38.995644 426.642853
+v 506.777130 -36.068253 424.312744
+v 492.699188 -32.078682 421.311615
+v 478.262238 -27.090712 417.725800
+v 463.588654 -20.833961 413.642548
+v 448.774048 -13.139382 409.021362
+v 433.891907 -3.910678 403.750977
+v 419.045837 6.875944 397.824036
+v 404.628082 18.460653 391.565887
+v 391.072235 30.537329 385.920074
+v 379.028748 41.826267 382.064911
+v 368.670532 49.443726 380.725189
+v 358.549561 54.395222 380.531830
+v 348.404388 58.506901 380.638733
+v 338.244080 61.600067 381.052063
+v 328.069855 63.519043 381.749451
+v 317.882935 64.120468 382.725250
+v 307.684784 63.248810 384.002289
+v 297.477448 60.733742 385.632843
+v 287.294800 56.440212 387.722626
+v 277.321533 50.401199 390.562927
+v 267.663147 42.891464 394.286743
+v 258.301697 34.496140 398.742035
+v 248.994797 26.854946 403.166351
+v 239.512375 20.954636 406.866608
+v 229.803421 16.673088 409.657196
+v 219.873230 13.867437 411.486908
+v 209.748764 12.435385 412.373779
+v 199.461060 12.339714 412.364685
+v 189.036453 13.619904 411.502899
+v 178.493576 16.405270 409.799713
+v 167.845886 20.925524 407.221649
+v 157.184464 26.466644 404.043915
+v 146.603638 32.183311 400.664124
+v 136.140640 37.779537 397.319763
+v 125.810577 42.952682 394.206268
+v 115.603958 47.442936 391.443146
+v 105.494179 51.044727 389.087952
+v 95.446793 53.650230 387.120880
+v 85.430969 55.232395 385.487152
+v 75.423729 56.320518 384.076843
+v 65.409348 59.149265 382.633728
+v 55.384785 63.344383 381.260315
+v 45.350006 68.337837 380.108490
+v 35.303028 73.047348 379.329102
+v 25.239304 77.164383 378.923645
+v 15.151506 80.781311 378.787750
+v 5.050496 84.499947 378.787750
+v -5.050514 89.075150 378.787750
+v -15.151525 95.063606 378.787750
+v -25.252533 102.949257 378.787750
+v -35.353546 113.321968 378.787750
+v -45.454552 125.727310 378.787750
+v -55.555565 137.384094 378.787750
+v -65.656570 147.682175 378.787750
+v -75.757584 156.189240 378.787750
+v -85.858604 162.459015 378.787750
+v -95.959618 166.332993 378.787750
+v -106.060623 167.623856 378.787750
+v -116.161636 166.332993 378.787750
+v -126.262642 162.459015 378.787750
+v -136.363647 156.189224 378.787750
+v -146.464661 147.682175 378.787750
+v -156.565674 137.384140 378.787750
+v -166.666656 125.727371 378.787750
+v -176.767670 113.123871 378.787750
+v -186.868683 99.946037 378.787750
+v -196.969681 86.354393 378.787750
+v -207.070679 72.526299 378.826294
+v -217.171692 57.957436 379.805481
+v -227.332687 43.974468 381.516937
+v -237.722107 33.967495 383.264099
+v -248.116882 27.622210 384.497833
+v -258.416138 24.276501 385.160004
+v -268.587067 23.630688 385.298309
+v -278.608093 25.699444 384.914124
+v -288.462555 30.777756 383.935699
+v -298.207916 39.048534 382.397858
+v -308.092682 48.333069 380.951843
+v -318.181824 57.770741 379.879791
+v -328.282867 66.847565 379.114960
+v -338.383881 75.143669 378.792328
+v -348.484894 82.521439 378.787750
+v -358.585907 88.986603 378.787750
+v -368.686951 94.381638 378.787750
+v -378.787964 97.520592 378.787750
+v -388.888977 97.423210 378.787750
+v -398.989990 91.635376 378.787750
+v -409.214600 78.844948 378.901581
+v -422.732025 60.604626 381.968750
+v -440.617432 39.188171 388.771088
+v -460.048859 16.089104 396.914062
+v -478.407776 -4.178195 404.152832
+v -495.020233 -19.121845 409.760956
+v -510.225342 -29.105581 413.829376
+v -524.327026 -35.380314 416.600311
+v -537.365601 -38.818489 418.287598
+v -549.182373 -39.934364 418.909607
+v -549.182373 -39.909935 402.877716
+v -537.365662 -38.794388 402.352844
+v -524.328613 -35.385147 400.925110
+v -510.240173 -29.259878 398.644806
+v -495.101318 -19.689215 395.424500
+v -478.703064 -5.653200 391.149261
+v -460.798889 13.080765 385.750732
+v -441.877747 34.522240 379.273193
+v -423.971375 54.731144 372.865662
+v -409.646362 72.086960 369.184387
+v -398.989990 84.833969 368.686737
+v -388.888977 91.386803 368.686737
+v -378.787964 92.258080 368.686737
+v -368.686951 89.396706 368.686737
+v -358.585907 84.318077 368.686737
+v -348.484894 78.114220 368.686737
+v -338.383881 71.051041 368.686737
+v -328.282867 63.340282 368.686737
+v -318.181824 55.188068 368.687805
+v -308.080811 46.744308 368.866425
+v -297.979797 38.248127 369.251221
+v -287.878784 30.228348 369.693481
+v -277.795746 24.987679 370.003967
+v -267.710938 22.845741 370.134033
+v -257.602478 23.561207 370.082184
+v -247.480057 27.075092 369.856689
+v -237.373703 33.548386 369.482025
+v -227.272705 43.332493 368.981873
+v -217.171692 56.245800 368.686737
+v -207.070679 69.706024 368.686737
+v -196.969681 83.068298 368.686737
+v -186.868683 96.072769 368.686737
+v -176.767670 108.689537 368.686737
+v -166.666656 120.593025 368.686737
+v -156.565674 131.522476 368.686737
+v -146.464661 140.855453 368.686737
+v -136.363647 148.514069 368.686737
+v -126.262642 154.225998 368.686737
+v -116.161636 157.760666 368.686737
+v -106.060623 158.958237 368.686737
+v -95.959618 157.760666 368.686737
+v -85.858604 154.225998 368.686737
+v -75.757584 148.514069 368.686737
+v -65.656570 140.855453 368.686737
+v -55.555565 131.522476 368.686737
+v -45.454552 120.592979 368.686737
+v -35.353546 109.844955 368.686737
+v -25.252533 101.361519 368.686737
+v -15.151525 94.966789 368.686737
+v -5.050514 90.226006 368.686737
+v 5.050496 86.636009 368.686737
+v 15.150883 83.687080 368.693146
+v 25.231361 80.661873 368.904236
+v 35.289158 77.229774 369.348480
+v 45.330883 73.418457 369.958038
+v 55.360458 69.847488 370.692383
+v 65.379433 67.317268 371.535797
+v 75.387589 66.184631 372.490509
+v 85.385323 66.266281 373.552338
+v 95.378105 65.687347 374.671417
+v 105.369080 64.192833 375.886017
+v 115.361008 61.700085 377.237396
+v 125.356636 58.171761 378.751648
+v 135.358673 53.637665 380.426056
+v 145.386093 48.226421 382.267914
+v 155.518692 42.203289 384.380310
+v 165.767578 36.143616 386.608704
+v 176.050903 31.739555 388.486176
+v 186.307617 29.153652 389.787292
+v 196.500427 28.283550 390.389984
+v 206.604141 29.062702 390.209320
+v 216.608353 31.457300 389.213135
+v 226.528458 35.444420 387.457458
+v 236.421326 40.977299 385.123047
+v 246.398682 47.929882 382.539154
+v 256.575226 56.008118 380.112335
+v 266.797363 64.050545 377.995270
+v 277.024048 70.198990 376.435913
+v 287.249817 74.611336 375.153046
+v 297.470306 77.515274 373.924866
+v 307.681946 79.003792 372.787415
+v 317.882294 79.145386 371.765961
+v 328.069855 78.022133 370.876434
+v 338.243683 75.724457 370.128021
+v 348.403198 72.355515 369.526520
+v 358.547852 68.039909 369.078156
+v 368.676605 62.760986 368.792877
+v 378.706085 54.330463 368.859680
+v 390.077698 41.703239 370.912323
+v 403.578888 27.333967 375.626007
+v 418.341339 13.150722 381.755005
+v 433.472260 0.089022 387.745300
+v 448.590851 -10.947388 393.112274
+v 463.514343 -19.708588 397.773010
+v 478.236328 -26.607941 401.819702
+v 492.693939 -31.936228 405.346588
+v 506.774750 -36.010910 408.317749
+v 520.311829 -38.983559 410.625977
+v 533.082886 -40.785519 412.143890
+v 544.824158 -41.391460 412.730499
+v 544.824158 -41.391991 399.462189
+v 533.082886 -40.782887 398.890839
+v 520.311279 -38.966030 397.350922
+v 506.771942 -35.940987 395.046722
+v 492.686554 -31.742205 392.102234
+v 478.209412 -26.051342 388.642548
+v 463.438263 -18.471827 384.689911
+v 448.385132 -8.488243 380.179626
+v 433.013428 4.425989 375.053223
+v 417.443848 19.893822 369.287384
+v 402.407501 36.446205 363.552002
+v 389.276825 52.512177 359.687317
+v 378.744019 65.538559 358.643250
+v 368.677429 73.226067 358.683319
+v 358.550842 78.919670 358.946503
+v 348.409210 83.730110 359.363647
+v 338.253052 87.519951 359.930786
+v 328.082214 90.174362 360.648499
+v 317.896576 91.602982 361.518158
+v 307.696442 91.729660 362.537506
+v 297.482727 90.483917 363.696198
+v 287.257538 87.799744 364.972626
+v 277.024353 83.626541 366.331848
+v 266.787720 77.954628 367.725800
+v 256.553497 70.946381 369.095276
+v 246.328110 64.169205 370.373993
+v 236.118179 58.118668 371.508148
+v 225.929779 52.828217 372.635712
+v 215.767853 48.547619 373.596771
+v 205.635239 45.567863 374.195038
+v 195.532028 44.086670 374.338074
+v 185.455078 44.205814 374.030548
+v 175.399200 45.952808 373.349487
+v 165.358673 49.302551 372.417450
+v 155.328644 54.159340 371.397614
+v 145.309418 59.319771 370.462952
+v 135.302185 63.688595 369.498749
+v 125.304283 67.255539 368.438782
+v 115.312943 69.998405 367.311096
+v 105.325439 71.890129 366.144165
+v 95.338959 72.923363 364.966553
+v 85.350739 73.103035 363.806885
+v 75.357941 72.455956 362.694336
+v 65.355232 72.484459 361.683624
+v 55.340893 73.898117 360.792603
+v 45.315300 76.367172 360.017242
+v 35.277344 79.404892 359.368958
+v 25.223763 82.141800 358.881378
+v 15.148804 84.477081 358.613525
+v 5.050496 86.628105 358.585754
+v -5.050514 89.242401 358.585754
+v -15.151525 92.780472 358.585754
+v -25.252533 97.679703 358.585754
+v -35.353546 104.297127 358.585754
+v -45.454552 112.819298 358.585754
+v -55.555565 122.705109 358.585754
+v -65.656570 131.522476 358.585754
+v -75.757584 138.733795 358.585754
+v -85.858604 144.092178 358.585754
+v -95.959618 147.396820 358.585754
+v -106.060623 148.514099 358.585754
+v -116.161636 147.396820 358.585754
+v -126.262642 144.092178 358.585754
+v -136.363647 138.733795 358.585754
+v -146.464661 131.522507 358.585754
+v -156.565674 122.705109 358.585754
+v -166.666656 112.557846 358.585754
+v -176.767670 101.374748 358.585754
+v -186.868683 89.456512 358.585754
+v -196.969681 76.866943 358.585754
+v -207.070679 63.867496 358.585754
+v -217.171692 50.908016 358.585754
+v -227.272705 38.570869 358.585754
+v -237.373703 29.016764 358.585754
+v -247.474716 22.580332 358.585754
+v -257.575714 19.030857 358.585754
+v -267.676727 18.316690 358.585754
+v -277.777740 20.542690 358.585754
+v -287.878784 25.911493 358.585754
+v -297.979797 33.459499 358.585754
+v -308.080811 41.295010 358.585754
+v -318.181824 49.183594 358.585754
+v -328.282867 56.911606 358.585754
+v -338.383881 64.264183 358.585754
+v -348.484894 71.028763 358.585754
+v -358.585907 76.999107 358.585754
+v -368.686951 81.825104 358.585754
+v -378.787964 84.242638 358.585754
+v -388.888977 82.345871 358.585754
+v -398.991241 75.051666 358.586884
+v -410.636230 62.713070 359.932037
+v -425.704468 46.776176 364.122437
+v -443.405090 28.249151 370.065979
+v -461.670929 8.990664 375.783478
+v -479.051392 -7.797482 380.381012
+v -495.202545 -20.604326 383.860687
+v -510.260620 -29.590624 386.464966
+v -524.331360 -35.479294 388.348114
+v -537.365845 -38.815544 389.548553
+v -549.182373 -39.917492 389.980499
+v -549.182373 -39.944134 378.856598
+v -537.366028 -38.863239 378.439606
+v -524.334595 -35.618053 377.283325
+v -510.283386 -29.992973 375.479767
+v -495.304443 -21.629751 373.021240
+v -479.382385 -10.062189 369.818481
+v -462.481934 4.800825 365.727936
+v -444.866180 21.792032 360.724060
+v -427.563538 38.389965 355.391083
+v -412.051544 52.794296 350.990662
+v -399.330292 64.490494 348.780121
+v -388.888977 72.172981 348.484711
+v -378.787964 75.021187 348.484711
+v -368.686951 73.313126 348.484711
+v -358.585907 68.707176 348.484711
+v -348.484894 62.906807 348.484711
+v -338.383881 56.331093 348.484711
+v -328.282867 49.220589 348.484711
+v -318.181824 41.841354 348.484711
+v -308.080811 34.446541 348.484711
+v -297.979797 27.160416 348.484711
+v -287.878784 20.178883 348.484711
+v -277.777740 14.614946 348.484711
+v -267.676727 12.223944 348.484711
+v -257.575714 12.851196 348.484711
+v -247.474716 16.368931 348.484711
+v -237.373703 22.782326 348.484711
+v -227.272705 32.254444 348.484711
+v -217.171692 44.048859 348.484711
+v -207.070679 56.416523 348.484711
+v -196.969681 68.909241 348.484711
+v -186.868683 81.090775 348.484711
+v -176.767670 92.537071 348.484711
+v -166.666656 103.041359 348.484711
+v -156.565674 112.557785 348.484711
+v -146.464661 120.810463 348.484711
+v -136.363647 127.543243 348.484711
+v -126.262642 132.532974 348.484711
+v -116.161636 135.603271 348.484711
+v -106.060623 136.639984 348.484711
+v -95.959618 135.603271 348.484711
+v -85.858604 132.532928 348.484711
+v -75.757584 127.543228 348.484711
+v -65.656570 120.810463 348.484711
+v -55.555565 112.562233 348.484711
+v -45.454552 104.515846 348.484711
+v -35.353546 98.052246 348.484711
+v -25.252533 93.183334 348.484711
+v -15.151525 89.723175 348.484711
+v -5.050514 87.350189 348.484711
+v 5.050496 85.687202 348.484711
+v 15.146281 84.312775 348.538452
+v 25.217632 82.674934 348.843384
+v 35.268669 80.654709 349.357117
+v 45.304245 78.537491 350.029877
+v 55.326981 77.200233 350.834625
+v 65.337593 76.952042 351.763977
+v 75.335747 78.039070 352.821503
+v 85.325134 79.052391 353.969116
+v 95.310013 79.175537 355.163147
+v 105.293182 78.406998 356.374786
+v 115.277420 76.761032 357.575256
+v 125.265564 74.254601 358.735840
+v 135.260345 70.907196 359.827881
+v 145.264572 66.751381 360.822845
+v 155.280197 62.052490 361.700714
+v 165.304138 58.422363 362.493103
+v 175.339417 56.199875 363.168884
+v 185.392075 55.387218 363.665771
+v 195.469254 55.970474 363.910919
+v 205.577225 57.901508 363.839172
+v 215.718872 61.064514 363.421356
+v 225.892761 65.302444 362.672089
+v 236.094528 70.493790 361.636200
+v 246.317978 76.539642 360.377228
+v 256.555939 83.344360 358.969208
+v 266.800903 90.412903 357.489105
+v 277.045837 96.056358 356.009949
+v 287.284485 100.095612 354.594788
+v 297.512146 102.592476 353.292603
+v 307.725616 103.626755 352.136322
+v 317.923248 103.271156 351.143097
+v 328.104614 101.586456 350.316895
+v 338.270264 98.630875 349.652710
+v 348.420990 94.475510 349.141632
+v 358.55...
[truncated message content] |
|
From: <ian...@us...> - 2008-03-04 21:44:51
|
Revision: 787
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=787&view=rev
Author: iansmith
Date: 2008-03-04 13:44:54 -0800 (Tue, 04 Mar 2008)
Log Message:
-----------
Fixed problems where we were printing errors to standard out rather than logging them.
Fixed parser to handle XML that has comma-based floating point.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/WebStore.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketWaiterThread.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthenticatedSiteResource.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -208,7 +208,7 @@
try {
return new URI(request.getRequestURL().toString());
} catch (URISyntaxException e) {
- e.printStackTrace();
+ Log.error("Couldn't get request URI!",e);
throw new IllegalStateException("Bad request URI?!? " + request.getRequestURI());
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -1113,7 +1113,13 @@
try {
return Float.parseFloat(value);
} catch (NumberFormatException e) {
- throw this.invalidValue(name, value);
+ //for people in other locales
+ value = value.replace(',', '.');
+ try {
+ return Float.parseFloat(value);
+ } catch (NumberFormatException f) {
+ throw this.invalidValue(name, value);
+ }
}
}
}
@@ -1385,7 +1391,13 @@
try {
return Double.valueOf(value).doubleValue();
} catch (NumberFormatException e) {
- throw this.invalidValue(name, value);
+ //other locales
+ value = value.replace(',', '.');
+ try {
+ return Double.valueOf(value).doubleValue();
+ } catch (NumberFormatException f) {
+ throw this.invalidValue(name, value);
+ }
}
}
}
Modified: maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
===================================================================
--- maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -313,4 +313,20 @@
assertEquals(3, possDoc.getSpaceID());
assertEquals(4, possDoc.getThingID());
}
+
+ public void testEuroNumbers() {
+ String source="<foo bar=\"5.678\" grik=\"1,234\"/>";
+ XMLElement elem=new XMLElement();
+ elem.parseString(source);
+ assertEquals(5.678,elem.getFloatAttribute("bar"),0.0001);
+ assertEquals(1.234,elem.getFloatAttribute("grik"),0.0001);
+
+ source="<football><euro cost=\"1,45\"/><american cost=\"145.1\"/></football>";
+ elem.parseString(source);
+ XMLElement euro=elem.getChild("euro");
+ XMLElement american=elem.getChild("american");
+
+ assertEquals(1.45,euro.getDoubleAttribute("cost"),0.0001);
+ assertEquals(145.1,american.getDoubleAttribute("cost"),0.0001);
+ }
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/WebStore.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/WebStore.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/WebStore.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -26,6 +26,7 @@
import com.ogoglio.client.WebAPIClientWire;
import com.ogoglio.client.WebAPIUtil;
import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.Log;
public class WebStore implements MediaStore {
@@ -70,7 +71,8 @@
try {
return new WebAPIClientWire().sendDelete(WebAPIUtil.appendToURI(mediaURI, name), null);
} catch (IOException e) {
- e.printStackTrace();
+ Log.error("Error in delete!",e);
+ //e.printStackTrace();
return false;
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometChannelManager.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -119,7 +119,7 @@
Log.error("No Such Destination!" + msg, e);
}
} catch (Throwable t) {
- t.printStackTrace();
+ Log.error("Error in CometChannelManager.messageDone",t);
}
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -71,9 +71,9 @@
try {
channels[i].sendMessage(message);
} catch (NoSuchDestinationException e) {
- e.printStackTrace();
+ Log.error("distribute() of network channel server, no such destination:",e);
} catch (BlockingQueue.QueueClosedException e) {
- e.printStackTrace();
+ Log.error("distribute() of network channel server, blockingqueue.queueclosed:",e);
}
}
}
@@ -86,7 +86,7 @@
try {
channels[i].sendMessage(message);
} catch (NoSuchDestinationException e) {
- e.printStackTrace();
+ Log.error("distributeExclusively() of network channel server, no such destination:",e);
}
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketWaiterThread.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketWaiterThread.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketWaiterThread.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -49,7 +49,7 @@
ready.clientReady(clientProto);
} catch (IOException e) {
if (!cleaned) {
- e.printStackTrace();
+ Log.error("IOException waiting for client in SimpleSocketWaiter:",e);
}
break;
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -40,10 +40,6 @@
public static final Random RANDOM = new Random();
- private static final long TEST_SIM_INTERVAL_MS = 15000;
-
- private static long lastTestOfSimServers=0L;
-
public static SpaceRecord updateSpace(final long spaceID, final SpaceDocument spaceDocument, SessionFactory sessionFactory) throws PersistException {
HibernateTask task = new HibernateTask() {
public Object run(Session hibernateSession) {
@@ -201,35 +197,45 @@
return findOrAssignSim(spaceRecord, sessionFactory, true);
}
- public static void verifyReachableSims(SimRecord[] puportedReachable, SessionFactory sessionFactory) throws PersistException {
+ public static void verifyReachableSims(SimRecord[] purportedReachable, SessionFactory sessionFactory) throws PersistException {
//let's see if they are ok
- for (int i=0; i<puportedReachable.length;++i) {
- try {
- URI simURI=puportedReachable[i].getSimURI();
- HttpURLConnection connection = (HttpURLConnection) simURI.toURL().openConnection();
- connection.setRequestMethod("GET");
- connection.setAllowUserInteraction(false);
- connection.setConnectTimeout(2000);
- connection.setReadTimeout(3000);
- if (connection.getResponseCode()!=200) {
- Log.warn("Can't get a connection to "+simURI+"! Marking inactive!");
- markNotReachable(puportedReachable[i], sessionFactory);
- } else {
- Log.info("Verified connection to "+simURI);
- }
- } catch (MalformedURLException e) {
- Log.warn("Can't understand the URI "+puportedReachable[i].getSimURI()+"! Marking inactive!");
- markNotReachable(puportedReachable[i], sessionFactory);
- } catch (ProtocolException e) {
- Log.warn("Can't understand the URI protocol "+puportedReachable[i].getSimURI()+"! Marking inactive!");
- markNotReachable(puportedReachable[i], sessionFactory);
- } catch (IOException e) {
- Log.warn("Can't connect to "+puportedReachable[i].getSimURI()+"! Marking inactive! IOException:"+e.getMessage());
- markNotReachable(puportedReachable[i], sessionFactory);
- }
+ for (int i=0; i<purportedReachable.length;++i) {
+ SimRecord someSimRec=purportedReachable[i];
+ verifySingleSimAsReachable(sessionFactory, someSimRec);
}
}
+
+ private static boolean verifySingleSimAsReachable(SessionFactory sessionFactory, SimRecord someSimRec) throws PersistException {
+ try {
+ URI simURI=someSimRec.getSimURI();
+ HttpURLConnection connection = (HttpURLConnection) simURI.toURL().openConnection();
+ connection.setRequestMethod("GET");
+ connection.setAllowUserInteraction(false);
+ connection.setConnectTimeout(2000);
+ connection.setReadTimeout(3000);
+ if (connection.getResponseCode()!=200) {
+ Log.warn("Can't get a connection to "+simURI+"! Marking inactive!");
+ markNotReachable(someSimRec, sessionFactory);
+ return false;
+ } else {
+ Log.info("Verified connection to "+simURI);
+ return true;
+ }
+ } catch (MalformedURLException e) {
+ Log.warn("Can't understand the URI "+someSimRec.getSimURI()+"! Marking inactive!");
+ markNotReachable(someSimRec, sessionFactory);
+ return false;
+ } catch (ProtocolException e) {
+ Log.warn("Can't understand the URI protocol "+someSimRec.getSimURI()+"! Marking inactive!");
+ markNotReachable(someSimRec, sessionFactory);
+ return false;
+ } catch (IOException e) {
+ Log.warn("Can't connect to "+someSimRec.getSimURI()+"! Marking inactive! IOException:"+e.getMessage());
+ markNotReachable(someSimRec, sessionFactory);
+ return false;
+ }
+ }
public static SimRecord findOrAssignSim(final SpaceRecord spaceRecord, SessionFactory sessionFactory, boolean use_network) throws PersistException {
SimRecord rec = findSimFromSpaceIfReachable(spaceRecord, sessionFactory);
@@ -241,14 +247,15 @@
if (assignable.length==0) {
throw new UnableToAssignSimException("Unable to find any sims that we can assign to!");
}
- //has it been a while?
- long now=System.currentTimeMillis();
- if ((now-lastTestOfSimServers<TEST_SIM_INTERVAL_MS) || (!use_network)) {
- return pickSimRandomly(spaceRecord, sessionFactory, assignable);
+ // first check this sim, if it's ok or no network then we just bail out
+ SimRecord randomChoice = pickSimRandomly(spaceRecord, sessionFactory, assignable);
+ if (!use_network) {
+ return randomChoice;
}
- //update the time check
- lastTestOfSimServers=now;
-
+ if (verifySingleSimAsReachable(sessionFactory, randomChoice)) {
+ return randomChoice;
+ }
+ //if we reach here, we have failed on that sim verification, so check ALL of them
verifyReachableSims(findAllReachableSims(spaceRecord, sessionFactory),sessionFactory);
assignable=findAllReachableAndNotRetiredSims(spaceRecord, sessionFactory);
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -122,7 +122,7 @@
try {
saveSpaceDocument(spaceSim.toSpaceDocument());
} catch (IOException e) {
- e.printStackTrace();
+ Log.error("IOException trying to save space document!",e);
}
}
}
@@ -194,7 +194,7 @@
}
return null;
} catch (PersistException e) {
- e.printStackTrace();
+ Log.error("Persist exception trying to getUserRole",e);
return null;
}
}
@@ -223,7 +223,7 @@
mediaService.write(MediaService.getPageContentName(spaceID, thingID, pageID), content);
return true;
} catch (IOException e) {
- e.printStackTrace();
+ Log.error("IOException trying to set page content",e);
return false;
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -195,7 +195,7 @@
listener.requestSave(this);
}
} catch (Throwable e) {
- e.printStackTrace();
+ Log.error("Error during cleanup of space "+space.getSpaceID()+"!",e);
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -109,11 +109,14 @@
ScriptMath math = (ScriptMath) constructorContext.newObject(globalScope, "Math", new Object[0]);
globalScope.put("math", globalScope, math);
} catch (IllegalAccessException e) {
- e.printStackTrace();
+ Log.error("Illegal access in constructor SpaceScriptEngine",e);
+ //e.printStackTrace();
} catch (InstantiationException e) {
- e.printStackTrace();
+ Log.error("InstantiationException in constructor of SpaceScriptEngine",e);
+ //e.printStackTrace();
} catch (InvocationTargetException e) {
- e.printStackTrace();
+ Log.error("Invocation target exception in constructor of SpaceScriptEngine",e);
+ //e.printStackTrace();
} finally {
Context.exit();
}
@@ -364,7 +367,8 @@
constructThingScript(thing);
}
} catch (Throwable e) {
- e.printStackTrace();
+ Log.error("Error in handle space event, trying to run thing script",e);
+ //e.printStackTrace();
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -470,7 +470,7 @@
sendStringResponse(newDoc.toString(), "text/xml", response);
} catch (PersistException e) {
- e.printStackTrace();
+ Log.error("Persist exception in post of ThingsResource",e);
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
@@ -1007,7 +1007,7 @@
sendStringResponse(newDoc.toString(), "text/xml", response);
} catch (PersistException e) {
- e.printStackTrace();
+ Log.error("Persist exception in post of Doors resource",e);
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthenticatedSiteResource.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthenticatedSiteResource.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthenticatedSiteResource.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -25,6 +25,7 @@
import com.ogoglio.appdev.servlet.SiteResource;
import com.ogoglio.persist.AccountRecord;
import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.Log;
public abstract class AuthenticatedSiteResource extends SiteResource {
@@ -72,7 +73,7 @@
}
doPost(request, response, pathElements, authedAccount);
} catch (PersistException e) {
- e.printStackTrace();
+ Log.error("Persist exception in post of Authenticated site resource!",e);
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java 2008-03-02 14:10:50 UTC (rev 786)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java 2008-03-04 21:44:54 UTC (rev 787)
@@ -228,7 +228,7 @@
Log.error("Unknown request payload: " + request.getPayload());
}
} catch (Throwable e) {
- e.printStackTrace();
+ Log.error("Error is MessageProxy.ClientMessageHandler.handleEvent!",e);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-03-02 14:10:47
|
Revision: 786
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=786&view=rev
Author: trevorolio
Date: 2008-03-02 06:10:50 -0800 (Sun, 02 Mar 2008)
Log Message:
-----------
Tweaks:
Make SpaceDuplicator's empty function available to other code.
Add an argument util function that asserts a parameter is greater than a constant.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/Obj.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java 2008-02-29 19:56:33 UTC (rev 785)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java 2008-03-02 14:10:50 UTC (rev 786)
@@ -103,7 +103,7 @@
docToMove.setScale(placedDoc.getScale());
}
- private void emptySpace(long spaceID, WebAPIClient client) throws IOException {
+ public static void emptySpace(long spaceID, WebAPIClient client) throws IOException {
ThingDocument[] thingDocs = client.getThingDocuments(spaceID);
for (int i = 0; i < thingDocs.length; i++) {
client.removePossessionFromSpace(thingDocs[i].getPossessionID());
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java 2008-02-29 19:56:33 UTC (rev 785)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java 2008-03-02 14:10:50 UTC (rev 786)
@@ -147,4 +147,10 @@
assertNotNegative(id);
}
+ public static void assertGreaterThan(int minValue, int value) {
+ if(value <= minValue){
+ throw new IllegalArgumentException("parameter " + value + " is less than " + minValue + " (and it shouldn't be)");
+ }
+ }
+
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/Obj.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/Obj.java 2008-02-29 19:56:33 UTC (rev 785)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/Obj.java 2008-03-02 14:10:50 UTC (rev 786)
@@ -288,7 +288,7 @@
}
/*
- * @param index vertext indices start at 1, not 0
+ * @param index vertex indices start at 1, not 0
*/
public Point3f getTextureVertex(int index) {
if (index == 0 || index > textureVertexCount()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-29 19:56:36
|
Revision: 785
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=785&view=rev
Author: trevorolio
Date: 2008-02-29 11:56:33 -0800 (Fri, 29 Feb 2008)
Log Message:
-----------
Added an example description to the account resource.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-02-29 19:55:57 UTC (rev 784)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-02-29 19:56:33 UTC (rev 785)
@@ -117,6 +117,10 @@
addSubResource(new AccountResource());
}
+ public String getAPIDescription(){
+ return "The root for all account related api";
+ }
+
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws ServletException, IOException {
sendStringResponse("Nothing to see here, folks.\n", "text/plain", response);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-29 19:55:55
|
Revision: 784
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=784&view=rev
Author: trevorolio
Date: 2008-02-29 11:55:57 -0800 (Fri, 29 Feb 2008)
Log Message:
-----------
Added an automatic way to see the resource heirarchy under an og servlet, with optional description.
For example http://localhost:8080/og/account/ogapi/ will produce
/account/
The root for all account related api
/account/template/
/account/template/attachment/
/account/template/*/
/account/validate/
/account/*/
/account/*/space/
/account/*/template/
/account/*/template/LONG/
/account/*/template/LONG/geometry/
/account/*/template/LONG/script/
/account/*/membership/
/account/*/possession/
/account/*/possession/LONG/
/account/*/body/
/account/*/body/default/
/account/*/body/LONG/
/account/*/body/LONG/texture/
/account/*/photo/
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2008-02-29 17:19:16 UTC (rev 783)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2008-02-29 19:55:57 UTC (rev 784)
@@ -50,8 +50,10 @@
public static final String OGOGLIO_BASE_URL_KEY = "ogoglio/baseURL";
- private static final String METHOD_PARAM = "method";
-
+ public static final String API_DESCRIPTOR_PATH = "ogapi";
+
+ public static final String METHOD_PARAM = "method";
+
private SiteResource baseResource = null;
private boolean noCache = true;
@@ -142,7 +144,7 @@
URI requestURI = getRequestURI(request);
String[] pathElements = getPathElements((String) baseResource.getPathElement(), requestURI);
-
+
if (pathElements == null) {
Log.error("Can't understand path elements in " + getClass().getCanonicalName() + "! " + requestURI);
Log.error(" baseResource for errant service() is " + baseResource.getClass().getCanonicalName());
@@ -150,6 +152,13 @@
return;
}
+ if(pathElements.length == 2 && API_DESCRIPTOR_PATH.equals(pathElements[1])){
+ StringBuffer result = new StringBuffer();
+ baseResource.toDocumentation(result, "/", 0);
+ baseResource.sendStringResponse(result.toString(), "text/plain", response);
+ return;
+ }
+
SiteResource requestedResource = getSiteResource(pathElements, baseResource);
if (requestedResource == null) {
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java 2008-02-29 17:19:16 UTC (rev 783)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java 2008-02-29 19:55:57 UTC (rev 784)
@@ -137,4 +137,34 @@
output.write(buffer, 0, read);
}
}
+
+
+ public void toDocumentation(StringBuffer result, String parentPath, int depth) {
+ String pathElementDisplayName = getPathElementDisplayName(pathElement);
+ String path = parentPath + pathElementDisplayName + "/";
+ result.append(path + "\n");
+ String description = getAPIDescription();
+ if(description != null){
+ result.append(description + "\n");
+ }
+ result.append("\n");
+
+ SiteResource[] subs = getSubResources();
+ for (int i = 0; i < subs.length; i++) {
+ subs[i].toDocumentation(result, path, depth + 1);
+ }
+ }
+
+ public String getPathElementDisplayName(Object pathElement){
+ if(LONG_ELEMENT.equals(pathElement)){
+ return "LONG";
+ } else if(WILDCARD_ELEMENT.equals(pathElement)){
+ return "*";
+ }
+ return pathElement.toString();
+ }
+
+ public String getAPIDescription() { //used to generate the og api documentation
+ return null;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-29 17:20:06
|
Revision: 783
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=783&view=rev
Author: trevorolio
Date: 2008-02-29 09:19:16 -0800 (Fri, 29 Feb 2008)
Log Message:
-----------
Fix the seating position for a few templates.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/resources/populate/template-17/template.properties
maven/trunk/ogoglio-server/src/main/resources/populate/template-18/template.properties
maven/trunk/ogoglio-server/src/main/resources/populate/template-19/template.properties
Modified: maven/trunk/ogoglio-server/src/main/resources/populate/template-17/template.properties
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-17/template.properties 2008-02-29 02:05:46 UTC (rev 782)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-17/template.properties 2008-02-29 17:19:16 UTC (rev 783)
@@ -1,7 +1,7 @@
seat: true
seatX: 0
-seatY: -0.5
+seatY: -0.35
seatZ: 0.1
seatRotX: 0
seatRotY: 3.1415
Modified: maven/trunk/ogoglio-server/src/main/resources/populate/template-18/template.properties
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-18/template.properties 2008-02-29 02:05:46 UTC (rev 782)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-18/template.properties 2008-02-29 17:19:16 UTC (rev 783)
@@ -1,8 +1,8 @@
seat: true
seatX: 0
-seatY: -0.6
-seatZ: 0
+seatY: -0.45
+seatZ: -0.2
seatRotX: 0
seatRotY: 1.6
seatRotZ: 0
Modified: maven/trunk/ogoglio-server/src/main/resources/populate/template-19/template.properties
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-19/template.properties 2008-02-29 02:05:46 UTC (rev 782)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-19/template.properties 2008-02-29 17:19:16 UTC (rev 783)
@@ -1,7 +1,7 @@
seat: true
seatX: 0
-seatY: -0.5
+seatY: -0.35
seatZ: 0.1
seatRotX: 0
seatRotY: 3.1415
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-29 02:05:42
|
Revision: 782
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=782&view=rev
Author: trevorolio
Date: 2008-02-28 18:05:46 -0800 (Thu, 28 Feb 2008)
Log Message:
-----------
Remove info panels when the space ui page is authed, so users can unauth and auth and get the right infopanels.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js
Modified: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js 2008-02-28 02:04:33 UTC (rev 781)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js 2008-02-29 02:05:46 UTC (rev 782)
@@ -80,6 +80,7 @@
spaceDiv.innerHTML = "There was an error. This page doesn't specify a space.";
return;
}
+ clearInfoPanels();
requestSpaceDocument(locationParameters['spaceID'], handleSpaceDoc);
}
@@ -203,6 +204,16 @@
}
}
+function clearInfoPanels(){
+ var infoDiv = document.getElementById("infoDiv");
+ if(infoDiv == null){
+ return;
+ }
+ for(var id in infoPanels){
+ infoDiv.removeChild(infoPanels[id]);
+ }
+}
+
function removeInfoPanel(id){
var infoDiv = document.getElementById("infoDiv");
if(infoDiv == null){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2008-02-28 02:04:30
|
Revision: 781
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=781&view=rev
Author: iansmith
Date: 2008-02-27 18:04:33 -0800 (Wed, 27 Feb 2008)
Log Message:
-----------
Some small changes to hopefully detect failed space starts more quickly. The new subtype
of PersistException explicitly demarcates this failure.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/UnableToAssignSimException.java
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2008-02-27 23:10:25 UTC (rev 780)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2008-02-28 02:04:33 UTC (rev 781)
@@ -209,6 +209,7 @@
HttpURLConnection connection = (HttpURLConnection) simURI.toURL().openConnection();
connection.setRequestMethod("GET");
connection.setAllowUserInteraction(false);
+ connection.setConnectTimeout(2000);
connection.setReadTimeout(3000);
if (connection.getResponseCode()!=200) {
Log.warn("Can't get a connection to "+simURI+"! Marking inactive!");
@@ -238,7 +239,7 @@
}
SimRecord[] assignable=findAllReachableAndNotRetiredSims(spaceRecord, sessionFactory);
if (assignable.length==0) {
- throw new PersistException("Unable to find any sims that we can assign to!");
+ throw new UnableToAssignSimException("Unable to find any sims that we can assign to!");
}
//has it been a while?
long now=System.currentTimeMillis();
@@ -252,7 +253,7 @@
assignable=findAllReachableAndNotRetiredSims(spaceRecord, sessionFactory);
if (assignable.length==0) {
- throw new PersistException("Unable to find any reachable sims (after doing a check)!");
+ throw new UnableToAssignSimException("Unable to find any reachable sims (after doing a check)!");
}
return pickSimRandomly(spaceRecord, sessionFactory, assignable);
}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/UnableToAssignSimException.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/UnableToAssignSimException.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/UnableToAssignSimException.java 2008-02-28 02:04:33 UTC (rev 781)
@@ -0,0 +1,13 @@
+package com.ogoglio.persist;
+
+import com.ogoglio.appdev.persist.PersistException;
+
+public class UnableToAssignSimException extends PersistException {
+ public UnableToAssignSimException(String msg) {
+ super(msg);
+ }
+ public UnableToAssignSimException(String msg, Exception e) {
+ super(msg);
+ innerThrowable=e;
+ }
+}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2008-02-27 23:10:25 UTC (rev 780)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2008-02-28 02:04:33 UTC (rev 781)
@@ -43,6 +43,7 @@
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpacePersistTasks;
import com.ogoglio.persist.SpaceRecord;
+import com.ogoglio.persist.UnableToAssignSimException;
import com.ogoglio.sim.Sim;
import com.ogoglio.sim.SpaceSimulator;
import com.ogoglio.sim.script.ScriptContextFactory;
@@ -491,6 +492,10 @@
}
sendStringResponse(list.toString(), "text/xml", response);
+ } catch (UnableToAssignSimException e) {
+ Log.error("Unable to assign sim trying to get list of things (often triggered by space duplication):"+e);
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
} catch (PersistException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-02-27 23:10:25 UTC (rev 780)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-02-28 02:04:33 UTC (rev 781)
@@ -59,6 +59,7 @@
import com.ogoglio.persist.SpaceRecord;
import com.ogoglio.persist.TemplatePersistTasks;
import com.ogoglio.persist.TemplateRecord;
+import com.ogoglio.persist.UnableToAssignSimException;
import com.ogoglio.sim.Sim;
import com.ogoglio.util.Log;
import com.ogoglio.util.StreamUtils;
@@ -441,6 +442,12 @@
Map validationMap = createEmailValidationMap(validationRecord.getEmail(), validationURL, "Ogoglio", getHostPortionOfURLForExternalUse());
String body = mailFormatter.format(validationMap, getTemplate(EMAIL_VALIDATION_TEMPLATE));
+ MailClient mailClient = getInitializedMailClient();
+ mailClient.sendEmail(validationRecord.getEmail(), from, "validate request", body);
+ Log.info("Sent validation email to " + validationRecord.getEmail());
+ }
+
+ private MailClient getInitializedMailClient() {
MailClient mailClient = null;
File mailDir = getSiteInfo().getMailDirectory() ;
if (mailDir == null) {
@@ -448,9 +455,19 @@
} else {
mailClient = new MailClient(mailDir);
}
- mailClient.sendEmail(validationRecord.getEmail(), from, "validate request", body);
- Log.info("Sent validation email to " + validationRecord.getEmail());
+ return mailClient;
}
+
+ private void handleCriticalException(Exception e) {
+ String from = "dont-reply@" + getDomainForExternalUse();
+ String to = "critical@" + getDomainForExternalUse();
+ MailClient mailClient = getInitializedMailClient();
+// try {
+// mailClient.sendEmail(to, from, "criticial exception", e.toString());
+// } catch (MailSendException ex) {
+// Log.error("Unable to send email about critical exception:"+e);
+// }
+ }
public static String getTemplate(String templateName) {
try {
@@ -893,13 +910,18 @@
if (record.getSpaceID() != -1) {
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(record.getSpaceID(), getSessionFactory());
if (spaceRecord != null) {
- SimRecord simRecord = SpacePersistTasks.findOrAssignSim(spaceRecord, getSessionFactory());
- if (simRecord != null) {
- URI thingURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + record.getSpaceID() + "/thing/" + record.getThingID());
- if (!new WebAPIClientWire().sendDelete(thingURI, null)) {
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- return;
+ try {
+ SimRecord simRecord = SpacePersistTasks.findOrAssignSim(spaceRecord, getSessionFactory());
+ if (simRecord != null) {
+ URI thingURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + record.getSpaceID() + "/thing/" + record.getThingID());
+ if (!new WebAPIClientWire().sendDelete(thingURI, null)) {
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
}
+ } catch (UnableToAssignSimException e) {
+ Log.error("Unable to find or assign sim! Space="+spaceRecord.getSpaceID()+"!");
+ throw e;
}
}
}
@@ -943,13 +965,18 @@
if (oldSpaceID != PossessionDocument.NO_SPACE) {
SpaceRecord oldSpaceRecord = SpacePersistTasks.findSpaceBySpaceID(oldSpaceID, getSessionFactory());
if (oldSpaceRecord != null) {
- SimRecord simRecord = SpacePersistTasks.findOrAssignSim(oldSpaceRecord, getSessionFactory());
- if (simRecord != null) {
- URI thingURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + oldSpaceID + "/thing/" + oldThingID);
- if (!new WebAPIClientWire().sendDelete(thingURI, null)) {
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- return;
+ try {
+ SimRecord simRecord = SpacePersistTasks.findOrAssignSim(oldSpaceRecord, getSessionFactory());
+ if (simRecord != null) {
+ URI thingURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + oldSpaceID + "/thing/" + oldThingID);
+ if (!new WebAPIClientWire().sendDelete(thingURI, null)) {
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
}
+ } catch (UnableToAssignSimException e) {
+ handleCriticalException(e);
+ throw e;
}
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2008-02-27 23:10:25 UTC (rev 780)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2008-02-28 02:04:33 UTC (rev 781)
@@ -885,14 +885,14 @@
}
SimRecord[] simRecs = SimPersistTasks.findSims(getSessionFactory());
- Log.debug("Found a list of sims in BaseSimResource, length is " + simRecs.length);
+ //Log.debug("Found a list of sims in BaseSimResource, length is " + simRecs.length);
XMLElement list = new XMLElement("list");
for (int i = 0; i < simRecs.length; i++) {
SimDocument simDoc = DocumentFactory.documentFromRecord(simRecs[i]);
if ((simDoc.isReachable()) && (!onlyServers)) {
try {
URI uri = WebAPIUtil.appendToURI(simDoc.getSimURI(), "space/");
- Log.debug("About to poll " + uri + " to see about it's space list...");
+ //Log.debug("About to poll " + uri + " to see about it's space list...");
WebAPIClientWire wire = new WebAPIClientWire();
wire.setConnectTimeout(2000);
wire.setReadTimeout(2000);
@@ -919,7 +919,7 @@
}
list.addChild(simDoc.toElement());
}
- Log.info("Requested list of sims:"+list.toString());
+ //Log.info("Requested list of sims:"+list.toString());
this.sendStringResponse(list.toString(), "text/xml", response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-27 23:10:24
|
Revision: 780
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=780&view=rev
Author: trevorolio
Date: 2008-02-27 15:10:25 -0800 (Wed, 27 Feb 2008)
Log Message:
-----------
ignore build dir
Property Changed:
----------------
maven/trunk/ogoglio-avserver/server/
Property changes on: maven/trunk/ogoglio-avserver/server
___________________________________________________________________
Name: svn:ignore
+ bin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-27 23:09:28
|
Revision: 779
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=779&view=rev
Author: trevorolio
Date: 2008-02-27 15:09:30 -0800 (Wed, 27 Feb 2008)
Log Message:
-----------
Revved chat widget source
Modified Paths:
--------------
maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml
maven/trunk/ogoglio-avserver/client/html-template/index.template.html
Modified: maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml
===================================================================
--- maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml 2008-02-27 22:56:28 UTC (rev 778)
+++ maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml 2008-02-27 23:09:30 UTC (rev 779)
@@ -5,7 +5,7 @@
<![CDATA[
import com.ogoglio.chat.client.UserStream;
- private var streamURL:String = "rtmp://10.0.2.2:1935/ogoglio/";
+ private var streamURL:String = null;
private var streamName:String = null;
private var username:String = null
private var spaceId:String = null
@@ -21,6 +21,15 @@
trace("Initializing Ogoglio Chat Client");
username = getParameter("username");
spaceId = getParameter("spaceID");
+ streamURL = getStreamURL();
+
+ if(streamURL == null){
+ statusLabel.text = "No stream url.";
+ pushToTalkButton.enabled = false;
+ muteCheckBox.enabled = false;
+ trace("Could not determine stream url");
+ return;
+ }
if(username == null || spaceId == null){
statusLabel.text = "No username or spaceID Parameter";
pushToTalkButton.enabled = false;
@@ -36,9 +45,29 @@
listen();
}
+ public function getStreamURL():String {
+ var paramURL:String = getParameter("streamURL");
+ if(paramURL != null){
+ return paramURL;
+ }
+ var hostname:String = getHostname();
+ if(hostname == null){
+ return null;
+ }
+ return "rtmp://" + hostname + ":1935/ogoglio/";
+ }
-
- public function getParameter(name:String):String {
+ public function getHostname():String {
+ var protocol:String = ExternalInterface.call("window.location.protocol.toString");
+ if(protocol == "file:") {
+ return "127.0.0.1";
+ } else {
+ return ExternalInterface.call("window.location.hostname.toString");
+ }
+ return null;
+ }
+
+ public function getParameter(name:String):String {
if(typeof getUrlParameters()[name] != undefined && getUrlParameters()[name] != null){
return getUrlParameters()[name];
}
@@ -175,7 +204,7 @@
muteCheckBox.enabled = true;
break;
case "NetConnection.Connect.Failed":
- trace("Failed to connect");
+ trace("Failed to connect to " + streamURL);
statusLabel.text = "Failed";
pushToTalkButton.enabled = false;
muteCheckBox.enabled = false;
Modified: maven/trunk/ogoglio-avserver/client/html-template/index.template.html
===================================================================
--- maven/trunk/ogoglio-avserver/client/html-template/index.template.html 2008-02-27 22:56:28 UTC (rev 778)
+++ maven/trunk/ogoglio-avserver/client/html-template/index.template.html 2008-02-27 23:09:30 UTC (rev 779)
@@ -70,7 +70,7 @@
"quality", "high",
"bgcolor", "${bgcolor}",
"name", "${application}",
- "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + "&username=trevor" + "&spaceID=44",
+ "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + "&username=boo&spaceID=44&streamURL=rtmp://localhost:1935/ogoglio/",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-27 22:56:40
|
Revision: 778
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=778&view=rev
Author: trevorolio
Date: 2008-02-27 14:56:28 -0800 (Wed, 27 Feb 2008)
Log Message:
-----------
The compiled flex widget which can talk with Wowza (or any flash media server clone).
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/AC_OETags.js
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat-debug.html
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat-debug.swf
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat.html
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat.swf
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.htm
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.js
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.swf
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/playerProductInstall.swf
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/AC_OETags.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/AC_OETags.js (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/AC_OETags.js 2008-02-27 22:56:28 UTC (rev 778)
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '<object ';
+ for (var i in objAttrs)
+ str += i + '="' + objAttrs[i] + '" ';
+ for (var i in params)
+ str += '><param name="' + i + '" value="' + params[i] + '" /> ';
+ str += '></object>';
+ } else {
+ str += '<embed ';
+ for (var i in embedAttrs)
+ str += i + '="' + embedAttrs[i] + '" ';
+ str += '> </embed>';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat-debug.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat-debug.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat-debug.html 2008-02-27 22:56:28 UTC (rev 778)
@@ -0,0 +1,107 @@
+<!-- saved from url=(0014)about:internet -->
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title></title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style>
+body { margin: 0px; overflow:hidden }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 0;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript" src="history.js"></script>
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+ // MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+ // This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+ // DO NOT MODIFY THE FOLLOWING FOUR LINES
+ // Location visited after installation is complete if installation is required
+ var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+ var MMredirectURL = window.location;
+ document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+ var MMdoctitle = document.title;
+
+ AC_FL_RunContent(
+ "src", "playerProductInstall",
+ "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+ "width", "215",
+ "height", "140",
+ "align", "middle",
+ "id", "OgoglioChat",
+ "quality", "high",
+ "bgcolor", "#869ca7",
+ "name", "OgoglioChat",
+ "allowScriptAccess","sameDomain",
+ "type", "application/x-shockwave-flash",
+ "pluginspage", "http://www.adobe.com/go/getflashplayer"
+ );
+} else if (hasRequestedVersion) {
+ // if we've detected an acceptable version
+ // embed the Flash Content SWF when all tests are passed
+ AC_FL_RunContent(
+ "src", "OgoglioChat-debug",
+ "width", "215",
+ "height", "140",
+ "align", "middle",
+ "id", "OgoglioChat",
+ "quality", "high",
+ "bgcolor", "#869ca7",
+ "name", "OgoglioChat",
+ "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id,
+ "allowScriptAccess","sameDomain",
+ "type", "application/x-shockwave-flash",
+ "pluginspage", "http://www.adobe.com/go/getflashplayer"
+ );
+ } else { // flash is too old or we can't detect the plugin
+ var alternateContent = 'Alternate HTML content should be placed here. '
+ + 'This content requires the Adobe Flash Player. '
+ + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+ document.write(alternateContent); // insert non-flash content
+ }
+// -->
+</script>
+<noscript>
+ <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ id="OgoglioChat" width="215" height="140"
+ codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+ <param name="movie" value="OgoglioChat-debug.swf" />
+ <param name="quality" value="high" />
+ <param name="bgcolor" value="#869ca7" />
+ <param name="allowScriptAccess" value="sameDomain" />
+ <embed src="OgoglioChat-debug.swf" quality="high" bgcolor="#869ca7"
+ width="215" height="140" name="OgoglioChat" align="middle"
+ play="true"
+ loop="false"
+ quality="high"
+ allowScriptAccess="sameDomain"
+ type="application/x-shockwave-flash"
+ pluginspage="http://www.adobe.com/go/getflashplayer">
+ </embed>
+ </object>
+</noscript>
+<iframe name="_history" src="history.htm" frameborder="0" scrolling="no" width="22" height="0"></iframe>
+</body>
+</html>
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat-debug.swf
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat-debug.swf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat.html 2008-02-27 22:56:28 UTC (rev 778)
@@ -0,0 +1,107 @@
+<!-- saved from url=(0014)about:internet -->
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title></title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style>
+body { margin: 0px; overflow:hidden }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 0;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript" src="history.js"></script>
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+ // MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+ // This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+ // DO NOT MODIFY THE FOLLOWING FOUR LINES
+ // Location visited after installation is complete if installation is required
+ var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+ var MMredirectURL = window.location;
+ document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+ var MMdoctitle = document.title;
+
+ AC_FL_RunContent(
+ "src", "playerProductInstall",
+ "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+ "width", "215",
+ "height", "140",
+ "align", "middle",
+ "id", "OgoglioChat",
+ "quality", "high",
+ "bgcolor", "#869ca7",
+ "name", "OgoglioChat",
+ "allowScriptAccess","sameDomain",
+ "type", "application/x-shockwave-flash",
+ "pluginspage", "http://www.adobe.com/go/getflashplayer"
+ );
+} else if (hasRequestedVersion) {
+ // if we've detected an acceptable version
+ // embed the Flash Content SWF when all tests are passed
+ AC_FL_RunContent(
+ "src", "OgoglioChat",
+ "width", "215",
+ "height", "140",
+ "align", "middle",
+ "id", "OgoglioChat",
+ "quality", "high",
+ "bgcolor", "#869ca7",
+ "name", "OgoglioChat",
+ "flashvars","historyUrl=history.htm",
+ "allowScriptAccess","sameDomain",
+ "type", "application/x-shockwave-flash",
+ "pluginspage", "http://www.adobe.com/go/getflashplayer"
+ );
+ } else { // flash is too old or we can't detect the plugin
+ var alternateContent = 'Alternate HTML content should be placed here. '
+ + 'This content requires the Adobe Flash Player. '
+ + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+ document.write(alternateContent); // insert non-flash content
+ }
+// -->
+</script>
+<noscript>
+ <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ id="OgoglioChat" width="215" height="140"
+ codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+ <param name="movie" value="OgoglioChat.swf" />
+ <param name="quality" value="high" />
+ <param name="bgcolor" value="#869ca7" />
+ <param name="allowScriptAccess" value="sameDomain" />
+ <embed src="OgoglioChat.swf" quality="high" bgcolor="#869ca7"
+ width="215" height="140" name="OgoglioChat" align="middle"
+ play="true"
+ loop="false"
+ quality="high"
+ allowScriptAccess="sameDomain"
+ type="application/x-shockwave-flash"
+ pluginspage="http://www.adobe.com/go/getflashplayer">
+ </embed>
+ </object>
+</noscript>
+<iframe name="_history" src="history.htm" frameborder="0" scrolling="no" width="22" height="0"></iframe>
+</body>
+</html>
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat.swf
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/OgoglioChat.swf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.htm
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.htm (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.htm 2008-02-27 22:56:28 UTC (rev 778)
@@ -0,0 +1,21 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<script type='text/javascript' language='JavaScript1.2' charset='utf-8'>
+var v = new top.Vars(top.getSearch(window));
+var fv = v.toString('$_');
+</script>
+</head>
+<body >
+<script type='text/javascript' language='JavaScript1.2' charset='utf-8'>
+document.writeln('<object id=\"utility\" name=\" \" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"" + activexDownloadURL + "#version=7,0,14,0\" width=\"100\" height=\"50\">');
+document.writeln('<param name=\"movie\" value=\"history.swf\" />');
+document.writeln('<param name=\"FlashVars\" value=\"'+fv+'&$_lconid='+top.lc_id+'\"/>');
+document.writeln('<param name=\"quality\" value=\"high\" />');
+document.writeln('<param name=\"bgcolor\" value=\"#FFFFFF\" />');
+document.writeln('<param name=\"profile\" value=\"false\" />');
+document.writeln('<embed id=\"utilityEmbed\" name=\"history.swf\" src=\"history.swf\" type=\"application/x-shockwave-flash\" flashvars=\"'+fv+'&$_lconid='+top.lc_id+'\" profile=\"false\" quality=\"high\" bgcolor=\"#FFFFFF\" width=\"100\" height=\"50\" align=\"\" pluginspage=\"" + pluginDownloadURL + "\"></embed>');
+document.writeln('</object>');
+</script>
+</body>
+</html>
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.js (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.js 2008-02-27 22:56:28 UTC (rev 778)
@@ -0,0 +1,56 @@
+// $Revision: 1.49 $
+// Vars
+try {
+Vars = function(qStr) {
+ this.numVars = 0;
+ if(qStr != null) {
+ var nameValue, name;
+ var pairs = qStr.split('&');
+ var pairLen = pairs.length;
+ for(var i = 0; i < pairLen; i++) {
+ var pair = pairs[i];
+ if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
+ var nameValue = pair.split('=');
+ var name = nameValue[0];
+ var value = nameValue[1];
+ if(this[name] == null && name.length > 0 && value.length > 0) {
+ this[name] = value;
+ this.numVars++;
+ }
+ }
+ }
+ }
+}
+Vars.prototype.toString = function(pre) {
+ var result = '';
+ if(pre == null) { pre = ''; }
+ for(var i in this) {
+ if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
+ result += pre + i + '=' + this[i] + '&';
+ }
+ }
+ if(result.length > 0) result = result.substr(0, result.length-1);
+ return result;
+}
+function getSearch(wRef) {
+ var searchStr = '';
+ if(wRef.location.search.length > 1) {
+ searchStr = new String(wRef.location.search);
+ searchStr = searchStr.substring(1, searchStr.length);
+ }
+ return searchStr;
+}
+var lc_id = Math.floor(Math.random() * 100000).toString(16);
+if (this != top)
+{
+ try {
+ top.Vars = Vars;
+ top.getSearch = getSearch;
+ top.lc_id = lc_id;
+ } catch (e){
+ console.log("Error: " + e);
+ }
+}
+} catch (e) {
+ console.log("Error: " + e);
+}
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.swf
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/history.swf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/playerProductInstall.swf
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/av/playerProductInstall.swf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2008-02-27 02:40:33
|
Revision: 777
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=777&view=rev
Author: iansmith
Date: 2008-02-26 18:40:31 -0800 (Tue, 26 Feb 2008)
Log Message:
-----------
Added log4j cruft to allow sensible debugging.
Added support for finding possessions by ID from the java api.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/src/main/resources/log4j/
maven/trunk/ogoglio-integration-test/src/main/resources/log4j/log4j.properties
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2008-02-27 01:45:14 UTC (rev 776)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2008-02-27 02:40:31 UTC (rev 777)
@@ -162,6 +162,10 @@
return (PossessionDocument[]) results.toArray(new PossessionDocument[0]);
}
+ public PossessionDocument getPossessionDocument(long possessionID) throws IOException {
+ return new PossessionDocument(wire.fetchAuthenticatedXML(descriptor.getPossessionURI(authenticator.getUsername(),possessionID), authenticator.getAuthCookie()));
+ }
+
public PossessionDocument addPossessionToSpace(long possessionID, long spaceID) throws IOException {
PossessionDocument doc = new PossessionDocument(possessionID, null, -1, spaceID, -1);
XMLElement result = wire.sendAuthenticatedXML(descriptor.getPossessionURI(authenticator.getUsername(), possessionID), doc.toString(), "POST", authenticator.getAuthCookie());
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java 2008-02-27 01:45:14 UTC (rev 776)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java 2008-02-27 02:40:31 UTC (rev 777)
@@ -195,6 +195,7 @@
int code = connection.getResponseCode();
if (code != 200) {
if (!followRedirects) {
+ Log.info("About to set redirects back on, but code was:"+code);
//we have to switch it back to prevent problems in the future
//XXX does this mean we can get concurrency problems in wire?
HttpURLConnection.setFollowRedirects(true);
Added: maven/trunk/ogoglio-integration-test/src/main/resources/log4j/log4j.properties
===================================================================
--- maven/trunk/ogoglio-integration-test/src/main/resources/log4j/log4j.properties (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/main/resources/log4j/log4j.properties 2008-02-27 02:40:31 UTC (rev 777)
@@ -0,0 +1,22 @@
+# if you want to have any hope of debugging things, you need this file
+log4j.rootLogger=DEBUG, R
+
+log4j.logger.org.apache=ERROR, R
+log4j.logger.org.hibernate=ERROR, R
+
+log4j.logger.com.ogoglio=DEBUG, R
+log4j.logger.com.ogoglio.space=ERROR, R
+
+#
+# do not want extra copies
+#
+log4j.additivity.com.ogoglio=false
+log4j.additivity.com.ogoglio.space=false
+log4j.additivity.org.apache=false
+
+#R appender, only should be used for stuff not configured here
+log4j.appender.R=org.apache.log4j.ConsoleAppender
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d [%p] %c - %m%n
+
+
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2008-02-27 01:45:14 UTC (rev 776)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2008-02-27 02:40:31 UTC (rev 777)
@@ -80,6 +80,7 @@
import com.ogoglio.xml.ThingDocument;
import com.ogoglio.xml.UserDocument;
import com.sun.org.apache.xalan.internal.xsltc.compiler.Template;
+import com.sun.swing.internal.plaf.basic.resources.basic;
public class ClientTest extends TestCase {
@@ -220,6 +221,7 @@
assertEquals("Test", accountDoc.getFirstName());
assertEquals("Sims", accountDoc.getLastName());
+
assertFalse(accountDoc.isEmailValid());
String emailValidationURL = getLastEmailValidationURL(accountDoc.getEmail());
assertNotNull(emailValidationURL);
@@ -563,6 +565,12 @@
possDoc = basicWebClient.addPossessionToSpace(possDoc.getPossessionID(), spaceDocument.getSpaceID());
assertTrue(possDoc.getThingID() != -1);
+ long pid=possDoc.getPossessionID();
+ //just call the api one other way to get the same document...
+ possDoc=basicWebClient.getPossessionDocument(pid);
+ assertEquals(pid,possDoc.getPossessionID());
+ assertEquals(spaceDocument.getSpaceID(),possDoc.getSpaceID());
+
ThingDocument thingDoc = basicWebClient.getThingDocument(spaceDocument.getSpaceID(), possDoc.getThingID());
thingDoc.setZ(-10);
basicWebClient.updateThing(spaceDocument.getSpaceID(), thingDoc);
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-02-27 01:45:14 UTC (rev 776)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2008-02-27 02:40:31 UTC (rev 777)
@@ -476,12 +476,14 @@
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
String requestedSecret = request.getParameter(SECRET_PARAMETER);
+ Log.info("Got a email validation GET on "+requestedSecret);
if (requestedSecret == null || requestedSecret.length() == 0) {
Log.error("Requested validation with no secret");
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
PendingEmailValidationRecord validationRecord = PendingEmailValidationTasks.findPendingEmailValidationBySecret(requestedSecret, getSessionFactory());
+ Log.info("Email validation "+requestedSecret+" and "+(validationRecord==null));
if (validationRecord == null) {
Log.error("Requested validation with unknown secret: " + requestedSecret);
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-27 01:47:06
|
Revision: 776
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=776&view=rev
Author: trevorolio
Date: 2008-02-26 17:45:14 -0800 (Tue, 26 Feb 2008)
Log Message:
-----------
A rough but working Flex client which works with the wowza module to create a separate audio space for each ogoglio space.
Modified Paths:
--------------
maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml
maven/trunk/ogoglio-avserver/client/html-template/index.template.html
Modified: maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml
===================================================================
--- maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml 2008-02-27 01:44:25 UTC (rev 775)
+++ maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml 2008-02-27 01:45:14 UTC (rev 776)
@@ -5,22 +5,49 @@
<![CDATA[
import com.ogoglio.chat.client.UserStream;
- private var streamURL:String = "rtmp://localhost:1935/videochat/";
- private var streamName:String = "test" + Math.random();
+ private var streamURL:String = "rtmp://10.0.2.2:1935/ogoglio/";
+ private var streamName:String = null;
+ private var username:String = null
+ private var spaceId:String = null
private var netConnection:NetConnection = null;
- private var userStream:UserStream = null;
-
private var mic:Microphone = null;
private var outgoingNetStream:NetStream = null;
+ private var userStreams:Dictionary = new Dictionary();
+
public function initAudio():void {
+ trace("Initializing Ogoglio Chat Client");
+ username = getParameter("username");
+ spaceId = getParameter("spaceID");
+ if(username == null || spaceId == null){
+ statusLabel.text = "No username or spaceID Parameter";
+ pushToTalkButton.enabled = false;
+ muteCheckBox.enabled = false;
+ trace("No username parameter");
+ return;
+ }
+ streamName = spaceId + "-" + username;
+ trace("Stream name is " + streamName);
+
trace("Initializing audio");
initMicrophone();
listen();
}
+
+
+ public function getParameter(name:String):String {
+ if(typeof getUrlParameters()[name] != undefined && getUrlParameters()[name] != null){
+ return getUrlParameters()[name];
+ }
+ if(typeof Application.application.parameters[name] != undefined && Application.application.parameters[name] != null){
+ return Application.application.parameters[name];
+ }
+ return null;
+ }
+
public function initMicrophone():void {
mic = Microphone.getMicrophone();
if(mic == null){
@@ -35,17 +62,10 @@
}
public function startTalk():void {
- if(mic == null){
+ if(mic == null || outgoingNetStream == null){
return;
}
- if(outgoingNetStream == null){
- outgoingNetStream = new NetStream(netConnection);
- prepNetStream(outgoingNetStream);
- outgoingNetStream.attachAudio(mic);
- outgoingNetStream.publish(streamName);
- } else {
- outgoingNetStream.attachAudio(mic);
- }
+ outgoingNetStream.attachAudio(mic);
statusLabel.text = "Talking";
}
@@ -92,10 +112,11 @@
statusLabel.text = "Setup...";
netConnection = new NetConnection();
-
+
var client:Object = new Object();
client.onMetaData = onMetaData;
client.onBWDone = onBWDone;
+ client.streamListChanged = streamListChanged;
netConnection.client = client;
netConnection.objectEncoding = ObjectEncoding.AMF0;
@@ -104,22 +125,50 @@
netConnection.connect(streamURL);
}
+
private function onMuteChange():void {
trace("On mute state change: " + muteCheckBox.selected);
-
- if(userStream == null){
- return;
+ for(var stream:String in userStreams){
+ trace("Muting " + stream);
+ userStreams[stream].setMute(muteCheckBox.selected);
}
- userStream.setMute(muteCheckBox.selected);
}
+
+ public function streamListChanged():String { //called by the server to indicate that streams left or arrived
+ trace("Stream List Changed!");
+ requestStreamList();
+ return "Ok";
+ }
+
+ private function requestStreamList():void{
+ trace("Requesting stream list");
+ netConnection.call("getStreamList", new Responder(handleStreamList), streamName);
+ }
+
+ private function handleStreamList(streamList:String):void {
+ trace("New stream list: " + streamList);
+ var streams:Array = streamList.split(",");
+ for(var i:int = 0; i < streams.length; i++){
+ if(userStreams[streams[i]] == null && streams[i] != streamName){
+ userStreams[streams[i]] = new UserStream(netConnection, streams[i]);
+ }
+ }
+ }
+
private function onNetStatus(evt:NetStatusEvent):void {
switch(evt.info.code) {
case "NetConnection.Connect.Success":
trace("Connection success!");
- statusLabel.text = "Connected";
-
- userStream = new UserStream(netConnection, streamName);
+
+ statusLabel.text = "Publishing...";
+ outgoingNetStream = new NetStream(netConnection);
+ prepNetStream(outgoingNetStream);
+ outgoingNetStream.publish(streamName);
+
+ statusLabel.text = "Streaming...";
+ requestStreamList();
+
statusLabel.text = "Playing";
pushToTalkButton.enabled = true;
@@ -143,6 +192,8 @@
pushToTalkButton.enabled = false;
muteCheckBox.enabled = false;
break;
+ case "NetStream.Publish.Start":
+ case "NetStream.Play.Reset":
case "NetStream.Play.Stop":
case "NetStream.Buffer.Full":
break;
@@ -151,6 +202,22 @@
}
}
+ public function getUrlParameters():Dictionary {
+ var urlParams:Dictionary = new Dictionary();
+
+ var fullUrl:String = ExternalInterface.call("eval","document.location.href");
+
+ var paramStr:String = fullUrl.split("?")[1];
+ if (paramStr != null) {
+ var params:Array = paramStr.split("&");
+ for (var i:int = 0; i < params.length; i++) {
+ var kv:Array = params[i].split("=");
+ urlParams[kv[0]] = kv[1];
+ }
+ }
+ return urlParams;
+ }
+
private function onMetaData(obj:Object):void {
trace("onMetaData");
}
Modified: maven/trunk/ogoglio-avserver/client/html-template/index.template.html
===================================================================
--- maven/trunk/ogoglio-avserver/client/html-template/index.template.html 2008-02-27 01:44:25 UTC (rev 775)
+++ maven/trunk/ogoglio-avserver/client/html-template/index.template.html 2008-02-27 01:45:14 UTC (rev 776)
@@ -70,7 +70,7 @@
"quality", "high",
"bgcolor", "${bgcolor}",
"name", "${application}",
- "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + '',
+ "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + "&username=trevor" + "&spaceID=44",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2008-02-27 01:46:08
|
Revision: 775
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=775&view=rev
Author: trevorolio
Date: 2008-02-26 17:44:25 -0800 (Tue, 26 Feb 2008)
Log Message:
-----------
A rough but working wowza module which supports a separate audio space per ogoglio space.
Modified Paths:
--------------
maven/trunk/ogoglio-avserver/server/build.xml
maven/trunk/ogoglio-avserver/server/src/com/ogoglio/wowza/ChatSpacesModule.java
Added Paths:
-----------
maven/trunk/ogoglio-avserver/server/conf/
maven/trunk/ogoglio-avserver/server/conf/Application.xml
Modified: maven/trunk/ogoglio-avserver/server/build.xml
===================================================================
--- maven/trunk/ogoglio-avserver/server/build.xml 2008-02-26 19:46:01 UTC (rev 774)
+++ maven/trunk/ogoglio-avserver/server/build.xml 2008-02-27 01:44:25 UTC (rev 775)
@@ -1,10 +1,21 @@
<?xml version="1.0"?>
-<project name="OgoglioChatSpaces" default="jar" basedir=".">
+<project name="OgoglioChatSpaces" default="install" basedir=".">
- <property name="wowza.lib.dir" value="/Library/WowzaMediaServerPro/lib"/>
+ <property name="wowza.dir" value="/Library/WowzaMediaServerPro" />
+ <property name="wowza.lib.dir" value="${wowza.dir}/lib"/>
+ <property name="wowza.conf.dir" value="${wowza.dir}/conf"/>
+ <property name="wowza.applications.dir" value="${wowza.dir}/applications"/>
+ <property name="ogoglio.conf.dir" value="${wowza.conf.dir}/ogoglio"/>
+ <property name="ogoglio.applications.dir" value="${wowza.applications.dir}/ogoglio"/>
<property name="jar.filename" value="OgoglioChatSpaces.jar"/>
<property name="core.build.dir" value="bin"/>
+ <target name="install" depends="jar">
+ <mkdir dir="${ogoglio.applications.dir}"/>
+ <mkdir dir="${ogoglio.conf.dir}"/>
+ <copy file="conf/Application.xml" todir="${ogoglio.conf.dir}" />
+ </target>
+
<target name="jar">
<jar jarfile="${wowza.lib.dir}/${jar.filename}">
<fileset dir="${core.build.dir}"/>
Added: maven/trunk/ogoglio-avserver/server/conf/Application.xml
===================================================================
--- maven/trunk/ogoglio-avserver/server/conf/Application.xml (rev 0)
+++ maven/trunk/ogoglio-avserver/server/conf/Application.xml 2008-02-27 01:44:25 UTC (rev 775)
@@ -0,0 +1,69 @@
+<Root>
+ <Application>
+ <!-- Uncomment to set application level timeout values
+ <ApplicationTimeout>60000</ApplicationTimeout>
+ <PingTimeout>12000</PingTimeout>
+ <ValidationFrequency>8000</ValidationFrequency>
+ -->
+ <Connections>
+ <AutoAccept>true</AutoAccept>
+ <AllowDomains></AllowDomains>
+ </Connections>
+ <!--
+ StorageDir path variables
+
+ ${com.wowza.wms.AppHome} - Application home directory
+ ${com.wowza.wms.ConfigHome} - Configuration home directory
+ ${com.wowza.wms.context.VHost} - Virtual host name
+ ${com.wowza.wms.context.Application} - Application name
+ ${com.wowza.wms.context.ApplicationInstance} - Application instance name
+
+ -->
+ <Streams>
+ <StreamType>live-lowlatency</StreamType>
+ <StorageDir></StorageDir>
+ </Streams>
+ <SharedObjects>
+ <StorageDir></StorageDir>
+ </SharedObjects>
+ <Client>
+ <IdleFrequency>-1</IdleFrequency>
+ </Client>
+ <!--
+ <Repeater>
+ <OriginURL></OriginURL>
+ </Repeater>
+ -->
+ <Modules>
+ <Module>
+ <Name>base</Name>
+ <Description>Base</Description>
+ <Class>com.ogoglio.wowza.ChatSpacesModule</Class>
+ </Module>
+ <Module>
+ <Name>properties</Name>
+ <Description>Properties</Description>
+ <Class>com.wowza.wms.module.ModuleProperties</Class>
+ </Module>
+ <Module>
+ <Name>logging</Name>
+ <Description>Client Logging</Description>
+ <Class>com.wowza.wms.module.ModuleClientLogging</Class>
+ </Module>
+ <Module>
+ <Name>flvplayback</Name>
+ <Description>FLVPlayback</Description>
+ <Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
+ </Module>
+ </Modules>
+ <Properties>
+ <!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
+ <!--
+ <Property>
+ <Name></Name>
+ <Value></Value>
+ </Property>
+ -->
+ </Properties>
+ </Application>
+</Root>
Property changes on: maven/trunk/ogoglio-avserver/server/conf/Application.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: maven/trunk/ogoglio-avserver/server/src/com/ogoglio/wowza/ChatSpacesModule.java
===================================================================
--- maven/trunk/ogoglio-avserver/server/src/com/ogoglio/wowza/ChatSpacesModule.java 2008-02-26 19:46:01 UTC (rev 774)
+++ maven/trunk/ogoglio-avserver/server/src/com/ogoglio/wowza/ChatSpacesModule.java 2008-02-27 01:44:25 UTC (rev 775)
@@ -1,55 +1,158 @@
package com.ogoglio.wowza;
-import com.wowza.wms.application.*;
-import com.wowza.wms.amf.*;
-import com.wowza.wms.client.*;
-import com.wowza.wms.module.*;
-import com.wowza.wms.request.*;
-import com.wowza.wms.stream.*;
+import java.util.HashMap;
+import java.util.StringTokenizer;
-public class ChatSpacesModule extends ModuleFastPlay {
+import com.wowza.wms.amf.AMFDataList;
+import com.wowza.wms.application.IApplicationInstance;
+import com.wowza.wms.client.IClient;
+import com.wowza.wms.module.IModuleCallResult;
+import com.wowza.wms.module.ModuleCore;
+import com.wowza.wms.request.RequestFunction;
+import com.wowza.wms.stream.IMediaStream;
- public void doSomething(IClient client, RequestFunction function, AMFDataList params) {
- getLogger().info("doSomething");
- sendResult(client, params, "Hello Wowza");
+public class ChatSpacesModule extends ModuleCore {
+
+ private IApplicationInstance appInstance = null;
+
+ public HashMap clientDataSet = new HashMap();
+
+ public void getStreamList(IClient client, RequestFunction function, AMFDataList params) {
+ getLogger().info("PARAM1: " + params.get(PARAM1));
+
+ String thisStreamName = (String) params.get(PARAM1).getValue();
+ ClientData data = new ClientData(client, thisStreamName);
+
+ ClientData[] clientData = getClientDataSets();
+ StringBuffer results = new StringBuffer();
+ for (int i = 0; i < clientData.length; i++) {
+ if(!clientData[i].getSpaceId().equals(data.getSpaceId())){
+ continue;
+ }
+ results.append(clientData[i].name);
+ if (i != clientData.length - 1) {
+ results.append(",");
+ }
+ }
+
+ sendResult(client, params, results.toString());
+
+ if (addClientData(data)) {
+ getLogger().info("Notifying remote clients");
+ notifyClientsOfStreamChange(data.getSpaceId(), client.getClientId());
+ }
}
-/*
- public void aonAppStart(IApplicationInstance appInstance) {
- String fullname = appInstance.getApplication().getName() + "/" + appInstance.getName();
- getLogger().info("onAppStart: " + fullname);
+
+ class MyResult implements IModuleCallResult {
+ public void onResult(IClient client, RequestFunction function, AMFDataList params) {
+ }
}
- public void aonAppStop(IApplicationInstance appInstance) {
- String fullname = appInstance.getApplication().getName() + "/" + appInstance.getName();
- getLogger().info("onAppStop: " + fullname);
+ private void notifyClientsOfStreamChange(String spaceID, int avoidedClientId) {
+ for (int i = 0; i < appInstance.getClientCount(); i++) {
+ IClient remoteClient = appInstance.getClient(i);
+ if (remoteClient == null) {
+ break;
+ }
+ ClientData data = getClientData(remoteClient.getClientId());
+ if(data == null){
+ getLogger().warn("Have a client with no client data: " + remoteClient.getClientId());
+ return;
+ }
+ if (remoteClient.getClientId() == avoidedClientId || !spaceID.equals(data.getSpaceId())) {
+ continue;
+ }
+ remoteClient.call("streamListChanged", new MyResult());
+ }
}
- public void aonConnect(IClient client, RequestFunction function, AMFDataList params) {
- getLogger().info("onConnect: " + client.getClientId());
+ private ClientData getClientData(int clientID) {
+ synchronized (clientDataSet) {
+ return (ClientData) clientDataSet.get(clientID);
+ }
}
- public void aonConnectAccept(IClient client) {
- getLogger().info("onConnectAccept: " + client.getClientId());
+ private ClientData[] getClientDataSets() {
+ synchronized (clientDataSet) {
+ return (ClientData[]) clientDataSet.values().toArray(new ClientData[0]);
+ }
}
- public void aonConnectReject(IClient client) {
- getLogger().info("onConnectReject: " + client.getClientId());
+ private boolean addClientData(ClientData data) {
+ synchronized (clientDataSet) {
+ if (clientDataSet.containsKey(data.client.getClientId())) {
+ return false;
+ }
+ clientDataSet.put(data.client.getClientId(), data);
+ return true;
+ }
}
- public void aonDisconnect(IClient client) {
- getLogger().info("onDisconnect: " + client.getClientId());
+ private ClientData removeClientData(int clientId) {
+ synchronized (clientDataSet) {
+ return (ClientData) clientDataSet.remove(clientId);
+ }
}
- public void aonStreamCreate(IMediaStream stream) {
- getLogger().info("onStreamCreate: " + stream.getSrc());
+ private class ClientData {
+ String name = null;
+
+ IClient client = null;
+
+ ClientData(IClient client, String name) {
+ this.client = client;
+ this.name = name;
+ }
+
+ String getSpaceId() {
+ return new StringTokenizer(name, "-").nextToken();
+ }
+
+ String getUsername() {
+ StringTokenizer tokenizer = new StringTokenizer(name, "-");
+ tokenizer.nextToken();
+ return tokenizer.nextToken();
+ }
+
}
+ public void onAppStart(IApplicationInstance appInstance) {
+ this.appInstance = appInstance;
+ getLogger().info("Starting the Ogoglio Chat Spaces App: " + getFullAppName());
+ }
+
+ public void onAppStop(IApplicationInstance appInstance) {
+ getLogger().info("Stopping the Ogoglio Chat Spaces App: " + getFullAppName());
+ }
+
+ public void onStreamCreate(IMediaStream stream) {
+ }
+
public void onStreamDestroy(IMediaStream stream) {
- getLogger().info("onStreamDestroy: " + stream.getSrc());
+ ClientData data = removeClientData(stream.getClientId());
+ if (data == null) {
+ return;
+ }
+ notifyClientsOfStreamChange(data.getSpaceId(), stream.getClientId());
}
+ public String getFullAppName() {
+ return appInstance.getApplication().getName() + "/" + appInstance.getName();
+ }
+
+ public void onConnect(IClient client, RequestFunction function, AMFDataList params) {
+ }
+
+ public void onConnectAccept(IClient client) {
+ }
+
+ public void onConnectReject(IClient client) {
+ }
+
+ public void onDisconnect(IClient client) {
+ }
+
public void onCall(String handlerName, IClient client, RequestFunction function, AMFDataList params) {
- getLogger().info("onCall: " + handlerName);
}
-*/
+
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|