Commit Graph

408 Commits

Author SHA1 Message Date
Michael Bayne a34e500ea6 Added startTransaction() and commitTransaction() to the InvocationDirector so
that EZGame can batch up state change requests which are all invocation service
requests.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4844 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-17 21:33:05 +00:00
Michael Bayne 6b46554eaf Widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4843 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-17 21:06:17 +00:00
Nathan Curtis 57421c8a58 There are many ways I could rant about this, but I'm going to try to keep it short and
informative (and clean ><)...

While testing the ability to go straight to someone in a game from My Whirled, I was getting 
decoding streaming problems (but only sometimes) when fetching the game data.  After many hours
of looking for the problem and swearing up and down that it was nothing but consistent, malicious 
bitrot, I've tracked it down to this.

In Underwhirled Drift (which is the game I was testing this on), I have a couple of property arrays
that get set when the game is first started up with this:

    _control.set(PLAYER_STATE, new Array(numPlayers));

This allows me to fill in the proper indices at a later time in random order.  This was working
fine for multi-player games, and after what I've discovered here, I think I can get away with 
something simpler, but that can wait for later.

When this was getting encoded, the expected effect would be to encode a TypedArray with a null
in each spot that is defined in the source array (numPlayers long).  In fact, it was creating an
empty, zero length TypedArray.  I'm not sure why - but that was confusing the system somewhere
along the line so that when that set of bytes was read back from the server on another client 
(for instance, when fetching the EZGameObject when trying to join an in-progress game).  Of course,
zero-length TypedArrays should go over the wire just fine, so I'm not entirely convinced that I've
tracked down the entire problem (or if that is in fact the issue, then it needs to be addressed).

The diffs here will cause the encoding and decoding to correctly pull nulls out of the array, and 
put them in the TypedArray.  The moral of this story is to watch out for this construct:

    for each (var obj :Object in arr) {
    }

...it may not always be doing what you would rightfully expect...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4827 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-18 23:29:49 +00:00
Michael Bayne 810969f6f9 Pass a message along with a FailureResponse.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4819 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-22 01:15:39 +00:00
Michael Bayne 9a150ebcda Some widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4818 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-22 01:12:02 +00:00
Robert Zubeck 59086147e6 A signed 64-bit integer can be stored as two 32-bit integers in Actionscript, but converting
them to a single number becomes inconvenient for values larger than an single int, and tricky 
when the value is negative (i.e. in two's complement split into two words, with sign bit only
in the high int). 

Instead of splitting a long into two ints, we store it internally as a byte array that corresponds 
exactly to Java's serialized version (sequence of eight bytes, high byte first), and we provide 
accessors to convert to and from Actionscript numbers. This makes Java Long values readable in 
Actionscript, and vice versa.

Unfortunately, Actionscript does not have a native 64-bit integer - the closest equivalent is the 
Number class. Since this is a double float with a 52-bit mantissa, very large long values will 
suffer precision loss during conversion. 




git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4811 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-10 20:49:03 +00:00
Robert Zubeck 77ef41cb42 Separated out chat message listener functionality, and subsequent chat message
processing. This enables subclasses of ChatDirector to listen for their own
types of chat messages, but call the superclass to process them.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4810 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-10 20:33:03 +00:00
Michael Bayne 4260a71946 When we call leavePlace() make sure locationDidChange() is dispatched to
listeners letting them know that we're no longer in a location.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4805 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-03 22:40:00 +00:00
Michael Bayne affca34556 Pipe down there little fellas. There seems to be no easy way to not show debug
logging on the console so let's not be uninformatively verbose.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4803 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-02 18:48:45 +00:00
Michael Bayne 0cb497e6ce This ain't overridin' nothin'.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4802 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-01 17:45:19 +00:00
Michael Bayne 010b2fc77a Regenerated from the Java version.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4799 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-01 17:24:26 +00:00
Ray Greenwell 47bace1003 This is tested.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4793 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-31 06:50:19 +00:00
Michael Bayne 962326fcaf Revamped the way BodyObject.location is tracked. Now we use an object which can
be extended to contain the sceneId by Whirled (Vilya's Whirled, though also
Whirled Whirled by extension) so that we don't end up with problems where
BodyObject.location changes but BodyObject.sceneId remains stale. This won't
impact Yohoho because the Yohoho client is always in a scene, it uses a
separate mechanism to track games, whereas Whirled's natural usage is to move
between scenes and non-scenes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4779 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-21 00:46:25 +00:00
Michael Bayne 10f606be27 Regenerated services. TypedArray is imported even though it's not used because
our code generation stuff is not the ultra-sophisticated, but we'll cope.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4764 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-13 23:54:25 +00:00
Michael Bayne 27c11ce393 Oops, missed this guy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4763 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-13 21:58:09 +00:00
Michael Bayne 77e3f22d90 Added moveToServer() which does pretty much what it says. Boy I love writing
everything in two languages. Especially when one doesn't support inner classes
and has non-C syntax just to make life easier for parser writers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4762 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-13 21:57:55 +00:00
Robert Zubeck 325dce876d Helper function for searching through an array based on some predicate function.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4760 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-13 02:03:25 +00:00
Ray Greenwell 1867645802 Did away with hackery where some chat types were initializing their own client info.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4750 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-10 03:04:35 +00:00
Ray Greenwell fd9a50fd55 Allow undefined array elements to print as "undefined" rather than "null".
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4749 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-06 23:07:44 +00:00
Ray Greenwell ecefdcac85 ObjectMarshaller, formerly EZObjectMarshaller in vilya + some value validation code
that was actually in GameControlBackend.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4748 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-06 22:26:00 +00:00
Ray Greenwell b1773889d2 Implemented StringUtil.fieldsToString() using flash's introspection.
Use it in SimpleStreamableObject's toString(), with some new formatting.
Unfortunately, the order of public variables seems random.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4746 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-02 20:33:59 +00:00
Ray Greenwell 87c5bbcd59 Added getPath().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4743 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-26 23:07:42 +00:00
Ray Greenwell 860c682585 Implemented transactions in actionscript.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4739 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-18 19:27:13 +00:00
Michael Bayne b7cfe7cf81 Headerification.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4734 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-14 17:40:52 +00:00
Ray Greenwell d59811b8cc Added bytesToString() and stringToBytes().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4733 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-14 01:07:04 +00:00
Ray Greenwell e7379cd41a Fixed a bug: the 'old value' of some events were not getting set
because the oldValue variable didn't contain UNSET_OLD_VALUE, but
rather null because it was set that way in the constructor.
Additionally, some of the constructors would only set the old value
if it wasn't null, which is also wrong because an old value can
easily be null.

We could probably just rip apart most of this code, because for
the most part events are not constructed on the client anyway. We might be
able to get away with just making all the event constructors 0 arg, and
then we don't have to worry about UNSET_OLD_VALUE, we just always apply.
But let's try to be more similar to the Java code, and so now I emulate
multiple constructors by checking how many arguments were provided and
not configuring event-specific data if it wasn't actually provided
to the constructor.

Note: none of this would be necessary if we could just declare a constructor:

public function AttributeChangedEvent (
    targetOid :int = 0, name :String = null, value :Object = null,
    oldValue :Object = UNSET_OLD_VALUE);

But you can't use constants as the default value in a parameter list
(commence being boggled) so we have to use null instead of UNSET_OLD_VALUE
as the default value, and then check the 'arguments' special variable to
see if someone passed in null or whether it came from the default value. Aiya.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4726 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-04 22:00:48 +00:00
Ray Greenwell fed8aceae5 Use StringUtil.parseInteger.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4724 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-25 21:19:50 +00:00
Ray Greenwell df27e347f0 Created parseInteger() as a replacement for the built-in parseInt(),
which parses a String like " 7pigs" as the value 7.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4723 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-25 21:19:31 +00:00
Ray Greenwell 32740e654a Fixed numeric key-modifying lookups.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4722 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-25 20:06:11 +00:00
Ray Greenwell cef7e14583 Tracked down the bug that was causing some composed translations
to come out as "mmmmmmmmmmmmmmmmmmmmmm".


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4721 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-25 19:42:03 +00:00
Ray Greenwell 8b85e8a940 Allow de-capitalizing to be turned off by subclasses.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4720 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-25 18:16:32 +00:00
Ray Greenwell c29a7b007b Um.
I'm not sure what I was thinking: we'll never want to auto-recognize
command:// urls in text. In the places where we'll use them we'll
format things ourselves.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4719 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-23 21:21:06 +00:00
Ray Greenwell f2e1d94e7a Comment fix.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4716 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-18 04:51:44 +00:00
Ray Greenwell 9ea934cd82 Added support for recognizing "command://" urls.
Sigh. So not standard.
I suppose I could devise a whole system for registering protocols, and
adding registered protocols to this regexp, but we'll never have another
one of these and this is just easier for now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4709 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-14 20:47:33 +00:00
Nathan Curtis 01b43deb6e Line -> LineSegment
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4707 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-10 22:00:24 +00:00
Michael Bayne 84855f8fe0 Enhanced debuggery, reenabled new streaming bits because now they should really
really work.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4705 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-09 01:17:13 +00:00
Ray Greenwell 5b07cd55f9 - Added a method to get the point of intersection.
- Added getLength().
- Took out crazy null-tolerance in equals(). If your line is malformed,
  you may get NPE's trying to test equality with another line. Fix your line.

These are line segments anyway. We should maybe rename this
class to LineSegment.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4702 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-09 00:26:14 +00:00
Nathan Curtis 0cba1203c9 implement equalable
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4700 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-09 00:02:36 +00:00
Michael Bayne bd8ad47153 Need a toString() here too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4679 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-03 22:56:54 +00:00
Nathan Curtis 5acc2b767a implement toString
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4678 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-03 20:38:21 +00:00
Michael Bayne 80f242616e Final refactor bits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4677 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-01 22:42:22 +00:00
Ray Greenwell 1a3eac323d - Have Controller use the CommandEvent callback dispatch stuff once
the controller has located the appropriate function.
- If the arg for a command or callback is an array, assume those are
  the parameters for the function. If you desire passing a single array
  argument, you've got to wrap it in another array, otherwise single
  args will be automatically wrapped for you.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4676 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-01 22:17:20 +00:00
Michael Bayne 1ca159fe34 Added isFailure().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4664 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-16 21:47:53 +00:00
Michael Bayne 2ec9d50b6f Dispatch tell failures via a TellFeedbackMessage so that we can easily route
them to the appropriate ChatDisplay when we're doing chat in IM-style
individual windows.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4663 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-16 21:42:18 +00:00
Michael Bayne 9918594bda Widened.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4662 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-16 21:17:02 +00:00
Ray Greenwell 20e9eb66bd Broke out array equals() into its own method.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4661 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-14 02:59:51 +00:00
Dave Hoover f56c2ab370 Let's do keywork substitution on the actionscript; it's got all those purty $Id$ tags, too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4652 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-07 00:25:28 +00:00
Ray Greenwell c4fac45b9c Created a ServerMessageEvent that is just like a normal MessageEvent
except that messages will never leave the server. If generated on a client,
they'll go to the server and be processed like a normal event there
(event handlers will be called) but the event will not leave the server and
be sent to subscribing clients.

Changed the ManagerCaller used by PlaceObjects to use ServerMessageEvents.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4648 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-06 19:00:41 +00:00
Ray Greenwell 8d21a4e053 For some reason, content loaded into another SWF does not know its URL
until after the INIT stage. I don't think this particularly matters for
parameters, since if the URL is unknown it almost certainly means that we
will not need to do the custom parameter loading anyway, but let's just
make sure.

This also knocks a "known issue" off my list, and opens up the possibility
of remixed items loading content packs from a relative URL.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4646 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-05 17:49:13 +00:00
Ray Greenwell 546c44c600 Stop trying to recover from this error (it doesn't work), but try logging
the event target.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4644 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-04 21:40:03 +00:00