Commit Graph

813 Commits

Author SHA1 Message Date
Nathan Curtis e3ae54ddb4 Add a comment so people don't accidentally new StreamableHashMap(), and expect it to work.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6106 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-08-09 18:34:26 +00:00
Nathan Curtis b6174f659f If no map class is passed in (should only happen on deserialization, and the real source map is provided on readObject), pass an empty immutable map to super, which is less weird and probably better than just ignoring and forcibly not calling the super constructor, which is what was happening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6105 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-08-09 18:30:45 +00:00
Bruno Garcia 03ae523e62 Typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6102 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-07-29 20:35:45 +00:00
Dave Hoover b8e029fdad In with the new logging
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6092 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-07-09 23:33:38 +00:00
Mike Thomas 4ddc60e369 Integer was getting envious of Short's MIN/MAX_VALUE constants, so let's appease it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6090 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-07-01 20:17:52 +00:00
Dave Hoover 3b266edcd6 That should be private.
If it's public, we try to shadow it in a subclass & wind up still
getting THIS one.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6083 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-06-18 23:40:16 +00:00
Mike Thomas 079269a825 Handle short[]'s on the actionscript side of streaming. This gets a little ugly given the lack of a primitive short on the actionscript side...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6071 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-06-08 01:37:08 +00:00
Mike Thomas f7a828e0c4 Move this convenience method up here to the ClientObject because it's... well... convenient.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6068 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-05-27 20:29:12 +00:00
Ray Greenwell 3496da8b28 Cruft removal.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6027 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-02-04 21:47:21 +00:00
Dave Hoover fdf51a634a Welcome to the future.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6008 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-01-04 21:47:46 +00:00
Jamie Doornbos 5e6cf46926 Backtrack a bit for recording channel speaks to the history. Instead of weighing down UserMessage with extra stuff (there is a lot of infrastructure that seems intent on avoiding this), record the value only in the server's history by wrapping messages in a new value class.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5991 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-11-10 00:05:56 +00:00
Ray Greenwell 6c65caeb1b readField() also gets an untyped return type.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5989 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-11-06 23:09:26 +00:00
Ray Greenwell 00c4777460 Example text.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5987 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-11-06 21:50:21 +00:00
Ray Greenwell d82a926ca1 Add an example to the docs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5986 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-11-06 21:18:43 +00:00
Ray Greenwell ee27342a24 Proposed change to readObject().
The purpose is to
- Ensure type checking for "fail-fast" detection of streaming errors.
- But simplify it so that callers don't have to cast themselves and
  potentially screw up by using "String(obj)" or "Array(obj)", or miss out
  on the fail-fastyness by using "obj as SomeType".
- But, at the same time, allow for the sveltest code possible.
    // first one is a bit shorter!
    _name = ins.readObject(Name);
    _name = Name(ins.readObject());

    // first one is a bit shorter!
    _state = ins.readObject(String);
    _state = ins.readObject() as String;


So, to sum up: the code is the shortest and doesn't require special-casing
if you are reading a String, Number, int, uint, Boolean, or Array.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5984 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-11-06 01:27:03 +00:00
Ray Greenwell c16de5994e Moved these here to narya.
Lately I'm trying to do things more "actionscripty", and so we just
use the "natural" iteration on an object (either 'for' or 'for each').
Plus, we never use these Iterators anywhere except in presents-based code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5983 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-10-27 00:57:48 +00:00
Ray Greenwell b124934a97 MethodQueue -> DelayUtil.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5981 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-10-21 21:49:17 +00:00
Nathan Curtis ea49d70129 * Add Msoy's MethodProfiler so I can use it in Riposte.
* Apparently, a couple of whitespace cleanups my gvim did awhile ago while I was looking around in
  here.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5971 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-24 20:40:48 +00:00
Ray Greenwell 1c538ac78e Drive-by logging modernization.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5970 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-24 20:18:14 +00:00
Ray Greenwell dae0f7f44f Fuckit, let's use uint paramters and make the default uint.MAX_VALUE.
Unless I have to roll this back because the like compiler in CS3
shits its pants trying to understand it (external references for
default parameter values seem to sometimes fail).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5969 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-24 20:13:39 +00:00
Ray Greenwell 3f2468e7a1 Oh crap, let's make ObjectOutputStream protect against fuckup, too.
Note that we're using ints instead of units for offset/length.
Does anyone really need a byte array larger than 2^31?
And if so, wouldn't you then also be within sight of busting 2^32?
Why not make it a Number and support up to 2^53?
Number is no guarantee of a desire for a floating-point value in
the flash libraries, see Graphics.lineStyle()'s first parameter.
Actionscript, you fail for not having long.
And... I said I wasn't going to bitch at Adobe/Macromedia any more
but this is a total FAIL.
0 is a valid length. Everyone knows this.
Can you imagine if they picked a different constant?
   length: the number of bytes to read, unless it's 9, in which case
   it reads *all* the bytes. Your code should check to see if you're
   about to read 9 bytes, and instead read 8 in one go and then
   a follow-on byte.
uint.MAX_VALUE would have made tons more sense.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5968 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-24 20:09:35 +00:00
Ray Greenwell 33d19f7a69 Another fix for potential streaming errors.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5967 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-24 19:37:34 +00:00
Ray Greenwell 730d448e40 As far as I can figure, ArrayMask objects are used even when
the Array length is 0, so let's make sure we don't cause any
streaming errors here.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5966 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-24 19:35:35 +00:00
Ray Greenwell f75d46f75f Add a better toString, for debugging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5963 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-17 23:16:22 +00:00
Ray Greenwell 53f1dff95d These are all final.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5962 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-17 21:58:30 +00:00
Ray Greenwell f9bc385c99 Some examples.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5961 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-17 21:53:02 +00:00
Ray Greenwell a24b0d2d03 So, these classes like Integer and langBoolean exist solely for
streaming to our java server, so let's just make them streamable directly.
Does away with the need for custom Streamers.
Also made them Hashable, in case we read a StreamableHashMap containing
Integers as keys, for example.
Less code is better code.
(Why was BooleanStreamer added the other day? langBoolean was already Streamable
 and was already in Translations)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5960 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-17 21:42:25 +00:00
Ray Greenwell 055aac9b55 Use Joiner instead of StringBuilder, in some places.
Use String concatination in others (it's faster in actionscript than in Java)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5959 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-16 21:13:07 +00:00
Ray Greenwell 9f967dd575 This is already output by SimpleStreamableObject...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5958 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-16 20:03:53 +00:00
Tom Conkling e0a4340947 add missing BooleanStreamer
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5957 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-15 21:53:26 +00:00
Ray Greenwell 32db838be2 Hmm don't throw the ArgumentError inside our own catch, even though
we should have re-thrown it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5951 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-11 16:49:37 +00:00
Ray Greenwell 4fe12a043d Even when fed an object graph with no loops we could have a stack
overflow in our recursive checking. Try to catch it and cope.
I have a bad feeling this won't actually work in some envs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5950 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-11 15:30:43 +00:00
Tom Conkling f4ab06b619 Integers and Booleans are final. This fixes the Integer[] streaming problem I was having with Bite Me.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5949 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-11 02:13:03 +00:00
Ray Greenwell 3aec11f519 This is cloggin' the bureau loggin'.
I'm pretty sure it's the BaseGameConfig.
Typically, clients don't add directly to a StreamableHashMap received
from the server, why would they? So let's just treat it as a String-key map
and shut it up.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5937 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-30 20:40:37 +00:00
Ray Greenwell 2b5b0389e0 These classes moved from flash-utils back into narya.
Not generally useful to your everyday flash coder.
MessageBundle and MessageManager are built on top of Flex Resources,
and were already being excluded from our asdocs, and TimeUtil uses MessageBundle.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5932 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-25 19:42:47 +00:00
Ray Greenwell da0e42a2b4 Inline references to other classes? That is not the actionscript way.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5931 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-25 19:24:21 +00:00
Ray Greenwell 5e0eb1d970 Fix the asdocs here. But wait, why is this even showing up in the SDK docs?
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5930 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-25 18:56:18 +00:00
Ray Greenwell 1083490e73 Use newMapOf().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5929 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-24 21:36:19 +00:00
Ray Greenwell f8d5e679fd We use StreamableHashMap sensible and only store one kind of key.
Let's guess the type based on the first key unserialized, and guess if it
was empty.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5928 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-24 05:22:05 +00:00
Ray Greenwell c9ea3709f7 Use new Maps factory.
The old HashMap class was a frankenstein one-size-fits-all mess of:
- storing simple objects
- storing Hashables
- having the capability to provide external functions to hash and check
equality of any other type of key.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5927 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-24 02:54:23 +00:00
Ray Greenwell 44480ada4a Use ClassUtil.isAssignableAs().
It works in thane now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5922 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-21 22:45:36 +00:00
Ray Greenwell 4848fe4b29 Now that ByteEnum has been liberated from depot, lets
support streaming them as bytes.
It's better than writing a modified UTF String, but
it'd be even nicer if we could avoid the short to read the class name
(Enums are final), but I suppose we still have to know whether one is null
or not. Hm.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5920 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-19 02:18:14 +00:00
Ray Greenwell 00416168bb Nix some warnings. One shouldn't be coped with, and so let's let it NPE.
The other happens now in normal circumstances in msoy, and I'd rather
not surround the call to super with an if to avoid this warning, and
potentially kablooie in the future if other functionality is added
to leftLocation in this base class...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5918 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-18 21:34:51 +00:00
Ray Greenwell a3b20e176b Scratched an itch...
Removed the unholy 'alreadyDisplayed' hack and associated return value
from ChatDisplay.
The localtype should be used to determine whether something should be
displayed. If not, why should ChatDisplay registration order matter?
It shouldn't. If there are two ChatDisplays that could potentially
show the same message and you only want one of them to, sort that
out in your own fuckin' code.
I'm not changing the Java side right now because I'd have to patch-up
a bunch of projects...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5916 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-15 00:06:12 +00:00
Ray Greenwell 1b17350ee0 Allow command handlers to be unregistered.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5915 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-14 23:45:47 +00:00
Ray Greenwell 4a734d00ef Drive-by logging varargification.
Don't ask what I'm doing driving in this neighborhood.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5913 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-14 22:12:56 +00:00
Ray Greenwell 04316d8620 My actionscript-fu has improved since I originally wrote this.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5911 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-14 03:10:48 +00:00
Ray Greenwell 49f5d7fed8 We don't read creds on the client.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5910 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-13 23:34:12 +00:00
Ray Greenwell e469bb4abc I'm pretty sure we never read Credentials on the client...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5909 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-13 23:32:30 +00:00
Ray Greenwell 7489a64555 Every byte is precious!
No need to tell the server the callerOid, it already knows it.
This saves 4 bytes for every listener you pass into an invocation request.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5908 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-13 19:15:21 +00:00