405 modified source files and 17,367 lines of diffs later we now enforce

more discipline when handling names in our code base. Any user entered
name should find its way into a Name object as soon as it comes out of a
text field or whatnot, and stay that way until it makes its way into a
text field or into a database record (for which String objects are vastly
simpler because of JORA magic).

Dear God, let me never again make a change this large for the rest of my
mortal life.

Unfortunately, this means we have to keep an eye out for funny business
pretty much everywhere. However, since we will absolutely want to test
market stalls and so forth on Azure, we'll have an opportunity to iron out
any funny business that might fall under the radar during our internal
testing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2980 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-03-06 11:29:19 +00:00
parent 92b716d790
commit 32dee3cbaf
58 changed files with 335 additions and 286 deletions
@@ -1,10 +1,12 @@
//
// $Id: PlayerStatusView.java,v 1.2 2004/02/25 14:48:44 mdb Exp $
// $Id: PlayerStatusView.java,v 1.3 2004/03/06 11:29:19 mdb Exp $
package com.threerings.puzzle.client;
import javax.swing.JPanel;
import com.threerings.util.Name;
import com.threerings.parlor.game.GameObject;
import com.threerings.puzzle.data.BoardSummary;
@@ -84,7 +86,7 @@ public class PlayerStatusView extends JPanel
protected GameObject _gameobj;
/** The player name. */
protected String _username;
protected Name _username;
/** The player index. */
protected int _pidx;
@@ -1,5 +1,5 @@
//
// $Id: PuzzleManager.java,v 1.7 2004/02/25 14:48:44 mdb Exp $
// $Id: PuzzleManager.java,v 1.8 2004/03/06 11:29:19 mdb Exp $
package com.threerings.puzzle.server;
@@ -22,6 +22,7 @@ import com.threerings.crowd.server.PlaceManagerDelegate;
import com.threerings.parlor.game.GameManager;
import com.threerings.util.MessageBundle;
import com.threerings.util.Name;
import com.threerings.util.RandomUtil;
import com.threerings.puzzle.Log;
@@ -62,7 +63,7 @@ public abstract class PuzzleManager extends GameManager
return (BodyObject)CrowdServer.omgr.getObject(ploid);
}
// otherwise look them up by name
String name = getPlayerName(playerIdx);
Name name = getPlayerName(playerIdx);
return (name == null) ? null : CrowdServer.lookupBody(name);
}
@@ -1,8 +1,10 @@
//
// $Id: PuzzleProvider.java,v 1.2 2004/02/25 14:48:44 mdb Exp $
// $Id: PuzzleProvider.java,v 1.3 2004/03/06 11:29:19 mdb Exp $
package com.threerings.puzzle.server;
import com.threerings.util.Name;
import com.threerings.presents.client.InvocationService.InvocationListener;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.dobj.RootDObjectManager;
@@ -54,7 +56,7 @@ public class PuzzleProvider
try {
// just this fellow will be playing
config.players = new String[] { user.username };
config.players = new Name[] { user.username };
// create the game manager and begin its initialization
// process
@@ -1,11 +1,12 @@
//
// $Id: PuzzleContext.java,v 1.3 2003/11/26 23:16:13 mdb Exp $
// $Id: PuzzleContext.java,v 1.4 2004/03/06 11:29:19 mdb Exp $
package com.threerings.puzzle.util;
import com.threerings.util.KeyDispatcher;
import com.threerings.util.KeyboardManager;
import com.threerings.util.MessageManager;
import com.threerings.util.Name;
import com.threerings.media.FrameManager;
import com.threerings.media.sound.SoundManager;
@@ -21,7 +22,7 @@ public interface PuzzleContext extends ParlorContext
/**
* Returns the username of the local user.
*/
public String getUsername ();
public Name getUsername ();
/**
* Returns a reference to the message manager used by the client.