public static void ReassignAccountToChar(Compte C) {
   C.get_persos().clear();
   SQLManager.LOAD_PERSO_BY_ACCOUNT(C.get_GUID());
   for (Personnage P : Persos.values()) {
     if (P.getAccID() == C.get_GUID()) {
       C.addPerso(P);
       P.setAccount(C);
     }
   }
 }
Example #2
0
 /*
  TODO : Gestion du paquet Af + position dans la file d'attente.
 */
 public static void PendingSystem(Compte C) {
   if (C == null) return;
   if (C._position <= 1) {
     try {
       Thread.sleep(750);
       if (C == null || C.getRealmThread()._out == null) return;
       SocketManager.MULTI_SEND_Af_PACKET(
           C.getRealmThread()._out,
           1,
           RealmServer._totalAbo,
           RealmServer._totalNonAbo,
           "" + 1,
           RealmServer._queueID);
       C._position = -1;
       RealmServer._totalAbo--;
     } catch (InterruptedException e) {
       SocketManager.REALM_SEND_ALREADY_CONNECTED(C.getRealmThread()._out);
       RealmServer.addToLog("Erreur : " + e.getMessage());
     }
   } else {
     try {
       Thread.sleep(750 * C._position);
       if (C == null || C.getRealmThread()._out == null) return;
       SocketManager.MULTI_SEND_Af_PACKET(
           C.getRealmThread()._out,
           1,
           RealmServer._totalAbo,
           RealmServer._totalNonAbo,
           "" + 1,
           RealmServer._queueID);
       C._position = -1;
       RealmServer._totalAbo--;
     } catch (InterruptedException e) {
       SocketManager.REALM_SEND_ALREADY_CONNECTED(C.getRealmThread()._out);
       RealmServer.addToLog("Erreur : " + e.getMessage());
     }
   }
 }
 public static void addAccountbyName(Compte compte) {
   ComptebyName.put(compte.get_name(), compte.get_GUID());
 }
 public static void addAccount(Compte compte) {
   Comptes.put(compte.get_GUID(), compte);
   ComptebyName.put(compte.get_name().toLowerCase(), compte.get_GUID());
 }
 public static boolean ipIsUsed(String ip) {
   for (Compte c : Comptes.values()) if (c.get_curIP().compareTo(ip) == 0) return true;
   return false;
 }
 public static Compte getCompteByPseudo(String p) {
   for (Compte C : Comptes.values()) if (C.get_pseudo().equals(p)) return C;
   return null;
 }