Hold on to your seats kids, it's another installment of "A Boy and His
Blowtorch". Refactored GameConfig and the EZ game framework, cleaning up some old cruft from GameConfig (which will break other projects and which I'll fix ASAP) and moved the XML based configuration system from ToyBox into EZGame. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@286 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -58,9 +58,8 @@ import com.threerings.parlor.game.server.GameManager;
|
||||
|
||||
import com.threerings.parlor.turn.server.TurnGameManager;
|
||||
|
||||
import com.threerings.ezgame.data.EZGameConfig;
|
||||
import com.threerings.ezgame.data.EZGameObject;
|
||||
import com.threerings.ezgame.data.EZGameMarshaller;
|
||||
import com.threerings.ezgame.data.EZGameObject;
|
||||
import com.threerings.ezgame.data.PropertySetEvent;
|
||||
import com.threerings.ezgame.data.UserCookie;
|
||||
|
||||
@@ -355,7 +354,7 @@ public class EZGameManager extends GameManager
|
||||
throw new InvocationException(INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
gcm.getCookie(getPersistentGameId(), body, new ResultListener<byte[]>() {
|
||||
gcm.getCookie(_gameconfig.getGameId(), body, new ResultListener<byte[]>() {
|
||||
public void requestCompleted (byte[] result) {
|
||||
// Result may be null: that's ok, it means we've looked up the user's
|
||||
// nonexistant cookie. Only set the cookie if the playerIndex is still in the
|
||||
@@ -391,7 +390,7 @@ public class EZGameManager extends GameManager
|
||||
_gameObj.addToUserCookies(cookie);
|
||||
}
|
||||
|
||||
gcm.setCookie(getPersistentGameId(), caller, value);
|
||||
gcm.setCookie(_gameconfig.getGameId(), caller, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -442,26 +441,13 @@ public class EZGameManager extends GameManager
|
||||
new PropertySetEvent(_gameObj.getOid(), propName, value, index, oldValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the game id of this ezgame, as set in the config.
|
||||
*/
|
||||
protected int getPersistentGameId ()
|
||||
throws InvocationException
|
||||
{
|
||||
int id = ((EZGameConfig) _config).persistentGameId;
|
||||
if (id == 0) {
|
||||
throw new InvocationException("Persistent game id not set.");
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that the specified user has access to do things in the game.
|
||||
*/
|
||||
protected void validateUser (ClientObject caller)
|
||||
throws InvocationException
|
||||
{
|
||||
switch (getGameType()) {
|
||||
switch (getMatchType()) {
|
||||
case GameConfig.PARTY:
|
||||
return; // always validate.
|
||||
|
||||
@@ -495,7 +481,7 @@ public class EZGameManager extends GameManager
|
||||
protected BodyObject getPlayerByOid (int oid)
|
||||
{
|
||||
// verify that they're a player
|
||||
switch (getGameType()) {
|
||||
switch (getMatchType()) {
|
||||
case GameConfig.PARTY:
|
||||
// all occupants are players in a party game
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user