Advertisement
Kovitikus

Python class TASK_HANDLER traceback

Sep 10th, 2020 (edited)
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. In rooms.py, class SewerRoom(Room), I'm asking my Python class SpawnHandler in world.spawn_handler.py to set a utils.delay for 3 seconds and then attempt to spawn a mob. After it spawns the mob, the torch is then passed onto my Python class MobHandler in world.mob_handler.py where it will pick a target and then choose an attack. There is a delay set in there, but only in the idle method, which is only called if get_target cannot find a target.
  2.  
  3. Links
  4. rooms.py
  5. https://github.com/kovitikus/hecate/blob/1a252a36fd54510959123af3a2159ffa87f1edb7/typeclasses/rooms.py#L207
  6.  
  7. spawn_handler.py
  8. https://github.com/kovitikus/hecate/blob/1a252a36fd54510959123af3a2159ffa87f1edb7/world/spawn_handler.py
  9.  
  10. mob_handler.py
  11. https://github.com/kovitikus/hecate/blob/1a252a36fd54510959123af3a2159ffa87f1edb7/world/mob_handler.py
  12.  
  13. evennia.scripts.taskhandler.py
  14. https://github.com/evennia/evennia/blob/master/evennia/scripts/taskhandler.py
  15.  
  16.  
  17.  
  18. Here is the traceback I receive.
  19.  
  20. 20-09-10 07:26:28-04 Unhandled error in Deferred:
  21. 20-09-10 07:26:28-04 Unhandled Error
  22. Traceback (most recent call last):
  23. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 1281, in mainLoop
  24. self.runUntilCurrent()
  25. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 902, in runUntilCurrent
  26. call.func(*call.args, **call.kw)
  27. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 460, in callback
  28. self._startRunCallbacks(result)
  29. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 568, in _startRunCallbacks
  30. self._runCallbacks()
  31. --- <exception caught here> ---
  32. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks
  33. current.result = callback(current.result, *args, **kw)
  34. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\task.py", line 865, in <lambda>
  35. d.addCallback(lambda ignored: callable(*args, **kw))
  36. File "d:\muddev\evennia\evennia\commands\cmdhandler.py", line 207, in _progressive_cmd_run
  37. value = generator.send(response)
  38. builtins.StopIteration:
  39.  
  40.  
  41. **UPDATE EDIT**
  42.  
  43. It seems like the utils.delay is perhaps freaking out that I deleted the mob with the admin command and maybe there's still something lingering, because right after that I reloaded the server and there were errors popping up during shutdown. It's pretty obvious that the utils.delay call is still trying to do something when it's finding a target and returning NoneType, but I'm not sure what's going on with the StopIteration traceback or how I can handle these issues.
  44.  
  45. I probably need to gracefully handle the deletion of the mob with a new admin command specifically for the mob_handler and/or spawn_handler, with maybe some way of gracefully stopping a delay callback?
  46.  
  47.  
  48. 20-09-10 13:40:42-04 [..] Server disconnected from the portal.
  49. 20-09-10 13:40:42-04 Main loop terminated.
  50. 20-09-10 13:40:42-04 Server Shut Down.
  51. 20-09-10 13:40:42-04 Server Shut Down.
  52. 20-09-10 13:40:42-04 Unhandled error in Deferred:
  53. 20-09-10 13:40:42-04 Unhandled Error
  54. Traceback (most recent call last):
  55. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 1281, in mainLoop
  56. self.runUntilCurrent()
  57. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 902, in runUntilCurrent
  58. call.func(*call.args, **call.kw)
  59. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 460, in callback
  60. self._startRunCallbacks(result)
  61. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 568, in _startRunCallbacks
  62. self._runCallbacks()
  63. --- <exception caught here> ---
  64. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks
  65. current.result = callback(current.result, *args, **kw)
  66. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\task.py", line 865, in <lambda>
  67. d.addCallback(lambda ignored: callable(*args, **kw))
  68. File "d:\muddev\evennia\evennia\commands\cmdhandler.py", line 207, in _progressive_cmd_run
  69. value = generator.send(response)
  70. builtins.StopIteration:
  71.  
  72. 20-09-10 13:40:42-04 Unhandled error in Deferred:
  73. 20-09-10 13:40:42-04 Unhandled Error
  74. Traceback (most recent call last):
  75. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 1281, in mainLoop
  76. self.runUntilCurrent()
  77. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 902, in runUntilCurrent
  78. call.func(*call.args, **call.kw)
  79. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 460, in callback
  80. self._startRunCallbacks(result)
  81. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 568, in _startRunCallbacks
  82. self._runCallbacks()
  83. --- <exception caught here> ---
  84. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks
  85. current.result = callback(current.result, *args, **kw)
  86. File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\task.py", line 865, in <lambda>
  87. d.addCallback(lambda ignored: callable(*args, **kw))
  88. File "D:\muddev\hecate\world\mob_handler.py", line 15, in check_for_target
  89. app_len = len(approached)
  90. builtins.TypeError: object of type 'NoneType' has no len()
  91.  
  92. 20-09-10 13:40:43-04 Loading d:\muddev\evennia\evennia\server\server.py...
  93. 20-09-10 13:40:43-04 Loaded.
  94. 20-09-10 13:40:43-04 twistd 19.2.1 (d:\muddev\myvirtualenv\scripts\python.exe 3.7.4) starting up.
  95. 20-09-10 13:40:43-04 reactor class: twisted.internet.selectreactor.SelectReactor.
  96. 20-09-10 13:40:43-04 Webserver starting on 4005
  97. 20-09-10 13:40:44-04 Server successfully reloaded.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement