Commit Graph

77 Commits

Author SHA1 Message Date
Ray Greenwell 7233c34e0f Call userObjectWillChange prior to informing the caller that the
change has been reported.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3578 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-27 01:01:26 +00:00
Michael Bayne a4ac47fb04 Reinstated the Presents I/O refactor with the modification of ensuring
that authentication is processed on the dobjmgr thread rather than
requiring the caller to do the right thing (or not as the case happened to
be).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3433 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-28 21:49:19 +00:00
Ray Greenwell d58d1001ac Roll it all back.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3432 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-28 19:33:28 +00:00
Michael Bayne a285695ca8 I finally broke down and did the rewrite to fix the potential race
condition between the omgr thread and the conmgr thread. Now when the omgr
thread processes an event that is going out to the clients, it flattents
the message itself for each client that is to receive the message and the
flattened data is posted to the conmgr outgoing queue.

This means that once an event is finished processing, no further
modifications to any of the data associated with the event can effect the
data queued up to be sent to the client. This is a good thing, it will
eliminate or illuminate a very baffling class of bugs that we've sort of
been ignoring because we knew this could be the cause.

We used to take an event and flatten it directly into the direct buffer
from which we would do our socket write. Now we flatten it into a
temporary byte array. This means a metric shitload more garbage generation
and collection. We used to do the flattening on the conmgr thread, now we
do it on the omgr thread. This means a big redistribution of CPU demand.

Either of those things could result in a significant negative impact on
our performance, but we'll just have to deploy this stuff and find out.
Whee! If it turns out to be a serious problem, there are potential
optimizations that could be done by keeping a pool of direct buffers
around and flattening messages into them, relying on the fact that the
outgoing conmgr queue generally doesn't grow too large and we could
allocate tens to a hundred megabytes of memory for the outgoing queue if
we really needed to.

I'd also like to test the overflow handling stuff more. It didn't really
change in that everything just deals with arrays of bytes now instead of
unflattened messages, but I'll be more comfortable once I've seen all this
in action on ice where there may be few users, but they are just as likely
to experience lag and receive an overflow queue as users on the higher
traffic servers. There is code to log when overflow queues are created and
finally flushed and how much use they got while they were around, so that
should give us an indication of whether things are operating properly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3419 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-19 08:39:19 +00:00
Michael Bayne 713e76373b Allow the authenticator to slip some authentication data down the line to
the PresentsClient which can then use it to fill in things like access
control information for the user. We could use this to replace the
UserStash mechanism we use on Yohoho, but that works so I doubt I'll do
that. However, this is needed to do things the more elegant way on future
projects, like Game Gardens.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3374 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 03:08:23 +00:00
Michael Bayne afabea71ad Big fat Bernie javadoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:08:21 +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 a6d7764e29 More custom classloader support. We now have a proof-of-concept working so
it's unlikely that the rabbit hole will surprise us with further depth.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3269 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-10 02:54:26 +00:00
Michael Bayne 8e9322c7fb Don't reclose an already closed connection, it generates a warning.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3173 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-27 01:27:44 +00:00
Michael Bayne 8856ae43a0 Made session ending more robust in the face of potential boocehs by
derived classes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3118 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-09-15 18:21:26 +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 761e05c540 Try to only log when something actually bad is going on.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3049 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-03 09:30:03 +00:00
Michael Bayne 32dee3cbaf 405 modified source files and 17,367 lines of diffs later we now enforce
more discipline when handling names in our code base. Any user entered
name should find its way into a Name object as soon as it comes out of a
text field or whatnot, and stay that way until it makes its way into a
text field or into a database record (for which String objects are vastly
simpler because of JORA magic).

Dear God, let me never again make a change this large for the rest of my
mortal life.

Unfortunately, this means we have to keep an eye out for funny business
pretty much everywhere. However, since we will absolutely want to test
market stalls and so forth on Azure, we'll have an opportunity to iron out
any funny business that might fall under the radar during our internal
testing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2980 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-03-06 11:29:19 +00:00
Ray Greenwell bfe9cbba04 Changed the variable named "enum", since that's a keyword in jdk 1.5
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2964 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-22 18:52:33 +00:00
Michael Bayne 350c49835c Let's use proper grammar.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2961 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-21 00:54:51 +00:00
Michael Bayne f8f4c1a611 If a client sends more than 100 messages in 10 seconds, give them the
heave ho.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2960 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-21 00:52:16 +00:00
Michael Bayne 414152443b We don't need to see the message.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2832 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-25 00:01:04 +00:00
Michael Bayne ba52e3cfa4 If we fail to deliver the objectAvailable() notification because the
client is disconnected, unsubscribe immediately. We normally unsubscribe
when the client loses its connection but it's possible for a subscription
request to come in and the client to lose connection before we can
communicate the object available response.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2824 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-10 23:23:41 +00:00
Michael Bayne 670d346c6c Clear out our subscription table in clearSubscrips() so that we don't
erroneously decide that we have stale subscriptions around, and log stale
subscriptions if we do end up clearing them.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2817 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-29 18:28:22 +00:00
Michael Bayne c597a5c833 Not to freak out if a client logs off between the time they made their
pirate selection and the time we manage to load up their pirate.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2816 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-25 21:07:54 +00:00
Michael Bayne 8b9199ed09 Make sure we don't have any dangling subscriptions if we receive a message
after having closed our client connection.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2791 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-07 23:30:13 +00:00
Michael Bayne 8d9b9f69d2 Quick hack to (hopefully) fix weird problem while I investigate.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2607 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-24 01:50:33 +00:00
Michael Bayne 1b1c38c998 Added tracking and reporting of messages sent and received; shaved 20 off
loc by combining message dispatch into one method.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2397 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-10 18:12:16 +00:00
Michael Bayne 36624d96ac Finally got around to making compound events actually stick together until
they arrive at the client. Mmm... network efficiency++.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2396 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-10 17:48:42 +00:00
Michael Bayne 057a5458ad Have the client manager let the clients know that they are being shutdown.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2357 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-03-30 21:04:18 +00:00
Michael Bayne d00619fe4d Log a stack trace if we choke during the resolution process.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2230 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-01 04:43:47 +00:00
Michael Bayne 7ff7ddc740 Not to freak out if we've lost our connection before we get around to
sending the bootstrap.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2216 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-24 21:36:04 +00:00
Michael Bayne 8bafb6fd32 Specifically ACK unsubscribe requests so that we don't see a bunch of
warning messages saying that we couldn't deliver events on the client that
come in after all client-side subscribers have been removed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2204 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-21 22:02:37 +00:00
Michael Bayne 6c3d9fba65 More goddamned fiddling to attempt to respond gracefully to any of the
wide variety of fucked up situations that might occur:

- Client authenticates and disconnects before their client object is
  resolved.
- Client authenticates and requests to end their session before their
  client is resolved.
- Client does one of the two previous actions and then attempts to
  reestablish a session before the client object is resolved from their
  first connection attempt.
- Client establishes a session in any of the previous or a normal
  circumstance but their client object fails to resolve.

Goddamned distributed programming, race-condition cluster fuck, strange
shit happening once in a blue moon business.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2086 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-22 19:16:31 +00:00
Michael Bayne b35f81cb62 A little more analysis revealed that we can avoid attempting to resume a
user's session if their client object is not yet resolved. When it does,
their session will be "started" for the first time and everything will
work itself out.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2068 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-15 18:32:19 +00:00
Michael Bayne 0749a20e6e Rejiggered endSession() so that overridden sessionDidEnd() methods can
call super.sessionDidEnd() and still do things with the client object at
the termination of the session.

Also removed the passing of the client object to sessionConnectionClosed()
because it's still possible that it won't be avaiable when that method is
called and whatever is being done there should also be done in
sessionDidEnd() if it is to work when the user ends their session as well
as when they disconnect.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2027 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-05 16:20:45 +00:00
Michael Bayne e91215b689 Explicitly pass along the client object to sessionConnectionClosed()
because it will have been cleared out of _clobj by the time said method is
called if it is called as a part of a terminated session.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2021 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-04 02:47:03 +00:00
Michael Bayne 371ca60bf5 Replaced old wacked-in-head system with proper reference counting for
client objects.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1989 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-26 02:14:25 +00:00
Michael Bayne 0cd73d2e56 Expose a calldown method that is called on the dobjmgr thread when a
client loses their connection (either gracefully or not).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1898 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 05:47:36 +00:00
Michael Bayne 79259479c6 Make a note of when we started our session and when we most recently
connected or disconnected. Use this to determine if a client has "expired"
(meaning they've been disconnected for too long).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1871 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-31 21:03:57 +00:00
Walter Korman fec48b8586 Track a user's connection status in their occupant info so that we can
react to player disconnection, idle (implementation still pending), and
reconnection appropriately.  Added PlaceManager.bodyUpdated().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1831 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-26 02:40:30 +00:00
Michael Bayne e2687d5474 Less debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1757 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-26 17:49:36 +00:00
Michael Bayne 6c7bee6c1d Logging cleanups.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1747 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-24 00:51:01 +00:00
Michael Bayne 487bbec942 Added call down methods so that derived client instances can react to
a changing client object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1727 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-20 20:42:37 +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
Walter Korman 4fa88cd501 Fixed javadoc typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1707 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-18 01:10:27 +00:00
Michael Bayne fc1232b98b Added means by which client's username can be changed (very carefully).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1684 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-16 23:34:25 +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 c3191b9170 Brought code into line with the new streaming world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1606 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-23 05:52:49 +00:00
Michael Bayne ae4267a7d5 Fixed problem with LogoffDispatcher where it was reusing a single instance
for all clients in a non-reentrant manner.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1566 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-10 01:25:11 +00:00
Michael Bayne 3261cff412 Removed debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1410 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-31 07:33:33 +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 e3fafb5b8c Exposed the mechanism for locking down client objects during a client
session so that fake sessions can effect their own locking.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1294 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-26 02:32:27 +00:00
Michael Bayne 970410d4e6 Minor fixups to prevent complaints during logoff.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1090 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-05 06:15:43 +00:00
Michael Bayne 9e16e87a69 Doris the refactorasaurus. Restructured the whole client object resolution
process so that it can be done by other entities than just the client
management services. Coordination between these parties is managed so that
no toes are stepped on in the course of loading and unloading clients and
everything is generally much nicer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1086 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-05 05:33:25 +00:00