def addTeamMember(self, characterId): '''添加队伍成员''' if characterId == self._owner.baseInfo.id: return {'result': False, 'message': Lg().g(491)} if self._teamId == -1: team = TeamManager().creatTeam(self._owner.baseInfo.id) else: team = TeamManager().getTeamByID(self._teamId) result = team.addMember(characterId) team.pushTeamMemberInfo() return result
def startCopyScene(self, characterId, vipMatrix): '''开始副本 @param chracterId: 角色的ID ''' if characterId != self.roomowner: return {'result': False, 'message': u'只有房主有权限'} if not self.areAllReady(): return {'result': False, 'message': u'还有玩家没有准备好'} player = PlayersManager().getPlayerByID(characterId) if vipMatrix == 1: if player.finance.getCoin() >= 5000: self.matrix.setNowEffect(vipMatrix) player.finance.updateCoin(player.finance.getCoin() - 5000) elif vipMatrix == 2: if player.finance.getGold() >= 10: self.matrix.setNowEffect(vipMatrix) player.finance.updateGold(player.finance.getGold() - 10) elif vipMatrix == 3: if player.finance.getGold() >= 50: self.matrix.setNowEffect(vipMatrix) player.finance.updateGold(player.finance.getGold() - 50) sendList = [] if len([member for member in self.members.values() if member]) > 1: team = TeamManager().creatTeam(characterId) team.setMatrix(self.matrix) for member in self.members.values(): if member: pp = PlayersManager().getPlayerByID(member['id']) if pp: sendList.append(pp.getDynamicId()) team.addMember(member['id']) data = enterInstance1(0, characterId, self.copySceneId) if data['result']: player = PlayersManager().getPlayerByID(characterId) dynamicId = player.getDynamicId() pushQuitHallMessage(sendList) pushEnterPlace(data['data'].get('placeId'), [dynamicId]) return data
def startCopyScene(self,characterId,vipMatrix): '''开始副本 @param chracterId: 角色的ID ''' if characterId != self.roomowner: return {'result':False,'message':u'只有房主有权限'} if not self.areAllReady(): return {'result':False,'message':u'还有玩家没有准备好'} player = PlayersManager().getPlayerByID(characterId) if vipMatrix ==1: if player.finance.getCoin()>=5000: self.matrix.setNowEffect(vipMatrix) player.finance.updateCoin(player.finance.getCoin() -5000) elif vipMatrix ==2: if player.finance.getGold()>=10: self.matrix.setNowEffect(vipMatrix) player.finance.updateGold(player.finance.getGold() -10) elif vipMatrix ==3 : if player.finance.getGold()>=50: self.matrix.setNowEffect(vipMatrix) player.finance.updateGold(player.finance.getGold() -50) sendList = [] if len([member for member in self.members.values() if member])>1: team = TeamManager().creatTeam(characterId) team.setMatrix(self.matrix) for member in self.members.values(): if member: pp = PlayersManager().getPlayerByID(member['id']) if pp: sendList.append(pp.getDynamicId()) team.addMember(member['id']) data = enterInstance1(0, characterId, self.copySceneId) if data['result']: player = PlayersManager().getPlayerByID(characterId) dynamicId = player.getDynamicId() pushQuitHallMessage(sendList) pushEnterPlace(data['data'].get('placeId'), [dynamicId]) return data