DistributedObject setLocation issue

Hello everyone! I’m here because I’m Veeeeeeery stumped on an issue I’ve encountered recently, I’m not quite sure what to put down in all honesty, I have the error output, and last piece of code that is called before everything goes kaput.
The error:

  File "otp/avatar/DistributedPlayer.py", line 93, in setLocation
    DistributedAvatar.DistributedAvatar.setLocation(self, parentId, zoneId)
  File "/usr/share/panda3d/direct/distributed/DistributedNode.py", line 49, in setLocation
    DistributedObject.DistributedObject.setLocation(self, parentId, zoneId)
  File "/usr/share/panda3d/direct/distributed/DistributedObject.py", line 497, in setLocation
    self.cr.storeObjectLocation(self, parentId, zoneId)
AttributeError: 'NoneType' object has no attribute 'storeObjectLocation'

The code that is last called:

    def setLocation(self, parentId, zoneId):
        DistributedAvatar.DistributedAvatar.setLocation(self, parentId, zoneId)
        if not (parentId in (0, None) and zoneId in (0, None)):
            if not self.cr._isValidPlayerLocation(parentId, zoneId):
                self.cr.disableDoId(self.doId)
                self.cr.deleteObject(self.doId)
        return None

I’m running on Panda3D cloned from the github repo. I’ll try to provide any feedback I can. Any help would be super appreciated!

  File "otp/avatar/DistributedPlayer.py", line 93, in setLocation
    DistributedAvatar.DistributedAvatar.setLocation(self, parentId, zoneId)
  File "/usr/share/panda3d/direct/distributed/DistributedNode.py", line 49, in setLocation
    DistributedObject.DistributedObject.setLocation(self, parentId, zoneId)
  File "/usr/share/panda3d/direct/distributed/DistributedObject.py", line 497, in setLocation
    self.cr.storeObjectLocation(self, parentId, zoneId)
AttributeError: 'NoneType' object has no attribute 'storeObjectLocation'

This means that your object is trying to set it’s location to your ClientRepository, but it (for some reason) doesn’t doesn’t know about it. In most cases, if the object comes from the server, (assuming that your ClientRepository is a subclass of ClientRepositoryBase) ‘cr’ should be defined with itself upon object generation. Otherwise, you would have to define it yourself.

But honestly, I think I can help out a bit better if you could explain what you’re trying to do here with your object.

Well, I’m not entirely sure, this is some old Toontown source code that I’ve been attempting to get up and running on the latest version of Panda3D available, (with Astron support). I’ve gotten over a lot of the hurtles but this has me stumped, this function is being called when the player moves from one location to another, such as attempting to walk into a building, or enter a tunnel, if you’re not familiar with Toontown terminology a tunnel just takes you to a different area of the game. The best I can do I suppose is post the entirety of the error code.
This used to work on an older version of Panda3D, but obviously something has changed quite a lot haha.

:task(error): Exception occurred in PythonTask readerPollTask-94525116263904
:ToonBase(warning): Handling Python exception.
Traceback (most recent call last):
  File "otp/otpbase/OTPBase.py", line 236, in run
    taskMgr.run()
  File "/usr/share/panda3d/direct/task/Task.py", line 517, in run
    self.step()
  File "/usr/share/panda3d/direct/task/Task.py", line 471, in step
    self.mgr.poll()
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 609, in readerPollUntilEmpty
    while self.readerPollOnce():
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 616, in readerPollOnce
    self.handleDatagram(self.private__di)
  File "otp/distributed/OTPClientRepository.py", line 1943, in handleDatagram
    self.handler(msgType, di)
  File "toontown/hood/QuietZoneState.py", line 153, in handleWaitForQuietZoneResponse
    base.cr.handlePlayGame(msgType, di)
  File "otp/distributed/OTPClientRepository.py", line 1558, in handlePlayGame
    self.handleMessageType(msgType, di)
  File "otp/distributed/OTPClientRepository.py", line 1838, in handleMessageType
    self.gotInterestDoneMessage(di)
  File "otp/distributed/OTPClientRepository.py", line 1864, in gotInterestDoneMessage
    self.handleInterestDoneMessage(di)
  File "/usr/share/panda3d/direct/distributed/DoInterestManager.py", line 617, in handleInterestDoneMessage
    messenger.send(event)
  File "/usr/share/panda3d/direct/showbase/Messenger.py", line 326, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "/usr/share/panda3d/direct/showbase/Messenger.py", line 411, in __dispatch
    method (*(extraArgs + sentArgs))
  File "toontown/distributed/ToontownClientRepository.py", line 966, in _handleEmuSetZoneDone
    messenger.send(event)
  File "/usr/share/panda3d/direct/showbase/Messenger.py", line 326, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "/usr/share/panda3d/direct/showbase/Messenger.py", line 411, in __dispatch
    method (*(extraArgs + sentArgs))
  File "toontown/hood/QuietZoneState.py", line 196, in _handleQuietZoneComplete
    self.fsm.request('waitForZoneRedirect')
  File "/usr/share/panda3d/direct/fsm/ClassicFSM.py", line 281, in request
    exitArgList)
  File "/usr/share/panda3d/direct/fsm/ClassicFSM.py", line 228, in __transition
    self.__enter(aState, enterArgList)
  File "/usr/share/panda3d/direct/fsm/ClassicFSM.py", line 214, in __enter
    aState.enter(argList)
  File "/usr/share/panda3d/direct/fsm/State.py", line 202, in enter
    self.__enterFunc(*argList)
  File "toontown/hood/QuietZoneState.py", line 237, in enterWaitForZoneRedirect
    self.fsm.request('waitForSetZoneResponse')
  File "/usr/share/panda3d/direct/fsm/ClassicFSM.py", line 281, in request
    exitArgList)
  File "/usr/share/panda3d/direct/fsm/ClassicFSM.py", line 228, in __transition
    self.__enter(aState, enterArgList)
  File "/usr/share/panda3d/direct/fsm/ClassicFSM.py", line 214, in __enter
    aState.enter(argList)
  File "/usr/share/panda3d/direct/fsm/State.py", line 202, in enter
    self.__enterFunc(*argList)
  File "toontown/hood/QuietZoneState.py", line 261, in enterWaitForSetZoneResponse
    base.cr.sendSetZoneMsg(zoneId)
  File "toontown/distributed/ToontownClientRepository.py", line 924, in sendSetZoneMsg
    localAvatar.setLocation(parentId, zoneId)
  File "otp/avatar/DistributedPlayer.py", line 93, in setLocation
    DistributedAvatar.DistributedAvatar.setLocation(self, parentId, zoneId)
  File "/usr/share/panda3d/direct/distributed/DistributedNode.py", line 49, in setLocation
    DistributedObject.DistributedObject.setLocation(self, parentId, zoneId)
  File "/usr/share/panda3d/direct/distributed/DistributedObject.py", line 497, in setLocation
    self.cr.storeObjectLocation(self, parentId, zoneId)
AttributeError: 'NoneType' object has no attribute 'storeObjectLocation'

Just in case anyone else ever runs into this issue, I figured out that Astron has a regression that disables the client. The fix was to use an older version of Astron, release 0.1.0 is what I’m currently using.