Did away with PartyGameConfig, added getGameType() to GameConfig.

Changed the names of the 3 standard game types, but I could be convinced
of better names:

SEATED_GAME: normal match-made game, a game with a set list of players that
             does not change.
SEATED_CONTINUOUS: the game starts immediately, but people join the room
             and then choose a place to sit to become a player.
PARTY: no seats, anyone that enters is a player.

Also, changed SEATED_CONTINUOUS to create an occupants array and auto-sit
the creator, since I'm pretty sure we'll want to show seating in the lobby
for those types of games (but it actually does neither right now, code
needs to be written either way, depending on UI decisions.)


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@182 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2007-02-13 00:50:29 +00:00
parent 400389ca03
commit de354c0e7b
18 changed files with 122 additions and 248 deletions
@@ -9,7 +9,6 @@ import com.threerings.crowd.client.PlaceController;
import com.threerings.parlor.game.client.GameConfigurator;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.game.data.PartyGameConfig;
import com.threerings.ezgame.client.EZGameController;
@@ -17,7 +16,6 @@ import com.threerings.ezgame.client.EZGameController;
* A game config for a simple multiplayer game.
*/
public class EZGameConfig extends GameConfig
implements PartyGameConfig
{
// TODO: this will eventually contain various XML configuration bits,
// or we'll expand this to contain other information.
@@ -25,13 +23,19 @@ public class EZGameConfig extends GameConfig
public String configData;
// TODO: this is separate right now, but may eventually be extracted
// from configData? Do not read this value, use getPartyGameType()
public byte partyGameType = NOT_PARTY_GAME;
// from configData? Do not read this value, use getGameType()
public byte gameType = SEATED_GAME;
/** If non-zero, a game id used to persistently identify the game.
* This could be thought of as a new-style rating id. */
public int persistentGameId;
@Override
public byte getGameType ()
{
return gameType;
}
// from abstract GameConfig
public String getBundleName ()
{
@@ -63,12 +67,6 @@ public class EZGameConfig extends GameConfig
return "com.threerings.ezgame.server.EZGameManager";
}
// from PartyGameConfig
public byte getPartyGameType ()
{
return partyGameType;
}
@Override
public boolean equals (Object other)
{
@@ -32,7 +32,8 @@ import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.server.CrowdServer;
import com.threerings.parlor.game.data.PartyGameConfig;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.game.server.GameManager;
import com.threerings.parlor.turn.server.TurnGameManager;
@@ -404,8 +405,8 @@ public class EZGameManager extends GameManager
protected void validateUser (ClientObject caller)
throws InvocationException
{
switch (getPartyGameType()) {
case PartyGameConfig.FREE_FOR_ALL_PARTY_GAME:
switch (getGameType()) {
case GameConfig.PARTY:
return; // always validate.
default:
@@ -447,7 +448,8 @@ public class EZGameManager extends GameManager
_gameObj.setEzGameService(
(EZGameMarshaller) CrowdServer.invmgr.registerDispatcher(new EZGameDispatcher(this)));
if (isPartyGame()) {
// if we don't need the no-show timer, start.
if (!needsNoShowTimer()) {
startGame();
}
}