type, but we don't really want to pollute our class <-> id mapping with a bunch
of extra fiddly enum classes, so we stream all enums as instances of their
declared type and let Enum.valueOf() map back to the custom derived type when
it creates an instance during deserialization.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4370 542714f4-19e9-0310-aa3c-eee0fc999fb1
value to avoid future compatibility problems if someone saves an object to a
database and then later adds a new enum anywhere but at the end of the list,
thereby changing the ordinals.
If you want maximal network efficiency, don't use enums. For most of what we'll
do with them, it doesn't merit having the future incompatibility hitch of
sending the ordinal.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4369 542714f4-19e9-0310-aa3c-eee0fc999fb1
our parent, but we don't want to do that for most sprites which are
shutdown anyway in a more managed way, and specifically our avatar sprite
is re-used as we move from room to room.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4366 542714f4-19e9-0310-aa3c-eee0fc999fb1
ObjectInputStream works in conjunction with a ObjectOutputStream on the
other end. The ObjectOutputStream will always assign class codes starting
at 1 and increasing sequentially from there, so we can look up a class
by index rather than hashing.
Uses less memory and is faster.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4365 542714f4-19e9-0310-aa3c-eee0fc999fb1
process and keep that information around in case the server ever wants to know.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4356 542714f4-19e9-0310-aa3c-eee0fc999fb1
There is already a ResultAdapter in util/ that adapts an
invocation service ResultListener into a com.samskivert.util.ResultListener.
Flash can't cope with two classes of the same name in the same library
module, so I named my adapter *Wrapper. For consistency it would be nice
if these were the same in ActionScript and Java, so maybe we'll end up
just renaming the one in util/.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4354 542714f4-19e9-0310-aa3c-eee0fc999fb1
This is actually kind of sketchy, because the resolver can't depend on it
because there are methods to resolve a client object without having an
authenticated connection.
For now, I'll leave this in.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4350 542714f4-19e9-0310-aa3c-eee0fc999fb1
pass the value of 'selected' (true or false) as the argument.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4349 542714f4-19e9-0310-aa3c-eee0fc999fb1
looking for something assignable from Object (rather than the other
way around) when the argument was null.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4346 542714f4-19e9-0310-aa3c-eee0fc999fb1
like Groovy and JRuby. Created a DynamicEventDispatcher that automatically maps
attribute, element and set events to methods. Say you have a field:
public DSet occupantInfo;
you can create a method in any class:
public void occupantInfoAdded (BodyObject source, OccupantInfo entry);
and then bind that class as a listener using the dynamic event dispatcher:
_myobj.addListener(new DynamicEventDispatcher(object));
I also created a nicer replacement for the MessageHandler system which is
clunky but still way simpler than using a full InvocationService. Basically we
dispatch MessageEvent as if it were a method call.
For example, in AtlantiManager I define:
public void placeTile (BodyObject placer, AtlantiTile tile)
which receives a request by a player to place a tile on their turn. Then in
AtlantiController, I simply call:
_atlobj.manager.invoke("placeTile", tile);
Of course, in JRuby and Groovy, that's going to look like:
_atlobj.manager.placeTile(tile);
which is all part of the fun.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4344 542714f4-19e9-0310-aa3c-eee0fc999fb1
distributed objects by reflection since we don't allow clients to create
objects, furthermore we needn't do it asynchronously. The object creation
methods were moved into the server-side only interface and made "immediate", so
the caller creates a derived instance of DObject and registers it with the
system instead of creating it with a Subscriber callback.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4342 542714f4-19e9-0310-aa3c-eee0fc999fb1
that we don't try to access array element .125 at runtime.
The designers of flash need to be suspended over a tank of sharks while
people try to write a program in actionscript to reel them in. I bet half
the time it compiles into something that just lets those ropes go.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4334 542714f4-19e9-0310-aa3c-eee0fc999fb1
compiler never wanted to tell me about.
- I was trying to store read values into the streamer itself, referecing
it as "this[ii]". This turns out to be legal, even though the class is
sealed, because you can access public fields using the [] operator with
a string argument. At runtime, ii == 0, it got Stringdafied to "0" and
then a field called "0" was looked up on the class and oh no, it didn't
exist.
- Worse, I had a line that referenced "length" instead of "arr.length".
There is no length defined in the class, nor is there one in the superclass.
It turns out the base class Object has an undocumented constant called
length that seems to always be 0. Isn't that special?
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4333 542714f4-19e9-0310-aa3c-eee0fc999fb1
(And found a faster way to compare the classes of two objects.)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4321 542714f4-19e9-0310-aa3c-eee0fc999fb1