Esempio n. 1
0
    def onDestroy(self):
        """
		KBEngine method.
		entity销毁
		"""
        ComBehavior.onDestroy(self)

        # 销毁SceneAlloc
        if self.sceneAlloc != None:
            self.sceneAlloc.destroy()
            self.sceneAlloc = None

        # 如果帐号ENTITY存在 则也通知销毁它
        if self.accountEntity != None:
            _time = time.time() - self.accountEntity.relogin
            if _time > 1:
                self.accountEntity.destroy()
                self.accountEntity = None
            else:
                DEBUG_MSG("Role[%i].destroySelf: relogin =%i" %
                          (self.id, _time))

        # 解除引用
        if self.accountEntity != None:
            self.accountEntity.activeRole = None
            self.accountEntity = None
Esempio n. 2
0
	def onDestroy(self):
		"""
		KBEngine method.
		"""
		ComBehavior.onDestroy(self)
		
		del KBEngine.globalData["space_%i" % self.spaceID]
		self.destroySpace()