Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- Links
- rooms.py
- https://github.com/kovitikus/hecate/blob/1a252a36fd54510959123af3a2159ffa87f1edb7/typeclasses/rooms.py#L207
- spawn_handler.py
- https://github.com/kovitikus/hecate/blob/1a252a36fd54510959123af3a2159ffa87f1edb7/world/spawn_handler.py
- mob_handler.py
- https://github.com/kovitikus/hecate/blob/1a252a36fd54510959123af3a2159ffa87f1edb7/world/mob_handler.py
- evennia.scripts.taskhandler.py
- https://github.com/evennia/evennia/blob/master/evennia/scripts/taskhandler.py
- Here is the traceback I receive.
- 20-09-10 07:26:28-04 Unhandled error in Deferred:
- 20-09-10 07:26:28-04 Unhandled Error
- Traceback (most recent call last):
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 1281, in mainLoop
- self.runUntilCurrent()
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 902, in runUntilCurrent
- call.func(*call.args, **call.kw)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 460, in callback
- self._startRunCallbacks(result)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 568, in _startRunCallbacks
- self._runCallbacks()
- --- <exception caught here> ---
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks
- current.result = callback(current.result, *args, **kw)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\task.py", line 865, in <lambda>
- d.addCallback(lambda ignored: callable(*args, **kw))
- File "d:\muddev\evennia\evennia\commands\cmdhandler.py", line 207, in _progressive_cmd_run
- value = generator.send(response)
- builtins.StopIteration:
- **UPDATE EDIT**
- 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.
- 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?
- 20-09-10 13:40:42-04 [..] Server disconnected from the portal.
- 20-09-10 13:40:42-04 Main loop terminated.
- 20-09-10 13:40:42-04 Server Shut Down.
- 20-09-10 13:40:42-04 Server Shut Down.
- 20-09-10 13:40:42-04 Unhandled error in Deferred:
- 20-09-10 13:40:42-04 Unhandled Error
- Traceback (most recent call last):
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 1281, in mainLoop
- self.runUntilCurrent()
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 902, in runUntilCurrent
- call.func(*call.args, **call.kw)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 460, in callback
- self._startRunCallbacks(result)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 568, in _startRunCallbacks
- self._runCallbacks()
- --- <exception caught here> ---
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks
- current.result = callback(current.result, *args, **kw)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\task.py", line 865, in <lambda>
- d.addCallback(lambda ignored: callable(*args, **kw))
- File "d:\muddev\evennia\evennia\commands\cmdhandler.py", line 207, in _progressive_cmd_run
- value = generator.send(response)
- builtins.StopIteration:
- 20-09-10 13:40:42-04 Unhandled error in Deferred:
- 20-09-10 13:40:42-04 Unhandled Error
- Traceback (most recent call last):
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 1281, in mainLoop
- self.runUntilCurrent()
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\base.py", line 902, in runUntilCurrent
- call.func(*call.args, **call.kw)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 460, in callback
- self._startRunCallbacks(result)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 568, in _startRunCallbacks
- self._runCallbacks()
- --- <exception caught here> ---
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks
- current.result = callback(current.result, *args, **kw)
- File "d:\muddev\myvirtualenv\Lib\site-packages\twisted\internet\task.py", line 865, in <lambda>
- d.addCallback(lambda ignored: callable(*args, **kw))
- File "D:\muddev\hecate\world\mob_handler.py", line 15, in check_for_target
- app_len = len(approached)
- builtins.TypeError: object of type 'NoneType' has no len()
- 20-09-10 13:40:43-04 Loading d:\muddev\evennia\evennia\server\server.py...
- 20-09-10 13:40:43-04 Loaded.
- 20-09-10 13:40:43-04 twistd 19.2.1 (d:\muddev\myvirtualenv\scripts\python.exe 3.7.4) starting up.
- 20-09-10 13:40:43-04 reactor class: twisted.internet.selectreactor.SelectReactor.
- 20-09-10 13:40:43-04 Webserver starting on 4005
- 20-09-10 13:40:44-04 Server successfully reloaded.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement