Commit Graph

104 Commits

Author SHA1 Message Date
Michael Bayne 3f19fcacf2 Moved Lifecycle to samskivert (my initial desire to do this came from a
non-work project). I promise to stop fooling around now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5805 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 19:16:49 +00:00
Michael Bayne e87c86dc2c Let's make the Lifecycle a bit more abstract and decouple it from all the
server business. I'd move the whole kit and kaboodle to samskivert but that
would mean moving the DependencyGraph as well...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5804 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 19:09:47 +00:00
Michael Bayne 0a20b36c8e Out with ShutdownManager, in with LifecycleManager which handles both
initialization and shutdown. This will obviate the need for a lot of manual
wiring up. ShutdownManager still works and passes through to LifecycleManager,
but switching to the new deal is encouraged.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5802 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 18:32:45 +00:00
Michael Bayne 17688e9ff5 Updated comment to reflect reality.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5758 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-29 21:59:28 +00:00
Michael Bayne 6fe7159b4c Provide an Iterable for our client objects.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5743 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-23 17:01:38 +00:00
Michael Bayne 688f2580ed Varargified log calls.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5697 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-26 00:02:19 +00:00
Charlie Groves 0da49cb6ab Uhh, might want to handle PresentsSession.getInetAddress returning null for disconnected clients
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5687 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-18 20:14:15 +00:00
Charlie Groves 8f05b41c6a Add getSessionsForAddress to return all the active sessions for a given IP address.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5682 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-06 21:29:01 +00:00
Dave Hoover 41003c6059 Widen/remove unused variable
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5663 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-02-23 21:53:18 +00:00
Michael Bayne 0650c074b3 Actually clearSession() can be called from any thread.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5660 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-02-18 23:08:13 +00:00
Michael Bayne e01c8b0635 Separate the reporting of session end to observers from clearing out our
internal bits. Only report that a session ended if we reported that it started,
but always clear out our bits when a session is shutting down.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5659 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-02-18 23:06:32 +00:00
Michael Bayne f75d810a92 Now that the PresentsSession reports its authname type, we can skip it in a few
of these places.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5656 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-02-13 03:08:16 +00:00
Jamie Doornbos a3d08aaa2d Oops, missed this little guy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5642 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-22 16:54:08 +00:00
Jamie Doornbos 00954dff5b Stop spamming the log file with these warnings. The code does nothing to prevent them and they are happening all over the shop in msoy.
Was going to try and skip the call to ClientObserver.clientSessionDidEnd if it has not yet been started but there is not clear way to determine the state of a session. It is shared between three different maps in ClientManager and PresentsSession and movement between the states is too complicated, at least for tomorrow's release.

[jamie@whirled1 /export/msoy]$ grep "Requested to release unmapped" log/world-server.log.2009-01-20 |wc -l
     830
[jamie@whirled1 /export/msoy]$ grep "Unregistered client" log/world-server.log.2009-01-20 |wc -l
    1971
[jamie@whirled1 /export/msoy]$ grep "Different clients" log/world-server.log.2009-01-20 |wc -l
     362


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5641 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-22 06:46:00 +00:00
Jamie Doornbos 44a4981d27 Stop trying to flush clients after the server shuts down
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5633 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-14 23:28:16 +00:00
Jamie Doornbos a99489e650 Aha! Fixed race condition in narya fundamentals introduced with guice (r5153). This was causing a very rare concurrent modification exception when a client would log on when another one was about to expire. The problem was revealed by the trace in the msoy log of the 2009/01/10.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5632 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-13 22:33:56 +00:00
Michael Bayne d273a550fa More session type reporting.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5630 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-10 19:04:12 +00:00
Michael Bayne 84b0a6b413 Report information that will allow us to disambiguate world, game and party
auths.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5627 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-10 18:46:31 +00:00
Jamie Doornbos e9bfc85db8 Let new implementations of this have better variable names
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5616 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-04 21:24:20 +00:00
Michael Bayne a0cc2fd348 Nixed the notion of a ConnectionObserver. The only observer was the
ClientManager and it is already pretty tightly coupled to the ConnectionManager
so we weren't really fooling anyone with that ham-fisted attempt at
abstraction.

Also cleaned up more mid-shutdown behavior. If a session is unmapped after the
omgr exits, avoid generating a warning by trying to hop onto the omgr thread to
clean up after ourselves. We still do all the actual socket related closing so
that the party on the other end of the socket benefits from a clean shutdown
where possible.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5537 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 01:52:29 +00:00
Michael Bayne b81ccde75b ClientFactory -> SessionFactory, etc.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5509 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:24:44 +00:00
Michael Bayne c69630b7e0 PresentsClient -> PresentsSession (Jamie's suggestion) and associated changes
on down the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5508 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:04:42 +00:00
Michael Bayne 6fd2882fa9 Actually we need to set up our local attribute here.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5476 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:02:51 +00:00
Dave Hoover 657aafaedb And of course, if I were thinking this morning, I would've rerun the organize imports
thing before committing instead of just going "oh yeah, I've been having this stuff
sitting around uncommitted for a while waiting on it to be blessed" and missing
out on things that'd changed in the meantime.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5400 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-26 17:35:29 +00:00
Dave Hoover 7ee6ace683 Javadoc warnings cleanups.
Note: this involves generated code from a samskivert patch I only just sent to mdb,
but he's in a meeting, so that won't show up for a little.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5369 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-12 17:59:26 +00:00
Charlie Groves 80ca1dbc64 Fix broken javadoc links and params to kill my Eclipse warnings. This includes
importing receivers from their senders to satisfy their links.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5333 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-21 01:46:51 +00:00
Michael Bayne fcedbe90d7 Thread.dumpStack() circumvents whatever logging is configured and writes
directly to stderr. Logging an exception with the associated warning does the
right thing and logs the stack trace via the logging system.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5318 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-13 17:35:37 +00:00
Michael Bayne 5c664a2667 Report a bit more information in these strange edge cases.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5292 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-05 12:49:40 +00:00
Michael Bayne 5c4ab96880 Styley stylopolis.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5252 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 14:01:51 +00:00
Michael Bayne c743432676 More style changes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5248 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 13:02:13 +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
Michael Bayne d689839442 Log a newly created exception to obtain our stack trace instead of using
Thread.dumpStack() which goes directly to stderr rather than through the
logging system.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5198 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-29 11:07:36 +00:00
Michael Bayne 0128f6525a Modify PresentsClient and ClientResolver creation so that we can inject
dependencies into both. Moved the legacy statics into CrowdServer so that at
least Presents can be pure (we should probably eventually move them into
BangServer and PiracyServer and fix everything else). Added some useful manager
references to PlaceManager delegate (_omgr, _invmgr) that handle the majority
of their service needs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5170 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 20:23:49 +00:00
Michael Bayne 8c37ca7bfa Three things:
- Inject the auth Invoker.
- Inject the Authenticator and formalize the chaining authenticator pattern.
- Simplify PeerNode creation and make the PeerAuthenticator a chainer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5162 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 13:04:27 +00:00
Michael Bayne 3aefc93838 Holy fruity beverage Batman! I'm taking the plunge and switching to Guice for
dependency resolution and management. Things are currently in a state of
transition, but the important patterns have been established and I'll aim to
sweep through all of Narya, Nenya and Vilya in the near future and do
everything properly.

Going through the other million-odd lines of code we have scattered across our
various projects that use these libraries is not something I plan to do, so
we'll be maintaining backward compatibility with the old static member method,
though I hope to strive toward eradication of that usage entirely in MSOY while
we still have a fighting chance.

Given that some of our projects will continue to use the static member method
in perpetuity, I'm not going to @Deprecate those fields because that would fill
their logs with so much spam that they'd have to turn off deprecation warnings
which would make life worse for them. So instead we'll settle for the big scary
comment warning people away from the old bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5153 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-07 17:44:48 +00:00
Michael Bayne 919112cf88 Switch to new samskivert logging API.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5134 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-27 19:25:38 +00:00
Michael Bayne 591dc1541a Extract our permission policy into a separate class so that a system can more
easily make use of different permission policies in different circumstances
(one can imagine a hypothetical partner who has different access control
requirements, perhaps).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5118 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-22 13:12:40 +00:00
Charlie Groves 8581947de5 Add a cousin of setUsername, updateUsername, that does the same thing but in the active client object. Like setUsername, its invocation should always be accompanied by the sacrifice of at least three chickens and if you really want it to succeed, one small goat.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5081 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-12 21:23:16 +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 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
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 b514ddbbf2 Always dispatch clientResolved() on the dobjmgr thread, even if the client is
already resolved and we're being called from a non-dobjmgr thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4744 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-28 21:42:41 +00:00
Michael Bayne 4d455eb6e6 _usermap is referenced by both the conmgr and dobjmgr threads, so access to it
must be synchronized.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4681 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-04 02:25:03 +00:00
Michael Bayne 69485a88ee Widened, fixed documentation and nixed unneeded runnable posting for
clientSessionDidEnd() which is called on the dobjmgr thread directly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4680 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-04 02:11:33 +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 0384c8c129 Update our AuthRequest on session resume so that we deliver the proper
bootstrap services.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4601 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-23 23:19:11 +00:00
Michael Bayne ff30b2e116 Type safety!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4573 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-13 00:23:13 +00:00
Michael Bayne 1e4c28ecff Fixed typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4492 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-12-21 06:58:11 +00:00
Michael Bayne 7379cf09db Communicate the client's timezone to the server during the authentication
process and keep that information around in case the server ever wants to know.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4356 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-07 01:56:41 +00:00
Ray Greenwell 0149aa3b1d Rollback last commit.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4351 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-30 00:34:07 +00:00