Commit Graph

98 Commits

Author SHA1 Message Date
Dave Hoover 02899d1083 Auld Lang Syne
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6407 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-01 05:02:21 +00:00
Michael Bayne f43c511436 No longer need to generate dispatchers. I'll leave the code here for the
time being.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6406 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-01 01:33:07 +00:00
Michael Bayne 97be2d9fc7 These guys are no longer needed.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6405 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-01 01:32:34 +00:00
Michael Bayne f8c7241f9f Switched providers to new dynamic dispatching.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6404 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-01 01:31:20 +00:00
Michael Bayne 5a67aa906b A while ago, I put on my todo list: "look into changing InvocationService to
use JVM generated proxies, nix marshaller/dispatcher."

The idea was to use Proxy.newProxyInstance to magically create (at runtime)
proxies for FooService interfaces instead of generating a bunch of boilerplate
code. I figured something similar could be done for FooDispatcher on the server
side.

However, we also generate C++ and ActionScript marshallers, and those aren't
ever going away (AS might support some sort of dynamic magic to do what we
need, but C++ sure don't). So I decided to leave the marshaller side of things
as is.

I did revamp the dispatcher side of things to eliminate the need for
FooDispatcher on the server. This turned out not to even require the use of
something so magical as java.lang.reflect.Proxy, because in this case we're
just reading in method ids over the network (and arguments), and calling the
appropriate method. Such mundane activities are easily accomplished with the
regular reflection API.

The existing dispatcher stuff still works as well, of course, and though the
conversion from the old style to the new style is pretty simple:

< invmgr.registerDispatcher(new FooDispatcher(fooprov))
> invmgr.registerProvider(fooprov, FooMarshaller.class)

there's no burning need to convert things over. Fortunately, there's no
(compatibility) impact on client projects to converting Narya and Vilya, so
I'll be doing that shortly. There will be a miniscule performance impact, but I
think the cost of a single reflective method call, given that all of its
arguments were read and unmarshalled from the network, will be a good distance
south of immaterial.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6403 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-01 01:29:26 +00:00
Michael Bayne 1db66920d2 Deprecated DSet.toArray. Pretending like arrays are parameterized collections
is a bad idea and will lead to pain. Nixed the one place where toArray was used
(which was a serous pig's breakfast itself).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6402 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-01 01:15:33 +00:00
Michael Bayne 328ff30506 Marshaller no longer needs Client import.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6401 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-31 22:42:45 +00:00
Michael Bayne 127e388349 Unused import nixage.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6400 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-31 22:36:46 +00:00
Michael Bayne 90c6429070 Missed a spot.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6399 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-31 22:32:15 +00:00
Michael Bayne e80409a7f4 Updated to use new Client-reference-free style.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6398 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-31 22:28:21 +00:00
Michael Bayne b60112ae93 Some fiddling to keep the CPP bits in sync as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6397 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-31 22:27:51 +00:00
Michael Bayne 36a98f8794 Removed the need to supply a Client reference when making invocation service
calls on the Java side, to match this added convenience we introduced to the
ActionScript side some time ago.

Before arms are raised into the air and waved like they really do care, bear
the following in mind:

Nothing will change at all on your project until you take some action to do so.
That action could include any of the following:

1. Continue to use narya-tools-1.2 to run genservice and you'll get the old
style "pass a Client reference for every service method invocation" marshallers
and you can continue to live happily in the past.

2. Leave some of your stuff un-regenerated, but generate new stuff using the
new tools and use the Client-reference-free style for new services. This is
likely to engender some PITA if you're trying to use both styles in the same
project because genservice just wants to operate on everything, but I offer it
as an option in case some other PITA motivates the tolerance of this
(presumably smaller) PITA.

3. Embrace the brave new world of simplicity and wield your good friend sed for
fun and profit:

(make necessary build.xml updates to start using narya-tools-1.4-SNAPSHOT)

% find src -name '*Service.java' | xargs sed -i 's:Client client, ::g'
(this will remove the Client argument from most of your services, some manual
fixes may be needed)

% ant genservice

% find src -name '*.java' | xargs sed -i 's:_ctx.getClient(), ::g'
(this will fix most of the places that pass a client reference into an
invocation service, some manual fixes will probably be needed)

I did this on Vilya and it magically took care of like 95% of the places where
changes were needed. The remaining half dozen changes were painless. Clearly
something like Yohoho vastly dwarfs Vilya in scope, but someone looking for an
hour or two of mindless typing to distract them on a lazy Sunday afternoon
would likely breeze through even that vast codebase without breaking a sweat.

Two more notes:

1. I'm going to switch Narya and Vilya over to the new style, and I'll be
fixing all the projects that use their services.

2. I lied (a teeny bit) about nothing changing. I made the old Client-taking
sendRequest methods deprecated, so projects that don't switch to the new style
will be presented with a large number of deprecation warnings. If this is too
terrible a burden to bear, I can remove the deprecation annotations on those
methods.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6395 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-31 21:56:46 +00:00
Par Winzell 2bb7f6e821 If we're going to support the idea that things can log in without a body, we can't have the peer manager NPE when that happens.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6394 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-28 14:58:07 +00:00
Dave Hoover faa7413d3c Nix unused import.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6393 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-22 19:47:36 +00:00
Michael Bayne 1d838d5e8e Simplify.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6392 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-22 01:42:32 +00:00
Michael Bayne d52be825ec Abstract the manner by which DObject reads and writes its fields. This allows
us to create a Scala trait that handles reading and writing Scala "fields"
which are not public fields but are rather private fields with public getters
and setters. This also enables the creation of bridges for other JVM-hosted
non-Java languages.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6391 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-22 01:30:55 +00:00
Tom Conkling 0b3e8297e4 GenActionScriptStreamableTask parses imports out of the existing .as file and merges them into the output, regardless of whether they appear between the GENERATED PREAMBLE START/END markers.
(Eclipse's auto-import-ordering makes it too easy for manually-added imports to get moved to a location where they'd be blown away by the task.)



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6388 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-18 00:47:33 +00:00
Par Winzell b041c6804b Since GWT is clearly moving away from (deprecating) TabPanel, let's ween ourselves off of it. However, TabLayoutPanel is a RequiresResize widget, which means it's not a drop-in replacement; it needs to be part of a layout.
The easiest way to accomplish this, if you have a degree of control over your page, is with something like:

    RootLayoutPanel.get().add(new ConfigEditorPanel(barHeight));

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6387 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-16 17:54:39 +00:00
Michael Bayne 884ffabddc We need the current timestamp to report proper idle duration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6386 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-16 02:22:21 +00:00
Michael Bayne 74c2c77443 Passing in the timestamp that dictates idleness allows us to propagate the idle
duration a bit less far. And Ray will be pleased to know that we're doing much
less redundant arithmetic.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6385 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-16 02:18:53 +00:00
Charlie Groves 6a45fec4ea Don't let presents' ping interval into Connection
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6384 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-16 01:59:47 +00:00
Charlie Groves 4d163ffd7f Allow generated sections to be turned off.
If a generated section like

// GENERATED BLAH START
var s: String = "I am some awesome stuff you didn't have to write";
// GENERATED BLAH END

is replaced with

// GENERATED BLAH DISABLED

that generated section will no longer be merged in.

This currently allows the class declaration to be customized in the actionscript
stuff, if it needs to extend or implement something that can't be inferred from
the Java class.  If someone's feeling frisky, they could split the streamable
section into sections for readObject, writeObject and fields to allow for read
and write customization.

This also fixes dropping no-longer generated sections and allows for sections
to be reordered in the source.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6383 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 23:46:56 +00:00
Par Winzell 1555bf92f9 Turn protected Java members into protected ActionScript members, and put them in the right place in the file.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6381 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 18:25:03 +00:00
Michael Bayne 413f06ac26 Use the new fluent API because it's sexy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6380 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 00:51:17 +00:00
Michael Bayne 1a6587f69b Bump Depot to 1.2-SNAPSHOT and regenerate records using type-safe column
expressions. We'll get to a new stable release soonish.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6379 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 00:47:20 +00:00
Charlie Groves 68f8a577e9 Don't depend on presents
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6378 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 00:37:10 +00:00
Charlie Groves f12887ae87 Don't require that ConnectionManager be a Reporter
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6377 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 00:31:29 +00:00
Michael Bayne 2b90dee9f7 Let's make it easy for anyone to indicate their expected connection, and use it
to suppress subscription failure events in addition to subscription success, as
well as event forwards (though those shouldn't, in theory, go out over a new
connection because subscribers are cleared when a connection is dropped).
Nothing else looked like it might result in a spurious message being sent if a
connection was dropped and reestablished, so none of the other calls were made
to supply an expected connection.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6376 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 00:19:33 +00:00
Andrzej Kapolka a2f8e4f7d9 This is what seems to be happening: the client requests a subscription
on one connection, then disconnects.  While that request is in the
pipeline, it reconnects, then receives the subcription that the first
connection requested before it sends its own subscription requests.  To
prevent this, make sure that the current connection is the same one
that made the request.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6375 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-10 21:20:47 +00:00
Michael Bayne 82978427ff We can get rid of our C++ backwards compatibility business now that we've
shipped that to our 1.3 release.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6372 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-10 18:02:10 +00:00
Charlie Groves 45b9fbbb78 Didn't mean to commit the record changes in 6363. Rolling back.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6364 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-10 02:51:59 +00:00
Charlie Groves e7dd16adc1 Switch back to the initial implementation of RegistrationManager to keep sending the same events
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6363 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-10 02:51:05 +00:00
Ray Greenwell 5476241fa4 PECS.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6362 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-10 02:44:18 +00:00
Charlie Groves c215fb49fd Need to run our processing first if any changes will be caught by checking
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6360 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-10 01:55:04 +00:00
Michael Bayne a985043d48 Some temporary backwards compatible bits for extant Corpse Craft clients.
Narya's strict approach to over the wire compatibility is not so nice when you
have cross-language clients that can't be updated at the same time as the
server.

Maybe we should consider a new over-the-wire format for C++ clients that is
more like pbuffers, which the Narya server could translate to and from Java
Streamable instances, and the C++ side could either use pbuffers directly or
have a similarly change resilient I/O layer that turned over-the-wire data into
C++ objects that mirrored (a potentially out of date) version of their Java
counterparts.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6358 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 22:27:57 +00:00
Charlie Groves ed7bea986d depot-1.0 doesn't have its .tmpl files, which causes genrecord to crash and burn. Bump to 1.1 and commit genrecord results.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6357 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 21:57:33 +00:00
Charlie Groves 4209af8963 Unused imports
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6356 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 21:56:04 +00:00
Bruno Garcia bf215119c4 Changed the names of generated signals to match their Java equivalents and to feel nicer with
plural field names.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6355 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 21:49:51 +00:00
Ray Greenwell af57cfdb35 Go back to using StreamableArrayList here, for now.
Events originating in Actionscript need to use that class because
we have no generic List class in actionscript. For things that
originate on the server this isn't a problem:
java array -> Array, and java List -> Array 
But for things originating on the actionscript client, any array
will become a java array unless we use StreamableArrayList.

So: maybe it's time to add List to the aspirin library. :|


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6354 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 19:49:54 +00:00
Charlie Groves 18e954a19b Check for gen changes ignoring $Id lines
I was interpreting the lack of modification for $Id lines being people not setting auto props, but
it was actually svn not showing diffs for things it generates.  Whoops.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6350 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 08:43:22 +00:00
Charlie Groves 39405136e9 Add uncommited generation checking to all the gen tasks.
If checking="true" on them, they generate their code to a String instead of a file, and compare that
against existing output.  If any generation would produce changes, the build is failed.

As a side effect, generation will now only write files if it's going to modify them, which should
eliminate some spurious compiling.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6349 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 07:43:18 +00:00
Ray Greenwell 0b77c89fa7 Improvements to Collection streaming support.
Any Collection can now be streamed. You can send Collections.emptyMap()
back to a client, for example.
(It will unstream as a HashMap on the other side.)

This actually streams everything to the exact same bytes as before.

Using specific classes is discouraged: ArrayList, StreamableArrayList...
If a Streamer is created for a class that has a field of that type,
a warning will be generated, urging you to change the field definition
to the interface.

Also: that setup is now deferred until needed, because in clyde/projectx
there are a number of Streamable classes that have fields of specific
classes, like ArrayIntSet for example, but don't use standard streaming
to transmit them. In that case it's totally cool for them to have a more
specific type.

Since that setup is potentially deferred, one change may be observed
for a class that uses custom readObject() and writeObject() methods
but still calls defaultReadObject(). The field marshallers will now
be configured a little later in the game than before.

But, we're actually saving a bit of memory by not setting up those
marshallers for streamable classes that never use them. Woo.

Please let me know if this causes any space shuttle explosions or
spikes the punch at your quinceanera.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6348 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 02:39:01 +00:00
Charlie Groves e91e11a765 Import cleanup
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6347 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 00:24:49 +00:00
Charlie Groves 35ca102d64 Oh yeah, that too
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6346 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 00:08:09 +00:00
Charlie Groves 939d309fa2 These are both pretty busted, so let's kill them to eliminate confusion with the functional
GenActionScriptStreamableTask.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6345 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 00:02:52 +00:00
Andrzej Kapolka 7119d3e874 An additional check to help track down a bug where subscriptions aren't
being cleared properly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6344 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-08 23:14:07 +00:00
Par Winzell 694f983ef3 One day perhaps we'll consider a world where clients can flit between bodies willy nilly and bodies don't necessarily have a client attached to them, but until that day, we're going to require that BodyObject.getClientObject() returns non-null when the body is in the wild.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6342 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-06 04:46:12 +00:00
Par Winzell 43b915de10 Send the FORCED_MOVE notification to the client, not the body.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6341 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-05 21:12:14 +00:00
Par Winzell 817b733ff0 Clarify that BodyLocator.forClient() should return null if the user is not currently driving a BodyObject. Use this fact to avoid various NPEs. Also introduce a reverse mapping of forClient(); it should always be possible to ask a BodyObject what its ClientObject connection to the user is.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6340 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-05 03:58:38 +00:00
Bruno Garcia 5758499ba0 Generate a signal for array ElementUpdatedEvents.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6339 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-04 01:30:08 +00:00