コード例 #1
0
 private void ranking_change_all_values(String[] cmd) throws IOException {
   if (cmd.length % 2 != 0) {
     if (logged) {
       boolean okChange = true;
       for (int i = 1; i < cmd.length; i = i + 2) {
         okChange = Ranking.getInstance().changeValue(cmd[i], cmd[i + 1]);
         if (!okChange) break;
       }
       if (okChange) Ranking.getInstance().saveToFile();
       else Ranking.getInstance().readProperties();
       OutputWrite("ranking_change_all_values=" + (okChange ? "OK" : "error"));
     } else {
       OutputWrite("ranking_change_all_values=error");
     }
   } else {
     OutputWrite("ranking_change_all_values=error");
   }
 }
コード例 #2
0
 private void ranking_reload(String[] cmd) throws IOException {
   if (cmd.length == 1) {
     if (!logged) {
       OutputWrite("ranking_reload=error;message=Non sei loggato");
     } else {
       Ranking.getInstance().readProperties();
       OutputWrite("ranking_reload=OK");
     }
   } else {
     OutputWrite("ranking_reload=error;message=Usage: ranking_reload");
   }
 }
コード例 #3
0
 private void ranking_force_update(String[] cmd) throws IOException {
   if (cmd.length == 1) {
     if (logged) {
       boolean b = Ranking.getInstance().forceUpdate();
       OutputWrite("ranking_force_update=" + (b ? "OK" : "error"));
     } else {
       OutputWrite("ranking_force_update=error");
     }
   } else {
     OutputWrite("ranking_force_update=error");
   }
 }