Added a handy update for changing an occupant's name.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5575 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -67,6 +67,22 @@ public class OccupantInfo extends SimpleStreamableObject
|
|||||||
public boolean update (T info);
|
public boolean update (T info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** An update to dispatch when an occupant's name changes. */
|
||||||
|
public static class NameUpdate implements Updater<OccupantInfo>
|
||||||
|
{
|
||||||
|
public NameUpdate (Name name) {
|
||||||
|
_name = name;
|
||||||
|
}
|
||||||
|
public boolean update (OccupantInfo info) {
|
||||||
|
if (info.username.equals(_name)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
info.username = _name;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
protected Name _name;
|
||||||
|
}
|
||||||
|
|
||||||
/** The body object id of this occupant (and our entry key). */
|
/** The body object id of this occupant (and our entry key). */
|
||||||
public Integer bodyOid;
|
public Integer bodyOid;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user