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:
@@ -47,6 +47,7 @@ import com.threerings.util.Iterator;
|
||||
import com.threerings.util.MessageBundle;
|
||||
import com.threerings.util.Name;
|
||||
import com.threerings.util.StringUtil;
|
||||
import com.threerings.util.Wrapped;
|
||||
|
||||
import com.threerings.presents.client.ConfirmAdapter;
|
||||
import com.threerings.presents.client.ResultWrapper;
|
||||
@@ -176,7 +177,14 @@ public class GameControlBackend
|
||||
|
||||
// straight data
|
||||
o["gameData"] = _gameData;
|
||||
o["gameConfig"] = (_ctrl.getPlaceConfig() as EZGameConfig).customConfig;
|
||||
|
||||
// convert our game config from a HashMap to a Dictionary
|
||||
var gameConfig :Object = {};
|
||||
var cfg :EZGameConfig = (_ctrl.getPlaceConfig() as EZGameConfig);
|
||||
cfg.params.forEach(function (key :Object, value :Object) :void {
|
||||
gameConfig[key] = (value is Wrapped) ? Wrapped(value).unwrap() : value;
|
||||
});
|
||||
o["gameConfig"] = gameConfig;
|
||||
|
||||
// functions
|
||||
o["setProperty_v1"] = setProperty_v1;
|
||||
@@ -388,7 +396,7 @@ public class GameControlBackend
|
||||
var uc :UserCookie =
|
||||
(_ezObj.userCookies.get(playerId) as UserCookie);
|
||||
if (uc != null) {
|
||||
callback(uc.cookie);
|
||||
callback(EZObjectMarshaller.decode(uc.cookie));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -901,7 +909,7 @@ public class GameControlBackend
|
||||
delete _cookieCallbacks[cookie.playerId];
|
||||
for each (var fn :Function in arr) {
|
||||
try {
|
||||
fn(cookie.cookie);
|
||||
fn(EZObjectMarshaller.decode(cookie.cookie));
|
||||
} catch (err :Error) {
|
||||
// cope
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user