pymud 0.19.2__py3-none-any.whl → 0.19.2.post1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pymud/pymud.py CHANGED
@@ -655,6 +655,10 @@ class PyMudApp:
655
655
  while session.connected:
656
656
  await asyncio.sleep(0.1)
657
657
 
658
+ for plugin in self._plugins.values():
659
+ if isinstance(plugin, Plugin):
660
+ plugin.onSessionDestroy(self.current_session)
661
+
658
662
  else:
659
663
  return
660
664
 
pymud/session.py CHANGED
@@ -461,12 +461,12 @@ class Session:
461
461
 
462
462
  def clean_finished_tasks(self):
463
463
  "清理已经完成的任务"
464
+ self._tasks = [t for t in self._tasks if not t.done()]
465
+
464
466
  # for task in self._tasks:
465
467
  # if isinstance(task, asyncio.Task) and task.done():
466
468
  # self._tasks.remove(task)
467
469
 
468
- self._tasks = list((t for t in self._tasks if isinstance(t, asyncio.Task) and not t.done()))
469
-
470
470
  def write(self, data) -> None:
471
471
  "向服务器写入数据(RAW格式字节数组/字节串)"
472
472
  if self._transport and not self._transport.is_closing():