def onReqAvatarList(self, infos): """ define method. """ DEBUG_MSG("Account:onReqAvatarList::%s" % (infos)) self.avatars = infos KBEngine.fireEvent("update_avatars", self.avatars)
def onReqAvatarList(self, infos): """ define method. """ DEBUG_MSG("Account:onReqAvatarList::%s" % (dict(infos))) self.avatars = dict(infos) KBEngine.fireEvent("update_avatars", self.avatars)
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)
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)))
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)
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)
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)))
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)
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)
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)
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)