Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.02 KB | None | 0 0
  1.    public static void LOAD_CHAR_KOLI() {
  2.         try {
  3.             long time = System.currentTimeMillis();
  4.             int i = 0;
  5.             ResultSet RS = executeQuery("SELECT * from personnages ORDER BY victoirek DESC LIMIT 3000;", Config.DB_NAME, 0);
  6.             World.LadderByKoli.clear();
  7.             while (RS.next()) {
  8.                 World.addLadderPlayerKoli(new LadderPlayer(RS.getInt("guid"), RS.getInt("level"), RS.getString("name"), RS.getInt("honor"), RS.getInt("class"), RS.getLong("xp"), RS.getInt("sexe"), RS.getLong("kamas"), RS.getInt("victoirek"), RS.getInt("defaitek"), RS.getInt("alignement"), RS.getInt("title"), RS.getInt("victoirea"), RS.getInt("defaitea"), RS.getInt("victoired"), RS.getInt("defaited"), RS.getInt("coteKoli"), RS.getInt("coteDuplum")));
  9.                 i++;
  10.                 //System.out.print((RS.getInt("id")) + " - ");
  11.             }
  12.             closeResultSet(RS);
  13.             System.out.println(i + " Characters koli loaded in " + (System.currentTimeMillis() - time) + "ms");
  14.         } catch (SQLException e) {
  15.             Logs.addToLog("SQL ERROR: " + e.getMessage());
  16.             e.printStackTrace();
  17.         }
  18.     }
  19.  
  20. public static void LOAD_CHAR_XP() {
  21.         try {
  22.             synchronized (World.LadderByExp) {
  23.                 long time = System.currentTimeMillis();
  24.                 int i = 0;
  25.                 ResultSet RS = executeQuery("SELECT * from personnages ORDER BY xp DESC LIMIT 3000;", Config.DB_NAME, 0);
  26.                 World.LadderByExp.clear();
  27.                 while (RS.next()) {
  28.                     World.addLadderPlayerEXP(new LadderPlayer(RS.getInt("guid"), RS.getInt("level"), RS.getString("name"), RS.getInt("honor"), RS.getInt("class"), RS.getLong("xp"), RS.getInt("sexe"), RS.getLong("kamas"), RS.getInt("victoirek"), RS.getInt("defaitek"), RS.getInt("alignement"), RS.getInt("title"), RS.getInt("victoirea"), RS.getInt("defaitea"), RS.getInt("victoired"), RS.getInt("defaited"), RS.getInt("coteKoli"), RS.getInt("coteDuplum")));
  29.                     i++;
  30.                     //System.out.print((RS.getInt("id")) + " - ");
  31.                 }
  32.                 closeResultSet(RS);
  33.                 System.out.println(i + " Characters exp loaded in " + (System.currentTimeMillis() - time) + "ms");
  34.             }
  35.         } catch (SQLException e) {
  36.             Logs.addToLog("SQL ERROR: " + e.getMessage());
  37.             e.printStackTrace();
  38.         }
  39.     }
  40.  
  41.  public static void LOAD_CHAR_HONOR() {
  42.         try {
  43.             synchronized (World.LadderByHonor) {
  44.                 long time = System.currentTimeMillis();
  45.                 int i = 0;
  46.                 ResultSet RS = executeQuery("SELECT * from personnages  ORDER BY honor DESC LIMIT 3000;", Config.DB_NAME, 0);
  47.                 World.LadderByHonor.clear();
  48.                 while (RS.next()) {
  49.                     World.addLadderPlayerHonor(new LadderPlayer(RS.getInt("guid"), RS.getInt("level"), RS.getString("name"), RS.getInt("honor"), RS.getInt("class"), RS.getLong("xp"), RS.getInt("sexe"), RS.getLong("kamas"), RS.getInt("victoirek"), RS.getInt("defaitek"), RS.getInt("alignement"), RS.getInt("title"), RS.getInt("victoirea"), RS.getInt("defaitea"), RS.getInt("victoired"), RS.getInt("defaited"), RS.getInt("coteKoli"), RS.getInt("coteDuplum")));
  50.  
  51.                     //World.LadderByHonor.put
  52.                     i++;
  53.                     //System.out.print((RS.getInt("id")) + " - ");
  54.                 }
  55.                 closeResultSet(RS);
  56.                 System.out.println(i + " Characters honor loaded in " + (System.currentTimeMillis() - time) + "ms");
  57.             }
  58.         } catch (SQLException e) {
  59.             Logs.addToLog("SQL ERROR: " + e.getMessage());
  60.             e.printStackTrace();
  61.         }
  62.     }
  63.  public static void LOAD_CHAR_DUP() {
  64.         try {
  65.             long time = System.currentTimeMillis();
  66.             int i = 0;
  67.             ResultSet RS = executeQuery("SELECT * from personnages ORDER BY coteDuplum DESC LIMIT 3000;", Config.DB_NAME, 0);
  68.             World.LadderByDuplum.clear();
  69.             while (RS.next()) {
  70.                 World.addLadderPlayerDuplum(new LadderPlayer(RS.getInt("guid"), RS.getInt("level"), RS.getString("name"), RS.getInt("honor"), RS.getInt("class"), RS.getLong("xp"), RS.getInt("sexe"), RS.getLong("kamas"), RS.getInt("victoirek"), RS.getInt("defaitek"), RS.getInt("alignement"), RS.getInt("title"), RS.getInt("victoirea"), RS.getInt("defaitea"), RS.getInt("victoired"), RS.getInt("defaited"), RS.getInt("coteKoli"), RS.getInt("coteDuplum")));
  71.                 i++;
  72.                 //System.out.print((RS.getInt("id")) + " - ");
  73.             }
  74.             closeResultSet(RS);
  75.             System.out.println(i + " Characters koli loaded in " + (System.currentTimeMillis() - time) + "ms");
  76.         } catch (SQLException e) {
  77.             Logs.addToLog("SQL ERROR: " + e.getMessage());
  78.             e.printStackTrace();
  79.         }
  80.     }
  81. ublic static void LOAD_CHAR_KOLI() {
  82.         try {
  83.             long time = System.currentTimeMillis();
  84.             int i = 0;
  85.             ResultSet RS = executeQuery("SELECT * from personnages ORDER BY victoirek DESC LIMIT 3000;", Config.DB_NAME, 0);
  86.             World.LadderByKoli.clear();
  87.             while (RS.next()) {
  88.                 World.addLadderPlayerKoli(new LadderPlayer(RS.getInt("guid"), RS.getInt("level"), RS.getString("name"), RS.getInt("honor"), RS.getInt("class"), RS.getLong("xp"), RS.getInt("sexe"), RS.getLong("kamas"), RS.getInt("victoirek"), RS.getInt("defaitek"), RS.getInt("alignement"), RS.getInt("title"), RS.getInt("victoirea"), RS.getInt("defaitea"), RS.getInt("victoired"), RS.getInt("defaited"), RS.getInt("coteKoli"), RS.getInt("coteDuplum")));
  89.                 i++;
  90.                 //System.out.print((RS.getInt("id")) + " - ");
  91.             }
  92.             closeResultSet(RS);
  93.             System.out.println(i + " Characters koli loaded in " + (System.currentTimeMillis() - time) + "ms");
  94.         } catch (SQLException e) {
  95.             Logs.addToLog("SQL ERROR: " + e.getMessage());
  96.             e.printStackTrace();
  97.         }
  98.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement