Commit Graph

5773 Commits

Author SHA1 Message Date
Michael Bayne 54c8226ea2 As Andrzej points out, this injected member should be transient. But oddly, the
original source code did not list it as such:

-        protected Name _user;
-        @Inject ChatHistory _chatHistory;
-    }

I wonder whether it worked...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6559 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:53:02 +00:00
Michael Bayne 8f5af330c6 Let's do this delayed marshaller initialization slightly differently, so that
only CustomClassStreamer needs to know about it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6558 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:45:38 +00:00
Andrzej Kapolka d0bc9da2b5 Calling createObject requires initialization, else we get an NPE.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6557 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:38:27 +00:00
Michael Bayne c55279a211 Converted some static inner classes into anonymous inner classes, yielding
improvement in locality of code and reduction in LOC.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6556 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:32:47 +00:00
Michael Bayne b759128425 With a magestic legacy as long and historied as Presents, nothing is ever easy.
We need to support legacy closures that have multiple constructors, one of
which will be a zero-argument constructor. All of the existing static inner
classes that extend NodeAction/NodeRequest will be such legacy classes. Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6555 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:14:22 +00:00
Ray Greenwell 73ef57ecc9 Guava: there's a class for that.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6554 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:01:48 +00:00
Michael Bayne 87c36ebf67 Improvements in comments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6553 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:56:36 +00:00
Michael Bayne 3291089b8c Jumped the gun there a little. We need to be sure not to filter out the
synthetic val$local fields that get inserted, only the this$outer field. And we
need to pass "zero" values for val$ fields to the synthesized constructor.

This means that closures cannot have more than one constructor, but since
they're anonymous inner classes, they necessarily have only one constructor, so
we should be fine.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6552 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:55:11 +00:00
Michael Bayne 10bea22f14 Made our node action and request into streamable closures, and removed the
warning about having to extend them with static inner classes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6551 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:30:23 +00:00
Michael Bayne 064fbe425a Added support for "streamable closures". The idea with these are that the
streaming mechanism will quietly gloss over the funny little outer class
reference stuffed into your closure as long as you promise not to use it
(because it's going to be null on the other side of the wire).

This will allow us to write:

_peermgr.invokeNodeAction(new NodeAction() {
    ...
});

which we presently have a big fat warning against, since it didn't work until
about 30 seconds from now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6550 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:28:26 +00:00
Michael Bayne 7c07bfcedc register() already puts our mapping in the _handlers table.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6549 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 20:02:00 +00:00
Andrzej Kapolka 6dc165f911 Fixed misplaced parenthesis.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6548 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-23 02:12:36 +00:00
Charlie Groves 34f0f9ab8d Unused imports
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6547 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-23 01:46:55 +00:00
Andrzej Kapolka 94c89e390c Include the longest elapsed time in the profile (not too useful if you profile
from the beginning, but useful if you clear the profiles in order to record
over a brief interval).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6546 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-23 01:40:08 +00:00
Andrzej Kapolka a1013e66bf Provide a means of setting the unit profile sampling frequency.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6543 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-22 22:36:34 +00:00
Andrzej Kapolka e9bbdd2c4b Use the getIntervalClassName method to identify intervals that have been
cancelled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6542 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-22 22:24:34 +00:00
Charlie Groves 74b598fc02 Add a main to PolicyServer that binds on the master port by default
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6541 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-22 07:09:43 +00:00
Mike Thomas c4a53bbbaa Explicitly handle the other cases of the enum in the switch so it's clear we mean to do nothing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6540 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-18 21:41:42 +00:00
Andrzej Kapolka 30b04ce54e Revert relationship bits on consultation with MDB.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6539 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-17 23:10:52 +00:00
Mark Johnson a7c4b2a949 - Allow you to optionally reload the global messages bundle when changing your locale
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6538 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-17 01:33:53 +00:00
Andrzej Kapolka fccd605b9f The very beginnings of support for different peer topologies: instead of
having every node connect to every other, we want to support having (for
example) nodes connect to a "super-peer" that distributes updates to its
children.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6537 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-17 00:54:24 +00:00
Andrzej Kapolka 03e58a28e1 We register as a client observer when we start up; we need to remove ourselves
when we shut down.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6536 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 23:48:36 +00:00
Michael Bayne a3c0b0bbdd Put our headers on the CPP files as well. This also fixes a problem where the
headers on the associated Java files were being stripped.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6534 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 18:20:17 +00:00
Michael Bayne 217927de2b A variety of javadoc fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6533 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 18:17:09 +00:00
Michael Bayne 0a15a1e09a Avoid generating {@link Outer.Inner}, as Javadoc does not support such links.
Bug 4464323 was filed 10 years ago, bringing this to Sun's attention, and has
been acknowledged as a known bug. Apparently this has not annoyed anyone on the
Java team enough to merit fixing. Sigh.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6532 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 17:50:09 +00:00
Andrzej Kapolka b205f60d1c Use the hostname stored in the Client rather than the IP address in case we're
using a proxy, in which case we'll send the non-proxy hostname in the
bootstrap data.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6530 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-10 23:18:22 +00:00
Ray Greenwell 4acf173bf3 Clarify.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6529 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-09 04:10:29 +00:00
Ray Greenwell fb39890cbd Refine and elaborate this warning message.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6528 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 22:36:39 +00:00
Ray Greenwell 5a3f7bbdc7 Tidy this up by making it recursive.
Deeply multidimensional arrays are rare.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6527 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 22:30:19 +00:00
Ray Greenwell dd43d89028 A few extra lines of code to support a fourth enum policy: name only.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6526 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 18:30:50 +00:00
Andrzej Kapolka b4b409caa3 Provide an option to show all command aliases in the usage text and only
show the first alias in the big list.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6525 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 04:57:43 +00:00
Ray Greenwell 08f6dbefa9 Comments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6524 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 01:08:33 +00:00
Ray Greenwell 55f031304c Let's rename those enum policy constants based on how they work,
not whether they're old or new.
OLD -> NAME_WITH_BYTE_ENUM
NEW -> ORDINAL
NEW_WITH_BYTE_ENUM -> ORDINAL_WITH_BYTE_ENUM


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6523 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 01:01:06 +00:00
Ray Greenwell b1d7577599 - Cleaned up streamers.
- Allow configuring of two new streaming policies for enums.
- Changed the alphabetical fields policy to be checked once on class init.

Let me elaborate on the first two changes:

1) The base Streamer class had grown to handle a variety of things.
There were two different ways to handle enums, a whole section of code
for arrays (two ways of handling those), and then custom reader/writer
methods were supported with fallback for regular old streaming classes.
A lot of this was checked by introspection every single time an object
was written/created/read. In addition, there were 6 different fields
in the base class, many of which would be unused by default. All
the BasicStreamers also inherited these fields and never did anything
with them.

So my change makes Streamer an abstract class with no non-static fields.
I pulled all the logic for different streaming strategies
into different classes and do the tests to determine which class
to use once when first setting up the streamer for a particular target class.

If our target class is an array with a final element type, why should
we be re-checking those two things each and every time an object is
written? Or if it's not an array and we've got field marshallers set up,
why are we wondering if it's an array or enum each time?

In addition, reading/writing would freak out if a field marshaller
was never found for a particular field. Let's fail faster and freak
out when the marshallers are first initialized, which is fine
now that (in a recentish commit) we don't initialize the marshallers
if there appears to be no reason to do so (if a Streamable class has
both a custom reader and a custom writer method, then the marshallers
are never used. The class could have non-transient fields that don't
stream, but it takes care of them itself in the custom methods.)

2) There are now three enum-streaming policies that can be configured.

- OLD, the default, will try to stream by byte if the enum is a ByteEnum,
  and fall back to using the enum's name.

- NEW will always stream an enum by ordinal, using the smallest integer
  type possible, given the enum's size. ByteEnum is ignored.

- NEW_WITH_BYTE_ENUM will do the ByteEnum thing for ByteEnums, and fall
  back to the new ordinal thing for other enums.


The idea here is that narya streaming is designed specifically such that
the server and client are running the same code. There are some edge
cases, and some games persist streamed objects, but in general
streaming by ordinal should be fine.

But, it's opt-in for now. I can't go breaking everything.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6522 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 00:48:39 +00:00
Mike Thomas 3b5e4d3f68 Fix the formatting of that comment...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6521 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-07 21:16:52 +00:00
Mike Thomas 24d126dd63 Allow the streamer to be used in a jvm-neutral way, streaming fields in alphabetical order. Sun JVMs use the order they're defined in the file, IBM JVMs apparently use the reverse of that, and Dalvik/Android JVMs stream in alphabetical order. Ideally, the alphabetical mode would be the default but this would break all kinds of legacy stuff, so I'm not going to make that the default. (I had done this before on the narya-1.5 tags - doing correctly on trunk now.)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6520 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-07 21:07:25 +00:00
Ray Greenwell 3640b7c289 The INSTANCE constant only really makes sense for ListStreamer,
as it's used for Collections, too.

Nixed my commented-out EnumSet/EnumMap explorations. A dead end.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6518 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-07 19:58:48 +00:00
Dave Hoover 568765dd13 Whitespace
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6517 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-07 19:55:59 +00:00
Dave Hoover 83d24a6d6e Update the comment, too
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6516 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-07 19:55:58 +00:00
Ray Greenwell a46e794730 Iterable is now supported, even more basic than Collection.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6515 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-07 19:52:41 +00:00
Ray Greenwell 490b381127 Streaming for Multiset and Iterable.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6512 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-05 15:31:46 +00:00
Jamie Doornbos f3c0359953 Allow users of the PersistingUnit to set the desired result from the invoke method rather than having to also override handleSuccess.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6508 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-28 19:30:34 +00:00
Charlie Groves 81bfee5132 Generate receivers and decoders for actionscript
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6507 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-26 02:04:06 +00:00
Tom Conkling c3d9b3b238 Move these variables where they belong and add some documentation. Also apparently whitespace.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6506 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-21 23:05:08 +00:00
Jamie Doornbos 061b55815d Just expose this number in case anyone needs it
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6502 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-21 21:36:19 +00:00
Jamie Doornbos 57b0175f7d Allow chat history to be held just long enough for the current stack to unwind.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6501 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-21 19:23:24 +00:00
Jamie Doornbos cbb97250ac Missed a spot
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6500 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-21 18:35:08 +00:00
Jamie Doornbos ee81934087 Extract the chat history code into a separate injectable module. This will make it easier to add new features or change the implementation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6499 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-21 18:34:06 +00:00
Mark Johnson eb41f8b70b - The secret would not be properly assigned to the ClientLocal during session resuming (and likely
on peer transfers of client connections), so have PresentsSession handle that in both starting
and resuming a session (and takes out a synchronized call in ClientManager).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6495 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-15 18:42:46 +00:00
Mark Johnson ee2c653c3e - This secret ended up being stored in the auth request
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6494 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-15 18:24:19 +00:00