Commit Graph

5900 Commits

Author SHA1 Message Date
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
Michael Bayne a6a008cb50 Turns out we want to highlight the difference between normal getting and
getting that adds the default value to the map. I opted for fetch() which at
least means something close to get() and can be documented as also inserting
the default value. I also considered obtain() and acquire() but those both felt
like they had something to do with locks. apply() seemed too functional.
wangle() seemed like a strong contender for a while.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5965 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-22 20:25:05 +00:00
Charlie Groves 3c159a6497 Widened
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5964 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-22 00:05:18 +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
Michael Bayne 293ec52255 Some Galileo inspired raw type and dead code elimination.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5956 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-14 22:20:16 +00:00
Dave Hoover 26d982ae54 Document those so eclipse with strict docbook warnings doesn't get
cranky that they're never used.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5955 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-14 22:18:31 +00:00
Michael Bayne 66af5d397b There's no especial need to disallow use of the constructor.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5954 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-12 01:17:49 +00:00
Michael Bayne bba467be39 Slight description editing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5953 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-12 01:15:53 +00:00
Michael Bayne 9b946dfbd5 DefaultMap extracted from Yohoho, simpl- and and MDB-ified. For Charlie's
inspection and approval and Matt's eventual use.

Note that we can't put this in samskivert as it depends on Google
Collections. Perhaps we should create an ooo-utils library for things like this
(and possibly move Narya's Serialization replacement therein since it is pretty
general purpose; Nate is using it for Riposte, for example).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5952 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-12 01:13:19 +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
Andrzej Kapolka 00569e651f Added a system for tracking the messages sent to and received from the
server for the purpose of statistics tracking.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5948 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-11 00:19:10 +00:00
Michael Bayne 05e37f4f42 This log message is not strictly necessary. The connection manager immediately
logs that it's listening on its configured ports, when start() is called. It
does so on a separate thread, but I don't believe the subtle ordering
possibilities there are something that's actually causing/likely to cause
problems and/or needs to be called out.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5947 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 19:42:18 +00:00
Michael Bayne 179c66f46a Missed a spot.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5946 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 19:39:03 +00:00
Michael Bayne 03ff9f8220 PresentsDObjectMgr.isRunning() is really isNotShutdown() and we need to
preserve those semantics. Sigh.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5945 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 19:38:36 +00:00
Michael Bayne f92350f1b3 Bah, don't include the PresentsDObjectMgr's state when trying to assert our
invariants.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5944 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 19:36:33 +00:00
Michael Bayne a8d3227fb5 You too. Naughty misreporter.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5943 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 19:32:06 +00:00
Michael Bayne 1c60b9cc75 Promote the datagramHostname to the bindHostname and use it for our TCP
connections as well.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5942 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 18:34:42 +00:00
Jamie Doornbos 701d885222 Keep track of the total number of units run independently of Stats so it is not reset every 3 minutes by pulse.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5941 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-09 23:59:02 +00:00
Par Winzell 6f7c9831d8 Comment tweak.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5940 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-09 14:50:30 +00:00
Michael Bayne f3fd4d28a5 We need to use the thread context classloader if one has not been specified.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5939 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-07 20:39:32 +00:00
Mike Thomas 2acedb91a4 Better protection against divide-by-zero - if we have less than a second, we'll just round up to 1 second.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5938 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-04 22:42:27 +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 bf5d3c666f Avast, thar be bugs here too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5936 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-30 00:37:08 +00:00
Charlie Groves e27f0ed5e2 No more setHours
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5935 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-26 22:51:48 +00:00
Charlie Groves 90e11d00b7 More fluency, less effluent
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5934 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-25 23:14:59 +00:00
Michael Bayne 7a95df0c26 Added import for javadoc.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5933 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-25 22:57:34 +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 e6fa8e77f1 Obsolete.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5926 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-22 00:12:51 +00:00
Ray Greenwell 6aa154575e Look ma, just lib.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5925 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-21 23:30:11 +00:00
Ray Greenwell 24c16141f6 I do not think we need this anymore.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5924 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-21 22:54:12 +00:00
Ray Greenwell b5de96dc83 It's an ecological disaster!
I'm trashing the Environment!
No more *-env libs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5923 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-21 22:46:50 +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