Commit Graph

763 Commits

Author SHA1 Message Date
Ray Greenwell 8284198e57 Don't do it twice. Yes, I'm embracing making things more "actionscripty",
including some implicit coercian to a Boolean, which can actually
be quite dangerous... but only with Strings and Numbers and whatnot.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5907 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-13 06:23:27 +00:00
Ray Greenwell ac2a633047 Regenerated services, and the callers that love them.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5906 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-13 06:18:26 +00:00
Ray Greenwell fe3d89132d A little bit of tweakery so that the invocation director to use
is known by any invocation marshaller, and so the client does
not need to be passed in.

Just here on the actionscript side for now, but this change may
make its way to Java.

Other changes may follow...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5904 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-13 06:17:28 +00:00
Jamie Doornbos 5d8a93632e Allow callers to detect when a client is about to die even though it is connected and logged on. This allows handling of the edge case where a client is getting throttled.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5897 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-05 22:12:16 +00:00
Michael Bayne d0d5c2805e StringUtil got moved to flash-utils.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5892 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-30 21:55:40 +00:00
Michael Bayne 805ef99374 Various utility classes moved to flash-utils.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5889 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-21 20:56:35 +00:00
Tom Conkling eceae381af Move ObjectSet to narya from contrib
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5876 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-17 18:58:45 +00:00
Tom Conkling 7e5f28042f I thought I compiled this before committing but apparnetly not
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5875 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-17 18:44:34 +00:00
Tom Conkling d4c3964b22 ObjectMap
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5874 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-17 18:37:38 +00:00
Ray Greenwell 83ce3f004e Added ByteEnum interface to ActionScript, and ByteEnumUtil.
Use this if you want your enums to persist to a byte reliably.
Coming soonesque: narya streaming support for ByteEnum.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5859 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-11 00:08:41 +00:00
Ray Greenwell 6dbdf8d413 Killed fromOrdinal().
Not available in Java, and generally a bad idea.
Pretend ordinal() doesn't exist, unless you're writing EnumSet, or something.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5858 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-11 00:06:23 +00:00
Tom Conkling 10c1da22bd case-insensitive String comparison util
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5857 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-10 20:24:45 +00:00
Tom Conkling c260457c6e Whoops
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5850 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-04 23:06:07 +00:00
Tom Conkling 95a159016f Utility function for converting from ordinal to Enum
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5849 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-04 22:48:21 +00:00
Tom Conkling 3eb6ee2a4f Add comment for potentially non-obvious behavior
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5844 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-02 19:14:55 +00:00
Michael Bayne 6e9077780c Added/updated source headers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5829 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-20 21:09:34 +00:00
Michael Bayne a1aa2d77ae Revamping/cleanup of how we handle authentication usernames as well as chained
authenticators and chained session factories. We can share a lot more code this
way and the implicit requirement that the default authenticator/factory had to
be configured before anyone else configured a chanied author/factory is gone.

The other big change is that Credentials doesn't require a username
(UsernamePasswordCreds inherits that username so most derived classes don't
notice any difference). Instead we require that a canonical authentication
username be determined and configured in AuthingConnection during the
authentication process. This canonical username is then used to resolve the
client session and map everything in the client manager.

This is pretty much exactly what was going on before except that we were doing
it all in an ad hoc way by jamming a new name into Credentials during the
authentication process and also doing jiggery pokery in
PresentsSession.assignStartingUsername. That all goes away and/or becomes
cleaner and more explicit.

This is going to impact some Yohoho jiggery pokery, which I will shortly commit
a patch for, but we're going to need to test it. Omelets, eggs, etc.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5828 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-20 00:56:01 +00:00
Ray Greenwell c3845a8b15 Fix simpleToString() per Tim's desire:
Cope with a bogus passed-in property name.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5820 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-09 18:16:16 +00:00
Ray Greenwell 8fd83e009a Some handy Predicates.
I did not add true() and false(), because WTF, YAGNI.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5810 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-30 00:31:08 +00:00
Jamie Doornbos 8dd6472824 Allow client code to detect whether or not the client is connected, since isLoggedOn returns true during the dispatch of CLIENT_DID_LOGOFF. This will allow msoy to prevent the display of room change popups when the client is disconnected.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5790 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-19 18:05:07 +00:00
Ray Greenwell cb5398c9e8 Time is now specified in milliseconds, as is the norm for times.
Added a note.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5786 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-13 19:19:48 +00:00
Ray Greenwell ae7373cdbc Might as well stop the timer if we're cleared.
It's the closest thing to a shutdown.

I've got half a mind to write a LinkedHashMap, and then
an ExpiringHashMap on top of that, and then have
ExpiringHashSet just utilize that in its internals.
But, YAGNI, for now... for now...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5784 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-13 00:42:24 +00:00
Ray Greenwell 42f7ce23ac Allow the event handler to be specified in the constructor.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5783 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-13 00:27:02 +00:00
Ray Greenwell 305de912ff - forEach was returning the ExpiringElements, not the data.
- We shouldn't need to run checkTimer() on add(), generally.
  If adding the sole element, we can just schedule the expiration
  directly.
- Simplified and functionalized some other bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5778 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-12 23:09:42 +00:00
Ray Greenwell 533c7f5408 Hooverian simplification, actionscriptified.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5767 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-03 20:08:46 +00:00
Ray Greenwell 34a99c26c0 If the last arg (in the Error position) is null, assume it's a null Error and
print "error=null" rather than "null=".


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5763 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-30 21:33:22 +00:00
Nathan Curtis d56ba51b49 I appear to have a hiesenbug, so this didn't actually end up testing this... but we should be
using the new varargs fanciness, including a stack trace from the error.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5762 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-30 18:44:11 +00:00
Ray Greenwell 0e2f26df73 The uber-adapter.
I could also make this just implement each interface, but I like
being able to assign the functions to their proper names.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5761 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-30 01:31:30 +00:00
Ray Greenwell d65dc84d1b Fix typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5754 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-28 02:14:52 +00:00
Ray Greenwell e7dbda821d Removed pointless 8-char optimization.
Now it is more useful for this to hash identically as in Java.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5753 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-28 01:14:01 +00:00
Ray Greenwell 9a50e5f791 Added compare().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5752 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-28 00:07:25 +00:00
Tom Conkling eb4b8674af ArrayUtil.sortedInsert
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5746 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-26 20:34:29 +00:00
Ray Greenwell 5df1335471 Add an easy way to initialize.
Jeez, this whole thing could *almost* go away if we moved to flash 10
and used Vector, but of course, there's no way to get the type of
Vector. Maybe there is, with describeType(). Can't experiment now.
I'd fall out of my chair if there were.
We need to know in case sending an empty array to the server,
it's still gotta be the right type (with non-empty we could
try examining the first element).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5742 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-23 00:30:44 +00:00
Ray Greenwell bfcb45434e Ye olde razor. Now that I know abjectscript like the back of my hand,
reviewing some of the first code written in it might be a good idea.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5741 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-23 00:23:34 +00:00
Michael Bayne c21f8ad735 Clear out our _bstrap reference after we logoff.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5734 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-18 00:06:06 +00:00
Ray Greenwell f03caf98fe Use Util.adapt(). Look at this functional programming masterpiece.
I'm not sure how much actual utility is here, and how much I just like the
gee-whiz factor.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5731 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-17 21:27:35 +00:00
Ray Greenwell 62fb546f27 Check this out. This little buddy rocks.
I sorta want to make a new FunctionUtil so that I can use it
with impunity everwhere without having to include the other crap in here.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5730 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-17 21:23:23 +00:00
Ray Greenwell bb87184632 Should resolve infinite recursion with SortedHashMap.
Tip from the pros: when you change a class, you might want to check
the subclasses for possible problems with that change.
:P


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5729 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-17 20:01:01 +00:00
Ray Greenwell 96bdaf9f1f Allow XML to be encoded.
Let's try it and see if it works. Let us know Nathan.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5728 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-17 01:06:00 +00:00
Ray Greenwell d354d951b8 Small tweaks. Apply directly to the nipples.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5727 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-16 23:00:36 +00:00
Ray Greenwell cbbd1f281d WeakValueHashMap. Apply directly to the ...
I hate your checkin comments, but I love your product!

The real reason I cleaned up HashMap: I override
forEach(), and now I don't need to do anything to make values() and keys()
work properly for weak values. Less code is better code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5726 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-16 22:55:40 +00:00
Ray Greenwell dbf20bdc28 WeakReference. Apply directly to the forehead.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5725 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-16 22:53:35 +00:00
Ray Greenwell 3300421741 - Use [] instead of "new Array()"
- Implement keys() and values() using forEach().
  - Less code is better code.
  - But, it's less efficient:
    - values() now looks up simple-key values by hashing
    - values() now unwraps non-simple keys, even though unneeded
    - keys() looks up simple-key values, even though unneeded

Say it with me like a 14-year-old girl: whatEVER!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5724 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-16 22:51:12 +00:00
Ray Greenwell 0f73afc492 This class is remarkably pointless.
We could trash it and change our toStringBuf() methods
to just return a String. I guess. Then the caller would
have to assign the string somewhere. I guess this has some value.

So anyway: Occam's razor, and fixes a small bug: appending undefined
would print as "null" since it was being forced to an Object first.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5722 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-15 20:25:26 +00:00
Ray Greenwell 305c53f53a These are breaking asdoc.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5721 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-15 18:52:15 +00:00
Michael Bayne 61f752a105 Check the right things in our Preconditions.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5720 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-15 00:28:07 +00:00
Michael Bayne b160aa944f Let's just have SafeSubscriber take two callbacks instead of forcing everyone
to screw around with SubscriberAdapter.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5719 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-15 00:22:24 +00:00
Michael Bayne 202f6bba81 Widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5718 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-15 00:13:29 +00:00
Ray Greenwell 021b5dab22 I swear I had made one of these way back when. Here it is again.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5716 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-14 01:40:14 +00:00
Michael Bayne 7f97d41fd5 Fail earlier here if we have no _clobj. I have been seeing this in testing,
though annoyingly now I can't reproduce it. Call Heisenberg!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5712 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-08 20:32:47 +00:00