Commit Graph

85 Commits

Author SHA1 Message Date
Michael Bayne 725f656197 Fixed a bunch of type safety bits pointed out by the latest version of Eclipse.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5274 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-30 12:58:51 +00:00
Dave Hoover 6b1d65553f And finally, narya gets the imports/overrides/regen love.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5241 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-18 23:20:17 +00:00
Andrzej Kapolka ac3640dc9d Standalone clients don't have communicators.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5129 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-23 21:00:08 +00:00
Andrzej Kapolka 9bafa5e7c8 Basic support for datagram messaging. Hope I haven't fucked
anything up!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5090 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-13 21:12:39 +00:00
Charlie Groves b65487f318 Cut the number of times a service class needs to be specified to two
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4993 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-10 01:18:32 +00:00
Dave Hoover 2ce35db583 Remove unneeded casts.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4923 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-01-17 01:25:52 +00:00
Michael Bayne 5ae87258fa If we lose our connection, let anyone who had a pending subscription request
outstanding know that their subscription request failed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4873 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-13 02:56:35 +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 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 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
Michael Bayne 77e3f22d90 Added moveToServer() which does pretty much what it says. Boy I love writing
everything in two languages. Especially when one doesn't support inner classes
and has non-C syntax just to make life easier for parser writers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4762 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-13 21:57:55 +00:00
Michael Bayne 2fead8208c Let's not confuse terminology between one server proxying for another server
and the ProxySubscriber mechanism by which the server proxies for the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4730 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 22:41:41 +00:00
Michael Bayne c365afa2fc Rejiggered the way things are handled when using a Client to proxy events from
another server. The PeerManager needs both to rewrite the oid of the events
before dispatching them and to assign an eventId to them so that they will not
be filtered by PresentsClient when deciding whether or not to send them along
to its client. Also fixed compound event dispatch in the process. Now proxy
subscribers will be notified once of a compound event rather than of each
individual internal event.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4729 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 22:37:53 +00:00
Elizabeth Fong 3c7a546472 rollback r4636 due to interference with non-yohoho projects
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4637 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-03-27 21:49:25 +00:00
Elizabeth Fong f76825c76e Fix yohoho singleplayer NPE boochery caused by unsafe direct call on DObjectManager
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4636 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-03-27 21:11:13 +00:00
Michael Bayne 09f0bee0f3 Yet more header patrol.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4602 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-24 00:39:27 +00:00
Michael Bayne de633c61b5 Standalone mode logon needs to be done less hackily now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4572 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-13 00:20:02 +00:00
Michael Bayne a617b9322e We need to run willLogon() immediately, also modified BasicDirector and Client
to fail if a director tries to register services groups but was not created
until after the client was logged on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4557 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-11 20:37:28 +00:00
Michael Bayne b7e16c86f5 Added getBootGroups() to Client, made use of it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4555 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-11 03:08:04 +00:00
Michael Bayne c2dbae4809 We'll actually need to call clientWillLogon()...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4554 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-11 01:50:11 +00:00
Michael Bayne ebc99935d5 If we're going to do this, I guess we're going to do it properly. Nixed the
notion of a global group (though we implicitly define one in InvocationCodes)
added a mechanism for directors (which generally handle the client side of
invocation services) to register their interest in bootstrap service groups so
that the whole goddamned complex business can happen magically behind the
scenes.

If you instantiate a director, it will automatically register interest in the
service group it needs and everything will work. If you don't use the director
code, you don't get the services and you can safely exclude all of that code
from your client even though the services are still in use on the server (and
presumably used by some other types of clients).

This is going to break all the builds, which I'll soon fix. Then I'll go write
all this in ActionScript. Yay!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4552 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-11 01:17:30 +00:00
Michael Bayne 9afcc526a0 Bit the bullet and implemented invocation service groups so that our various
MetaSOY clients (Swiftly, World, and soon Admin Dashboard) don't have to know
about a bunch of unrelated crap. Fricking complexity++, grumble.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4551 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-11 00:42:35 +00:00
Michael Bayne 4894d1cfde Annoyingly, ClientObserver.clientDidLogoff() is called before the client's
inner bits are all clear and ready to try logging on to a new server. We
specifically wait to call clientLogonFailed() until after everything is
cleared, but I don't want to change the behavior of clientDidLogoff() for fear
that any one of the zillion directors depends on something being around during
that call.

Instead I added another callback clientDidClear() that is called when a
successful session is fulled cleared out (basically when we're not calling
clientLogonFailed()) so that entities that are waiting for a logoff to finish
so that they can logon somewhere else have a clean way of doing so.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4255 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-07 04:02:42 +00:00
Michael Bayne 33a758dfce The basis of cluster support for Presents servers. All servers in a cluster
make connections to other servers in the cluster and can exchange events (in a
limited fashion).

This is different than Liz's project wherein servers share an oid space and one
can interchangably work with distributed objects from any server. This package
provides a means by which certain services (by default, presence and chat) can
be communicated between servers to allow communication between players
scattered around a bunch of otherwise independent server instances.

This is less general purpose but also less likely to encourage people to write
code that tightly couples multiple servers and then falls over because it
generates gobs of network traffic as events are flung willy nilly behind the
scenes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4238 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-01 00:19:59 +00:00
Michael Bayne 0a5953bf17 Chipping away at proper type safety for all of the Narya code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4232 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-27 17:46:36 +00:00
Michael Bayne 77adfc15ec Revamped the basic Presents client to support attempts to connect to the server
on multiple ports, falling back from one to the next as appropriate.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4158 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-30 22:12:15 +00:00
Ray Greenwell 981deb3b6b Fixed two bugs with delta calculation:
- if a pong response took more than 5 seconds to receive, another ping
  would be sent. When the pong finally arrived the delta would be
  calculated using the most recently sent ping.
  Fix: don't send more pings while waiting on a pong.
- After a pong is received, the _deltas array is mangled while
  calculating the server delta, making subsequent pongs possibly
  overwrite earlier calculated deltas.
  Fix: calculate using a copy.

Also, changed the delta calculation to be the mean of the deltas rather
than the median. Left code in to do it both ways if this change was not
kosher...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3990 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-30 01:08:32 +00:00
Michael Bayne 301c1cbe4d Dispatch the notification that the client failed to logon after we are
completely cleaned up so that an immediate attempt to logon using a
different configuration will not fail due to the client thinking it's
still logged on from the previous failed attempt.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3658 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-21 20:23:37 +00:00
Michael Bayne eba31091bb Switch the default port for the Presents system to the DirectPlay port.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3656 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-21 19:26:05 +00:00
Michael Bayne ee144eb974 Created a basic application framework that integrates JME's rendering loop
(in fixed framerate format) with the Presents event queue in what will
hopefully be happy harmony. Also made some edits to the Presents code to
not sound like we assume things run on the AWT thread which we don't and
which is not the case in this framework.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3510 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-20 21:44:03 +00:00
Andrzej Kapolka ad1edd6e69 Added standalone flag and special standalone logoff method to Client, options to BasicDirector to hold off on initializing directors not needed for standalone mode.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3393 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-10 02:06:43 +00:00
Michael Bayne 121f6d7e53 Did the refactoring necessary to get the client and server to live happily
together in one JVM and both interoperate with the AWT thread in a manner
so harmonious as to bring a tear to the eye. This was surprisingly much
easier that I expected, thanks to my eminently sensible initial design,
I'm sure. ;)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3360 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-20 00:37:34 +00:00
Michael Bayne 56417cdb0a Indicate whether we rejected an attempt to logon because we're still in
the throes of a previous connection. Also don't spuriously recreate our
ticker because it's very possible for logon() to be called and not
logoff(), logon() might fail, for example.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3321 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 05:03:37 +00:00
Ray Greenwell bd80c348eb The great Interval revamp.
There is no more SafeInterval, instead Intervals can be constructed with a RunQueue to use for expiring.
PresentsDObjectMgr implements RunQueue.
Client has a getRunQueue() method to get the client side RunQueue.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3283 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-22 19:23:00 +00:00
Michael Bayne c92a922678 The rabbit hole goes deeper. Now we can configure the client with a custom
classloader to use when unserializing objects off the network. Also fixed
the way custom classloaders were used as Class.forName(class, true,
loader) seems to be the proper way to go to have caching work and whatnot.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3268 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-10 01:23:44 +00:00
Michael Bayne aa241b22cb Do things in a slightly more thread-safe manner (whatever that means).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3148 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-18 21:40:24 +00:00
Michael Bayne a9720fd905 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3099 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:21:06 +00:00
Michael Bayne d618d3c771 Eclipse suggested cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2971 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:50:28 +00:00
Michael Bayne 5774f1b6a5 Removed verbose logging. Didn't discover anything useful with regard to
disconnects.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2923 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-12-19 18:30:23 +00:00
Michael Bayne 1bdfb805ab We can't do this, currentTimeMillis() will return bogus values such that
the math appears to work out even though time stopped. We can use
RunAnywhere.currentTimeMillis() which will warn if time goes backwards but
since when that happens the IntervalManager stops dead in it's tracks,
we'll never get ticked to find out about it. Fucking Windows.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2911 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-12-13 02:56:29 +00:00
Michael Bayne 3af7167f2c Track and report whether we go long periods of time without being ticked.
We should be ticked every five seconds.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2909 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-12-13 02:50:12 +00:00
Michael Bayne 0cd11f034b Not to freak out if we've no bootstrap.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2890 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-12-03 23:38:58 +00:00
Michael Bayne 567d3696a9 Added toServerTime().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2818 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-30 22:18:18 +00:00
Michael Bayne bedb859943 Demoted logging to debug.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2814 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-25 15:57:38 +00:00
Michael Bayne 32bfc704d7 Not to freak out while we're not connected.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2767 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-12 01:01:09 +00:00
Michael Bayne 732c0aab41 Modified clock synchronization approach slightly so that we allow 5
seconds to pass in between ping/pong latency samples. Additionally, we
resync the clock every 10 minutes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2748 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 20:20:39 +00:00
Michael Bayne 7efc5dfc32 Make the auth response data available to interested parties.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2713 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-07-17 21:39:15 +00:00
Michael Bayne 5bccc8482c Report the computed server/client time differential.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2593 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-20 19:07:52 +00:00
Michael Bayne 91146a6805 Added support for registering, on a per class basis, a delay which will be
observed after the last subscriber of a matching distributed object has
been removed. Our client's subscription will not be flushed until after
the delay has expired, and only then if no other subscriber has come along
requesting the object in the meanwhile.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2303 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-03-11 04:43:14 +00:00
Michael Bayne ebfdc80977 Shoot the bootstrap out the debug log.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2224 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-28 04:24:16 +00:00