Commit Graph

4987 Commits

Author SHA1 Message Date
Par Winzell b174219540 We now build a subset of Narya for execution on Tamarin, the server-side AS3 VM.
- We use the ASC compiler, which works quite differently from compc/mxmlc. It doesn't attempt any mapping between class hierarchy and directory structure. You feed it source, that's it. This compiler is under continuous development, and the one shipped in Flex SDK 3 is buggy, so we supply our own in lib/asc.jar for the time being.
 - Since much of Narya relies on classes that don't exist on Tamarin (e.g. DisplayObject), we have to isolate a specific subset of source. Right now that's done ridiculously explicitly as a list of class files, in etc/asc-files.txt. In the long run we will want to resolve this more elegantly, but there are no trivial solutions at hand.
 - We have not implemented the full flash.utils.describeType() for Tamarin, but rather a subset of its functionality: one method to see if one type derives from another, and another method to extract the public variable names in an object. The environment-specific code has been isolated to com.threerings.util.env.Environment, and build.xml simply copies either Environment.as-tm or Environment.as-fp into place depending on what it's targeting.
 - The ASC compilation links against lib/builtin.abc, which supplies information about core classes such as Object, Array, etc, and lib/thane.abc which is our homegrown emulation library containing e.g. flash.net.Socket and other things we need that's not part of the open-source code Adobe donated to Mozilla, but rather still in their proprietary Flash Player code.

I'm committing thane.abc and builtin.abc directly now, but they will shortly be built by the Thane project and published as maven whatnots. We could auto-publish lib/asc.jar too, but I think we may want more explicit control over how we version that.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5045 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-07 15:33:07 +00:00
Par Winzell 4442cb7bc4 Try a different way of assessing the plainness of an object that doesn't rely on describeType(). This could potentially break games and such in somewhat non-obvious ways. I've tested a number of things locally but the next step is www.dev.whirled.com.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5044 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-07 00:34:23 +00:00
Jamie Doornbos 430b23a5bb regenerated services, notice actionscript stuff has the most changes
(I just noticed marshallers are importing themselves but the flash compiler 
doesn't seem to mind, so committing now)



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5043 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 22:54:58 +00:00
Jamie Doornbos 2ecda5b89a Forgot to check the receivers, needed to do the standard removeGlobals call
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5042 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 22:48:36 +00:00
Jamie Doornbos 61b1f23303 Narya.abc work - refactored GenServiceTask import mechanism in order to generate
clean action script files with no unnecessary imports
* New class ImportSet to facilitate the operations being performed manually
  throughout the code. Also removes the need for rawimports
* Threaded ImportSet through all places where imports and rawimports were used
  and removed magic parameters to control import generation
* Added an ImportSet instance to ServiceListener, this was key to the action 
  script fixes
* Moved all the import tweaking and munging logic into the generate* methods
  and made specific to code being generated (removed overreaching stuff
  from ServiceMethod, this was part of the problem)
* Removed blanket imports from tmpl files
* Removed unused methods
* Fixed tabs from last commit
* Quick and dirty script to check for unused imports


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5041 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 22:44:36 +00:00
Par Winzell aeafaccd66 I think this depencency on Stage is obsolete now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5040 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 19:45:47 +00:00
Par Winzell 971ec75567 Some manual unused-import removal. I think one or two of these might need further Jamie lovin' but I want to get ABC compilation running.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5039 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 17:12:42 +00:00
Par Winzell 15c16a40b6 Running genreceiver and genservice with Jamie's spiffed-up generators.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5038 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 17:03:54 +00:00
Par Winzell 5924aac198 Running genreceiver and genservice with Jamie's spiffed-up generators.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5037 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 16:59:04 +00:00
Jamie Doornbos bf501313f1 Narya.abc work - get rid of unused imports in generated service targets:
* ServiceMethod import options:
  - Made argument type imports ignore first N args (0 for old behavior)
  - Made marshaller listener imports optional
* Added InvocationTask._verbose and several dumps of current imports to help 
  track down future superfluous imports
* Made the import of ServiceListener method arguments' types optional
* Wrapped up most of processService code into protected inner class 
  ServiceDescription and made configurable:
  - Optional import of the types of the first arguments of the service methods
  - Optinoal import of the types of listener method arguments
* Changed generate methods to take the service class and construct their own
  local ServiceDescription configured for their target
* Removed global import of service class and do it explicitly where required
  (via method addServiceImport)
* Made some imports conditional
  - InvocationResponseEvent for mashallers only if service has some listeners
  - InvocationException for providers only if service has some methods with 
    listener arguments
* Removed unused variables and imports


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5036 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-05 22:53:31 +00:00
Charlie Groves c4af1d257c Add dependency on google-collect for the bureaucracy
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5035 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-05 21:10:11 +00:00
Par Winzell 5cae3fb3a3 This is no longer useful to us.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5034 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-01 00:00:27 +00:00
Jamie Doornbos 3d65f679e8 Fixed I/O in BureauRegistry and removed synchronization
* Keep an Invoker member
* Added internal Launcher class to run ProcessBuilder.start on the invoker 
  thread because it is blocking
* Removed synchronized from methods, all ooo-servers are single threaded, 
  hurray!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5033 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-30 18:27:45 +00:00
Jamie Doornbos e74035a05c Bureaucracy smoke test and resulting bug fixes
* Added RegistryTester smoke test which randomly creates and destroys agents 
  in batches
* Fixed bug where correct agent id was never making it to client
* Implemented Bureau.toString (+refactored summarize method)
* Fixed nasty bug due to my assumption that SafeSubscriber =~ Subscriber, they 
  are in fact completely different


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5032 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-30 17:55:40 +00:00
Jamie Doornbos 490b5b9764 Bureaucracy: Fixed my TODO about using google's Maps and Sets utils
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5031 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 19:02:13 +00:00
Jamie Doornbos f41233c5ac Bureaucracy review updates and hello world test
* Fleshed out client-side Agent class, made abstract
* Delegate the creation of the bureau director to subclasses of BureauClient
* Moved BureauDirector's BureauReceiver and Subscriber implementations to 
  anonymous classes that delegate to protected methods.
* Use SafeSubscriber
* Added new service method for notiyfing the server when the creation of an
  agent fails so that the registry is not perpetually waiting
* Made BureauCredentials more conformant
* Made BureauRegistry respond properly to client logging off
* Got rid of superfluous uses of safeToString
* Changed Launcher to CommandGenerator and now use ProcessBuilder and 
  copyMergedOutput
* Changed bureau process parameters to server name and port instead of URL


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5030 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 18:34:51 +00:00
Charlie Groves 938d7f5994 Share a single MethodFinder between all instances of a subclass of PlaceManager as they can be large enough constitute the bulk of a PlaceManager
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5029 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 18:07:04 +00:00
Tom Conkling f6e95780f5 created KeyboardCodes. Most of these constants are mysteriously missing from flash.ui.Keyboard, where they're supposed to be.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5028 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 00:58:39 +00:00
Jamie Doornbos 74dac11f97 Bureaucracy
* Fixed signature of Receiver methods
* Implemented create/destroy mechanism and bootstrap request in BureauDirector
* Added BureauContext class to expose bureau information on top of usual 
  presents stuff
* Added BureauContext implementation in BureauClient
* Added code to kick off the director when the client logs on
* Added credentials for a bureau logon, which is just a token passed to 
  command line launcher
* Added concept of bureau types to distinguish between executable and command 
  line arguments; includes interface BureauRegistry.Launcher
* Implemented backend for the registry


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5027 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-28 18:34:57 +00:00
Jamie Doornbos b10cc3643d Removed @Override on interface methods.
the deployment build must be using stricter options (need to find them so I can replicate these issues locally in the future)

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5026 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-25 20:39:51 +00:00
Jamie Doornbos e7374452cd Skeleton for bureau/agent architecture (https://wiki.earth.threerings.net/display/whirled/The+Bureacracy)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5025 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-25 20:22:21 +00:00
Jamie Doornbos 5d02ac7306 Fix runjava which was out of date.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5024 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-25 00:20:44 +00:00
Ray Greenwell 8b673c08aa Layabout checkin: asdoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5023 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 21:54:56 +00:00
Ray Greenwell 7cd7cc48cb Swap the order of the generatorFn and callbackFn args.
Made the generatorFn optional, in case the source values are already ready-to-go,
although 99% of the time it's going to be better to use the generator function
to get things ready to go because MultiLoader will take care of figuring out
the sources structure.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5022 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 21:47:00 +00:00
Michael Bayne 249c4bb42d Nixed some now redundant casts.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5021 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 20:00:09 +00:00
Michael Bayne 0fb090ea52 Let's also make that a warning now that we don't think it's going to happen as
a matter of course on old VMs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5020 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 19:59:07 +00:00
Michael Bayne 9700aa13cd Use a method available since JDK1.1 to determine our innerness and simplify the
logic. If we're inner and we're not static, we have a problem.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5019 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 19:58:16 +00:00
Michael Bayne 290d7a9ea1 Freak not out if we fail to determine if our class is local, anonymous or a
non-static member. Pre-1.5 VMs can't do all of these things and Retroweaver
freaks out at runtime when put to the task.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5018 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 19:34:22 +00:00
Ray Greenwell b65bdd47e1 Use a Timer instead of ENTER_FRAME.
This is a potentially more dangerous change, but nothing
seems awry. Eyes peeled!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5017 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 18:17:42 +00:00
Ray Greenwell b367372dc6 Gah, I tried to abort the last commit so I could make this change,
and instead my checkin message got mangled.

*clearing throat*
..So our old way of doing things was pointlessly waiting a frame to handle
network events.
We also ran object subscribe/unsubscribe requests through the same queue,
and now those are processed immediately. Everything seems ok, but let's
keep an eye out.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5016 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 18:07:59 +00:00
Ray Greenwell 19831db930 Stop waiting for ENTER_FRAME to process incoming messages.
This was residual from the initial conversion from Java, but I don't think
it's very necessary on the flash side, and Zell is working to decouple
the presents layer from flash-player specific classes and events like
ENTER_FRAME.
So now we just process everything immediately.
I did some tests, it seems that the flash player dispatches ENTER_FRAME,
then it dispatches any network events, then the frame is rendered.
So our old way of doing things was pointlessly 


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5015 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 18:04:50 +00:00
Ray Greenwell bf55267dac Let's handle the common case first here too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5014 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 17:35:09 +00:00
Ray Greenwell cd9126b55c - Proper casting.
- Handle the common case first.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5013 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 17:32:38 +00:00
Andrzej Kapolka 630d74a5eb Added static methods as in EnumSet, folded in updateSize since it
was only called in one place.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5012 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 03:36:35 +00:00
Andrzej Kapolka 86e09be9c6 Added a StreamableEnumSet class (not actually derived from
EnumSet, because Java's implementation of that is private).  The 
performance could conceivably be improved; Java uses two 
implementations, one using a single long to store the element 
flags (for enumerated types with 64 or fewer constants) and one 
using an array of longs (for types with more than 64).  This uses 
an array of bytes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5011 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 02:47:14 +00:00
Michael Bayne 4328cc7875 Yohoho needs to replace the auth response data on the fly. Allow it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5010 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-22 21:23:37 +00:00
Ray Greenwell 5b1b22b955 Removed cruft that long ago was promoted to its own file.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5009 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-22 17:59:52 +00:00
Mike Thomas 4a25cc3f46 If we fail spectacularly in checking localness, let's print out what class is having trouble, since the java libs don't actually do that.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5008 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-21 18:43:30 +00:00
Tom Conkling 8311762471 I blame the beer
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5007 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-19 01:39:55 +00:00
Tom Conkling c6d763127d StringUtil.parseBoolean
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5006 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-19 01:32:21 +00:00
Tom Conkling ab02c0ee30 StringUtil.parseNumber
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5005 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-19 01:06:41 +00:00
Tom Conkling 3b863e30fa Per Ray's suggestion, this returns undefined, rather than null, if the object is not found
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5004 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-17 19:14:42 +00:00
Tom Conkling 855b4f27d4 copy-paste typo fix
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5003 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-17 19:11:12 +00:00
Tom Conkling f0bf02796e ArrayUtil.findIf convenience function
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5002 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-17 19:04:18 +00:00
Michael Bayne f017673964 Disallow streaming of non-static inner classes to avoid the inevitable
freakoutery as we try to stream the instance's implicit reference to its
containing class.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5001 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-17 02:48:04 +00:00
Michael Bayne 784b087ed0 Stop our peer refresher interval when we are shut down.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5000 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-16 22:22:09 +00:00
Ray Greenwell 6736267388 Jamie has discovered that the MultiLoader can sometimes be gc'd before
calling the callback. Loaders are not supposed to do this, but that may
only be when loading over the network and not from a ByteArray.

We know that retaining a reference to the MultiLoader fixes it, but
that increases the burden on the users of this class. Let's try this
instead, I think it will work: just retain references to active MultiLoaders
in the class.

Jamie's going to test this, as well.

(Also: in foreach mode, free references to results after reporting them.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4999 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-15 21:08:25 +00:00
Ray Greenwell 9f51434a57 Bugfix: in foreach mode, we need to report back if a source is already complete.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4998 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-14 03:00:31 +00:00
Charlie Groves 1c4cfe501f Delay notifying the client about the under ass rug yanking until we're in finishResolved in case UserChangeListener.changeReported performs a long operation off the omgr thread and allows the client to respond before _clobj has actually been switched
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4997 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-11 21:04:48 +00:00
Nathan Curtis b82dbb416c Modify requestTell() to accept an optional localFeedback parameter, defaulting to
ChatCodes.PLACE_CHAT_TYPE that gets used for any feedback generated from the tell process.  This 
will allow chat systems that display tells in a custom way (tabs) to distinguish tell-related
feedback from other feedback.  


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4996 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-11 17:03:24 +00:00