This error has shown up out of the blue (last night my game ran fine, and this morning the error appeared). I've been able to narrow the cause of the error down to this code, which previously caused no problems:
- Code: Select all
if ( _playerObject[ SIGNUP_DATE ] == undefined ) {
_playerObject[ SIGNUP_DATE ] = TimeUtils.getUTC();
}
if ( _playerObject[ MUTE ] == undefined ) {
_playerObject[ MUTE ] = DefaultPlayerValues.mute;
}
if ( _playerObject[ NAME ] == undefined ) {
_playerObject[ NAME ] = _facebook.name;
}
if ( _playerObject[ NEW ] == undefined ) {
_playerObject[ NEW ] = 1;
}
if ( _playerObject[ TUTORIAL ] == undefined ) {
_playerObject[ TUTORIAL ] = 1;
}
if ( _playerObject[ BACKGROUND ] == undefined ) {
_playerObject[ BACKGROUND ] = 0;
}
_playerObject[ GAME_NAME ] = _facebook.firstName;
_playerObject[ ONLINE ] = 1;
_playerObject.save();
This code initializes the user. If I comment out a few of the above lines, but leave the save(), the problem disappears.
EDIT: OK, I just uncommented all of the lines, so my code is now back to its original state, and the problem is gone. But the cause of the error is really disturbing. If this happens to a user, s/he is essentially done as a player because I won't know how to diagnose or solve the player's problem.