Commit Graph

86 Commits

Author SHA1 Message Date
Ray Greenwell 2cb6086434 Look ma, it's the last word in a small Ray-Charlie quibble. :)
I just feel like: imagine if there were no Map.containsKey().
You would instead have to get() the value and see if it's not null.
If you did that, you certainly wouldn't throw away the value if you
were going to get it again right below, would you? So why would
you do it simply because of the addition of a convenient method
called containsKey()?


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5067 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-09 21:46:43 +00:00
Michael Bayne 5d544fdd55 Use Maps and Lists. Unglommed imports. Having them separated into presents and
crowd was intentional (with presents on top because it is more "generic"). We
must resist Eclipse's desire to squish our imports together into one giant,
hard to (visually) parse blob.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5060 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-09 11:47:38 +00:00
Charlie Groves 938d7f5994 Share a single MethodFinder between all instances of a subclass of PlaceManager as they can be large enough constitute the bulk of a PlaceManager
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5029 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 18:07:04 +00:00
Michael Bayne abeeef4d10 PlaceManagerDelegate no longer takes its target manager in its constructor but
rather is configured with it when added to the manager as a delegate.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4868 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-10 04:41:01 +00:00
Michael Bayne d4562ff806 Allow external parties to call applyToDelegates().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4838 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-10-02 23:29:02 +00:00
Dave Hoover 59a65e9ef2 We're waiting to hear that our PlaceObject has been destroyed so we can
call didShutdown, so we can't stop listening to it until then.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4824 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-13 21:38:01 +00:00
Michael Bayne e71fed20c3 Clear out our PlaceManager listenerships when we shutdown to ensure that the
manager can be collected even if the object lingers about for a while and
because it sets a good example.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4823 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-11 22:20:28 +00:00
Michael Bayne bc739b6520 Clear out our speak service once we've unregistered it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4822 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-11 19:59:08 +00:00
Michael Bayne 3f7705dfc2 Split SpeakProvider into SpeakHandler and SpeakUtil. SpeakProvider is now a
proper interface like all the other new invocation service backends.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4795 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-31 21:05:23 +00:00
Michael Bayne 962326fcaf Revamped the way BodyObject.location is tracked. Now we use an object which can
be extended to contain the sceneId by Whirled (Vilya's Whirled, though also
Whirled Whirled by extension) so that we don't end up with problems where
BodyObject.location changes but BodyObject.sceneId remains stale. This won't
impact Yohoho because the Yohoho client is always in a scene, it uses a
separate mechanism to track games, whereas Whirled's natural usage is to move
between scenes and non-scenes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4779 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-21 00:46:25 +00:00
Ray Greenwell cbb661337f Just check if the message event is private.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4650 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-06 20:53:49 +00:00
Ray Greenwell 5843ce777c Only attempt to call a method on the manager if the received event
is a ServerMessageEvent.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4649 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-06 20:46:15 +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 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 737bca0a98 Have where() use which().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4463 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-11-28 18:24:25 +00:00
Ray Greenwell 776761aeef Allow the occupant info to be different depending on the place.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4457 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-11-17 20:01:36 +00:00
Michael Bayne 35082bbaca New and improved lint removal.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4438 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-10-26 23:00:20 +00:00
Michael Bayne 6a47c766cc Switched to a better name.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4345 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-24 18:42:22 +00:00
Michael Bayne b4d66588c1 Added some magic on the road toward more elegant support for dynamic languages
like Groovy and JRuby. Created a DynamicEventDispatcher that automatically maps
attribute, element and set events to methods. Say you have a field:

  public DSet occupantInfo;

you can create a method in any class:

  public void occupantInfoAdded (BodyObject source, OccupantInfo entry);

and then bind that class as a listener using the dynamic event dispatcher:

  _myobj.addListener(new DynamicEventDispatcher(object));

I also created a nicer replacement for the MessageHandler system which is
clunky but still way simpler than using a full InvocationService. Basically we
dispatch MessageEvent as if it were a method call. 

For example, in AtlantiManager I define:

    public void placeTile (BodyObject placer, AtlantiTile tile)

which receives a request by a player to place a tile on their turn. Then in
AtlantiController, I simply call:

   _atlobj.manager.invoke("placeTile", tile);

Of course, in JRuby and Groovy, that's going to look like:

   _atlobj.manager.placeTile(tile);

which is all part of the fun.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4344 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-24 17:35:32 +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
Mike Thomas 3d7c12a5d1 Allow a little more info in deciding whether to declare the place empty.
Also, while I was in there, added some safety so we don't lose track of shutdownIntervals and let them run amuck.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4295 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-28 21:16:37 +00:00
Mike Thomas 19219bb1a3 Break out the logic for whether the place is empty so we can override it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4280 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-20 01:28:29 +00:00
Michael Bayne bdadd2377e Behold, TAPOAFTSM! The Awesome Power Of A Fully Type-Safe Mothership.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4246 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-05 00:56:16 +00:00
Ray Greenwell 79c6427c21 StringBuffer -> StringBuilder.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4191 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-13 22:42:20 +00:00
Ray Greenwell 26c928fc45 Use the valueOf factory methods pretty much everywhere.
These are the preferred way to get instances of Boolean, Byte,
Short, Character, Integer, Long, Float, and Double object.
It's always made sense for Boolean objects, and with 1.5 these factory
methods were blessed as the proper way to get instances unless one
absolutely needed a distinct object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4145 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-24 01:24:24 +00:00
Michael Bayne 0699eb3d1c Added a standard mechanism for customizing the AccessController on a
PlaceObject. Created a default AccessController that is slightly more strict
than the CrowdServer-wide default in that it only allows place occupants to
subscribe to a PlaceObject (a motivated and resourceful player could otherwise
listen in on place chat everywhere in the game if they so desired; with a
custom client, of course).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4079 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-30 19:16:05 +00:00
Michael Bayne d57adeca1c Big fat bernie OccupantInfo revamp. Now:
- OccupantInfo is created by the BodyObject
- the BodyObject is passed to the OI constructor and it uses information
  therefrom to configure itself
- the PlaceManager are no longer responsible for indicating the type of
  OccupantInfo to use or how to populate it.

This makes much more sense as the same type of OccupantInfo is generally used
across the entire system and it's annoying to have to have every PlaceMaanger
derived class know the type of OccupantInfo to create and know how to
initialize it. The one drawback is that only information from the BodyObject
can be used to populate the OccupantInfo, unpublished server-side only
information cannot be used (unless its stuffed into a transient field in the
BodyObject).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3774 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-03 03:05:06 +00:00
Ray Greenwell 38ee3ae362 When a place is loaded, immediately schedule an unload in the future, if
applicable, as it will only otherwise get checked when users leave the place.
It's possible that we'll load and nobody will ever enter.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3763 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-11-17 03:29:24 +00:00
Michael Bayne 176329e1ed Various updates to allow a system where a user's visible name is not the same
as their authentication name (which we leave in BodyObject.username). This
turns out to be simpler than the system we adopted for Yohoho wherein we
replace the player's user object after they select a character, but converting
to this sort of system is way more work than would be worth it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3758 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-11-10 23:18:58 +00:00
Ray Greenwell 3820456813 Allow subclasses to not create a speak service if they should so desire.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3644 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-06 17:47:51 +00:00
Andrzej Kapolka 9213b23ce1 Added ratifyBodyEntry to PlaceManager.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3561 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-17 21:53:53 +00:00
Ray Greenwell 5290ab7c1d Pass the mode to the speaker validator.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3429 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-27 20:16:59 +00:00
Michael Bayne 2d19a0ba82 Renamed DSet.entries() -> DSet.iterator().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3406 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-15 02:12:03 +00:00
Michael Bayne 93ef73095e Make it possible for external entities to add delegates.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3301 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-14 17:06:23 +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 1f8c4578b7 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:12:55 +00:00
Michael Bayne ef748636e2 Various Eclipse suggested bits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2969 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:41:47 +00:00
Ray Greenwell ca89a3c122 Demoted logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2935 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-01-11 17:43:12 +00:00
Michael Bayne 8c219530d1 More debug log wrapping.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2804 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-22 23:59:39 +00:00
Michael Bayne a34e6a7fd8 Only log when we unload the place, not when it becomes empty.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2782 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-20 01:54:57 +00:00
Michael Bayne 4a302495d5 Unload scene managers (and all their associated business) after they've
been unoccupied for five minutes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2772 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-15 18:40:48 +00:00
Ray Greenwell 40afe3cb94 Chat revamp, phase 1.
- Repackaged crowd/chat
- All messages are delivered to the client via ChatMessage messages,
  including tells.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2631 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-03 21:41:33 +00:00
Michael Bayne 8fef03b84e Make where() not freak out if we do not yet have our place object.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2320 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-03-25 01:12:29 +00:00
Michael Bayne 56b0012782 Use Comparable for the to be removed distributed set key.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2290 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-26 17:54:56 +00:00
Michael Bayne fc1a45dbaa Make where() publicly accessible.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2242 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-05 00:23:52 +00:00
Walter Korman 9347fec9ce Populate newly created occupant info with the body object's status.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1880 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-01 21:32:23 +00:00
Walter Korman f1c8ccd347 Added PlaceManager.applyToOccupants(), and a generic useful OccupantOp.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1869 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-31 01:12:08 +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 061c73c64e Place managers may need a chance to clean up after a failed permissions
check; so we give them a callback for such contingencies.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1780 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-06 03:31:16 +00:00
Michael Bayne 4da35c0f0b Provide a means by which a place manager can check, early in the
initialization process, whether or not it actually wants to be created,
and allow it to abort the whole deal if it doesn't.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1777 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-06 00:44:58 +00:00