Commit Graph

4793 Commits

Author SHA1 Message Date
Michael Bayne 4f83cf0119 Added a backwards compatible registerDispatcher() call to repair GG games.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4851 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-19 23:16:52 +00:00
Michael Bayne 27b95dd19a Nix another redundant cast.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4850 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-19 18:28:56 +00:00
Michael Bayne 66660bc490 Don't need to cast the result of an array clone.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4849 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-19 18:22:37 +00:00
Ray Greenwell 2f4439c64e Made the map work with null as a key.
(Dictionary supports null keys, so we merely call null a 'simple' key.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4848 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-18 23:55:26 +00:00
Michael Bayne a2af35fcfd Log a warning rather than NPEing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4847 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-18 18:49:52 +00:00
Andrzej Kapolka 8c4776a3f0 Might as well use a different signifier in case people do want to use
negative indices.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4846 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-18 18:01:49 +00:00
Andrzej Kapolka 924a8a319d That was a fun one to track down. Using an index of -1 for Array.splice
inserts the element just before--not after--the last element.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4845 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-18 01:41:19 +00:00
Michael Bayne a34e500ea6 Added startTransaction() and commitTransaction() to the InvocationDirector so
that EZGame can batch up state change requests which are all invocation service
requests.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4844 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-17 21:33:05 +00:00
Michael Bayne 6b46554eaf Widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4843 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-17 21:06:17 +00:00
Charlie Groves 45034b895e Reference the client immediately rather than on the dobjmgr thread so it doesn't get released before we tell the listener it's resolved.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4842 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-10 02:01:48 +00:00
Michael Bayne 8cfe92aba6 Nix empty directories.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4841 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-09 06:04:14 +00:00
Michael Bayne 466ae35688 Proper Long handling and checking for @ActionScript(omit=true) up the
superclass chain. Other such annotation "inheritance" is needed for methods,
but that I'll do later.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4840 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-09 01:52:22 +00:00
Michael Bayne 8f81893a0c getFailureMessage() should be protected as it's not part of the persisting
unit's public API.

handleResult() and handleFailure() could also be protected but we're adapting
Invoker.Unit to something that appears to provide a different (persistence
friendly) public API even though the invoker doesn't actually call it, but
rather the normal Unit public methods call the new public methods. But we still
want to maintain the "feel" of these being the PersistingUnit's "main thing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4839 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-08 23:55:51 +00:00
Michael Bayne d4562ff806 Allow external parties to call applyToDelegates().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4838 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-02 23:29:02 +00:00
Michael Bayne 13c2173829 Don't need two of these fellers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4837 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-02 00:09:13 +00:00
Michael Bayne 4cc4c3c9f1 Use the bare BlockingCommunicator in the PeerNode instead of the
ClientCommunicator which does stuff like try to save its preferred connection
port using the Java preference system (which is no longer available to server
processes due to the removal of their home directories).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4836 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-01 23:47:02 +00:00
Michael Bayne ab632ffe83 Refactored communicator so that we can not do some things in the peer client
(which runs on the server) that we do in a normal client (which runs on a
user's computer). Eventually we'll make a custom Communicator for use on the
server that integrates with the ConnectionManager's polled socket I/O which
will be easier now that this bit of factoring has been done.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4835 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-01 23:44:31 +00:00
Michael Bayne 120d641dea Comment rearranging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4834 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-01 21:26:27 +00:00
Mark Johnson 1ec7f25ea6 Refreshing the peers seems to often take just over 500ms, so increase the time we wait before logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4833 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-28 23:26:42 +00:00
Mike Thomas b3678b086d The client manager was busy registering client objects on the ConnectionManager thread rather than the dobj thread. Give it a nudge in the right direction.
Also, added logging to the PresentsDObjectMgr to check for this type of thing and dump stack if anyone is trying to register objects anywhere but the DObj thread (assuming we're sufficiently far started up that there is one).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4832 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-28 18:35:20 +00:00
Michael Bayne 873eede988 Log a message when we drop a forced move request due to a pending move.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4831 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-24 20:47:17 +00:00
Michael Bayne 6904c467bf Identify ourselves if we turn out to be a long dobj unit.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4830 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-24 17:23:02 +00:00
Michael Bayne 400a42930b Return the correct value if we're asked for this node's public hostname or
port.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4829 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-20 01:49:56 +00:00
Michael Bayne c0ead54dbe Dispatch our client tick on the RunQueue so that it doesn't end up running on a
separate thread and racing against other client actions. Also nixed a pointless
type check and cast.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4828 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-19 03:35:17 +00:00
Nathan Curtis 57421c8a58 There are many ways I could rant about this, but I'm going to try to keep it short and
informative (and clean ><)...

While testing the ability to go straight to someone in a game from My Whirled, I was getting 
decoding streaming problems (but only sometimes) when fetching the game data.  After many hours
of looking for the problem and swearing up and down that it was nothing but consistent, malicious 
bitrot, I've tracked it down to this.

In Underwhirled Drift (which is the game I was testing this on), I have a couple of property arrays
that get set when the game is first started up with this:

    _control.set(PLAYER_STATE, new Array(numPlayers));

This allows me to fill in the proper indices at a later time in random order.  This was working
fine for multi-player games, and after what I've discovered here, I think I can get away with 
something simpler, but that can wait for later.

When this was getting encoded, the expected effect would be to encode a TypedArray with a null
in each spot that is defined in the source array (numPlayers long).  In fact, it was creating an
empty, zero length TypedArray.  I'm not sure why - but that was confusing the system somewhere
along the line so that when that set of bytes was read back from the server on another client 
(for instance, when fetching the EZGameObject when trying to join an in-progress game).  Of course,
zero-length TypedArrays should go over the wire just fine, so I'm not entirely convinced that I've
tracked down the entire problem (or if that is in fact the issue, then it needs to be addressed).

The diffs here will cause the encoding and decoding to correctly pull nulls out of the array, and 
put them in the TypedArray.  The moral of this story is to watch out for this construct:

    for each (var obj :Object in arr) {
    }

...it may not always be doing what you would rightfully expect...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4827 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-18 23:29:49 +00:00
Michael Bayne 93c89fe0a7 Be sure that we always dispatch subscription responses (success or failure) on
the dobjmgr thread to relieve the caller of the burden of knowing what thread
they are on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4826 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-14 18:17:50 +00:00
Mike Thomas e4cb816fba This is being called on other-than-the-DObject thread, and we really don't want to be posting messages directly outside that thread.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4825 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-14 17:58:54 +00:00
Dave Hoover 59a65e9ef2 We're waiting to hear that our PlaceObject has been destroyed so we can
call didShutdown, so we can't stop listening to it until then.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4824 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-13 21:38:01 +00:00
Michael Bayne e71fed20c3 Clear out our PlaceManager listenerships when we shutdown to ensure that the
manager can be collected even if the object lingers about for a while and
because it sets a good example.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4823 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-11 22:20:28 +00:00
Michael Bayne bc739b6520 Clear out our speak service once we've unregistered it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4822 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-11 19:59:08 +00:00
Michael Bayne 9f2a90f001 Implement Comparable<Name>. The old compareTo() did funny things if a Name was
being compared with a non-Name but I'm almost certain that never happened and
was just Ray being kooky.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4821 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-10 17:34:53 +00:00
Michael Bayne 30cb0b6122 Use junit4.jar.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4820 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-28 20:26:04 +00:00
Michael Bayne 810969f6f9 Pass a message along with a FailureResponse.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4819 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-22 01:15:39 +00:00
Michael Bayne 9a150ebcda Some widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4818 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-22 01:12:02 +00:00
Michael Bayne 52be62ddbf Added a helper method for calling an invocation service method on one or more
remote nodes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4817 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-17 21:02:44 +00:00
Michael Bayne d92f81af78 Crowd peer services now forward broadcasts as well as tells. We must get the
word to the people, all the people.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4816 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-16 22:38:40 +00:00
Par Winzell 3204cc6266 We're not going to do this INDEX: comment thing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4815 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-16 21:53:53 +00:00
Michael Bayne f90a39207f Created a peer-aware DatabaseConfigRegistry that broadcasts changed runtime
configuration information to other peers so that they all remain in sync.

Also nixed constructor arguments to the peer manager so that it can be created
at server construct time like all other managers and be available for the
twisty maze of inter-registration that takes place during the manager init
process.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4814 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-16 20:53:17 +00:00
Michael Bayne b18ebdbc53 Whitespace trimming.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4813 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-16 18:33:45 +00:00
Michael Bayne f80495f906 Widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4812 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-16 18:25:46 +00:00
Robert Zubeck 59086147e6 A signed 64-bit integer can be stored as two 32-bit integers in Actionscript, but converting
them to a single number becomes inconvenient for values larger than an single int, and tricky 
when the value is negative (i.e. in two's complement split into two words, with sign bit only
in the high int). 

Instead of splitting a long into two ints, we store it internally as a byte array that corresponds 
exactly to Java's serialized version (sequence of eight bytes, high byte first), and we provide 
accessors to convert to and from Actionscript numbers. This makes Java Long values readable in 
Actionscript, and vice versa.

Unfortunately, Actionscript does not have a native 64-bit integer - the closest equivalent is the 
Number class. Since this is a double float with a 52-bit mantissa, very large long values will 
suffer precision loss during conversion. 




git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4811 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-10 20:49:03 +00:00
Robert Zubeck 77ef41cb42 Separated out chat message listener functionality, and subsequent chat message
processing. This enables subclasses of ChatDirector to listen for their own
types of chat messages, but call the superclass to process them.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4810 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-10 20:33:03 +00:00
Andrzej Kapolka 2ac50f387a Added a StreamableHashSet class.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4809 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-10 19:44:02 +00:00
Par Winzell 1eda45d8c8 Document index use.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4808 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-07 18:11:30 +00:00
Michael Bayne a6be47fa83 Adjust the shutdown process to ensure that we can get messages generated during
the shutdown sequence out to our clients where desired.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4807 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-06 18:38:27 +00:00
Michael Bayne 0c5a4f6683 Useful error reporting.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4806 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-04 02:16:24 +00:00
Michael Bayne 4260a71946 When we call leavePlace() make sure locationDidChange() is dispatched to
listeners letting them know that we're no longer in a location.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4805 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-03 22:40:00 +00:00
Michael Bayne 87bad12e19 Widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4804 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-02 21:52:11 +00:00
Michael Bayne affca34556 Pipe down there little fellas. There seems to be no easy way to not show debug
logging on the console so let's not be uninformatively verbose.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4803 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-02 18:48:45 +00:00
Michael Bayne 0cb497e6ce This ain't overridin' nothin'.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4802 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-01 17:45:19 +00:00