diff --git a/direct/src/distributed/AstronInternalRepository.py b/direct/src/distributed/AstronInternalRepository.py index 9ae17b9289..c04d9c168c 100644 --- a/direct/src/distributed/AstronInternalRepository.py +++ b/direct/src/distributed/AstronInternalRepository.py @@ -260,8 +260,8 @@ class AstronInternalRepository(ConnectionRepository): dg = PyDatagram() dg.addServerHeader(doId, self.ourChannel, DBSS_OBJECT_ACTIVATE_WITH_DEFAULTS) dg.addUint32(doId) - dg.addUint32(parentId) - dg.addUint32(zoneId) + dg.addUint32(0) + dg.addUint32(0) self.send(dg) # DEFAULTS_OTHER isn't implemented yet, so we chase it with a SET_FIELDS dg = PyDatagram() @@ -270,6 +270,13 @@ class AstronInternalRepository(ConnectionRepository): dg.addUint16(fieldCount) dg.appendData(fieldPacker.getString()) self.send(dg) + # Now slide it into the zone we expect to see it in (so it + # generates onto us with all of the fields in place) + dg = PyDatagram() + dg.addServerHeader(doId, self.ourChannel, STATESERVER_OBJECT_SET_LOCATION) + dg.addUint32(parentId) + dg.addUint32(zoneId) + self.send(dg) else: dg = PyDatagram() dg.addServerHeader(doId, self.ourChannel, DBSS_OBJECT_ACTIVATE_WITH_DEFAULTS) @@ -278,6 +285,13 @@ class AstronInternalRepository(ConnectionRepository): dg.addUint32(zoneId) self.send(dg) + def sendSetLocation(self, do, parentId, zoneId): + dg = PyDatagram() + dg.addServerHeader(do.doId, self.ourChannel, STATESERVER_OBJECT_SET_LOCATION) + dg.addUint32(parentId) + dg.addUint32(zoneId) + self.send(dg) + def generateWithRequired(self, do, parentId, zoneId, optionalFields=[]): """ Generate an object onto the State Server, choosing an ID from the pool.