We’ve bumped into a pretty strange error, and I was hoping someone might be able to help out. We have a networked game where a number of clients participate in a series of actions together. We’re using a few finite state machines (for each client avatar and one for the server) to facilitate these actions.
When an avatar left the game, the code wasn’t properly “cleaning up” his/her action state on the server. So, we placed a method call in the avatar’s “delete” function that tells it to vacate the server’s FSM. However, this causes an unexpected problem:
Traceback (most recent call last):
File "server.py", line 133, in ?
run() # run Panda
File "C:\Panda3D-1.0.5\direct\src\showbase\ShowBase.py", line 1603, in run
self.taskMgr.run()
File "C:\Panda3D-1.0.5\direct\src\task\Task.py", line 781, in run
self.step()
File "C:\Panda3D-1.0.5\direct\src\task\Task.py", line 728, in step
self.__stepThroughList(taskPriList)
File "C:\Panda3D-1.0.5\direct\src\task\Task.py", line 671, in __stepThroughList
ret = self.__executeTask(task)
File "C:\Panda3D-1.0.5\direct\src\task\Task.py", line 602, in __executeTask
ret = task(task)
File "C:\Panda3D-1.0.5\direct\src\distributed\ServerRepository.py", line 188, in readerPollUntilEmpty
while self.readerPollOnce():
File "C:\Panda3D-1.0.5\direct\src\distributed\ServerRepository.py", line 201, in readerPollOnce
self.handleDatagram(datagram)
File "C:\Panda3D-1.0.5\direct\src\distributed\ServerRepository.py", line 221, in handleDatagram
self.handleClientUpdateField(datagram, dgi)
File "C:\Panda3D-1.0.5\direct\src\distributed\ServerRepository.py", line 266, in handleClientUpdateField
dclass = self.DOIDtoDClass[doid]
KeyError: 2000001
This error seems to occur at the end of the delete function at this line:
DistributedObject.delete(self)
We tried placing our method call in disable(), but the same problem occurs (when it hits “DistributedObject.disable(self)”).
We don’t see this error when we remove our clean-up method call, so our attempts to remove this avatar from the server FSM is definitely doing something wrong. I’m not very familiar with DistributedObject methods, so I’m not sure why disable() and delete() are coughing. Does anyone have any ideas as to what causes this error?