Exemple #1
0
    def onReqAvatarList(self, infos):
        """
		define method.
		"""
        DEBUG_MSG("Account:onReqAvatarList::%s" % (infos))
        self.avatars = infos
        KBEngine.fireEvent("update_avatars", self.avatars)
Exemple #2
0
    def onReqAvatarList(self, infos):
        """
		define method.
		"""
        DEBUG_MSG("Account:onReqAvatarList::%s" % (dict(infos)))
        self.avatars = dict(infos)
        KBEngine.fireEvent("update_avatars", self.avatars)
Exemple #3
0
	def set_modelScale(self, oldValue):
		"""
		Property method.
		服务器设置了modelNumber属性
		"""
		DEBUG_MSG("%s::set_modelScale: %i changed:%s->%s" % (self.getScriptName(), self.id, oldValue, self.modelScale))
		
		KBEngine.fireEvent("set_modelScale", self.id, self.modelScale)
Exemple #4
0
	def set_HP_Max(self, oldValue):
		"""
		Property method.
		服务器设置了属性
		"""
		DEBUG_MSG("%s::set_HP_Max: %i changed:%s->%s" % (self.getScriptName(), self.id, oldValue, self.HP_Max))
		
		KBEngine.fireEvent("set_HP_Max", json.dumps((self.id, self.HP_Max)))
Exemple #5
0
	def set_modelScale(self, oldValue):
		"""
		Property method.
		服务器设置了modelNumber属性
		"""
		DEBUG_MSG("%s::set_modelScale: %i changed:%s->%s" % (self.getScriptName(), self.id, oldValue, self.modelScale))
		
		KBEngine.fireEvent("set_modelScale", self.id, self.modelScale)
Exemple #6
0
	def recvDamage(self, attackerID, skillID, damageType, damage):
		"""
		defined.
		"""
		DEBUG_MSG("%s::recvDamage: %i attackerID=%i, skillID=%i, damageType=%i, damage=%i" % \
			(self.getScriptName(), self.id, attackerID, skillID, damageType, damage))
		
		# 通知表现层改变表现
		KBEngine.fireEvent("recvDamage", self.id, attackerID, skillID, damageType, damage)
Exemple #7
0
	def set_name(self, oldValue):
		"""
		Property method.
		服务器设置了name属性
		"""
		DEBUG_MSG("%s::set_name: %i changed:%s->%s" % (self.getScriptName(), self.id, oldValue, self.name))
		
		# 通知表现层改变表现
		KBEngine.fireEvent("set_name", self.id, self.name)
Exemple #8
0
	def set_modelID(self, oldValue):
		"""
		Property method.
		服务器设置了modelNumber属性
		"""
		DEBUG_MSG("%s::set_modelID: %i changed:%s->%s" % (self.getScriptName(), self.id, oldValue, self.modelID))
		
		# 通知表现层改变表现
		KBEngine.fireEvent("set_modelID", json.dumps((self.id, self.modelID)))
Exemple #9
0
    def set_HP_Max(self, oldValue):
        """
		Property method.
		服务器设置了属性
		"""
        DEBUG_MSG("%s::set_HP_Max: %i changed:%s->%s" %
                  (self.getScriptName(), self.id, oldValue, self.HP_Max))

        KBEngine.fireEvent("set_HP_Max", self.id, self.HP_Max)
Exemple #10
0
	def set_name(self, oldValue):
		"""
		Property method.
		服务器设置了name属性
		"""
		DEBUG_MSG("%s::set_name: %i changed:%s->%s" % (self.getScriptName(), self.id, oldValue, self.name))
		
		# 通知表现层改变表现
		KBEngine.fireEvent("set_name", self.id, self.name)
Exemple #11
0
	def set_modelID(self, oldValue):
		"""
		Property method.
		服务器设置了modelNumber属性
		"""
		DEBUG_MSG("%s::set_modelID: %i changed:%s->%s" % (self.getScriptName(), self.id, oldValue, self.modelID))
		
		# 通知表现层改变表现
		KBEngine.fireEvent("set_modelID", self.id, self.modelID)
Exemple #12
0
    def recvDamage(self, attackerID, skillID, damageType, damage):
        """
		defined.
		"""
        DEBUG_MSG("%s::recvDamage: %i attackerID=%i, skillID=%i, damageType=%i, damage=%i" % \
         (self.getScriptName(), self.id, attackerID, skillID, damageType, damage))

        # 通知表现层改变表现
        KBEngine.fireEvent("recvDamage", self.id, attackerID, skillID,
                           damageType, damage)
Exemple #13
0
	def fireEvent(self, evtName):
		firedatas = ""
		
		if evtName == "update_avatars":
			dctinfo = copy.deepcopy(dict(self.avatars))
			for info in dctinfo.values():
				for data in info[4].values():
					data[1] = ""
			
			firedatas = json.dumps(dctinfo)
			
		KBEngine.fireEvent(evtName, firedatas)
Exemple #14
0
    def fireEvent(self, evtName):
        firedatas = ""

        if evtName == "update_avatars":
            dctinfo = copy.deepcopy(dict(self.avatars))
            for info in dctinfo.values():
                for data in info[4].values():
                    data[1] = ""

            firedatas = json.dumps(dctinfo)

        KBEngine.fireEvent(evtName, firedatas)
Exemple #15
0
    def onCreateAvatarResult(self, retcode, info):
        """
		define method.
		"""
        DEBUG_MSG("Account:onCreateAvatarResult::%s, retcode=%i" % (info, retcode))

        if info[0] == 0:  # "dbid"
            DEBUG_MSG("Account:onCreateAvatarResult::avatar full.")
            return

        self.avatars[info[0]] = info
        KBEngine.fireEvent("update_avatars", self.avatars)
Exemple #16
0
	def onCreateAvatarResult(self, retcode, info):
		"""
		define method.
		"""
		DEBUG_MSG("Account:onCreateAvatarResult::%s, retcode=%i" % (info, retcode))
		
		if info[0] == 0: # "dbid"
			DEBUG_MSG("Account:onCreateAvatarResult::avatar full.")
			return
			
		self.avatars[info[0]] = info
		KBEngine.fireEvent("update_avatars", self.avatars)