Commit Graph

39 Commits

Author SHA1 Message Date
Michael Bayne 3c1c1d1921 We need to restore the remote oid as well before we send the unsubscribe req.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4791 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-27 21:47:50 +00:00
Robert Zubeck 73b7e56563 Fixing a typo that prevented the creation of lock release handlers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4788 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-27 17:46:10 +00:00
Michael Bayne c2b44deb2d Once we've unproxied an object, we need to remap it into our Client's
distributed object space so that the unsubscribe from the remote server is
properly handled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4787 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-27 02:38:14 +00:00
Michael Bayne 7a8bb7389a Screw backwards compatibility. We're all about the future.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4786 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-26 20:49:13 +00:00
Robert Zubeck 8275f739c0 Wrapper for peer network operations that need to acquire and release resource locks.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4780 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-23 17:09:08 +00:00
Michael Bayne 9ef330b291 Added applyToNodes().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4778 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 22:46:49 +00:00
Michael Bayne 91ffdd810b Name our invokers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4777 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 22:03:17 +00:00
Michael Bayne 6531aa581c Extract client info clearing into a method that can be easily extended.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4775 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 21:35:54 +00:00
Michael Bayne 7cf24684a7 Added locateClient().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4771 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 06:18:16 +00:00
Michael Bayne 6b67de9fca Looking something up in all the peer node objects is tricky, so let's
encapsulate it into a mechanism that takes care of the trickiness for us.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4770 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 22:03:12 +00:00
Michael Bayne f68aa1d6d3 Iterate over a snapshot of the values so that we avoid concurrent modification.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4769 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 21:06:09 +00:00
Par Winzell 6c65d51d76 I'm switching PeerRepository over to Depot and it returns Lists, not ArrayLists. I sure wish we could use the List and Map interfaces. It's not like we're suddenly going to surprise the caller by maliciously returning a LinkedList one day, or something.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4768 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 20:33:47 +00:00
Michael Bayne 321c3f17e5 Factored PeerNode out of PeerManager as that class was getting complicated and
dangerous with two big inner helper classes. Added the nodeName to NodeObject
and some other handy methods.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4767 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 01:59:27 +00:00
Michael Bayne 0c448bc92d Update our LAST_UPDATED column every minute while we're alive so that if we
lose connection with a peer for any reason, it will notice that we're still
alive and reconnect.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4732 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 23:36:25 +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
Andrzej Kapolka d3d841e3e5 Some fiddling to handle cases where peers become connected after having
been disconnected (in which case there may be conflicts in lock 
ownership) or are connected asymmetrically (A is subscribed to B, B is 
not yet subscribed to A).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4674 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-24 19:47:12 +00:00
Michael Bayne 3b4c331e0b Log when we're calling logoff() for our local peers to see if this is or isn't
happening on the hanging dev server.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4604 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-27 00:46:32 +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 c25024f497 Move some low-level object access control into Presents from Crowd (default all
objects to non-modifiable, restrict client object subscriptions to the client
in question). Modified Peer code to not log a warning when a peer is not online
in an expected way (not listening for connections).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4598 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-23 19:41:30 +00:00
Andrzej Kapolka 2376e86f3f Forward events to proxies. Fixed NPE, changed account names used in
peer sign-on to be the connecting server's node name.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4580 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-15 00:26:52 +00:00
Andrzej Kapolka 32d99abe15 Missed a couple lines.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4578 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-14 22:20:09 +00:00
Andrzej Kapolka 0fa6d2f233 Keep track of node subscribers (and lock action ratifiers) by their
client oids.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4577 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-14 20:35:11 +00:00
Andrzej Kapolka 51fed0676e Use the number of subscribers to determine how many responses to expect.
Take the lock immediately if there are no subscribers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4576 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-14 02:30:37 +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 a1be45996b Implemented the mechanism for initiating and clearing out a remote object
proxy. Untested, but hey, it probably works. :)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4543 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-08 19:43:55 +00:00
Andrzej Kapolka 9a39128322 Changed the lock mechanism to use a service to ratify requests to
acquire and release locks, and to use handler objects to manage locks in 
the process of resolution.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4542 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-08 00:02:11 +00:00
Andrzej Kapolka 2f7c992320 First pass at a distributed lock system. Barbie says, "Concurrency is
hard!"


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4533 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-05 22:19:36 +00:00
Mark Johnson f897b54099 Added cache management to the peer manager so it can inform servers that persistent data has
changed and they'll need to reload it


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4531 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-03 01:33:49 +00:00
Michael Bayne 3b2c3c921b Widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4524 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-02 23:40:42 +00:00
Michael Bayne e9f13b66cd Beans, frank.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4442 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-11-02 05:14:46 +00:00
Michael Bayne bc9f53396c Revamped distributed object creation. There was no particular reason to create
distributed objects by reflection since we don't allow clients to create
objects, furthermore we needn't do it asynchronously. The object creation
methods were moved into the server-side only interface and made "immediate", so
the caller creates a derived instance of DObject and registers it with the
system instead of creating it with a Subscriber callback.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4342 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-23 23:46:48 +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 c0628363cb Updates to support a public facing and back-channel host for each node.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4254 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-06 23:52:55 +00:00
Michael Bayne ef86404ed8 Ignore peer clients, and scan through the client info set when removing because
we can't rely on building a new client info at session end time because the
client's ClientObject will have been destroyed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4250 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-05 23:27:25 +00:00
Michael Bayne 6be44f5a65 Finished up the basic peer system and wired up the tell forwarding. In theory
it all works, now to test it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4249 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-05 22:48:32 +00:00
Michael Bayne 40d0df6dfa Properly quell the unchecked warning. I'm not entirely sure whether there is a
construct that could be made to do what I want in a type safe manner. The
method returns Class<? extends NodeObject> which is correctly expresses the
valid types that can be returned.

However, I can't pass the capture <? extends NodeObject> (NodeObject extends
DObject) to a method that takes <T extends DObject>. I'm not entirely sure why
not, but I imagine it has something to do with the subtleties of type-erasure,
or maybe it's just a limitation of the inference that can be done by the
compiler. I don't know what type <? extends NodeObject> is considered to be, I
would have thought just NodeObject but apparently not.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4242 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-04 02:20:10 +00:00
Michael Bayne 3a9c6ced44 A bunch more peer business.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4241 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-01 03:34:00 +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