Commit Graph

63 Commits

Author SHA1 Message Date
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
Walter Korman 90a919720a Removed code to disallow adding an observer more than once since the
observer list now takes care of that.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2064 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-12 23:56:36 +00:00
Michael Bayne 2f7399ed68 Added support for specifying a version string during the client
authentication process.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1870 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-31 18:44:34 +00:00
Michael Bayne 98d19e055a Added facilities for idling out clients that have not communicated with
the server in 90 seconds. The client is set up to ping the server if it
has had nothing to say to it for other reasons in the last 60 seconds.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1860 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-29 23:51:26 +00:00
Michael Bayne 7ce6ca340e Clear out clobj when we're logged off; keep cloid up to date; don't claim
we're logged on until we're fully logged on (meaning we have our clobj
reference).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1818 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-21 18:04:56 +00:00
Michael Bayne dfd499582e Removed vestigal field.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1789 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-08 22:00:27 +00:00
Michael Bayne bdd49a4b3f Moved clientObjectDidChange() into SessionObserver because anyone
observing the session is likely to need to know about that sort of thing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1719 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-20 00:54:39 +00:00
Michael Bayne ba4985053f Revamped "persona selection" support. Things now actually work, and in as
sensible a way as we can hope for.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1717 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-19 23:36:59 +00:00
Michael Bayne e54a4d41f4 The great invocation services rethink of 2002! Rearchitected the remote
method invocation services and converted everything to the new style.
Could this be my biggest checkin ever?


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1642 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-14 19:08:01 +00:00
Michael Bayne 67492e13f0 Modified client observer notification process to:
a) use an ObserverList in SAFE_IN_ORDER_NOTIFY mode which circumnavigates
any funny business like observers being added or removed while we're
notifying the observers.

b) require that the clients be notified on the main client thread
(generally the AWT thread) by using the invoker; we had a problem
previously where clientDidLogoff() was being called by the communicator's
writer thread which caused all hell to break loose because everything
outside the client networking layer depends on running on the same thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1422 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-04 16:34:24 +00:00
Michael Bayne 9b88def20b Took out the server ticks business because we're going to do delta times
in a more general purpose manner.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1403 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-28 22:54:43 +00:00
Michael Bayne fc0300d80d Removed debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1401 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-28 22:07:13 +00:00
Michael Bayne 1492561985 Whoops, had that backwards.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1400 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-28 22:06:05 +00:00
Michael Bayne 2f1a67077a Added code to establish the time delta between the client and server
clocks immediately following authentication.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1398 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-28 21:56:38 +00:00
Michael Bayne 625fc79502 Restructured invocation director so that it can be used in the absence of
a Client instance.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1228 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-10 06:08:59 +00:00
Michael Bayne 1d956214dd Added SessionObserver which is a pared down version of ClientObserver that
only reports logon and logoff.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1117 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-11 19:51:25 +00:00
Michael Bayne 284e8ef6ed Made addObserver into addClientObserver because that's how we do it
everywhere else. Same thing for removeObserver.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@981 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-09 20:45:23 +00:00
Michael Bayne cd458fa3aa Moved the default server port into the client where it is accessible by
various entities rather than only server code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@571 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-25 23:36:06 +00:00
Michael Bayne 8dcdfb7e8a Added loggedOn() which indicates whether or not we're logged on and
modified code not to try to logoff in logoff() unless we're actually
logged on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@491 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-18 18:40:18 +00:00
Michael Bayne 8a4c46badc The first great Three Rings renaming. Cocktail changed to Narya, Cher
changed to Presents and Party changed to Crowd. Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@431 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-11 04:07:54 +00:00
Michael Bayne e75e442f0c Make the bootstrap data available to external entities.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@412 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-09 18:17:33 +00:00
Michael Bayne 95f6bf7300 Modified client so that the invocation director is always around rather
than being created after we log on because other code will want to
register itself with the invocation director before we log on. The
invocation director now just handles being reinitialized which is what
will happen when we log off and back on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@384 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-03 03:42:31 +00:00
Michael Bayne 6620936a04 We've always been at war with Eurasia. Changed InvocationManager to
InvocationDirector (please god let the renaming be done). Removed IntMap
and modified code to use samskivert's HashIntMap.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@375 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-02 02:08:16 +00:00