Commit Graph

91 Commits

Author SHA1 Message Date
Walter Korman d18ce7a79d Call GameManagerDelegate.setAI() when a player is set to an AI player.
Don't expose the game manager's internal AI skill level array to external
parties.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1502 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-19 23:41:25 +00:00
Michael Bayne 5bfbc9f17a Provide access to player info via safer getter methods rather than giving
away references to our internal arrays.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1495 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-19 23:18:58 +00:00
Walter Korman 6b8e19f011 Make the array of AI skill levels accessible so that delegates can figure
out what kind of AI-related machinations they should engage in during
startup.  Added isAI() to allow checking whether a particular player index
belongs to an AI player.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1493 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-19 23:06:08 +00:00
Walter Korman abcc329e78 Expanded imports.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1470 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-18 02:35:10 +00:00
Walter Korman 3f45a25bdb Store the current round id in the game object rather than tracking
separately in the game manager and controller which can then get unhappily
out of sync.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1450 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-12 07:59:19 +00:00
Ray Greenwell 0443a31294 extend SafeInterval
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1433 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-10 21:37:13 +00:00
Ray Greenwell b81ab2f176 added systemMessage() which can optionally queue up a message for
when the game starts.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1427 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-06 22:13:56 +00:00
Ray Greenwell b46aa1c1c3 Default all games to rated.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1423 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-05 00:47:13 +00:00
Walter Korman c4c8e2297b Added the notion of a round with an associated round identifier that is
incremented whenever the game is reset.  Games that don't make use of the
resetting functionality essentially consist of a single round.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1420 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-03 21:08:57 +00:00
Ray Greenwell bce33033d8 removed setRateGame()
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1419 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-01 23:14:53 +00:00
Ray Greenwell b900adeeeb Moved in the setRateGame() method from PuzzleManager; have it set the
rated flag in the gameconfig.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1418 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-01 21:21:20 +00:00
Michael Bayne 18c4c32c85 Whoops, I booched it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1346 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-07 00:57:49 +00:00
Michael Bayne 581a2cce44 Don't choke if we're asked about game over and we've already shut down and
pitched our game object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1344 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-07 00:49:24 +00:00
Ray Greenwell 849eaec47b gameDidEnd will now be called even if the game is cancelled.
Made AI ticking only happen while the game is IN_PLAY.
Added forgotten comment.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1285 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-19 21:40:38 +00:00
Ray Greenwell 575c276c9a hold gamemanagers in a set instead of a list since their order doesn't matter
and we want to prevent them from being added twice.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1284 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-19 21:33:21 +00:00
Ray Greenwell 4b0b462c3a Tick for each AI, pass the tick to the delegates.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1283 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-19 21:16:42 +00:00
Ray Greenwell 48ad174dd7 initial revision.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1282 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-19 18:33:32 +00:00
Ray Greenwell e73350838f - Moved AI handling framework here from PuzzleManager.
- Set game state to CANCELLED if it wasn't yet GAME_OVER when shutting down
  the game.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1281 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-19 18:33:10 +00:00
Walter Korman 988223cc3e Consider the game to be over when its state isn't IN_PLAY, so that
AWAITING_PLAYERS, CANCELLED, etc. are properly addressed by those that
check in on these sorts of things.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1276 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-18 16:57:29 +00:00
Michael Bayne 51c7f6b527 Removed a bunch of code to generate failure responses as it's now handled
automagically!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1269 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-17 18:26:30 +00:00
Michael Bayne 85cdabbbee Added some imports that were needed for javadoc comment resolution that
became necesssary when *Codes were moved out of .client and into .data.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1247 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 18:06:20 +00:00
Michael Bayne 9235848ce6 Javadoc fix.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1246 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 18:05:30 +00:00
Walter Korman a97e9db978 Moved remaining client.*Codes classes into their respective data packages
as they are intended to represent codes shared between the client and the
server.  Made correspondingly necessary changes throughout.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1240 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 16:28:05 +00:00
Michael Bayne 0e23a600b2 Clear out the game over flag when the game starts (or resets).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1237 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-14 02:33:16 +00:00
Michael Bayne fd87ec437a Moved game reset processing into main game framework. Also modified game
start processing on the server so that we don't want for the IN_PLAY
attribute change to be processed before calling gameDidStart() because we
don't want to do that when resetting the game (because someone could come
along and end the game in between gameWillStart() and gameDidStart() which
would be annoying and bad), so we need to be consistent and run straight
through both when starting the game for the first time and when resetting
it.

This means that game managers that really need to wait until their events
are processed and do some game start processing at that point will have to
listen for the IN_PLAY transition themselves *and* they'll have to be
aware that someone could have come along and ended the game in between the
call to gameDidStart() and the dispatch of the IN_PLAY event. Sketchy, but
unavoidable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1235 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-14 00:26:05 +00:00
Michael Bayne b486315e47 Revamp! Modified the way configuration is handled.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1166 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-28 22:32:34 +00:00
Michael Bayne 1806eb3344 Added equals() and hashCode() so that we can compare game configurations;
removed serialization code because SimpleStreamableObject now
automatically handles it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1153 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-26 22:58:31 +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 5f18acd3d8 Modified distributed object attribute setting such that attributes are
*always* set immediately because after some deliberation, we decided that
doing that led to less unexpectedly annoying behavior than having to wait
for the event to propagate to see the new value.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1062 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-20 23:35:42 +00:00
Walter Korman c0cfec8f90 Fixed comment typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1060 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-20 02:10:02 +00:00
Michael Bayne b3619774c3 Use setStateImmediate() when ending the game so that other game manager
code doesn't have to do something like that itself to prevent code from
being inadvertently executed after the game has been ended.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1002 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-15 03:42:32 +00:00
Michael Bayne 573939b483 Ignore request to start up an in-play game; moved code that starts a game
when all players have arrived in the game room into a method that can be
overridden.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1000 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-14 07:28:12 +00:00
Michael Bayne 6448309b0e startGame() and endGame() need to be public to be accessible to the
delegates; added isGameOver() to standardize the way that the delegates
determine that the game is over (isGameOver() may need to be customized by
the games, so we want the delegates to use the game's custom code when
appropriate).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@996 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-13 18:50:15 +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 ebc3fe229d Made getTurnHolderIndex() public.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@991 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-12 07:17:33 +00:00
Michael Bayne 671d7ddce1 Documentation fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@990 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-12 07:01:54 +00:00
Michael Bayne 7a8908111b Oh the humanity. Modified the turn game services to be a "mix-in" using
the bastard Java technique of delegates and interfaces. I feel like I'm
doing OOP with one hand tied behind my back.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@989 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-12 06:57:30 +00:00
Michael Bayne fca91d350b Added facilities for being notified when the parlor director receives a
game ready notification and for taking charge of the process of entering
the game room.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@980 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-09 11:23:49 +00:00
Michael Bayne 5581b3e65b Converted more dobj classes to use the gendobj script. (Had to do a wee
bit of fiddling to accomplish some things that used to be done by hand.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@973 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-08 23:55:25 +00:00
Michael Bayne a83e512270 Modified DObject.toString() to use fieldsToString() so that all of its
derived classes need not do their own toString()ing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@928 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-04 01:47:20 +00:00
Michael Bayne b7913ceb0b Moved generic marshalling code into presents.io from presents.dobj.io as
it is now general purpose.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@912 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-01 23:32:37 +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 f4f846f7e8 Don't log the whole game object when we destroy it, just the oid.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@595 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-07 10:44:02 +00:00
Michael Bayne ebdb840264 Modified gameDidStart() and gameDidEnd() to take place after the game
state transition event has been processed. This ensures that any events
posted up to (and during) the call to startGame() or endGame() are
dispatched before we invoke code that reacts to that change in game state.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@593 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-07 03:21:42 +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 afdba54f1c Remove the body to table mapping when a user leaves the table.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@565 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-25 23:02:17 +00:00
Michael Bayne 6cc3631d48 Rearrangements and added code to clean up after tables when their
associated games finally go away.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@548 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-24 01:14:38 +00:00
Michael Bayne 30185cb814 Shut down the game manager when everyone leaves the room. The game object
and manager will simply disappear at that point which means that the game
will be aborted if it hasn't yet been completed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@547 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-24 01:00:54 +00:00
Michael Bayne 218eea6dc2 Changed TableManager to TableDirector. Will I ever learn?
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@534 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-23 23:52:01 +00:00
Michael Bayne a4ceafd268 Extracted server side of table management from the parlor manager and put
it into its own table manager class so that each place manager that wishes
to perform table management can instantiate a table manager which can then
more easily track tables for that particular place.

Now handle occupants disappearing from pending tables properly. Still need
to sort out game object life-cycle tracking.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@532 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-23 23:47:02 +00:00