Ejemplo n.º 1
0
 def __delitem__(self, userid, disconnecting=False):
     if not disconnecting:
         player_dictionary[userid].multi_levels = 0
     if userid not in self:
         return
     self[userid].remove_multi_level()
     super(_MultiLevelManager, self).__delitem__(userid)
     if not len(self):
         on_tick_listener_manager.unregister_listener(self._tick)
Ejemplo n.º 2
0
 def __delitem__(self, userid, reset_levels=True):
     """Remove the player from the dictionary and remove the effects."""
     if reset_levels:
         player_dictionary[userid].multi_levels = 0
     if userid not in self:
         return
     self[userid].remove_multi_level()
     super(_MultiLevelManager, self).__delitem__(userid)
     if not self:
         on_tick_listener_manager.unregister_listener(self._tick)
Ejemplo n.º 3
0
 def __delitem__(self, userid, reset_levels=True):
     """Remove the player from the dictionary and remove the effects."""
     if reset_levels:
         player_dictionary[userid].multi_levels = 0
     if userid not in self:
         return
     self[userid].remove_multi_level()
     super(_MultiLevelManager, self).__delitem__(userid)
     if not len(self):
         on_tick_listener_manager.unregister_listener(self._tick)
Ejemplo n.º 4
0
 def _unregister_if_empty(self):
     """Unregister the internal tick listener if the list is empty."""
     if not self:
         on_tick_listener_manager.unregister_listener(self._tick)
Ejemplo n.º 5
0
 def _bootstrap_inner(self):
     try:
         super()._bootstrap_inner()
     finally:
         on_tick_listener_manager.unregister_listener(self._tick)
Ejemplo n.º 6
0
 def __del__(self):
     on_tick_listener_manager.unregister_listener(self._tick)
Ejemplo n.º 7
0
 def _unregister_if_empty(self):
     """Unregister the internal tick listener if the list is empty."""
     if not self:
         on_tick_listener_manager.unregister_listener(self._tick)