Exemple #1
0
 def GetEmblemInfo(self):
     '''获取行会管理人员信息'''
     veteranList = eval('['+self.guildinfo['veterans']+']')
     staffList = eval('['+self.guildinfo['staffOfficers']+']')
     senatorsList = eval('['+self.guildinfo['senators']+']')
     info = {}
     info['corpsFounder'] = dbGuild.getCharacterNameByID(self.guildinfo['creator'])
     info['corpsId'] = self.id
     info['corpsImg'] = self.guildinfo['emblemLevel']
     info['createData'] = str(self.guildinfo['createDate'])
     info['corpsLevel'] = self.guildinfo['level']
     info['curProgress'] = self.guildinfo['exp']
     info['maxPorgress'] = self.guildinfo['level']**2*1000
     info['emblemLevel'] = self.guildinfo['emblemLevel']
     info['corpsChief'] = dbGuild.getCharacterNameByID(self.guildinfo['president'])
     info['veteranList'] = []
     info['staffInfo'] = []
     info['orderInfo'] = []
     info['bugleTxt'] = self.guildinfo['bugle']
     for veteran in veteranList:
         info['veteranList'].append(dbGuild.getCharacterNameByID(veteran))
     for staff in staffList:
         info['staffInfo'].append(dbGuild.getCharacterNameByID(staff))
     for senator in senatorsList:
         info['orderInfo'].append(dbGuild.getCharacterNameByID(senator))
     return info
Exemple #2
0
 def GetEmblemInfo(self):
     '''获取行会管理人员信息'''
     veteranList = eval('[' + self.guildinfo['veterans'] + ']')
     staffList = eval('[' + self.guildinfo['staffOfficers'] + ']')
     senatorsList = eval('[' + self.guildinfo['senators'] + ']')
     info = {}
     info['corpsFounder'] = dbGuild.getCharacterNameByID(
         self.guildinfo['creator'])
     info['corpsId'] = self.id
     info['corpsImg'] = self.guildinfo['emblemLevel']
     info['createData'] = str(self.guildinfo['createDate'])
     info['corpsLevel'] = self.guildinfo['level']
     info['curProgress'] = self.guildinfo['exp']
     info['maxPorgress'] = self.guildinfo['level']**2 * 1000
     info['emblemLevel'] = self.guildinfo['emblemLevel']
     info['corpsChief'] = dbGuild.getCharacterNameByID(
         self.guildinfo['president'])
     info['veteranList'] = []
     info['staffInfo'] = []
     info['orderInfo'] = []
     info['bugleTxt'] = self.guildinfo['bugle']
     for veteran in veteranList:
         info['veteranList'].append(dbGuild.getCharacterNameByID(veteran))
     for staff in staffList:
         info['staffInfo'].append(dbGuild.getCharacterNameByID(staff))
     for senator in senatorsList:
         info['orderInfo'].append(dbGuild.getCharacterNameByID(senator))
     return info
Exemple #3
0
    def TransferCorps(self,operator,memberId):
        '''移交国长
        @param operator: int 操作者的id
        @param memberId: int 被任命的角色的id
        '''
        managementGroup = eval("["+self.guildinfo['veterans']+"]")\
                                +eval("["+self.guildinfo['staffOfficers']+"]")\
                                +eval("["+self.guildinfo['senators']+"]")
        if memberId not in managementGroup:
            return {'result':False,'message':Lg().g(534)}
        if operator!=self.president:
            return {'result':False,'message':Lg().g(515)}
        if not dbGuild.checkCharacterInGuild(memberId, self.id):
            return {'result':False,'message':Lg().g(524)}
        result = dbGuild.TransferCorps(self.id, operator, memberId)
        if result:
            self.president = memberId
            player = PlayersManager().getPlayerByID(operator)
            player.updatePlayerInfo()
            member = PlayersManager().getPlayerByID(memberId)
            
            if member:
                member.updatePlayerInfo()
            dbGuild.updateCharacterGuildInfo(memberId, {'post':4})
            membername = dbGuild.getCharacterNameByID(memberId)
            content = Lg().g(535)%\
            (self.guildinfo.get('nickname',''),membername,self.guildinfo.get('name',''),)
            title = Lg().g(526)
            for characterId in dbGuild.getAllGuildCharacterId(self.id):
                m = Mail( title=title,type =0, senderId =-1, receiverId=characterId[0],\
                            sender = Lg().g(128),content=content)
                m.mailIntoDB()
            postdict = dbGuild.updateGuildPost(self.id)
            self.veterans=postdict.veterans
            self.staffOfficers=postdict.staffOfficers
            self.senators=postdict.senators
#            self.SynchGuildInfo()
            return {'result':True,'message':Lg().g(85)}
        return {'result':False,'message':Lg().g(536)}
Exemple #4
0
    def TransferCorps(self, operator, memberId):
        '''移交国长
        @param operator: int 操作者的id
        @param memberId: int 被任命的角色的id
        '''
        managementGroup = eval("["+self.guildinfo['veterans']+"]")\
                                +eval("["+self.guildinfo['staffOfficers']+"]")\
                                +eval("["+self.guildinfo['senators']+"]")
        if memberId not in managementGroup:
            return {'result': False, 'message': Lg().g(534)}
        if operator != self.president:
            return {'result': False, 'message': Lg().g(515)}
        if not dbGuild.checkCharacterInGuild(memberId, self.id):
            return {'result': False, 'message': Lg().g(524)}
        result = dbGuild.TransferCorps(self.id, operator, memberId)
        if result:
            self.president = memberId
            player = PlayersManager().getPlayerByID(operator)
            player.updatePlayerInfo()
            member = PlayersManager().getPlayerByID(memberId)

            if member:
                member.updatePlayerInfo()
            dbGuild.updateCharacterGuildInfo(memberId, {'post': 4})
            membername = dbGuild.getCharacterNameByID(memberId)
            content = Lg().g(535)%\
            (self.guildinfo.get('nickname',''),membername,self.guildinfo.get('name',''),)
            title = Lg().g(526)
            for characterId in dbGuild.getAllGuildCharacterId(self.id):
                m = Mail( title=title,type =0, senderId =-1, receiverId=characterId[0],\
                            sender = Lg().g(128),content=content)
                m.mailIntoDB()
            postdict = dbGuild.updateGuildPost(self.id)
            self.veterans = postdict.veterans
            self.staffOfficers = postdict.staffOfficers
            self.senators = postdict.senators
            #            self.SynchGuildInfo()
            return {'result': True, 'message': Lg().g(85)}
        return {'result': False, 'message': Lg().g(536)}