Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DistributedObjectUD.generateWithRequired*() broken #6

Open
kestred opened this issue Aug 17, 2014 · 1 comment
Open

DistributedObjectUD.generateWithRequired*() broken #6

kestred opened this issue Aug 17, 2014 · 1 comment

Comments

@kestred
Copy link
Member

kestred commented Aug 17, 2014

Issue as reported by @TheCheapestPixels at Astron/Astron#281.


I updated Astrons Panda3D fork. Since then my code (https://github.com/TheCheapestPixels/astron_examples/tree/master/01_simple_example) won't run anymore, crashing on simple_example.py line 45 when trying to generate DistributedMaprootUD.

When using self.maproot.generateWithRequiredAndId(self.maproot, 0), I now get informed that:
TypeError: generateWithRequiredAndId() takes at least 4 arguments (3 given)
(Then again, I don't know why it worked in the first place.)

When using:

> self.maproot.generateWithRequiredAndId(self.maproot, 0, 0):
Traceback (most recent call last):
  File "./simple_example_server.py", line 102, in <module>
    simple_server.run()
  File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 2932, in run
    self.taskMgr.run()
  File "/usr/share/panda3d/direct/task/Task.py", line 502, in run
    self.step()
  File "/usr/share/panda3d/direct/task/Task.py", line 460, in step
    self.mgr.poll()
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 613, in readerPollUntilEmpty
    while self.readerPollOnce():
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 618, in readerPollOnce
    if self.checkDatagram():
  File "/home/baribal/src/astron_examples/01_simple_example/simple_example.py", line 45, in set_maproot
    self.maproot.generateWithRequiredAndId(self.maproot, 0, 0)
  File "/usr/share/panda3d/direct/distributed/DistributedObjectUD.py", line 321, in generateWithRequiredAndId
    self.air.generateWithRequiredAndId(self, doId, parentId, zoneId, optionalFields)
  File "/usr/share/panda3d/direct/distributed/AstronInternalRepository.py", line 429, in generateWithRequiredAndId
    do.sendGenerateWithRequired(self, parentId, zoneId, optionalFields)
  File "/usr/share/panda3d/direct/distributed/DistributedObjectUD.py", line 381, in sendGenerateWithRequired
    optionalFields)
AttributeError: DistributedMaprootUD instance has no attribute '__trunc__'

Of course, that'd not be the right thing to do, either, as I do want an autogenerated doId, but still.

When using self.maproot.generateWithRequiredAndId(self.maproot, 123456, 0) (the doId is now in the StateServers range):

Traceback (most recent call last):
  File "./simple_example_server.py", line 102, in <module>
    simple_server.run()
  File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 2932, in run
    self.taskMgr.run()
  File "/usr/share/panda3d/direct/task/Task.py", line 502, in run
    self.step()
  File "/usr/share/panda3d/direct/task/Task.py", line 460, in step
    self.mgr.poll()
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 613, in readerPollUntilEmpty
    while self.readerPollOnce():
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 618, in readerPollOnce
    if self.checkDatagram():
  File "/home/baribal/src/astron_examples/01_simple_example/simple_example.py", line 45, in set_maproot
    self.maproot.generateWithRequiredAndId(self.maproot, 123456, 0)
  File "/usr/share/panda3d/direct/distributed/DistributedObjectUD.py", line 321, in generateWithRequiredAndId
    self.air.generateWithRequiredAndId(self, doId, parentId, zoneId, optionalFields)
  File "/usr/share/panda3d/direct/distributed/AstronInternalRepository.py", line 428, in generateWithRequiredAndId
    self.addDOToTables(do, location=(parentId, zoneId))
  File "/usr/share/panda3d/direct/distributed/DoCollectionManager.py", line 402, in addDOToTables
    self.storeObjectLocation(do, location[0], location[1])
  File "/usr/share/panda3d/direct/showbase/PythonUtil.py", line 3543, in _exceptionLogged
    return f(*args, **kArgs)
  File "/usr/share/panda3d/direct/distributed/DoCollectionManager.py", line 360, in storeObjectLocation
    elif parentId not in (None, 0, self.getGameDoId()):
  File "/usr/share/panda3d/direct/distributed/DoCollectionManager.py", line 27, in getGameDoId
    return self.GameGlobalsId
AttributeError: 'AstronInternalRepository' object has no attribute 'GameGlobalsId'

Finally, the code that I actually do want to have and that IMO should work:

> self.maproot.generateWithRequired(self.maproot, 0)
Traceback (most recent call last):
  File "./simple_example_server.py", line 102, in <module>
    simple_server.run()
  File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 2932, in run
    self.taskMgr.run()
  File "/usr/share/panda3d/direct/task/Task.py", line 502, in run
    self.step()
  File "/usr/share/panda3d/direct/task/Task.py", line 460, in step
    self.mgr.poll()
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 613, in readerPollUntilEmpty
    while self.readerPollOnce():
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 618, in readerPollOnce
    if self.checkDatagram():
  File "/home/baribal/src/astron_examples/01_simple_example/simple_example.py", line 46, in set_maproot
    self.maproot.generateWithRequired(self.maproot, 0)
  File "/usr/share/panda3d/direct/distributed/DistributedObjectUD.py", line 308, in generateWithRequired
    self.air.generateWithRequired(self, parentId, zoneId, optionalFields)
  File "/usr/share/panda3d/direct/distributed/AstronInternalRepository.py", line 418, in generateWithRequired
    self.generateWithRequiredAndId(do, doId, parentId, zoneId, optionalFields)
  File "/usr/share/panda3d/direct/distributed/AstronInternalRepository.py", line 429, in generateWithRequiredAndId
    do.sendGenerateWithRequired(self, parentId, zoneId, optionalFields)
  File "/usr/share/panda3d/direct/distributed/DistributedObjectUD.py", line 381, in sendGenerateWithRequired
    optionalFields)
AttributeError: DistributedMaprootUD instance has no attribute '__trunc__'
@alyssarosenzweig
Copy link

For the time being, the fix for GameGlobalsId goes back to the issue with Toontown's shards, so the fix would be to set air.GameGlobalsId to the ID of the DistributedMaproot.

CFSworks added a commit that referenced this issue Feb 11, 2015
CMake: Add installation target rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants