Exemplo n.º 1
0
    def refuseGuildApply(self, operator, characterId):
        '''拒绝角色的入会申请
        @param operator: 操作者的id
        @param characterId: int 申请人的id
        '''
        president = self.get('president')
        veteranList = eval('[' + self.guildinfo['veterans'] + ']')
        staffList = eval('[' + self.guildinfo['staffOfficers'] + ']')
        senatorsList = eval('[' + self.guildinfo['senators'] + ']')
        #获取操作者的权限
        if operator == president:
            operatorpost = Lg().g(520)
        elif operator in veteranList:
            operatorpost = Lg().g(519)
        elif operator in staffList:
            operatorpost = Lg().g(518)
        elif operator in senatorsList:
            operatorpost = Lg().g(517)

        managementGroup = veteranList + staffList + senatorsList
        if not dbGuild.checkHasApply(self.id, characterId):
            return -4
        if operator != self.president and operator not in managementGroup:
            return -1  #权限不够
        result = dbGuild.delGuildApplyJoinRecord(self.id, characterId)
        if result:
            player = PlayersManager().getPlayerByID(operator)
            content = Lg().g(533) % (player.baseInfo.getName(), operatorpost,
                                     self.guildinfo.get('nickname', ''))
            title = Lg().g(526)
            m = Mail( title=title,type =0, senderId =-1, receiverId=characterId,\
                            sender = Lg().g(128),content=content)
            m.mailIntoDB()
            tplayer = PlayersManager().getPlayerByID(characterId)
            if tplayer:
                tplayer.quest.specialTaskHandle(ADDGUILDTASKTYPE)
        return 1
Exemplo n.º 2
0
 def refuseGuildApply(self,operator,characterId):
     '''拒绝角色的入会申请
     @param operator: 操作者的id
     @param characterId: int 申请人的id
     '''
     president = self.get('president')
     veteranList = eval('['+self.guildinfo['veterans']+']')
     staffList = eval('['+self.guildinfo['staffOfficers']+']')
     senatorsList = eval('['+self.guildinfo['senators']+']')
     #获取操作者的权限
     if operator==president:
         operatorpost =Lg().g(520)
     elif operator in veteranList:
         operatorpost = Lg().g(519)
     elif operator in staffList:
         operatorpost = Lg().g(518)
     elif operator in senatorsList:
         operatorpost = Lg().g(517)
     
     managementGroup = veteranList + staffList + senatorsList
     if not dbGuild.checkHasApply(self.id, characterId):
         return -4
     if operator!=self.president and operator not in managementGroup:
         return -1#权限不够
     result = dbGuild.delGuildApplyJoinRecord(self.id, characterId)
     if result:
         player = PlayersManager().getPlayerByID(operator)
         content = Lg().g(533)%(player.baseInfo.getName(),operatorpost,self.guildinfo.get('nickname',''))
         title = Lg().g(526)
         m = Mail( title=title,type =0, senderId =-1, receiverId=characterId,\
                         sender = Lg().g(128),content=content)
         m.mailIntoDB()
         tplayer = PlayersManager().getPlayerByID(characterId)
         if tplayer:
             tplayer.quest.specialTaskHandle(ADDGUILDTASKTYPE)
     return 1
 def UnsubscribeJionGuild(self,guildId):
     '''取消申请'''
     if not dbGuild.checkHasApply(guildId, self._owner.baseInfo.id):
         return {'result':False,'message':Lg().g(344)}
     dbGuild.delGuildApplyJoinRecord(guildId, self._owner.baseInfo.id)
     return {'result':True}