diff --git a/src/java/com/threerings/crowd/server/PlaceManager.java b/src/java/com/threerings/crowd/server/PlaceManager.java index 03e305b22..71130ca13 100644 --- a/src/java/com/threerings/crowd/server/PlaceManager.java +++ b/src/java/com/threerings/crowd/server/PlaceManager.java @@ -322,12 +322,7 @@ public class PlaceManager _plobj.startTransaction(); try { - // clone the canonical copy and insert it into the DSet - _plobj.addToOccupantInfo((OccupantInfo)info.clone()); - - // add the body oid to our place object's occupant list - _plobj.addToOccupants(body.getOid()); - + addOccupantInfo((OccupantInfo)info.clone()); } finally { _plobj.commitTransaction(); } @@ -580,6 +575,21 @@ public class PlaceManager } } + /** + * Adds this occupant's info to the {@link PlaceObject}. This is called in a transaction on the + * place object so if a derived class needs to add additional information for an occupant it + * should override this method. It may opt to add the information before calling super if it + * wishes to rely on its information being configured when {@link #bodyAdded} is called. + */ + protected void addOccupantInfo (OccupantInfo info) + { + // clone the canonical copy and insert it into the DSet + _plobj.addToOccupantInfo(info); + + // add the body oid to our place object's occupant list + _plobj.addToOccupants(info.getBodyOid()); + } + /** * Returns whether the location should be marked as empty and potentially shutdown. */