Commit Graph

71 Commits

Author SHA1 Message Date
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
Michael Bayne ed0693a8e7 Clear out our speak service registration when the place object goes away.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1725 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-20 04:53:14 +00:00
Michael Bayne 8d0e764485 Whoops! addTo not update.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1680 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-13 05:11:59 +00:00
Michael Bayne ba88c02650 We need to clone the occupant info *every* time we update it, even the
first time.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1679 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-13 05:08:00 +00:00
Michael Bayne 335ef8eb05 New occupant info handling facilities that prevent rapid fire modifiers
from stepping on one anothers' toes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1676 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-13 00:20:43 +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 fadf226677 Added convenient where() method to PlaceManager which is used when logging
errors to report the "place" in which the error happen. The SceneManager
overrides this to include scene information. Scrupulous use will make log
messages much more scrutable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1514 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-20 22:12:23 +00:00
Michael Bayne 16d4bfabca Demoted some log messages to debug.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1387 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-24 05:58:55 +00:00
Michael Bayne 47a5ad9fb7 We no longer need to set up our occupantInfo set with the type of object
it holds and we can now create custom occupant info classes depending on
the body that is entering the place.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1270 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-17 22:02:08 +00:00
Michael Bayne 7ccb9594b9 Changed DSet.Element to DSet.Entry in preparation for the addition of
array element update support. (Arrays have elements, sets have entries.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1133 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-18 23:21:26 +00:00
Michael Bayne 88a4dc157a Fixed up the didShutdown() business which was happening twice; moved the
delegation into the base callback methods.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1001 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-14 18:08:53 +00:00
Michael Bayne a85a6f1394 Delegation! Since it's clear that extracting services into delegation
classes is only going to become more common, I've gone and created a
comprehensive facility for creating and using delegates in the place
controller and manager as well as the game controller and manager. With
the pattern nicely set, it is also easy to extend to controller/managers
further up the hierarchy that might need to delegate special methods of
their own. Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@994 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-13 03:21:28 +00:00
Michael Bayne 6e962013a9 Minor cleanups; added PlaceManager to MessageHandler callback.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@773 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-14 00:11:18 +00:00
Michael Bayne cc21ad8679 Javadoc fixes and cleanups.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@623 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-18 04:27:56 +00:00
Michael Bayne b632510cb1 Javadoc edits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@576 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-26 01:40:22 +00:00
Michael Bayne 96b0faff38 Forgot to implement ObjectDeathListener.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@546 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-24 01:00:09 +00:00