public void performRankingUpdate(Map<Integer,Integer> legionRanking){
  log.info("Legion ranking update task started");
  long startTime=System.currentTimeMillis();
  Iterator<Legion> legionsIterator=allCachedLegions.iterator();
  int legionsUpdated=0;
  this.legionRanking=legionRanking;
  while (legionsIterator.hasNext()) {
    Legion legion=legionsIterator.next();
    if (legionRanking.containsKey(legion.getLegionId())) {
      legion.setLegionRank(legionRanking.get(legion.getLegionId()));
      PacketSendUtility.broadcastPacketToLegion(legion,new SM_LEGION_EDIT(0x01,legion));
    }
    legionsUpdated++;
  }
  long workTime=System.currentTimeMillis() - startTime;
  log.info("Legion ranking update: " + workTime + " ms, legions: "+ legionsUpdated);
}

public void performRankingUpdate ( Map < Integer , Integer > legionRanking ) { log . info ( "Legion ranking update task started" ) ; long startTime = System . currentTimeMillis ( ) ; Iterator < Legion > legionsIterator = allCachedLegions . iterator ( ) ; int legionsUpdated = 0 ; this . legionRanking = legionRanking ; while ( legionsIterator . hasNext ( ) ) { Legion legion = legionsIterator . next ( ) ; if ( legionRanking . containsKey ( legion . getLegionId ( ) ) ) { legion . setLegionRank ( legionRanking . get ( legion . getLegionId ( ) ) ) ; PacketSendUtility . broadcastPacketToLegion ( legion , new SM_LEGION_EDIT ( 0x01 , legion ) ) ; } legionsUpdated ++ ; } long workTime = System . currentTimeMillis ( ) - startTime ; log . info ( "Legion ranking update: " + workTime + " ms, legions: " + legionsUpdated ) ; }
this method will set the legion ranking if needed
