Advertisement
Guest User

sdsqdq

a guest
Jan 24th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 111.92 KB | None | 0 0
  1. package org.common;
  2.  
  3. import java.io.PrintWriter;
  4. import java.util.ArrayList;
  5. import java.util.Map;
  6. import java.util.Map.Entry;
  7.  
  8. import org.client.Characters;
  9. import org.client.Characters.Group;
  10. import org.common.World.ItemSet;
  11. import org.fight.Fight;
  12. import org.fight.Fight.Fighter;
  13. import org.fight.object.Collector;
  14. import org.fight.object.Prism;
  15. import org.fight.object.Monster.MobGroup;
  16. import org.game.GameSendThread;
  17. import org.game.GameServer;
  18. import org.kernel.Logs;
  19. import org.kernel.Main;
  20. import org.object.AuctionHouse;
  21. import org.object.Guild;
  22. import org.object.Maps;
  23. import org.object.Mount;
  24. import org.object.Objects;
  25. import org.object.Trunk;
  26. import org.object.AuctionHouse.HdvEntry;
  27. import org.object.Guild.GuildMember;
  28. import org.object.Maps.Case;
  29. import org.object.Maps.InteractiveObject;
  30. import org.object.Maps.MountPark;
  31. import org.object.NpcTemplates.NPC;
  32. import org.object.Objects.ObjTemplate;
  33. import org.object.job.Job.StatsMetier;
  34.  
  35. public class SocketManager {
  36.  
  37.     public static void send(Characters p, String packet) {
  38.         if (p == null || p.get_compte() == null)
  39.             return;
  40.         if (p.get_compte().getGameThread() == null)
  41.             return;
  42.         GameSendThread out = p.get_compte().getGameThread().get_out();
  43.         if (out != null) {
  44.             packet = CryptManager.toUtf(packet);
  45.             out.send(packet);
  46.         }
  47.     }
  48.  
  49.     public static void send(GameSendThread out, String packet) {
  50.         if (out != null) {
  51.             packet = CryptManager.toUtf(packet);
  52.             out.send(packet);
  53.             Logs.addToHistoricLog("Game: Packet: " + packet +" to " + out);
  54.         }
  55.     }
  56.    
  57.     public static void send(PrintWriter out, String packet) {
  58.         long t = System.currentTimeMillis();
  59.         if (out != null && !packet.equals("") && !packet.equals("\0")) {
  60.             packet = CryptManager.toUtf(packet);
  61.             out.print((new StringBuilder(String.valueOf(packet))).append('\0').toString());
  62.             out.flush();
  63.         }
  64.         if (System.currentTimeMillis() - t > 5000L)
  65.             GAME_SEND_cMK_PACKET_TO_ADMIN("@", 0, "DEBUG-SOCKET-OUT",
  66.                     (new StringBuilder("SocketManager.send( ____OUT ); = ")).append(System.currentTimeMillis() - t)
  67.                             .append("; ").toString());
  68.     }
  69.    
  70.     /* Start Packet */
  71.  
  72.     public static void MULTI_SEND_Af_PACKET(GameSendThread out, int position, int totalAbo, int totalNonAbo,
  73.             String subscribe, int queueID) {
  74.         StringBuilder packet = new StringBuilder();
  75.         packet.append("Af").append(position).append("|").append(totalAbo).append("|").append(totalNonAbo).append("|")
  76.                 .append(subscribe).append("|").append(queueID);
  77.         send(out, packet.toString());
  78.  
  79.         Logs.addToRealmSockLog("Serv: Send>>" + packet.toString());
  80.     }
  81.  
  82.     public static void GAME_SEND_HELLOGAME_PACKET(GameSendThread out) {
  83.         String packet = "HG";
  84.         send(out, packet);
  85.  
  86.         Logs.addToGameSockLog("Game: Send >> " + packet);
  87.     }
  88.  
  89.     public static void GAME_SEND_ATTRIBUTE_FAILED(GameSendThread out) {
  90.         String packet = "ATE";
  91.         send(out, packet);
  92.  
  93.         Logs.addToGameSockLog("Game: Send >> " + packet);
  94.     }
  95.  
  96.     public static void GAME_SEND_ATTRIBUTE_SUCCESS(GameSendThread out) {
  97.         String packet = "ATK0";
  98.         send(out, packet);
  99.  
  100.         Logs.addToGameSockLog("Game: Send >> " + packet);
  101.     }
  102.  
  103.     public static void GAME_SEND_AV0(GameSendThread out) {
  104.         String packet = "AV0";
  105.         send(out, packet);
  106.  
  107.         Logs.addToGameSockLog("Game: Send >> " + packet);
  108.     }
  109.  
  110.     public static void GAME_SEND_HIDE_GENERATE_NAME(GameSendThread out) {
  111.         String packet = "APE2";
  112.         send(out, packet);
  113.  
  114.         Logs.addToGameSockLog("Game: Send >> " + packet);
  115.     }
  116.  
  117.     public static void GAME_SEND_PERSO_LIST(GameSendThread out, Map<Integer, Characters> persos, int subscriber) {
  118.         StringBuilder packet = new StringBuilder();
  119.         packet.append("ALK").append((subscriber * 60) + "000").append("|").append(persos.size());
  120.         for (Entry<Integer, Characters> entry : persos.entrySet()) {
  121.             packet.append(entry.getValue().parseALK());
  122.  
  123.         }
  124.         send(out, packet.toString());
  125.  
  126.         Logs.addToGameSockLog("Game: Send >> " + packet.toString());
  127.  
  128.     }
  129.  
  130.     public static void GAME_SEND_SUBSCRIBE_MESSAGE(GameSendThread out, String str) {
  131.         StringBuilder packet = new StringBuilder();
  132.         packet.append("BP").append(str);
  133.         send(out, packet.toString());
  134.  
  135.         Logs.addToGameSockLog("Game: Send >> " + packet.toString());
  136.     }
  137.  
  138.     public static void GAME_SEND_SUBSCRIBE_MESSAGE(Characters p, String str) {
  139.         StringBuilder packet = new StringBuilder();
  140.         packet.append("BP").append(str);
  141.         send(p, packet.toString());
  142.  
  143.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  144.                 + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  145.     }
  146.  
  147.     public static void GAME_SEND_CREATE_DOC(Characters p, String doc) {
  148.         String packet = "dC|" + doc;
  149.         send(p, packet);
  150.  
  151.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  152.                 + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  153.     }
  154.  
  155.     public static void GAME_SEND_LEAVE_DOC(Characters p) {
  156.         String packet = "dV";
  157.         send(p, packet);
  158.  
  159.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  160.                 + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  161.     }
  162.  
  163.     /** TODO: Packets prismes **/
  164.     public static void GAME_SEND_am_ALIGN_PACKET_TO_SUBAREA(Characters p, String str) {
  165.         String packet = "am" + str;
  166.         send(p, packet);
  167.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  168.     }
  169.  
  170.     public static void GAME_SEND_aM_ALIGN_PACKET_TO_AREA(Characters p, String str) {
  171.         String packet = "aM" + str;
  172.         send(p, packet);
  173.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  174.        
  175.     }
  176.  
  177.     public static void SEND_Cb_CONQUETE(Characters p, String str) {
  178.         String packet = "Cb" + str;
  179.         send(p, packet);
  180.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  181.        
  182.     }
  183.  
  184.     public static void SEND_GA_Action_ALL_MAPS(Maps Carte, String gameActionID, int actionID, String s1, String s2) {
  185.         String packet = "GA" + gameActionID + ";" + actionID + ";" + s1;
  186.         if (!s2.equals(""))
  187.             packet += ";" + s2;
  188.         for (Characters z : Carte.getPersos())
  189.             send(z, packet);
  190.         Logs.addToGameSockLog("Game: Send >> ALL(" + Carte.getPersos().size() +") " + packet.toString());
  191.     }
  192.  
  193.     public static void SEND_CIV_INFOS_CONQUETE(Characters p) {
  194.         String packet = "CIV";
  195.         send(p, packet);
  196.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  197.     }
  198.  
  199.     public static void SEND_CW_INFO_CONQUETE(Characters p, String str) {
  200.         String packet = "CW" + str;
  201.         send(p, packet);
  202.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  203.        
  204.     }
  205.  
  206.     public static void SEND_CB_BONUS_CONQUETE(Characters p, String str) {
  207.         String packet = "CB" + str;
  208.         send(p, packet);
  209.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  210.        
  211.     }
  212.  
  213.     public static void SEND_Wp_MENU_Prisme(Characters p) {
  214.         String packet = "Wp" + p.parsePrismesList();
  215.         send(p.get_compte().getGameThread().get_out(), packet);
  216.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  217.     }
  218.  
  219.     public static void SEND_Ww_CLOSE_Prisme(Characters p) {
  220.         String packet = "Ww";
  221.         send(p, packet);
  222.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  223.        
  224.     }
  225.  
  226.     public static void SEND_CP_INFO_DEFENSEURS_PRISME(Characters p, String str) {
  227.         String packet = "CP" + str;
  228.         send(p, packet);
  229.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  230.        
  231.     }
  232.  
  233.     public static void SEND_Cp_INFO_ATTAQUANT_PRISME(Characters p, String str) {
  234.         String packet = "Cp" + str;
  235.         send(p, packet);
  236.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  237.        
  238.     }
  239.  
  240.     public static void SEND_CA_ATTAQUE_MESSAGE_PRISME(Characters p, String str) {
  241.         String packet = "CA" + str;
  242.         send(p, packet);
  243.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  244.     }
  245.  
  246.     public static void SEND_CS_SURVIVRE_MESSAGE_PRISME(Characters perso, String str) {
  247.         String packet = "CS" + str;
  248.         send(perso, packet);
  249.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  250.     }
  251.  
  252.     public static void SEND_CD_MORT_MESSAGE_PRISME(Characters perso, String str) {
  253.         String packet = "CD" + str;
  254.         send(perso, packet);
  255.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  256.     }
  257.  
  258.     public static void SEND_CIJ_INFO_JOIN_PRISME(Characters perso, String str) {
  259.         String packet = "CIJ" + str;
  260.         send(perso, packet);
  261.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  262.     }
  263.     //TODO OCO
  264.     public static void GAME_SEND_OCO_PACKET_REMOVE(Characters perso, Objects obj) {
  265.         String packet = "OCO" + obj.parseItem() + "*" + obj.getGuid();
  266.         send(perso, packet);
  267.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  268.     }
  269.  
  270.     public static void SEND_GM_PRISME_TO_MAP(GameSendThread _out, Maps Carte) {
  271.         String packet = Carte.getPrismeGMPacket();
  272.         if (packet == "" || packet.isEmpty())
  273.             return;
  274.         send(_out, packet);
  275.         Logs.addToGameSockLog("Game: Send >> " + packet.toString());
  276.     }
  277.  
  278.     public static void GAME_SEND_PRISME_TO_MAP(Maps Carte, Prism Prisme) {
  279.         String packet = Prisme.getGMPrisme();
  280.         for (Characters z : Carte.getPersos())
  281.             send(z, packet);
  282.         Logs.addToGameSockLog("Game: Send >> " + packet.toString());
  283.     }
  284.     /** TODO: Fin packets prismes **/
  285.  
  286.     public static void REALM_SEND_MESSAGE_DECO(Characters perso, int MSG_ID, String args) {
  287.         String packet = "M0" + MSG_ID + "|" + args;
  288.         send(perso, packet);
  289.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  290.     }
  291.    
  292.     public static void SEND_MESSAGE_DECO_ALL() {
  293.         String packet = "M04|";
  294.         for (Characters perso : World.getOnlinePersos()) {
  295.             send(perso, packet);
  296.         }
  297.         Logs.addToGameSockLog("Game: Send ALL(" + World.getOnlinePersos().size() + ")>> " + packet.toString());
  298.     }
  299.  
  300.     public static void GAME_SEND_NAME_ALREADY_EXIST(GameSendThread out) {
  301.         String packet = "AAEa";
  302.         send(out, packet);
  303.  
  304.         Logs.addToGameSockLog("Game: Send >> " + packet);
  305.     }
  306.    
  307.     public static void GAME_SEND_NAME_INCORRECT(GameSendThread out) {
  308.         String packet = "AAEn";
  309.         send(out, packet);
  310.         Logs.addToGameSockLog("Game: Send >> " + packet);
  311.     }
  312.  
  313.     public static void GAME_SEND_CREATE_PERSO_FULL(GameSendThread out) {
  314.         String packet = "AAEf";
  315.         send(out, packet);
  316.  
  317.         Logs.addToGameSockLog("Game: Send >> " + packet);
  318.     }
  319.  
  320.     public static void GAME_SEND_CREATE_OK(GameSendThread out) {
  321.         String packet = "AAK";
  322.         send(out, packet);
  323.  
  324.         Logs.addToGameSockLog("Game: Send >> " + packet);
  325.     }
  326.  
  327.     public static void GAME_SEND_DELETE_PERSO_FAILED(GameSendThread out) {
  328.         String packet = "ADE";
  329.         send(out, packet);
  330.  
  331.         Logs.addToGameSockLog("Game: Send >> " + packet);
  332.     }
  333.  
  334.     public static void GAME_SEND_CREATE_FAILED(GameSendThread out) {
  335.         String packet = "AAEF";
  336.         send(out, packet);
  337.         Logs.addToGameSockLog("Game: Send >> " + packet);
  338.     }
  339.  
  340.     public static void GAME_SEND_PERSO_SELECTION_FAILED(GameSendThread out) {
  341.         String packet = "ASE";
  342.         send(out, packet);
  343.  
  344.         Logs.addToGameSockLog("Game: Send >> " + packet);
  345.     }
  346.  
  347.     public static void GAME_SEND_STATS_PACKET(Characters perso) {
  348.         String packet = perso.getAsPacket();
  349.         send(perso, packet);
  350.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  351.     }
  352.  
  353.     public static void GAME_SEND_Rx_PACKET(Characters perso) {
  354.         String packet = "Rx" + perso.getMountXpGive();
  355.         send(perso, packet);
  356.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  357.     }
  358.  
  359.     public static void GAME_SEND_Rn_PACKET(Characters perso, String name) {
  360.         String packet = "Rn" + name;
  361.         send(perso, packet);
  362.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  363.     }
  364.  
  365.     public static void GAME_SEND_Re_PACKET(Characters perso, String sign, Mount DD) {
  366.         String packet = "Re" + sign;
  367.         if (sign.equals("+"))
  368.             packet += DD.parse();
  369.  
  370.         send(perso, packet);
  371.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  372.     }
  373.  
  374.     public static void GAME_SEND_ASK(GameSendThread out, Characters perso) {
  375.         StringBuilder packet = new StringBuilder();
  376.         packet.append("ASK|").append(perso.get_GUID()).append("|").append(perso.get_name()).append("|");
  377.         packet.append(perso.get_lvl()).append("|").append(perso.get_classe()).append("|").append(perso.get_sexe());
  378.         packet.append("|").append(perso.get_gfxID()).append("|")
  379.                 .append((perso.get_color1() == -1 ? "-1" : Integer.toHexString(perso.get_color1())));
  380.         packet.append("|").append((perso.get_color2() == -1 ? "-1" : Integer.toHexString(perso.get_color2())))
  381.                 .append("|");
  382.         packet.append((perso.get_color3() == -1 ? "-1" : Integer.toHexString(perso.get_color3()))).append("|");
  383.         packet.append(perso.parseItemToASK());
  384.  
  385.         send(out, packet.toString());
  386.  
  387.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  388.     }
  389.  
  390.     public static void GAME_SEND_ALIGNEMENT(GameSendThread out, int alliID) {
  391.         String packet = "ZS" + alliID;
  392.         send(out, packet);
  393.  
  394.         Logs.addToGameSockLog("Game: Send >> " + packet);
  395.     }
  396.  
  397.     public static void GAME_SEND_ADD_CANAL(GameSendThread out, String chans) {
  398.         String packet = "cC+" + chans;
  399.         send(out, packet);
  400.  
  401.         Logs.addToGameSockLog("Game: Send >> " + packet);
  402.     }
  403.  
  404.     public static void GAME_SEND_ZONE_ALLIGN_STATUT(GameSendThread out) {
  405.         String packet = "al" + World.getSousZoneStateString();
  406.         send(out, packet);
  407.  
  408.         Logs.addToGameSockLog("Game: Send >> " + packet);
  409.     }
  410.  
  411.     public static void GAME_SEND_SEESPELL_OPTION(GameSendThread out, boolean spells) {
  412.         String packet = "SLo" + (spells ? "+" : "-");
  413.         send(out, packet);
  414.  
  415.         Logs.addToGameSockLog("Game: Send >> " + packet);
  416.     }
  417.  
  418.     public static void GAME_SEND_RESTRICTIONS(GameSendThread out) {
  419.         String packet = "AR6bk";
  420.         send(out, packet);
  421.  
  422.         Logs.addToGameSockLog("Game: Send >> " + packet);
  423.     }
  424.  
  425.     public static void GAME_SEND_Ow_PACKET(Characters perso) {
  426.         String packet = "Ow" + perso.getPodUsed() + "|" + perso.getMaxPod();
  427.         send(perso, packet);
  428.  
  429.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  430.     }
  431.  
  432.     public static void GAME_SEND_OT_PACKET(GameSendThread out, int id) {
  433.         String packet = "OT";
  434.         if (id > 0)
  435.             packet += id;
  436.         send(out, packet);
  437.  
  438.         Logs.addToGameSockLog("Game: Send >> " + packet);
  439.     }
  440.  
  441.     public static void GAME_SEND_SEE_FRIEND_CONNEXION(GameSendThread out, boolean see) {
  442.         String packet = "FO" + (see ? "+" : "-");
  443.         send(out, packet);
  444.  
  445.         Logs.addToGameSockLog("Game: Send >> " + packet);
  446.     }
  447.  
  448.     public static void GAME_SEND_GAME_CREATE(GameSendThread out, String _name) {
  449.         String packet = "GCK|1|" + _name;
  450.         send(out, packet);
  451.  
  452.         Logs.addToGameSockLog("Game: Send >> " + packet);
  453.     }
  454.  
  455.     public static void GAME_SEND_SERVER_HOUR(GameSendThread out) {
  456.         String packet = GameServer.getServerTime();
  457.         send(out, packet);
  458.  
  459.         Logs.addToGameSockLog("Game: Send >> " + packet);
  460.     }
  461.  
  462.     public static void GAME_SEND_SERVER_DATE(GameSendThread out) {
  463.         String packet = GameServer.getServerDate();
  464.         send(out, packet);
  465.  
  466.         Logs.addToGameSockLog("Game: Send >> " + packet);
  467.     }
  468.  
  469.     public static void GAME_SEND_MAPDATA(GameSendThread out, int id, String date, String key) {
  470.         String packet = "GDM|" + id + "|" + date + "|" + key;
  471.         send(out, packet);
  472.  
  473.         Logs.addToGameSockLog("Game: Send >> " + packet);
  474.     }
  475.  
  476.     public static void GAME_SEND_GDK_PACKET(GameSendThread out) {
  477.         String packet = "GDK";
  478.         send(out, packet);
  479.  
  480.         Logs.addToGameSockLog("Game: Send >> " + packet);
  481.     }
  482.  
  483.     public static void GAME_SEND_MAP_MOBS_GMS_PACKETS(GameSendThread out, Maps carte) {
  484.         String packet = carte.getMobGroupGMsPackets();
  485.         if (packet.equals(""))
  486.             return;
  487.         send(out, packet);
  488.  
  489.         Logs.addToGameSockLog("Game: Send >> " + packet);
  490.     }
  491.  
  492.     public static void GAME_SEND_MAP_OBJECTS_GDS_PACKETS(GameSendThread out, Maps carte) {
  493.         String packet = carte.getObjectsGDsPackets();
  494.         if (packet.equals(""))
  495.             return;
  496.         send(out, packet);
  497.  
  498.         Logs.addToGameSockLog("Game: Send >> " + packet);
  499.     }
  500.  
  501.     public static void GAME_SEND_MAP_NPCS_GMS_PACKETS(GameSendThread _out, Maps carte) {
  502.         String packet = carte.getNpcsGMsPackets();
  503.         if (packet.equals("") && packet.length() < 4)
  504.             return;
  505.         send(_out, packet);
  506.  
  507.         Logs.addToDebug((new StringBuilder("Game: Send >> ")).append(packet).toString());
  508.     }
  509.  
  510.     public static void GAME_SEND_MAP_PERCO_GMS_PACKETS(GameSendThread out, Maps carte) {
  511.         String packet = Collector.parseGM(carte);
  512.         if (packet.length() < 5)
  513.             return;
  514.         send(out, packet);
  515.  
  516.         Logs.addToGameSockLog("Game: Send >> " + packet);
  517.     }
  518.     /*
  519.      * public static void GAME_SEND_MAP_GMS_PACKETS(GameSendThread out, Carte
  520.      * carte) { String packet = carte.getGMsPackets(); send(out,packet);
  521.      * if(Ancestra.debug) Logs.addToGameSockLog("Game: Send >> "+packet); }
  522.      */
  523.  
  524.     public static void GAME_SEND_ERASE_ON_MAP_TO_MAP(Maps map, int guid) {
  525.         String packet = "GM|-" + guid;
  526.         if (map == null || map.getPersos() == null)
  527.             return;
  528.         for (Characters z : map.getPersos()) {
  529.             if (z.get_compte().getGameThread() == null)
  530.                 continue;
  531.             send(z.get_compte().getGameThread().get_out(), packet);
  532.         }
  533.  
  534.         Logs.addToGameSockLog("Game: Map " + map.get_id() + " (" + map.getPersos().size() + "): Send>>" + packet);
  535.     }
  536.  
  537.     public static void GAME_SEND_ERASE_ON_MAP_TO_FIGHT(Fight f, int guid) {
  538.         String packet = "GM|-" + guid;
  539.         for (int z = 0; z < f.getFighters(1).size(); z++) {
  540.             if (f.getFighters(1).get(z).getPersonnage().get_compte().getGameThread() == null)
  541.                 continue;
  542.             send(f.getFighters(1).get(z).getPersonnage(), packet);
  543.         }
  544.         for (int z = 0; z < f.getFighters(2).size(); z++) {
  545.             if (f.getFighters(2).get(z).getPersonnage().get_compte().getGameThread() == null)
  546.                 continue;
  547.             send(f.getFighters(2).get(z).getPersonnage(), packet);
  548.         }
  549.  
  550.         Logs.addToGameSockLog("Game: Fighter ID " + f.get_id() + ": Send>>" + packet);
  551.     }
  552.  
  553.     public static void GAME_SEND_ON_FIGHTER_KICK(Fight f, int guid, int team) {
  554.         String packet = "GM|-" + guid;
  555.         for (Fighter F : f.getFighters(team)) {
  556.             if (F.getPersonnage() == null || F.getPersonnage().get_compte().getGameThread() == null
  557.                     || F.getPersonnage().get_GUID() == guid)
  558.                 continue;
  559.             send(F.getPersonnage(), packet);
  560.         }
  561.  
  562.         Logs.addToGameSockLog("Game: Fighter ID " + f.get_id() + ": Send>>" + packet);
  563.     }
  564.  
  565.     public static void GAME_SEND_ALTER_FIGHTER_MOUNT(Fight fight, Fighter fighter, int guid, int team, int otherteam) {
  566.         StringBuilder packet = new StringBuilder();
  567.         packet.append("GM|-").append(guid).append((char) 0x00).append(fighter.getGmPacket('~'));
  568.         for (Fighter F : fight.getFighters(team)) {
  569.             if (F.getPersonnage() == null || F.getPersonnage().get_compte().getGameThread() == null
  570.                     || !F.getPersonnage().isOnline())
  571.                 continue;
  572.             send(F.getPersonnage(), packet.toString());
  573.         }
  574.         if (otherteam > -1) {
  575.             for (Fighter F : fight.getFighters(otherteam)) {
  576.                 if (F.getPersonnage() == null || F.getPersonnage().get_compte().getGameThread() == null
  577.                         || !F.getPersonnage().isOnline())
  578.                     continue;
  579.                 send(F.getPersonnage(), packet.toString());
  580.             }
  581.         }
  582.  
  583.         Logs.addToGameSockLog("Game: Fight ID " + fight.get_id() + ": Send>>" + packet);
  584.     }
  585.  
  586.     public static void GAME_SEND_ADD_PLAYER_TO_MAP(Maps map, Characters perso) {
  587.         String packet = "GM|+" + perso.parseToGM();
  588.         for (Characters z : map.getPersos())
  589.             send(z, packet);
  590.  
  591.         Logs.addToGameSockLog("Game: Map " + map.get_id() + " (" + map.getPersos().size() + "): Send>>" + packet);
  592.     }
  593.  
  594.     public static void GAME_SEND_DUEL_Y_AWAY(GameSendThread out, int guid) {
  595.         String packet = "GA;903;" + guid + ";o";
  596.         send(out, packet);
  597.  
  598.         Logs.addToGameSockLog("Game: Send >> " + packet);
  599.     }
  600.  
  601.     public static void GAME_SEND_DUEL_E_AWAY(GameSendThread out, int guid) {
  602.         String packet = "GA;903;" + guid + ";z";
  603.         send(out, packet);
  604.  
  605.         Logs.addToGameSockLog("Game: Send >> " + packet);
  606.     }
  607.  
  608.     public static void GAME_SEND_MAP_NEW_DUEL_TO_MAP(Maps map, int guid, int guid2) {
  609.         String packet = "GA;900;" + guid + ";" + guid2;
  610.         for (Characters z : map.getPersos())
  611.             send(z, packet);
  612.  
  613.         Logs.addToGameSockLog("Game: Map " + map.get_id() + " (" + map.getPersos().size() + "): Send>>" + packet);
  614.     }
  615.  
  616.     public static void GAME_SEND_CANCEL_DUEL_TO_MAP(Maps map, int guid, int guid2) {
  617.         String packet = "GA;902;" + guid + ";" + guid2;
  618.         for (Characters z : map.getPersos())
  619.             send(z, packet);
  620.  
  621.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  622.     }
  623.  
  624.     public static void GAME_SEND_MAP_START_DUEL_TO_MAP(Maps map, int guid, int guid2) {
  625.         String packet = "GA;901;" + guid + ";" + guid2;
  626.         for (Characters z : map.getPersos())
  627.             send(z, packet);
  628.  
  629.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  630.     }
  631.  
  632.     public static void GAME_SEND_MAP_FIGHT_COUNT(GameSendThread out, Maps map) {
  633.         String packet = "fC" + map.getNbrFight();
  634.         send(out, packet);
  635.  
  636.         Logs.addToGameSockLog("Game: Send >> " + packet);
  637.     }
  638.  
  639.     public static void GAME_SEND_FIGHT_GJK_PACKET_TO_FIGHT(Fight fight, int teams, int state, int cancelBtn, int duel,
  640.             int spec, long time, int type) {
  641.         StringBuilder packet = new StringBuilder();
  642.         packet.append("GJK").append(state).append("|");
  643.         packet.append(cancelBtn).append("|").append(duel).append("|");
  644.         packet.append(spec).append("|").append(time).append("|").append(type);
  645.         for (Fighter f : fight.getFighters(teams)) {
  646.             if (f.hasLeft())
  647.                 continue;
  648.             send(f.getPersonnage(), packet.toString());
  649.         }
  650.  
  651.         Logs.addToGameSockLog("Game: Map: Send>>" + packet.toString());
  652.     }
  653.  
  654.     public static void GAME_SEND_FIGHT_PLACES_PACKET_TO_FIGHT(Fight fight, int teams, String places, int team) {
  655.         String packet = "GP" + places + "|" + team;
  656.         for (Fighter f : fight.getFighters(teams)) {
  657.             if (f.hasLeft())
  658.                 continue;
  659.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  660.                 continue;
  661.             send(f.getPersonnage(), packet);
  662.         }
  663.  
  664.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  665.     }
  666.  
  667.     public static void GAME_SEND_MAP_FIGHT_COUNT_TO_MAP(Maps map) {
  668.         String packet = "fC" + map.getNbrFight();
  669.         for (Characters z : map.getPersos())
  670.             send(z, packet);
  671.  
  672.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  673.     }
  674.  
  675.     public static void GAME_SEND_GAME_ADDFLAG_PACKET_TO_MAP(Maps map, int arg1, int guid1, int guid2, int cell1,
  676.             String str1, int cell2, String str2) {
  677.         StringBuilder packet = new StringBuilder();
  678.         packet.append("Gc+").append(guid1).append(";").append(arg1).append("|").append(guid1).append(";").append(cell1)
  679.                 .append(";").append(str1).append("|").append(guid2).append(";").append(cell2).append(";").append(str2);
  680.         for (Characters z : map.getPersos())
  681.             send(z, packet.toString());
  682.  
  683.         Logs.addToGameSockLog("Game: Map: Send>>" + packet.toString());
  684.     }
  685.  
  686.     public static void GAME_SEND_GAME_ADDFLAG_PACKET_TO_PLAYER(Characters p, Maps map, int arg1, int guid1, int guid2,
  687.             int cell1, String str1, int cell2, String str2) {
  688.         StringBuilder packet = new StringBuilder();
  689.         packet.append("Gc+").append(guid1).append(";").append(arg1).append("|").append(guid1).append(";").append(cell1)
  690.                 .append(";").append(str1).append("|").append(guid2).append(";").append(cell2).append(";").append(str2);
  691.         send(p, packet.toString());
  692.  
  693.         Logs.addToGameSockLog("Game: Map: Send>>" + packet.toString());
  694.     }
  695.  
  696.     public static void GAME_SEND_GAME_REMFLAG_PACKET_TO_MAP(Maps map, int guid) {
  697.         String packet = "Gc-" + guid;
  698.         for (Characters z : map.getPersos())
  699.             send(z, packet);
  700.  
  701.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  702.     }
  703.  
  704.     public static void GAME_SEND_ADD_IN_TEAM_PACKET_TO_MAP(Maps map, int teamID, Fighter perso) {
  705.         StringBuilder packet = new StringBuilder();
  706.         packet.append("Gt").append(teamID).append("|+").append(perso.getGUID()).append(";")
  707.                 .append(perso.getPacketsName()).append(";").append(perso.get_lvl());
  708.         for (Characters z : map.getPersos())
  709.             send(z, packet.toString());
  710.  
  711.         Logs.addToGameSockLog("Game: Map: Send>>" + packet.toString());
  712.     }
  713.  
  714.     public static void GAME_SEND_ADD_IN_TEAM_PACKET_TO_PLAYER(Characters p, Maps map, int teamID, Fighter perso) {
  715.         StringBuilder packet = new StringBuilder();
  716.         packet.append("Gt").append(teamID).append("|+").append(perso.getGUID()).append(";")
  717.                 .append(perso.getPacketsName()).append(";").append(perso.get_lvl());
  718.         send(p, packet.toString());
  719.  
  720.         Logs.addToGameSockLog("Game: Map: Send>>" + packet.toString());
  721.     }
  722.  
  723.     public static void GAME_SEND_REMOVE_IN_TEAM_PACKET_TO_MAP(Maps map, int teamID, Fighter perso) {
  724.         StringBuilder packet = new StringBuilder();
  725.         packet.append("Gt").append(teamID).append("|-").append(perso.getGUID()).append(";")
  726.                 .append(perso.getPacketsName()).append(";").append(perso.get_lvl());
  727.         for (Characters z : map.getPersos())
  728.             send(z, packet.toString());
  729.  
  730.         Logs.addToGameSockLog("Game: Map: Send>>" + packet.toString());
  731.     }
  732.  
  733.     public static void GAME_SEND_MAP_MOBS_GMS_PACKETS_TO_MAP(Maps map) {
  734.         String packet = map.getMobGroupGMsPackets(); // Un par un comme sa lors
  735.                                                         // du respawn :)
  736.         for (Characters z : map.getPersos())
  737.             send(z, packet);
  738.  
  739.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  740.     }
  741.  
  742.     public static void GAME_SEND_MAP_MOBS_GM_PACKET(Maps map, MobGroup current_Mobs) {
  743.         if (!Main.isRunning)
  744.             return;
  745.         String packet = "GM|";
  746.         packet += current_Mobs.parseGM();// Un par un comme sa lors du respawn
  747.                                             // :)
  748.         for (Characters z : map.getPersos())
  749.             send(z, packet);
  750.  
  751.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  752.     }
  753.  
  754.     public static void GAME_SEND_MAP_GMS_PACKETS(Maps map, Characters _perso) {
  755.         map.sendGMsPackets(_perso);
  756.     }
  757.  
  758.     public static void GAME_SEND_MAP_GMS_PACKETS(Characters perso, String packet) {
  759.         send(perso, packet);
  760.  
  761.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  762.     }
  763.  
  764.     public static void GAME_SEND_ON_EQUIP_ITEM(Maps map, Characters _perso) {
  765.         String packet = _perso.parseToOa();
  766.         for (Characters z : map.getPersos())
  767.             send(z, packet);
  768.  
  769.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  770.     }
  771.  
  772.     public static void GAME_SEND_ON_EQUIP_ITEM_FIGHT(Characters _perso, Fighter f, Fight F) {
  773.         String packet = _perso.parseToOa();
  774.         for (Fighter z : F.getFighters(f.getTeam2())) {
  775.             if (z.getPersonnage() == null)
  776.                 continue;
  777.             send(z.getPersonnage(), packet);
  778.         }
  779.         for (Fighter z : F.getFighters(f.getOtherTeam())) {
  780.             if (z.getPersonnage() == null)
  781.                 continue;
  782.             send(z.getPersonnage(), packet);
  783.         }
  784.  
  785.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  786.     }
  787.  
  788.     public static void GAME_SEND_FIGHT_CHANGE_PLACE_PACKET_TO_FIGHT(Fight fight, int teams, Maps map, int guid,
  789.             int cell) {
  790.         String packet = "GIC|" + guid + ";" + cell + ";1";
  791.         for (Fighter f : fight.getFighters(teams)) {
  792.             if (f.hasLeft())
  793.                 continue;
  794.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  795.                 continue;
  796.             send(f.getPersonnage(), packet);
  797.         }
  798.  
  799.         Logs.addToGameSockLog("Game: Send >> " + packet);
  800.     }
  801.  
  802.     public static void GAME_SEND_FIGHT_CHANGE_OPTION_PACKET_TO_MAP(Maps map, char s, char option, int guid) {
  803.         String packet = "Go" + s + option + guid;
  804.         for (Characters z : map.getPersos())
  805.             send(z, packet);
  806.  
  807.         Logs.addToGameSockLog("Game: Send >> " + packet);
  808.     }
  809.  
  810.     public static void GAME_SEND_FIGHT_PLAYER_READY_TO_FIGHT(Fight fight, int teams, int guid, boolean b) {
  811.         String packet = "GR" + (b ? "1" : "0") + guid;
  812.         if (fight.get_state() != 2)
  813.             return;
  814.         for (Fighter f : fight.getFighters(teams)) {
  815.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  816.                 continue;
  817.             if (f.hasLeft())
  818.                 continue;
  819.             send(f.getPersonnage(), packet);
  820.         }
  821.  
  822.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  823.     }
  824.  
  825.     public static void GAME_SEND_GJK_PACKET(Characters perso, int state, int cancelBtn, int duel, int spec, long time,
  826.             int unknown) {
  827.         StringBuilder packet = new StringBuilder();
  828.         packet.append("GJK").append(state).append("|").append(cancelBtn).append("|").append(duel).append("|")
  829.                 .append(spec).append("|").append(time).append("|").append(unknown);
  830.         send(perso, packet.toString());
  831.  
  832.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  833.     }
  834.  
  835.     public static void GAME_SEND_FIGHT_PLACES_PACKET(GameSendThread out, String places, int team) {
  836.         String packet = "GP" + places + "|" + team;
  837.         send(out, packet);
  838.  
  839.         Logs.addToGameSockLog("Game: Send >> " + packet);
  840.     }
  841.  
  842.     public static void GAME_SEND_Im_PACKET_TO_ALL(String s) {
  843.         String packet = "Im" + s;
  844.         for (Characters perso : World.getOnlinePersos())
  845.             send(perso, packet);
  846.  
  847.         Logs.addToGameSockLog("Game: Send ALL(" + World.getOnlinePersos().size() + ") >> " + packet);
  848.     }
  849.  
  850.     public static void GAME_SEND_Im_PACKET(Characters out, String str) {
  851.         String packet = "Im" + str;
  852.         send(out, packet);
  853.  
  854.         Logs.addToGameSockLog("Game: Send >> " + packet);
  855.     }
  856.  
  857.     public static void GAME_SEND_ILS_PACKET(Characters perso, int i) {
  858.         String packet = "ILS" + i;
  859.         send(perso, packet);
  860.  
  861.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  862.     }
  863.  
  864.     public static void GAME_SEND_ILF_PACKET(Characters perso, int i) {
  865.         String packet = "ILF" + i;
  866.         send(perso, packet);
  867.  
  868.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  869.     }
  870.  
  871.     public static void SEND_Im1223_MESSAGE_TO_ALL(String str) {
  872.         String packet = "Im1223;" + str;
  873.         for (Characters perso : World.getOnlinePersos())
  874.             send(perso, packet);
  875.  
  876.         Logs.addToGameSockLog("Game: Send ALL(" + World.getOnlinePersos().size() + ") >> " + packet);
  877.     }
  878.  
  879.     public static void GAME_SEND_Im_PACKET_TO_MAP(Maps map, String id) {
  880.         String packet = "Im" + id;
  881.         for (Characters z : map.getPersos())
  882.             send(z, packet);
  883.  
  884.         Logs.addToGameSockLog("Game: Map: Send MAP(" + map.getPersos().size() +")>>" + packet);
  885.     }
  886.  
  887.     public static void GAME_SEND_eUK_PACKET_TO_MAP(Maps map, int guid, int emote) {
  888.         String packet = "eUK" + guid + "|" + emote;
  889.         for (Characters z : map.getPersos())
  890.             send(z, packet);
  891.  
  892.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  893.     }
  894.  
  895.     public static void GAME_SEND_Im_PACKET_TO_FIGHT(Fight fight, int teams, String id) {
  896.         String packet = "Im" + id;
  897.         for (Fighter f : fight.getFighters(teams)) {
  898.             if (f.hasLeft())
  899.                 continue;
  900.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  901.                 continue;
  902.             send(f.getPersonnage(), packet);
  903.         }
  904.  
  905.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  906.     }
  907.  
  908.     public static void GAME_SEND_MESSAGE(Characters perso, String mess, String color) {
  909.         String packet = "cs<font color='#" + color + "'>" + mess + "</font>";
  910.         send(perso, packet);
  911.  
  912.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  913.     }
  914.  
  915.     public static void GAME_SEND_MESSAGE_TO_MAP(Maps map, String mess, String color) {
  916.         String packet = "cs<font color='#" + color + "'>" + mess + "</font>";
  917.         for (Characters z : map.getPersos())
  918.             send(z, packet);
  919.  
  920.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  921.     }
  922.  
  923.     public static void GAME_SEND_GA903_ERROR_PACKET(GameSendThread out, char c, int guid) {
  924.         String packet = "GA;903;" + guid + ";" + c;
  925.         send(out, packet);
  926.  
  927.         Logs.addToGameSockLog("Game: Send >> " + packet);
  928.     }
  929.  
  930.     public static void GAME_SEND_GIC_PACKETS_TO_FIGHT(Fight fight, int teams) {
  931.         StringBuilder packet = new StringBuilder();
  932.         packet.append("GIC|");
  933.         for (Fighter p : fight.getFighters(3)) {
  934.             if (p.get_fightCell() == null)
  935.                 continue;
  936.             packet.append(p.getGUID()).append(";").append(p.get_fightCell().getID()).append(";1|");
  937.         }
  938.         for (Fighter perso : fight.getFighters(teams)) {
  939.             if (perso.hasLeft())
  940.                 continue;
  941.             if (perso.getPersonnage() == null || !perso.getPersonnage().isOnline())
  942.                 continue;
  943.             send(perso.getPersonnage(), packet.toString());
  944.         }
  945.  
  946.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet.toString());
  947.     }
  948.  
  949.     public static void GAME_SEND_GIC_PACKET_TO_FIGHT(Fight fight, int teams, Fighter f) {
  950.         StringBuilder packet = new StringBuilder();
  951.         packet.append("GIC|").append(f.getGUID()).append(";").append(f.get_fightCell().getID()).append(";1|");
  952.  
  953.         for (Fighter perso : fight.getFighters(teams)) {
  954.             if (perso.hasLeft())
  955.                 continue;
  956.             if (perso.getPersonnage() == null || !perso.getPersonnage().isOnline())
  957.                 continue;
  958.             send(perso.getPersonnage(), packet.toString());
  959.         }
  960.  
  961.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet.toString());
  962.     }
  963.  
  964.     public static void GAME_SEND_GS_PACKET_TO_FIGHT(Fight fight, int teams) {
  965.         String packet = "GS";
  966.         for (Fighter f : fight.getFighters(teams)) {
  967.             if (f.hasLeft())
  968.                 continue;
  969.             f.initBuffStats();
  970.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  971.                 continue;
  972.             send(f.getPersonnage(), packet);
  973.         }
  974.  
  975.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  976.     }
  977.  
  978.     public static void GAME_SEND_GS_PACKET(Characters perso) {
  979.         String packet = "GS";
  980.         send(perso, packet);
  981.  
  982.         Logs.addToGameSockLog("Game: Fight : Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  983.     }
  984.  
  985.     public static void GAME_SEND_GTL_PACKET_TO_FIGHT(Fight fight, int teams) {
  986.         for (Fighter f : fight.getFighters(teams)) {
  987.             if (f.hasLeft())
  988.                 continue;
  989.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  990.                 continue;
  991.             send(f.getPersonnage(), fight.getGTL());
  992.         }
  993.  
  994.         Logs.addToGameSockLog("Game: Fight : Send>>" + fight.getGTL());
  995.     }
  996.  
  997.     public static void GAME_SEND_GTL_PACKET(Characters perso, Fight fight) {
  998.         String packet = fight.getGTL();
  999.         send(perso, packet);
  1000.  
  1001.         Logs.addToGameSockLog("Game: Fight : Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1002.     }
  1003.  
  1004.     public static void GAME_SEND_GTM_PACKET_TO_FIGHT(Fight fight, int teams) {
  1005.         StringBuilder packet = new StringBuilder();
  1006.         packet.append("GTM");
  1007.         for (Fighter f : fight.getFighters(3)) {
  1008.             packet.append("|").append(f.getGUID()).append(";");
  1009.             if (f.isDead()) {
  1010.                 packet.append("1");
  1011.                 continue;
  1012.             } else
  1013.                 packet.append("0;").append(f.getPDV() + ";").append(f.getPA() + ";").append(f.getPM() + ";");
  1014.             packet.append((f.isHide() ? "-1" : f.get_fightCell().getID())).append(";");// On envoie pas la cell d'un invisible :p
  1015.             packet.append(";");// ??
  1016.             packet.append(f.getPDVMAX());
  1017.         }
  1018.         for (Fighter f : fight.getFighters(teams)) {
  1019.             if (f.hasLeft())
  1020.                 continue;
  1021.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1022.                 continue;
  1023.             send(f.getPersonnage(), packet.toString());
  1024.         }
  1025.  
  1026.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet.toString());
  1027.     }
  1028.  
  1029.     public static void GAME_SEND_GAMETURNSTART_PACKET_TO_FIGHT(Fight fight, int teams, int guid, int time) {
  1030.         String packet = "GTS" + guid + "|" + time;
  1031.         for (Fighter f : fight.getFighters(teams)) {
  1032.             if (f.hasLeft())
  1033.                 continue;
  1034.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1035.                 continue;
  1036.             send(f.getPersonnage(), packet);
  1037.         }
  1038.  
  1039.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1040.     }
  1041.  
  1042.     public static void GAME_SEND_GAMETURNSTART_PACKET(Characters perso, int guid, int time) {
  1043.         String packet = "GTS" + guid + "|" + time;
  1044.         send(perso, packet);
  1045.  
  1046.         Logs.addToGameSockLog("Game: Fight : Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1047.     }
  1048.  
  1049.     public static void GAME_SEND_GV_PACKET(Characters perso) {
  1050.         String packet = "GV";
  1051.         send(perso, packet);
  1052.  
  1053.         Logs.addToGameSockLog("Game: Fight : Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1054.     }
  1055.  
  1056.     public static void GAME_SEND_PONG(GameSendThread out) {
  1057.         String packet = "pong";
  1058.         send(out, packet);
  1059.  
  1060.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1061.     }
  1062.  
  1063.     public static void GAME_SEND_QPONG(GameSendThread out) {
  1064.         String packet = "qpong";
  1065.         send(out, packet);
  1066.  
  1067.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1068.     }
  1069.  
  1070.     public static void GAME_SEND_GAS_PACKET_TO_FIGHT(Fight fight, int teams, int guid) {
  1071.         String packet = "GAS" + guid;
  1072.         for (Fighter f : fight.getFighters(teams)) {
  1073.             if (f.hasLeft())
  1074.                 continue;
  1075.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1076.                 continue;
  1077.             send(f.getPersonnage(), packet);
  1078.         }
  1079.  
  1080.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1081.     }
  1082.  
  1083.     public static void GAME_SEND_GA_PACKET_TO_FIGHT(Fight fight, int teams, int actionID, String s1, String s2) {
  1084.         String packet = "GA;" + actionID + ";" + s1;
  1085.         if (!s2.equals(""))
  1086.             packet += ";" + s2;
  1087.  
  1088.         for (Fighter f : fight.getFighters(teams)) {
  1089.             if (f.hasLeft())
  1090.                 continue;
  1091.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1092.                 continue;
  1093.             send(f.getPersonnage(), packet);
  1094.         }
  1095.  
  1096.         Logs.addToGameSockLog("Game: Fight(" + fight.getFighters(teams).size() + ") : Send>>" + packet);
  1097.     }
  1098.  
  1099.     public static void GAME_SEND_GA_PACKET_TO_FIGHT(Fight fight, int teams, int actionID, int s1, String s2) {
  1100.         String packet = "GA;" + actionID + ";" + s1;
  1101.         if (!s2.equals(""))
  1102.             packet += ";" + s2;
  1103.  
  1104.         for (Fighter f : fight.getFighters(teams)) {
  1105.             if (f.hasLeft())
  1106.                 continue;
  1107.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1108.                 continue;
  1109.             send(f.getPersonnage(), packet);
  1110.         }
  1111.  
  1112.         Logs.addToGameSockLog("Game: Fight(" + fight.getFighters(teams).size() + ") : Send>>" + packet);
  1113.     }
  1114.  
  1115.     public static void GAME_SEND_GA_PACKET(GameSendThread out, String actionID, String s0, String s1, String s2) {
  1116.         String packet = "GA" + actionID + ";" + s0;
  1117.         if (!s1.equals(""))
  1118.             packet += ";" + s1;
  1119.         if (!s2.equals(""))
  1120.             packet += ";" + s2;
  1121.  
  1122.         send(out, packet);
  1123.  
  1124.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1125.     }
  1126.  
  1127.     public static void GAME_SEND_GA_PACKET_TO_FIGHT(Fight fight, int teams, int gameActionID, String s1, String s2,
  1128.             String s3) {
  1129.         String packet = "GA" + gameActionID + ";" + s1 + ";" + s2 + ";" + s3;
  1130.         for (Fighter f : fight.getFighters(teams)) {
  1131.             if (f.hasLeft())
  1132.                 continue;
  1133.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1134.                 continue;
  1135.             send(f.getPersonnage(), packet);
  1136.         }
  1137.  
  1138.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1139.     }
  1140.  
  1141.     public static void GAME_SEND_GAMEACTION_TO_FIGHT(Fight fight, int teams, String packet) {
  1142.         for (Fighter f : fight.getFighters(teams)) {
  1143.             if (f.hasLeft())
  1144.                 continue;
  1145.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1146.                 continue;
  1147.             send(f.getPersonnage(), packet);
  1148.         }
  1149.  
  1150.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1151.     }
  1152.  
  1153.     public static void GAME_SEND_GAF_PACKET_TO_FIGHT(Fight fight, int teams, int i1, int guid) {
  1154.         String packet = "GAF" + i1 + "|" + guid;
  1155.         for (Fighter f : fight.getFighters(teams)) {
  1156.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1157.                 continue;
  1158.             send(f.getPersonnage(), packet);
  1159.         }
  1160.  
  1161.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1162.     }
  1163.  
  1164.     public static void GAME_SEND_BN(Characters perso) {
  1165.         String packet = "BN";
  1166.         send(perso, packet);
  1167.  
  1168.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1169.     }
  1170.  
  1171.     public static void GAME_SEND_BN(GameSendThread out) {
  1172.         String packet = "BN";
  1173.         send(out, packet);
  1174.  
  1175.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1176.     }
  1177.  
  1178.     public static void GAME_SEND_GAMETURNSTOP_PACKET_TO_FIGHT(Fight fight, int teams, int guid) {
  1179.         String packet = "GTF" + guid;
  1180.         for (Fighter f : fight.getFighters(teams)) {
  1181.             if (f.hasLeft())
  1182.                 continue;
  1183.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1184.                 continue;
  1185.             send(f.getPersonnage(), packet);
  1186.         }
  1187.  
  1188.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1189.     }
  1190.  
  1191.     public static void GAME_SEND_GTR_PACKET_TO_FIGHT(Fight fight, int teams, int guid) {
  1192.         String packet = "GTR" + guid;
  1193.         for (Fighter f : fight.getFighters(teams)) {
  1194.             if (f.hasLeft())
  1195.                 continue;
  1196.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1197.                 continue;
  1198.             send(f.getPersonnage(), packet);
  1199.         }
  1200.  
  1201.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1202.     }
  1203.  
  1204.     public static void GAME_SEND_EMOTICONE_TO_MAP(Maps map, int guid, int id) {
  1205.         String packet = "cS" + guid + "|" + id;
  1206.         for (Characters z : map.getPersos())
  1207.             send(z, packet);
  1208.  
  1209.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  1210.     }
  1211.  
  1212.     public static void GAME_SEND_SPELL_UPGRADE_FAILED(GameSendThread _out) {
  1213.         String packet = "SUE";
  1214.         send(_out, packet);
  1215.  
  1216.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1217.     }
  1218.  
  1219.     public static void GAME_SEND_SPELL_UPGRADE_SUCCED(GameSendThread _out, int spellID, int level) {
  1220.         String packet = "SUK" + spellID + "~" + level;
  1221.         send(_out, packet);
  1222.  
  1223.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1224.     }
  1225.  
  1226.     public static void GAME_SEND_SPELL_LIST(Characters perso) {
  1227.         String packet = perso.parseSpellList();
  1228.         send(perso, packet);
  1229.  
  1230.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1231.     }
  1232.  
  1233.     public static void GAME_SEND_FIGHT_PLAYER_DIE_TO_FIGHT(Fight fight, int teams, int guid) {
  1234.         String packet = "GA;103;" + guid + ";" + guid;
  1235.         for (Fighter f : fight.getFighters(teams)) {
  1236.             if (f.hasLeft() || f.getPersonnage() == null)
  1237.                 continue;
  1238.             if (f.getPersonnage().isOnline())
  1239.                 send(f.getPersonnage(), packet);
  1240.         }
  1241.  
  1242.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1243.     }
  1244.  
  1245.     public static void GAME_SEND_FIGHT_GE_PACKET_TO_FIGHT(Fight fight, int teams, int win) {
  1246.         String packet = fight.GetGE(win);
  1247.         for (Fighter f : fight.getFighters(teams)) {
  1248.             if (f.hasLeft() || f.getPersonnage() == null)
  1249.                 continue;
  1250.             if (f.getPersonnage().isOnline())
  1251.                 send(f.getPersonnage(), packet);
  1252.             // After
  1253.             /**
  1254.              * Personnage perso = f.getPersonnage();
  1255.              * SocketManager.GAME_SEND_GV_PACKET(perso); perso.set_duelID(-1);
  1256.              * perso.set_ready(false); perso.fullPDV(); perso.set_fight(null);
  1257.              * SocketManager.GAME_SEND_GV_PACKET(perso);
  1258.              * SocketManager.GAME_SEND_ADD_PLAYER_TO_MAP(perso.get_curCarte(),
  1259.              * perso); perso.get_curCell().addPerso(perso);
  1260.              **/
  1261.         }
  1262.  
  1263.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  1264.     }
  1265.  
  1266.     public static void GAME_SEND_FIGHT_GIE_TO_FIGHT(Fight fight, int teams, int mType, int cible, int value,
  1267.             String mParam2, String mParam3, String mParam4, int turn, int spellID) {
  1268.         StringBuilder packet = new StringBuilder();
  1269.         packet.append("GIE").append(mType).append(";").append(cible).append(";").append(value).append(";")
  1270.                 .append(mParam2).append(";").append(mParam3).append(";").append(mParam4).append(";").append(turn)
  1271.                 .append(";").append(spellID);
  1272.         for (Fighter f : fight.getFighters(teams)) {
  1273.             if (f.hasLeft() || f.getPersonnage() == null)
  1274.                 continue;
  1275.             if (f.getPersonnage().isOnline())
  1276.                 send(f.getPersonnage(), packet.toString());
  1277.         }
  1278.  
  1279.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet.toString());
  1280.     }
  1281.  
  1282.     public static void GAME_SEND_MAP_FIGHT_GMS_PACKETS_TO_FIGHT(Fight fight, int teams, Maps map) {
  1283.         String packet = map.getFightersGMsPackets();
  1284.         for (Fighter f : fight.getFighters(teams)) {
  1285.             if (f.hasLeft())
  1286.                 continue;
  1287.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1288.                 continue;
  1289.             send(f.getPersonnage(), packet);
  1290.         }
  1291.  
  1292.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1293.     }
  1294.  
  1295.     public static void GAME_SEND_MAP_FIGHT_GMS_PACKETS(Fight fight, Maps map, Characters _perso) {
  1296.         String packet = map.getFightersGMsPackets();
  1297.         send(_perso, packet);
  1298.  
  1299.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1300.     }
  1301.  
  1302.     public static void GAME_SEND_FIGHT_PLAYER_JOIN(Fight fight, int teams, Fighter _fighter) {
  1303.         String packet = _fighter.getGmPacket('+');
  1304.  
  1305.         for (Fighter f : fight.getFighters(teams)) {
  1306.             if (f != _fighter) {
  1307.                 if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1308.                     continue;
  1309.                 if (f.getPersonnage() != null && f.getPersonnage().get_compte().getGameThread() != null)
  1310.                     send(f.getPersonnage(), packet);
  1311.             }
  1312.         }
  1313.  
  1314.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1315.     }
  1316.    
  1317.     public static void GAME_SEND_PUB(String msg) {
  1318.         String packet = "cMKF|-1|Serveur|" + msg;
  1319.         for(Characters perso : World.getOnlinePersos())
  1320.             send(perso, packet);
  1321.  
  1322.         Logs.addToGameSockLog("Game: Send ALL(" + World.getOnlinePersos().size() + ") >> " + packet);
  1323.     }
  1324.  
  1325.     public static void GAME_SEND_cMK_PACKET(Characters perso, String suffix, int guid, String name, String msg) {
  1326.         String packet = "cMK" + suffix + "|" + guid + "|" + name + "|" + msg;
  1327.         send(perso, packet);
  1328.  
  1329.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1330.     }
  1331.  
  1332.     public static void GAME_SEND_FIGHT_LIST_PACKET(GameSendThread out, Maps map) {
  1333.         StringBuilder packet = new StringBuilder();
  1334.         packet.append("fL");
  1335.         for (Entry<Integer, Fight> entry : map.get_fights().entrySet()) {
  1336.             if (packet.length() > 2) {
  1337.                 packet.append("|");
  1338.             }
  1339.             packet.append(entry.getValue().parseFightInfos());
  1340.         }
  1341.         send(out, packet.toString());
  1342.  
  1343.         Logs.addToGameSockLog("Game: Send >> " + packet.toString());
  1344.     }
  1345.  
  1346.     public static void GAME_SEND_cMK_PACKET_TO_MAP(Maps map, String suffix, int guid, String name, String msg) {
  1347.         String packet = "cMK" + suffix + "|" + guid + "|" + name + "|" + msg;
  1348.         for (Characters z : map.getPersos())
  1349.             send(z, packet);
  1350.  
  1351.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  1352.     }
  1353.  
  1354.     public static void GAME_SEND_cMK_PACKET_TO_GUILD(Guild g, String suffix, int guid, String name, String msg) {
  1355.         String packet = "cMK" + suffix + "|" + guid + "|" + name + "|" + msg;
  1356.         for (Characters perso : g.getMembers()) {
  1357.             if (perso == null || !perso.isOnline())
  1358.                 continue;
  1359.             send(perso, packet);
  1360.         }
  1361.  
  1362.         Logs.addToGameSockLog("Game: Guild: Send>>" + packet);
  1363.     }
  1364.  
  1365.     public static void GAME_SEND_cMK_PACKET_TO_ALL(String suffix, int guid, String name, String msg) {
  1366.         String packet = "cMK" + suffix + "|" + guid + "|" + name + "|" + msg;
  1367.         for (Characters perso : World.getOnlinePersos())
  1368.             send(perso, packet);
  1369.  
  1370.         Logs.addToGameSockLog("Game: ALL(" + World.getOnlinePersos().size() + "): Send>>" + packet);
  1371.     }
  1372.  
  1373.     public static void GAME_SEND_cMK_PACKET_TO_ALIGN(String suffix, int guid, String name, String msg,
  1374.             Characters _perso) {
  1375.         String packet = "cMK" + suffix + "|" + guid + "|" + name + "|" + msg;
  1376.         for (Characters perso : World.getOnlinePersos()) {
  1377.             if (perso.get_align() == _perso.get_align()) {
  1378.                 send(perso, packet);
  1379.             }
  1380.         }
  1381.  
  1382.         Logs.addToGameSockLog("Game: ALL(" + World.getOnlinePersos().size() + "): Send>>" + packet);
  1383.     }
  1384.  
  1385.     public static void GAME_SEND_cMK_PACKET_TO_ADMIN(String suffix, int guid, String name, String msg) {
  1386.         String packet = "cMK" + suffix + "|" + guid + "|" + name + "|" + msg;
  1387.         for (Characters perso : World.getOnlinePersos())
  1388.             if (perso.isOnline())
  1389.                 if (perso.get_compte() != null)
  1390.                     if (perso.get_compte().get_gmLvl() > 0)
  1391.                         send(perso, packet);
  1392.  
  1393.         Logs.addToGameSockLog("Game: ALL(" + World.getOnlinePersos().size() + "): Send>>" + packet);
  1394.     }
  1395.  
  1396.     public static void GAME_SEND_cMK_PACKET_TO_FIGHT(Fight fight, int teams, String suffix, int guid, String name,
  1397.             String msg) {
  1398.         String packet = (new StringBuilder("cMK")).append(suffix).append("|").append(guid).append("|").append(name)
  1399.                 .append("|").append(msg).toString();
  1400.         for (Fighter f : fight.getFighters(teams)) {
  1401.             if (f.hasLeft())
  1402.                 continue;
  1403.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1404.                 continue;
  1405.             send(f.getPersonnage(), packet);
  1406.         }
  1407.  
  1408.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1409.     }
  1410.  
  1411.     public static void GAME_SEND_GDZ_PACKET_TO_FIGHT(Fight fight, int teams, String suffix, int cell, int size,
  1412.             int unk) {
  1413.         String packet = "GDZ" + suffix + cell + ";" + size + ";" + unk;
  1414.  
  1415.         for (Fighter f : fight.getFighters(teams)) {
  1416.             if (f.hasLeft())
  1417.                 continue;
  1418.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1419.                 continue;
  1420.             send(f.getPersonnage(), packet);
  1421.         }
  1422.  
  1423.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1424.     }
  1425.  
  1426.     public static void GAME_SEND_GDC_PACKET_TO_FIGHT(Fight fight, int teams, int cell) {
  1427.         String packet = "GDC" + cell;
  1428.  
  1429.         for (Fighter f : fight.getFighters(teams)) {
  1430.             if (f.hasLeft())
  1431.                 continue;
  1432.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1433.                 continue;
  1434.             send(f.getPersonnage(), packet);
  1435.         }
  1436.  
  1437.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1438.     }
  1439.  
  1440.     public static void GAME_SEND_GDC_PACKET(Maps map, int cell) {
  1441.         String packet = "GDC" + cell + ";aaWaaaaaaa800;1";
  1442.         for (Characters z : map.getPersos())
  1443.             send(z, packet);
  1444.  
  1445.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1446.     }
  1447.  
  1448.     public static void GAME_SEND_GDC_PACKET(Maps map, String str) {
  1449.         String packet = "GDC" + str;
  1450.         for (Characters perso : map.getPersos())
  1451.             send(perso, packet);
  1452.  
  1453.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1454.     }
  1455.  
  1456.     public static void GAME_SEND_GDF_PACKET(Maps map, String str) {
  1457.         String packet = "GDF|" + str;
  1458.         for (Characters z : map.getPersos())
  1459.             send(z, packet);
  1460.  
  1461.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1462.     }
  1463.  
  1464.     public static void GAME_SEND_GA2_PACKET(GameSendThread out, int guid) {
  1465.         String packet = "GA;2;" + guid + ";";
  1466.         send(out, packet);
  1467.  
  1468.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1469.     }
  1470.  
  1471.     public static void GAME_SEND_CHAT_ERROR_PACKET(GameSendThread out, String name) {
  1472.         String packet = "cMEf" + name;
  1473.         send(out, packet);
  1474.  
  1475.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1476.     }
  1477.  
  1478.     public static void GAME_SEND_eD_PACKET_TO_MAP(Maps map, int guid, int dir) {
  1479.         String packet = "eD" + guid + "|" + dir;
  1480.         for (Characters z : map.getPersos())
  1481.             send(z, packet);
  1482.  
  1483.         Logs.addToGameSockLog("Game: Map: Send>>" + packet);
  1484.     }
  1485.  
  1486.     public static void GAME_SEND_ECK_PACKET(Characters perso, int type, String str) {
  1487.         String packet = "ECK" + type;
  1488.         if (!str.equals(""))
  1489.             packet += "|" + str;
  1490.         send(perso, packet);
  1491.  
  1492.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1493.     }
  1494.  
  1495.     public static void GAME_SEND_ECK_PACKET(GameSendThread out, int type, String str) {
  1496.         String packet = "ECK" + type;
  1497.         if (!str.equals(""))
  1498.             packet += "|" + str;
  1499.         send(out, packet);
  1500.  
  1501.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1502.     }
  1503.  
  1504.     public static void GAME_SEND_ITEM_VENDOR_LIST_PACKET(Characters perso, NPC npc) {
  1505.         String packet = "EL" + npc.get_template().getItemVendorList();
  1506.         send(perso, packet);
  1507.  
  1508.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1509.     }
  1510.  
  1511.     public static void GAME_SEND_ITEM_LIST_PACKET_PERCEPTEUR(GameSendThread out, Collector perco) {
  1512.         String packet = "EL" + perco.getItemPercepteurList();
  1513.         send(out, packet);
  1514.  
  1515.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1516.     }
  1517.  
  1518.     public static void GAME_SEND_ITEM_LIST_PACKET_SELLER(Characters p, Characters out) {
  1519.         String packet = "EL" + p.parseStoreItemsList();
  1520.         send(out, packet);
  1521.  
  1522.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + out.get_name() + "(" + out.get_GUID() + ") ~ account : " + out.get_compte().get_name() + "(" + out.get_compte().get_GUID() +")");
  1523.        
  1524.     }
  1525.  
  1526.     public static void GAME_SEND_EV_PACKET(GameSendThread out) {
  1527.         String packet = "EV";
  1528.         send(out, packet);
  1529.  
  1530.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1531.     }
  1532.  
  1533.     public static void GAME_SEND_EV_PACKET(Characters perso) {
  1534.         String packet = "EV";
  1535.         send(perso, packet);
  1536.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1537.     }
  1538.  
  1539.     public static void GAME_SEND_DCK_PACKET(GameSendThread out, int id) {
  1540.         String packet = "DCK" + id;
  1541.         send(out, packet);
  1542.  
  1543.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1544.     }
  1545.  
  1546.     public static void GAME_SEND_QUESTION_PACKET(GameSendThread out, String str) {
  1547.         String packet = "DQ" + str;
  1548.         send(out, packet);
  1549.  
  1550.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1551.     }
  1552.  
  1553.     public static void GAME_SEND_END_DIALOG_PACKET(GameSendThread out) {
  1554.         String packet = "DV";
  1555.         send(out, packet);
  1556.  
  1557.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1558.     }
  1559.  
  1560.     public static void GAME_SEND_CONSOLE_SUCCESS_PACKET(GameSendThread out, String mess) {
  1561.         String packet = "BAT2" + mess;
  1562.         send(out, packet);
  1563.  
  1564.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1565.     }
  1566.  
  1567.     public static void GAME_SEND_CONSOLE_ERROR_PACKET(GameSendThread out, String mess) {
  1568.         String packet = "BAT1" + mess;
  1569.         send(out, packet);
  1570.  
  1571.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1572.     }
  1573.  
  1574.     public static void GAME_SEND_CONSOLE_NEUTRAL_PACKET(GameSendThread out, String mess) {
  1575.         String packet = "BAT0" + mess;
  1576.         send(out, packet);
  1577.  
  1578.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1579.     }
  1580.  
  1581.     public static void GAME_SEND_BUY_ERROR_PACKET(GameSendThread out) {
  1582.         String packet = "EBE";
  1583.         send(out, packet);
  1584.  
  1585.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1586.     }
  1587.  
  1588.     public static void GAME_SEND_SELL_ERROR_PACKET(GameSendThread out) {
  1589.         String packet = "ESE";
  1590.         send(out, packet);
  1591.  
  1592.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1593.     }
  1594.  
  1595.     public static void GAME_SEND_BUY_OK_PACKET(GameSendThread out) {
  1596.         String packet = "EBK";
  1597.         send(out, packet);
  1598.  
  1599.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1600.     }
  1601.  
  1602.     public static void GAME_SEND_OBJECT_QUANTITY_PACKET(Characters perso, Objects obj) {
  1603.         String packet = "OQ" + obj.getGuid() + "|" + obj.getQuantity();
  1604.         send(perso, packet);
  1605.  
  1606.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1607.     }
  1608.  
  1609.     public static void GAME_SEND_OAKO_PACKET(Characters perso, Objects obj) {
  1610.         String packet = "OAKO" + obj.parseItem();
  1611.         send(perso, packet);
  1612.  
  1613.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1614.        
  1615.     }
  1616.  
  1617.     public static void GAME_SEND_ESK_PACKEt(Characters perso) {
  1618.         String packet = "ESK";
  1619.         send(perso, packet);
  1620.  
  1621.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1622.        
  1623.     }
  1624.  
  1625.     public static void GAME_SEND_REMOVE_ITEM_PACKET(Characters perso, int guid) {
  1626.         String packet = "OR" + guid;
  1627.         send(perso, packet);
  1628.  
  1629.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1630.        
  1631.     }
  1632.  
  1633.     public static void GAME_SEND_DELETE_OBJECT_FAILED_PACKET(GameSendThread out) {
  1634.         String packet = "OdE";
  1635.         send(out, packet);
  1636.  
  1637.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1638.     }
  1639.  
  1640.     public static void GAME_SEND_OBJET_MOVE_PACKET(Characters perso, Objects obj) {
  1641.         String packet = "OM" + obj.getGuid() + "|";
  1642.         if (obj.getPosition() != Constant.ITEM_POS_NO_EQUIPED)
  1643.             packet += obj.getPosition();
  1644.  
  1645.         send(perso, packet);
  1646.  
  1647.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1648.        
  1649.     }
  1650.  
  1651.     public static void GAME_SEND_EMOTICONE_TO_FIGHT(Fight fight, int teams, int guid, int id) {
  1652.         String packet = (new StringBuilder("cS")).append(guid).append("|").append(id).toString();
  1653.         for (Fighter f : fight.getFighters(teams)) {
  1654.             if (f.hasLeft())
  1655.                 continue;
  1656.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  1657.                 continue;
  1658.             send(f.getPersonnage(), packet);
  1659.         }
  1660.  
  1661.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1662.     }
  1663.  
  1664.     public static void GAME_SEND_OAEL_PACKET(GameSendThread out) {
  1665.         String packet = "OAEL";
  1666.         send(out, packet);
  1667.  
  1668.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1669.     }
  1670.  
  1671.     public static void GAME_SEND_NEW_LVL_PACKET(GameSendThread out, int lvl) {
  1672.         String packet = "AN" + lvl;
  1673.         send(out, packet);
  1674.  
  1675.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1676.     }
  1677.  
  1678.     public static void GAME_SEND_MESSAGE_TO_ALL(String msg, String color) {
  1679.         String packet = "cs<font color='#" + color + "'>" + msg + "</font>";
  1680.         for (Characters P : World.getOnlinePersos()) {
  1681.             send(P, packet);
  1682.         }
  1683.  
  1684.         Logs.addToGameSockLog("Game: ALL (" + World.getOnlinePersos().size() + "): Send>>" + packet);
  1685.     }
  1686.  
  1687.     public static void GAME_SEND_EXCHANGE_REQUEST_OK(GameSendThread out, int guid, int guidT, int msgID) {
  1688.         String packet = "ERK" + guid + "|" + guidT + "|" + msgID;
  1689.         send(out, packet);
  1690.  
  1691.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1692.     }
  1693.  
  1694.     public static void GAME_SEND_EXCHANGE_REQUEST_ERROR(GameSendThread out, char c) {
  1695.         String packet = "ERE" + c;
  1696.         send(out, packet);
  1697.  
  1698.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1699.     }
  1700.  
  1701.     public static void PERSO_SEND_EXCHANGE_REQUEST_ERROR(Characters perso, char c) {
  1702.         String packet = "ERE" + c;
  1703.         send(perso, packet);
  1704.  
  1705.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1706.        
  1707.     }
  1708.  
  1709.     public static void GAME_SEND_EXCHANGE_CONFIRM_OK(GameSendThread out, int type) {
  1710.         String packet = "ECK" + type;
  1711.         send(out, packet);
  1712.  
  1713.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1714.     }
  1715.  
  1716.     public static void GAME_SEND_EXCHANGE_MOVE_OK(Characters perso, char type, String signe, String s1) {
  1717.         String packet = "EMK" + type + signe;
  1718.         if (!s1.equals(""))
  1719.             packet += s1;
  1720.         send(perso, packet);
  1721.  
  1722.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1723.        
  1724.     }
  1725.  
  1726.     public static void GAME_SEND_EXCHANGE_MOVE_OK_FM(Characters perso, char type, String signe, String s1) {
  1727.         String packet = "EmK" + type + signe;
  1728.         if (!s1.equals(""))
  1729.             packet += s1;
  1730.         send(perso, packet);
  1731.  
  1732.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1733.        
  1734.     }
  1735.  
  1736.     public static void GAME_SEND_EXCHANGE_OTHER_MOVE_OK(GameSendThread out, char type, String signe, String s1) {
  1737.         String packet = "EmK" + type + signe;
  1738.         if (!s1.equals(""))
  1739.             packet += s1;
  1740.         send(out, packet);
  1741.  
  1742.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1743.     }
  1744.  
  1745.     public static void GAME_SEND_EXCHANGE_OTHER_MOVE_OK_FM(GameSendThread out, char type, String signe, String s1) {
  1746.         String packet = "EMK" + type + signe;
  1747.         if (!s1.equals(""))
  1748.             packet += s1;
  1749.         send(out, packet);
  1750.  
  1751.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1752.     }
  1753.  
  1754.     public static void GAME_SEND_EXCHANGE_OK(GameSendThread out, boolean ok, int guid) {
  1755.         String packet = "EK" + (ok ? "1" : "0") + guid;
  1756.         send(out, packet);
  1757.  
  1758.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1759.     }
  1760.  
  1761.     public static void GAME_SEND_EXCHANGE_VALID(GameSendThread out, char c) {
  1762.         String packet = "EV" + c;
  1763.         send(out, packet);
  1764.  
  1765.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1766.     }
  1767.  
  1768.     public static void GAME_SEND_GROUP_INVITATION_ERROR(GameSendThread out, String s) {
  1769.         String packet = "PIE" + s;
  1770.         send(out, packet);
  1771.  
  1772.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1773.     }
  1774.  
  1775.     public static void GAME_SEND_GROUP_INVITATION(GameSendThread out, String n1, String n2) {
  1776.         String packet = "PIK" + n1 + "|" + n2;
  1777.         send(out, packet);
  1778.  
  1779.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1780.     }
  1781.  
  1782.     public static void GAME_SEND_GROUP_CREATE(GameSendThread out, Group g) {
  1783.         String packet = "PCK" + g.getChief().get_name();
  1784.         send(out, packet);
  1785.  
  1786.         Logs.addToGameSockLog("Game: Groupe: Send>>" + packet);
  1787.     }
  1788.  
  1789.     public static void GAME_SEND_PL_PACKET(GameSendThread out, Group g) {
  1790.         String packet = "PL" + g.getChief().get_GUID();
  1791.         send(out, packet);
  1792.  
  1793.         Logs.addToGameSockLog("Game: Groupe: Send>>" + packet);
  1794.     }
  1795.  
  1796.     public static void GAME_SEND_PR_PACKET(Characters perso) {
  1797.         String packet = "PR";
  1798.         send(perso, packet);
  1799.  
  1800.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1801.        
  1802.     }
  1803.  
  1804.     public static void GAME_SEND_PV_PACKET(GameSendThread out, String s) {
  1805.         String packet = "PV" + s;
  1806.         send(out, packet);
  1807.  
  1808.         Logs.addToGameSockLog("Game: Send >> " + packet);
  1809.     }
  1810.  
  1811.     public static void GAME_SEND_ALL_PM_ADD_PACKET(GameSendThread out, Group g) {
  1812.         StringBuilder packet = new StringBuilder();
  1813.         packet.append("PM+");
  1814.         boolean first = true;
  1815.         for (Characters p : g.getPersos()) {
  1816.             if (!first)
  1817.                 packet.append("|");
  1818.             packet.append(p.parseToPM());
  1819.             first = false;
  1820.         }
  1821.         send(out, packet.toString());
  1822.  
  1823.         Logs.addToGameSockLog("Game: Send >> " + packet.toString());
  1824.     }
  1825.  
  1826.     public static void GAME_SEND_PM_ADD_PACKET_TO_GROUP(Group g, Characters p) {
  1827.         String packet = "PM+" + p.parseToPM();
  1828.         for (Characters P : g.getPersos())
  1829.             send(P, packet);
  1830.  
  1831.         Logs.addToGameSockLog("Game: Groupe: Send>>" + packet);
  1832.     }
  1833.  
  1834.     public static void GAME_SEND_PM_MOD_PACKET_TO_GROUP(Group g, Characters p) {
  1835.         String packet = "PM~" + p.parseToPM();
  1836.         for (Characters P : g.getPersos())
  1837.             send(P, packet);
  1838.  
  1839.         Logs.addToGameSockLog("Game: Groupe: Send>>" + packet);
  1840.     }
  1841.  
  1842.     public static void GAME_SEND_PM_DEL_PACKET_TO_GROUP(Group g, int guid) {
  1843.         String packet = "PM-" + guid;
  1844.         for (Characters P : g.getPersos())
  1845.             send(P, packet);
  1846.  
  1847.         Logs.addToGameSockLog("Game: Groupe: Send>>" + packet);
  1848.     }
  1849.  
  1850.     public static void GAME_SEND_cMK_PACKET_TO_GROUP(Group g, String s, int guid, String name, String msg) {
  1851.         String packet = "cMK" + s + "|" + guid + "|" + name + "|" + msg + "|";
  1852.         for (Characters P : g.getPersos())
  1853.             send(P, packet);
  1854.  
  1855.         Logs.addToGameSockLog("Game: Groupe: Send>>" + packet);
  1856.     }
  1857.  
  1858.     public static void GAME_SEND_FIGHT_DETAILS(GameSendThread out, Fight fight) {
  1859.         if (fight == null)
  1860.             return;
  1861.         StringBuilder packet = new StringBuilder();
  1862.         packet.append("fD").append(fight.get_id()).append("|");
  1863.         for (Fighter f : fight.getFighters(1))
  1864.             packet.append(f.getPacketsName()).append("~").append(f.get_lvl()).append(";");
  1865.         packet.append("|");
  1866.         for (Fighter f : fight.getFighters(2))
  1867.             packet.append(f.getPacketsName()).append("~").append(f.get_lvl()).append(";");
  1868.         send(out, packet.toString());
  1869.  
  1870.         Logs.addToGameSockLog("Game: Send >> " + packet.toString());
  1871.     }
  1872.  
  1873.     public static void GAME_SEND_IQ_PACKET(Characters perso, int guid, int qua) {
  1874.         String packet = "IQ" + guid + "|" + qua;
  1875.         send(perso, packet);
  1876.  
  1877.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1878.        
  1879.     }
  1880.  
  1881.     public static void GAME_SEND_JN_PACKET(Characters perso, int jobID, int lvl) {
  1882.         String packet = "JN" + jobID + "|" + lvl;
  1883.         send(perso, packet);
  1884.  
  1885.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1886.        
  1887.     }
  1888.  
  1889.     public static void GAME_SEND_GDF_PACKET_TO_MAP(Maps map, Case cell) {
  1890.         int cellID = cell.getID();
  1891.         InteractiveObject object = cell.getObject();
  1892.         String packet = "GDF|" + cellID + ";" + object.getState() + ";" + (object.isInteractive() ? "1" : "0");
  1893.         for (Characters z : map.getPersos())
  1894.             send(z, packet);
  1895.  
  1896.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  1897.     }
  1898.  
  1899.     public static void GAME_SEND_GA_PACKET_TO_MAP(Maps map, String gameActionID, int actionID, String s1, String s2) {
  1900.         String packet = "GA" + gameActionID + ";" + actionID + ";" + s1;
  1901.         if (!s2.equals(""))
  1902.             packet += ";" + s2;
  1903.  
  1904.         for (Characters z : map.getPersos())
  1905.             send(z, packet);
  1906.  
  1907.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  1908.     }
  1909.  
  1910.     public static void GAME_SEND_EL_BANK_PACKET(Characters perso) {
  1911.         String packet = "EL" + perso.parseBankPacket();
  1912.         send(perso, packet);
  1913.  
  1914.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1915.        
  1916.     }
  1917.  
  1918.     public static void GAME_SEND_EL_TRUNK_PACKET(Characters perso, Trunk t) {
  1919.         String packet = "EL" + t.parseToTrunkPacket();
  1920.         send(perso, packet);
  1921.  
  1922.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1923.        
  1924.     }
  1925.  
  1926.     public static void GAME_SEND_JX_PACKET(Characters perso, ArrayList<StatsMetier> SMs) {
  1927.         StringBuilder packet = new StringBuilder();
  1928.         packet.append("JX");
  1929.         for (StatsMetier sm : SMs) {
  1930.             packet.append("|").append(sm.getTemplate().getId()).append(";").append(sm.get_lvl()).append(";")
  1931.                     .append(sm.getXpString(";")).append(";");
  1932.         }
  1933.         send(perso, packet.toString());
  1934.  
  1935.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1936.        
  1937.     }
  1938.  
  1939.     public static void GAME_SEND_JO_PACKET(Characters perso, ArrayList<StatsMetier> SMs) {
  1940.         for (StatsMetier sm : SMs) {
  1941.             String packet = "JO" + sm.getID() + "|" + sm.getOptBinValue() + "|2";// FIXME
  1942.                                                                                     // 2=?
  1943.             send(perso, packet);
  1944.  
  1945.             Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1946.            
  1947.         }
  1948.     }
  1949.  
  1950.     public static void GAME_SEND_JS_PACKET(Characters perso, ArrayList<StatsMetier> SMs) {
  1951.         String packet = "JS";
  1952.         for (StatsMetier sm : SMs) {
  1953.             packet += sm.parseJS();
  1954.         }
  1955.         send(perso, packet);
  1956.  
  1957.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1958.        
  1959.     }
  1960.  
  1961.     public static void GAME_SEND_EsK_PACKET(Characters perso, String str) {
  1962.         String packet = "EsK" + str;
  1963.         send(perso, packet);
  1964.  
  1965.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1966.        
  1967.     }
  1968.  
  1969.     public static void GAME_SEND_FIGHT_SHOW_CASE(ArrayList<GameSendThread> PWs, int guid, int cellID) {
  1970.         String packet = "Gf" + guid + "|" + cellID;
  1971.         for (GameSendThread PW : PWs) {
  1972.             send(PW, packet);
  1973.         }
  1974.  
  1975.         Logs.addToGameSockLog("Game: Fight: Send>>" + packet);
  1976.     }
  1977.  
  1978.     public static void GAME_SEND_Ea_PACKET(Characters perso, String str) {
  1979.         String packet = "Ea" + str;
  1980.         send(perso, packet);
  1981.  
  1982.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1983.        
  1984.     }
  1985.  
  1986.     public static void GAME_SEND_EA_PACKET(Characters perso, String str) {
  1987.         String packet = "EA" + str;
  1988.         send(perso, packet);
  1989.  
  1990.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1991.        
  1992.     }
  1993.  
  1994.     public static void GAME_SEND_Ec_PACKET(Characters perso, String str) {
  1995.         String packet = "Ec" + str;
  1996.         send(perso, packet);
  1997.  
  1998.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  1999.        
  2000.     }
  2001.  
  2002.     public static void GAME_SEND_Em_PACKET(Characters perso, String str) {
  2003.         String packet = "Em" + str;
  2004.         send(perso, packet);
  2005.  
  2006.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2007.        
  2008.     }
  2009.  
  2010.     public static void GAME_SEND_IO_PACKET_TO_MAP(Maps map, int guid, String str) {
  2011.         String packet = "IO" + guid + "|" + str;
  2012.         for (Characters z : map.getPersos())
  2013.             send(z, packet);
  2014.  
  2015.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  2016.     }
  2017.  
  2018.     public static void GAME_SEND_FRIENDLIST_PACKET(Characters perso) {
  2019.         String packet = "FL" + perso.get_compte().parseFriendList();
  2020.         send(perso, packet);
  2021.         if (perso.getWife() != 0) {
  2022.             String packet2 = "FS" + perso.get_wife_friendlist();
  2023.             send(perso, packet2);
  2024.  
  2025.             Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2026.            
  2027.         }
  2028.  
  2029.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2030.        
  2031.     }
  2032.  
  2033.     public static void GAME_SEND_FRIEND_ONLINE(Characters logando, Characters perso) {
  2034.         String packet = "Im0143;" + logando.get_compte().get_pseudo()
  2035.                 + " (<b><a href='asfunction:onHref,ShowPlayerPopupMenu," + logando.get_name() + "'>"
  2036.                 + logando.get_name() + "</a></b>)";
  2037.         send(perso, packet);
  2038.  
  2039.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2040.        
  2041.     }
  2042.  
  2043.     public static void GAME_SEND_FA_PACKET(Characters perso, String str) {
  2044.         String packet = "FA" + str;
  2045.         send(perso, packet);
  2046.  
  2047.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2048.        
  2049.     }
  2050.  
  2051.     public static void GAME_SEND_FD_PACKET(Characters perso, String str) {
  2052.         String packet = "FD" + str;
  2053.         send(perso, packet);
  2054.  
  2055.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2056.        
  2057.     }
  2058.  
  2059.     public static void GAME_SEND_Rp_PACKET(Characters perso, MountPark MP) {
  2060.         StringBuilder packet = new StringBuilder();
  2061.         if (MP == null)
  2062.             return;
  2063.  
  2064.         packet.append("Rp").append(MP.get_owner()).append(";").append(MP.get_price()).append(";").append(MP.get_size())
  2065.                 .append(";").append(MP.getObjectNumb()).append(";");
  2066.  
  2067.         Guild G = MP.get_guild();
  2068.         // Si une guilde est definie
  2069.         if (G != null) {
  2070.             packet.append(G.get_name()).append(";").append(G.get_emblem());
  2071.         } else {
  2072.             packet.append(";");
  2073.         }
  2074.  
  2075.         send(perso, packet.toString());
  2076.  
  2077.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2078.        
  2079.     }
  2080.  
  2081.     public static void GAME_SEND_OS_PACKET(Characters perso, int pano) {
  2082.         StringBuilder packet = new StringBuilder();
  2083.         packet.append("OS");
  2084.         int num = perso.getNumbEquipedItemOfPanoplie(pano);
  2085.         if (num <= 0)
  2086.             packet.append("-").append(pano);
  2087.         else {
  2088.             packet.append("+").append(pano).append("|");
  2089.             ItemSet IS = World.getItemSet(pano);
  2090.             if (IS != null) {
  2091.                 StringBuilder items = new StringBuilder();
  2092.                 // Pour chaque objet de la pano
  2093.                 for (ObjTemplate OT : IS.getItemTemplates()) {
  2094.                     // Si le joueur l'a équipé
  2095.                     if (perso.hasEquiped(OT.getID())) {
  2096.                         // On l'ajoute au packet
  2097.                         if (items.length() > 0)
  2098.                             items.append(";");
  2099.                         items.append(OT.getID());
  2100.                     }
  2101.                 }
  2102.                 packet.append(items.toString()).append("|")
  2103.                         .append(IS.getBonusStatByItemNumb(num).parseToItemSetStats());
  2104.             }
  2105.         }
  2106.         send(perso, packet.toString());
  2107.  
  2108.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2109.        
  2110.     }
  2111.  
  2112.     public static void GAME_SEND_MOUNT_DESCRIPTION_PACKET(Characters perso, Mount DD) {
  2113.         String packet = "Rd" + DD.parse();
  2114.         send(perso, packet);
  2115.  
  2116.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2117.        
  2118.     }
  2119.  
  2120.     public static void GAME_SEND_Rr_PACKET(Characters perso, String str) {
  2121.         String packet = "Rr" + str;
  2122.         send(perso, packet);
  2123.  
  2124.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2125.        
  2126.     }
  2127.  
  2128.     public static void GAME_SEND_ALTER_GM_PACKET(Maps map, Characters perso) {
  2129.         String packet = "GM|~" + perso.parseToGM();
  2130.         for (Characters z : map.getPersos())
  2131.             send(z, packet);
  2132.  
  2133.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  2134.     }
  2135.  
  2136.     public static void GAME_SEND_Ee_PACKET(Characters perso, char c, String s) {
  2137.         String packet = "Ee" + c + s;
  2138.         send(perso, packet);
  2139.  
  2140.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2141.        
  2142.     }
  2143.  
  2144.     public static void GAME_SEND_cC_PACKET(Characters perso, char c, String s) {
  2145.         String packet = "cC" + c + s;
  2146.         send(perso, packet);
  2147.  
  2148.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2149.        
  2150.     }
  2151.  
  2152.     public static void GAME_SEND_ADD_NPC_TO_MAP(Maps map, NPC npc) {
  2153.         String packet = "GM|" + npc.parseGM();
  2154.         for (Characters z : map.getPersos())
  2155.             send(z, packet);
  2156.  
  2157.         Logs.addToDebug("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  2158.     }
  2159.  
  2160.     public static void GAME_SEND_ADD_PERCO_TO_MAP(Maps map) {
  2161.         String packet = "GM|" + Collector.parseGM(map);
  2162.         for (Characters z : map.getPersos())
  2163.             send(z, packet);
  2164.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  2165.     }
  2166.    
  2167.     public static void GAME_SEND_ATTACK_DEATH_PERCO(Maps map){
  2168.         String packet = "GD|" + Collector.parseGM(map);
  2169.         for (Characters z : map.getPersos())
  2170.             send(z, packet);
  2171.         Logs.addToGameLog("Game: Map(" + map.getPersos().size() + "): Send>> " + packet);
  2172.     }
  2173.  
  2174.     public static void GAME_SEND_GDO_PACKET_TO_MAP(Maps map, char c, int cell, int itm, int i) {
  2175.         String packet = "GDO" + c + cell + ";" + itm + ";" + i;
  2176.         for (Characters z : map.getPersos())
  2177.             send(z, packet);
  2178.  
  2179.         Logs.addToGameSockLog("Game: Map(" + map.getPersos().size() + "): Send>>" + packet);
  2180.     }
  2181.  
  2182.     public static void GAME_SEND_GDO_PACKET(Characters perso, char c, int cell, int itm, int i) {
  2183.         String packet = "GDO" + c + cell + ";" + itm + ";" + i;
  2184.         send(perso, packet);
  2185.  
  2186.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID() + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() +")");
  2187.        
  2188.     }
  2189.  
  2190.     public static void GAME_SEND_ZC_PACKET(Characters p, int a) {
  2191.         String packet = "ZC" + a;
  2192.         send(p, packet);
  2193.  
  2194.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  2195.        
  2196.     }
  2197.  
  2198.     public static void GAME_SEND_GIP_PACKET(Characters p, int a) {
  2199.         String packet = "GIP" + a;
  2200.         send(p, packet);
  2201.  
  2202.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  2203.     }
  2204.  
  2205.     public static void GAME_SEND_gn_PACKET(Characters p) {
  2206.         String packet = "gn";
  2207.         send(p, packet);
  2208.  
  2209.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  2210.     }
  2211.  
  2212.     public static void GAME_SEND_gC_PACKET(Characters p, String s) {
  2213.         String packet = "gC" + s;
  2214.         send(p, packet);
  2215.  
  2216.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  2217.     }
  2218.  
  2219.     public static void GAME_SEND_gV_PACKET(Characters p) {
  2220.         String packet = "gV";
  2221.         send(p, packet);
  2222.  
  2223.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID() + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() +")");
  2224.     }
  2225.  
  2226.     public static void GAME_SEND_gIM_PACKET(Characters p, Guild g, char c) {
  2227.         String packet = "gIM" + c;
  2228.         switch (c) {
  2229.         case '+':
  2230.             packet += g.parseMembersToGM();
  2231.             break;
  2232.         }
  2233.         send(p, packet);
  2234.  
  2235.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2236.                 + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2237.     }
  2238.  
  2239.     public static void GAME_SEND_gIB_PACKET(Characters p, String infos) {
  2240.         String packet = "gIB" + infos;
  2241.         send(p, packet);
  2242.  
  2243.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2244.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2245.     }
  2246.  
  2247.     public static void GAME_SEND_gIH_PACKET(Characters p, String infos) {
  2248.         String packet = "gIH" + infos;
  2249.         send(p, packet);
  2250.  
  2251.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2252.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2253.     }
  2254.  
  2255.     public static void GAME_SEND_gS_PACKET(Characters p, GuildMember gm) {
  2256.         StringBuilder packet = new StringBuilder();
  2257.         packet.append("gS").append(gm.getGuild().get_name()).append("|")
  2258.                 .append(gm.getGuild().get_emblem().replace(',', '|')).append("|").append(gm.parseRights());
  2259.         send(p, packet.toString());
  2260.  
  2261.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2262.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2263.     }
  2264.  
  2265.     public static void GAME_SEND_gJ_PACKET(Characters p, String str) {
  2266.         String packet = "gJ" + str;
  2267.         send(p, packet);
  2268.  
  2269.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2270.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2271.     }
  2272.  
  2273.     public static void GAME_SEND_gK_PACKET(Characters p, String str) {
  2274.         String packet = "gK" + str;
  2275.         send(p, packet);
  2276.  
  2277.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2278.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2279.     }
  2280.  
  2281.     public static void GAME_SEND_gIG_PACKET(Characters p, Guild g) {
  2282.         long xpMin = World.getExpLevel(g.get_lvl()).guilde;
  2283.         long xpMax;
  2284.         if (World.getExpLevel(g.get_lvl() + 1) == null) {
  2285.             xpMax = -1;
  2286.         } else {
  2287.             xpMax = World.getExpLevel(g.get_lvl() + 1).guilde;
  2288.         }
  2289.         StringBuilder packet = new StringBuilder();
  2290.         packet.append("gIG").append((g.getSize() > 9 ? 1 : 0)).append("|").append(g.get_lvl()).append("|").append(xpMin)
  2291.                 .append("|").append(g.get_xp()).append("|").append(xpMax);
  2292.         send(p, packet.toString());
  2293.  
  2294.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2295.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2296.     }
  2297.  
  2298.     // args : 0 = Spam | 1 = Inactif | 2 = Lvl max atteint | 3 = Inactif |
  2299.     // 4 = Interrompu pour maintenance | 5 = Achat maison | 6 = Max objet
  2300.     // 7 = Opération nn auto | 8 = Objet non dispo | 9 = Magazin vide
  2301.     // 10 = Interrompu | 11 = Interrompu
  2302.     public static void REALM_SEND_MESSAGE(GameSendThread out, String args) {
  2303.         String packet = "M0" + args;
  2304.         send(out, packet);
  2305.  
  2306.         Logs.addToGameSockLog("Game: Send >> " + packet);
  2307.     }
  2308.  
  2309.     public static void GAME_SEND_WC_PACKET(Characters p) {
  2310.         String packet = "WC" + p.parseZaapList();
  2311.         send(p.get_compte().getGameThread().get_out(), packet);
  2312.  
  2313.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2314.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2315.     }
  2316.  
  2317.     public static void GAME_SEND_WV_PACKET(Characters p) {
  2318.         String packet = "WV";
  2319.         send(p, packet);
  2320.  
  2321.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2322.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2323.     }
  2324.  
  2325.     public static void GAME_SEND_ZAAPI_PACKET(Characters p, String list) {
  2326.         String packet = "Wc" + p.get_curCarte().get_id() + "|" + list;
  2327.         send(p, packet);
  2328.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2329.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2330.     }
  2331.  
  2332.     public static void GAME_SEND_CLOSE_ZAAPI_PACKET(Characters p) {
  2333.         String packet = "Wv";
  2334.         send(p, packet);
  2335.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2336.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2337.     }
  2338.  
  2339.     public static void GAME_SEND_WUE_PACKET(Characters p) {
  2340.         String packet = "WUE";
  2341.         send(p, packet);
  2342.  
  2343.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2344.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2345.     }
  2346.  
  2347.     public static void GAME_SEND_EMOTE_LIST(Characters p, String s, String s1) {
  2348.         String packet = "eL" + s + "|" + s1;
  2349.         send(p, packet);
  2350.  
  2351.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2352.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2353.     }
  2354.  
  2355.     public static void GAME_SEND_NO_EMOTE(Characters p) {
  2356.         String packet = "eUE";
  2357.         send(p, packet);
  2358.  
  2359.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2360.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2361.     }
  2362.  
  2363.     public static void GAME_SEND_ADD_ENEMY(Characters p, Characters enemie) {
  2364.  
  2365.         String packet = "iAK" + enemie.get_compte().get_name() + ";2;" + enemie.get_name() + ";36;10;0;100.FL.";
  2366.         send(p, packet);
  2367.  
  2368.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2369.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2370.     }
  2371.  
  2372.     public static void GAME_SEND_iAEA_PACKET(Characters p) {
  2373.  
  2374.         String packet = "iAEA.";
  2375.         send(p, packet);
  2376.  
  2377.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2378.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2379.     }
  2380.  
  2381.     public static void GAME_SEND_ENEMY_LIST(Characters p) {
  2382.  
  2383.         String packet = "iL" + p.get_compte().parseEnemyList();
  2384.         send(p, packet);
  2385.  
  2386.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2387.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2388.     }
  2389.  
  2390.     public static void GAME_SEND_iD_COMMANDE(Characters p, String str) {
  2391.         String packet = "iD" + str;
  2392.         send(p, packet);
  2393.  
  2394.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2395.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2396.     }
  2397.  
  2398.     public static void GAME_SEND_BWK(Characters perso, String str) {
  2399.         String packet = "BWK" + str;
  2400.         send(perso, packet);
  2401.  
  2402.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2403.                 + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2404.     }
  2405.  
  2406.     public static void GAME_SEND_KODE(Characters perso, String str) {
  2407.         String packet = "K" + str;
  2408.         send(perso, packet);
  2409.  
  2410.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2411.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2412.     }
  2413.  
  2414.     public static void GAME_SEND_hOUSE(Characters perso, String str) {
  2415.         String packet = "h" + str;
  2416.         send(perso, packet);
  2417.  
  2418.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2419.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2420.  
  2421.     }
  2422.  
  2423.     public static void GAME_SEND_FORGETSPELL_INTERFACE(char sign, Characters perso) {
  2424.         String packet = "SF" + sign;
  2425.         send(perso, packet);
  2426.  
  2427.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2428.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2429.     }
  2430.  
  2431.     public static void GAME_SEND_R_PACKET(Characters perso, String str) {
  2432.         String packet = "R" + str;
  2433.         send(perso, packet);
  2434.  
  2435.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2436.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2437.     }
  2438.  
  2439.     public static void GAME_SEND_gIF_PACKET(Characters perso, String str) {
  2440.         String packet = "gIF" + str;
  2441.         send(perso, packet);
  2442.  
  2443.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2444.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2445.     }
  2446.  
  2447.     public static void GAME_SEND_gITM_PACKET(Characters perso, String str) {
  2448.         String packet = "gITM" + str;
  2449.         send(perso, packet);
  2450.  
  2451.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2452.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2453.     }
  2454.  
  2455.     public static void GAME_SEND_gITp_PACKET(Characters perso, String str) {
  2456.         String packet = "gITp" + str;
  2457.         send(perso, packet);
  2458.  
  2459.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2460.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2461.     }
  2462.  
  2463.     public static void GAME_SEND_gITP_PACKET(Characters perso, String str) {
  2464.         String packet = "gITP" + str;
  2465.         send(perso, packet);
  2466.  
  2467.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2468.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2469.     }
  2470.  
  2471.     public static void GAME_SEND_IH_PACKET(Characters perso, String str) {
  2472.         String packet = "IH" + str;
  2473.         send(perso, packet);
  2474.  
  2475.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2476.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2477.     }
  2478.  
  2479.     public static void GAME_SEND_FLAG_PACKET(Characters perso, Characters cible) {
  2480.         String packet = "IC" + cible.get_curCarte().getX() + "|" + cible.get_curCarte().getY();
  2481.         send(perso, packet);
  2482.  
  2483.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2484.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2485.     }
  2486.  
  2487.     public static void GAME_SEND_DELETE_FLAG_PACKET(Characters perso) {
  2488.         String packet = "IC|";
  2489.         send(perso, packet);
  2490.  
  2491.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2492.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2493.     }
  2494.  
  2495.     public static void GAME_SEND_gT_PACKET(Characters perso, String str) { //Perco packet (pos/retirer)
  2496.         String packet = "gT" + str;
  2497.         send(perso, packet);
  2498.  
  2499.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2500.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2501.     }
  2502.    
  2503.     public static void GAME_SEND_gA_PACKET(Characters perso, String str) { //Perco fight packet (attack/survive/death)
  2504.         String packet = "gA" + str;
  2505.         send(perso, packet);
  2506.  
  2507.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2508.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2509.     }
  2510.  
  2511.     public static void GAME_SEND_GUILDHOUSE_PACKET(Characters perso) {
  2512.         String packet = "gUT";
  2513.         send(perso, packet);
  2514.  
  2515.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2516.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2517.     }
  2518.  
  2519.     public static void GAME_SEND_GUILDENCLO_PACKET(Characters perso) {
  2520.         String packet = "gUF";
  2521.         send(perso, packet);
  2522.  
  2523.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2524.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2525.     }
  2526.  
  2527.     /** HDV **/
  2528.     public static void GAME_SEND_EHm_PACKET(Characters out, String sign, String str) {
  2529.         String packet = "EHm" + sign + str;
  2530.  
  2531.         send(out, packet);
  2532.  
  2533.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + out.get_name() + "(" + out.get_GUID()
  2534.                 + ") ~ account : " + out.get_compte().get_name() + "(" + out.get_compte().get_GUID() + ")");
  2535.     }
  2536.  
  2537.     public static void GAME_SEND_EHM_PACKET(Characters out, String sign, String str) {
  2538.         String packet = "EHM" + sign + str;
  2539.  
  2540.         send(out, packet);
  2541.  
  2542.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + out.get_name() + "(" + out.get_GUID()
  2543.         + ") ~ account : " + out.get_compte().get_name() + "(" + out.get_compte().get_GUID() + ")");
  2544.     }
  2545.  
  2546.     public static void GAME_SEND_EHP_PACKET(Characters out, int templateID) // Packet
  2547.                                                                             // d'envoie
  2548.                                                                             // du
  2549.                                                                             // prix
  2550.                                                                             // moyen
  2551.                                                                             // du
  2552.                                                                             // template
  2553.                                                                             // (En
  2554.                                                                             // réponse
  2555.                                                                             // a
  2556.                                                                             // un
  2557.                                                                             // packet
  2558.                                                                             // EHP)
  2559.     {
  2560.  
  2561.         String packet = "EHP" + templateID + "|" + World.getObjTemplate(templateID).getAvgPrice();
  2562.  
  2563.         send(out, packet);
  2564.  
  2565.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + out.get_name() + "(" + out.get_GUID()
  2566.         + ") ~ account : " + out.get_compte().get_name() + "(" + out.get_compte().get_GUID() + ")");
  2567.     }
  2568.  
  2569.     public static void GAME_SEND_EHl(Characters out, AuctionHouse seller, int templateID) {
  2570.         String packet = "EHl" + seller.parseToEHl(templateID);
  2571.         send(out, packet);
  2572.  
  2573.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + out.get_name() + "(" + out.get_GUID()
  2574.         + ") ~ account : " + out.get_compte().get_name() + "(" + out.get_compte().get_GUID() + ")");
  2575.     }
  2576.  
  2577.     public static void GAME_SEND_EHL_PACKET(Characters out, int categ, String templates) // Packet
  2578.                                                                                             // de
  2579.                                                                                             // listage
  2580.                                                                                             // des
  2581.                                                                                             // templates
  2582.                                                                                             // dans
  2583.                                                                                             // une
  2584.                                                                                             // catégorie
  2585.                                                                                             // (En
  2586.                                                                                             // réponse
  2587.                                                                                             // au
  2588.                                                                                             // packet
  2589.                                                                                             // EHT)
  2590.     {
  2591.         String packet = "EHL" + categ + "|" + templates;
  2592.  
  2593.         send(out, packet);
  2594.  
  2595.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + out.get_name() + "(" + out.get_GUID()
  2596.         + ") ~ account : " + out.get_compte().get_name() + "(" + out.get_compte().get_GUID() + ")");
  2597.     }
  2598.  
  2599.     public static void GAME_SEND_EHL_PACKET(Characters out, String items) // Packet
  2600.                                                                             // de
  2601.                                                                             // listage
  2602.                                                                             // des
  2603.                                                                             // objets
  2604.                                                                             // en
  2605.                                                                             // vente
  2606.     {
  2607.         String packet = "EHL" + items;
  2608.  
  2609.         send(out, packet);
  2610.  
  2611.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + out.get_name() + "(" + out.get_GUID()
  2612.         + ") ~ account : " + out.get_compte().get_name() + "(" + out.get_compte().get_GUID() + ")");
  2613.     }
  2614.  
  2615.     public static void GAME_SEND_HDVITEM_SELLING(Characters perso) {
  2616.         String packet = "EL";
  2617.         HdvEntry[] entries = perso.get_compte().getHdvItems(Math.abs(perso.get_isTradingWith())); // Récupère
  2618.                                                                                                     // un
  2619.                                                                                                     // tableau
  2620.                                                                                                     // de
  2621.                                                                                                     // tout
  2622.                                                                                                     // les
  2623.                                                                                                     // items
  2624.                                                                                                     // que
  2625.                                                                                                     // le
  2626.                                                                                                     // personnage
  2627.                                                                                                     // à
  2628.                                                                                                     // en
  2629.                                                                                                     // vente
  2630.                                                                                                     // dans
  2631.                                                                                                     // l'HDV
  2632.                                                                                                     // où
  2633.                                                                                                     // il
  2634.                                                                                                     // est
  2635.         boolean isFirst = true;
  2636.         for (HdvEntry curEntry : entries) {
  2637.             if (curEntry == null)
  2638.                 break;
  2639.             if (!isFirst)
  2640.                 packet += "|";
  2641.             packet += curEntry.parseToEL();
  2642.  
  2643.             isFirst = false;
  2644.         }
  2645.         send(perso, packet);
  2646.  
  2647.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2648.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2649.     }
  2650.  
  2651.     public static void GAME_SEND_WEDDING(Maps c, int action, int homme, int femme, int parlant) {
  2652.         String packet = "GA;" + action + ";" + homme + ";" + homme + "," + femme + "," + parlant;
  2653.         Characters Homme = World.getPersonnage(homme);
  2654.         send(Homme, packet);
  2655.  
  2656.         Logs.addToGameSockLog("Game: Send >> " + packet);
  2657.     }
  2658.  
  2659.     public static void GAME_SEND_PF(Characters perso, String str) {
  2660.         String packet = "PF" + str;
  2661.         send(perso, packet);
  2662.  
  2663.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2664.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2665.     }
  2666.  
  2667.     public static void GAME_SEND_MERCHANT_LIST(Characters perso, short mapID) {
  2668.         StringBuilder packet = new StringBuilder();
  2669.         packet.append("GM|~");
  2670.         if (World.getSeller(perso.get_curCarte().get_id()) == null)
  2671.             return;
  2672.         for (Integer pID : World.getSeller(perso.get_curCarte().get_id())) {
  2673.             if (!World.getPersonnage(pID).isOnline() && World.getPersonnage(pID).is_showSeller()) {
  2674.                 packet.append(World.getPersonnage(pID).parseToMerchant()).append("|");
  2675.             }
  2676.         }
  2677.         if (packet.length() < 5)
  2678.             return;
  2679.         send(perso, packet.toString());
  2680.  
  2681.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2682.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2683.     }
  2684.  
  2685.     public static void GAME_SEND_cMK_PACKET_INCARNAM_CHAT(Characters perso, String suffix, int guid, String name,
  2686.             String msg) {
  2687.         String packet = "cMK" + suffix + "|" + guid + "|" + name + "|" + msg;
  2688.         /*
  2689.         if (perso.get_lvl() > 15) {
  2690.             GAME_SEND_BN(perso);
  2691.             return;
  2692.         }
  2693.         */
  2694.         for (Characters perso1 : World.getOnlinePersos()) {
  2695.             send(perso1, packet);
  2696.         }
  2697.  
  2698.         Logs.addToGameSockLog("Game: ALL(" + World.getOnlinePersos().size() + "): Send>>" + packet);
  2699.     }
  2700.  
  2701.     public static void GAME_SEND_PACKET_TO_FIGHT(Fight fight, int i, String packet) {
  2702.         for (Fighter f : fight.getFighters(i)) {
  2703.             if (f.hasLeft())
  2704.                 continue;
  2705.             if (f.getPersonnage() == null || !f.getPersonnage().isOnline())
  2706.                 continue;
  2707.             send(f.getPersonnage(), packet);
  2708.         }
  2709.  
  2710.         Logs.addToGameSockLog("Game: Fight : Send>>" + packet);
  2711.     }
  2712.  
  2713.     public static void GAME_SEND_CIN_Packet(Characters perso, String num) { // Jouer cinématique
  2714.         String packet = "GA;2;" + perso.get_GUID() + ";" + num;
  2715.         send(perso, packet);
  2716.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2717.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2718.     }
  2719.  
  2720.     public static void GAME_SEND_TB_Packet(GameSendThread out) { // Jouer la cinématique de départ
  2721.         String packet = "TB";
  2722.         send(out, packet);
  2723.         Logs.addToGameLog("Game: Send >> " + packet);
  2724.     }
  2725.  
  2726.     public static void GAME_SEND_UPDATE_OBJECT_DISPLAY_PACKET(Characters perso, Objects item) {
  2727.         StringBuilder packet = new StringBuilder();
  2728.         packet.append("OCO").append(item.parseItem());
  2729.         send(perso, packet.toString());
  2730.  
  2731.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2732.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2733.     }
  2734.  
  2735.     public static void GAME_SEND_Carte_ACTUALIZAR_CELDA(Maps Carte, String str) { // Actualiser une cellule
  2736.         String packet = "GDO+" + str;
  2737.         for (Characters z : Carte.getPersos())
  2738.             send(z, packet);
  2739.  
  2740.         Logs.addToGameSockLog("Game: Send >>   " + packet);
  2741.     }
  2742.  
  2743.     //GAME_SEND
  2744.     public static void ENVIAR_GDO_PONER_OBJETO_CRIA_EN_MAPA(Maps mapa, String str) { // Actualiser une cellule 3.0
  2745.         String packet = "GDO+" + str;
  2746.         for (Characters z : mapa.getPersos())
  2747.             send(z, packet);
  2748.  
  2749.         Logs.addToGameSockLog("Game: Send >>  " + packet);
  2750.     }
  2751.  
  2752.     public static void GAME_SEND_DELETE_STATS_ITEM_FM(Characters perso, int id) {
  2753.         String packet = "OR" + id;
  2754.         send(perso, packet);
  2755.  
  2756.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2757.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2758.     }
  2759.  
  2760.     public static void GAME_SEND_Ew_PACKET(Characters perso, int pods, int podsMax) { // Pods de la dinde
  2761.         String packet = "Ew" + pods + ";" + podsMax + "";
  2762.         send(perso, packet);
  2763.  
  2764.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2765.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2766.     }
  2767.  
  2768.     public static void GAME_SEND_BAIO_PACKET(Characters perso, String str) { // Afficher le panel d'info
  2769.         String packet = "BAIO" + str;
  2770.         if (perso.get_compte().get_gmLvl() > 0)
  2771.             send(perso, packet);
  2772.         else
  2773.             perso.get_compte().getGameThread().kick();
  2774.  
  2775.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2776.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2777.     }
  2778.    
  2779.     public static void GAME_SEND_BAIC_PACKET(Characters perso, String str) { // Afficher le panel d'info
  2780.         String packet = "BAIC" + str;
  2781.         send(perso, packet);
  2782.  
  2783.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2784.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2785.     }
  2786.  
  2787.     public static void GAME_SEND_EJ_PACKET(Characters perso, int metid, int pid, StatsMetier sm) { // Regarder un livre de métier
  2788.        
  2789.         Characters p = World.getPersonnage(pid);
  2790.         if (p == null)
  2791.             return;
  2792.         String a = p.parse_tojobbook(metid);
  2793.         if (a == null)
  2794.             return;
  2795.         String packet = "EJ+" + metid + ";" + pid + ";" + a;
  2796.         send(perso, packet);
  2797.        
  2798.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2799.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2800.     }
  2801.  
  2802.     public static void GAME_SEND_Ag_PACKET(GameSendThread out, int idObject, String codeObject) { // Cadeau à la connexion
  2803.         String packet = "Ag1|" + idObject + "|Cadeau !!!| Voilà un joli cadeau pour vous ! "
  2804.                 + "Un jeune aventurier comme vous sera sans servir de la meilleur façon ! "
  2805.                 + "Bonne continuation avec ceci ! |DOFUS|" + codeObject;
  2806.         send(out, packet);
  2807.  
  2808.         Logs.addToGameSockLog("Game: Send >>  " + packet);
  2809.     }
  2810.  
  2811.     public static void GAME_SEND_AGK_PACKET(GameSendThread out) { // Cadeau à la connexion
  2812.         String packet = "AGK";
  2813.         send(out, packet);
  2814.  
  2815.         Logs.addToGameSockLog("Game: Send >>  " + packet);
  2816.     }
  2817.  
  2818.     public static void GAME_SEND_dCK_PACKET(Characters perso, String id) // Ouvrir
  2819.                                                                         // un
  2820.                                                                         // livre
  2821.     {
  2822.         String packet = "dCK" + id;
  2823.         send(perso, packet);
  2824.  
  2825.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2826.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2827.     }
  2828.  
  2829.     public static void GAME_SEND_SB_PACKET(Characters p, Characters.BoostSpellStats stats, boolean isAdd) {
  2830.         StringBuilder packet = new StringBuilder();
  2831.         boolean isFirst = false;
  2832.         Characters.BoostSpellStats trueStats = p.getTotalBoostSpellStats();
  2833.         int trueval;
  2834.         if (!isAdd) {
  2835.             for (Entry<Integer, Map<Integer, Integer>> entry : stats.getAllEffects().entrySet()) {
  2836.                 if (entry == null || entry.getValue() == null)
  2837.                     continue;
  2838.                 for (Entry<Integer, Integer> stat : entry.getValue().entrySet()) {
  2839.                     if (!isFirst)
  2840.                         packet.append("\0");
  2841.                     packet.append("SB").append(stat.getKey()).append(";").append(entry.getKey()).append(";-1");
  2842.                     isFirst = false;
  2843.                 }
  2844.             }
  2845.         } else {
  2846.             for (Entry<Integer, Map<Integer, Integer>> entry : stats.getAllEffects().entrySet()) {
  2847.                 if (entry == null || entry.getValue() == null)
  2848.                     continue;
  2849.                 for (Entry<Integer, Integer> stat : entry.getValue().entrySet()) {
  2850.                     if (!isFirst)
  2851.                         packet.append("\0");
  2852.                     switch (stat.getKey()) {
  2853.                     case Constant.STATS_BOOST_SPELL_CASTOUTLINE:
  2854.                     case Constant.STATS_BOOST_SPELL_NOLINEOFSIGHT:
  2855.                     case Constant.STATS_BOOST_SPELL_RANGEABLE:
  2856.                         packet.append("SB").append(stat.getKey()).append(";").append(entry.getKey()).append(";1");
  2857.                         break;
  2858.                     default:
  2859.                         trueval = trueStats.getStat(entry.getKey(), stat.getKey());
  2860.                         packet.append("SB").append(stat.getKey()).append(";").append(entry.getKey()).append(";")
  2861.                                 .append(trueval);
  2862.                     }
  2863.                     isFirst = false;
  2864.                 }
  2865.             }
  2866.         }
  2867.         send(p, packet.toString());
  2868.  
  2869.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + p.get_name() + "(" + p.get_GUID()
  2870.         + ") ~ account : " + p.get_compte().get_name() + "(" + p.get_compte().get_GUID() + ")");
  2871.     }
  2872.  
  2873.     public static void GAME_SEND_FIGHT_PLAYER_JOIN(Characters perso, Fighter f) {
  2874.         String packet = f.getGmPacket('+');
  2875.         send(perso, packet);
  2876.  
  2877.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2878.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2879.     }
  2880.  
  2881.     public static void GAME_SEND_MOUNT_PODS(Characters perso, int pods) {
  2882.         String packet = "Ew" + pods + ";1000";
  2883.         send(perso, packet);
  2884.        
  2885.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2886.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2887.     }
  2888.  
  2889.     public static void GAME_SEND_EL_MOUNT_INVENTAIRE(GameSendThread _out, Mount DD) {
  2890.         String packet = "EL" + DD.getInventaire();
  2891.         send(_out, packet);
  2892.        
  2893.         Logs.addToGameSockLog("Game: Send >> " + packet);
  2894.     }
  2895.  
  2896.     public static void GAME_SEND_OCO_PACKET(Characters perso, Objects obj) {
  2897.         String packet = "OCO" + obj.parseItem();
  2898.         send(perso, packet);
  2899.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2900.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2901.     }
  2902.  
  2903.     public static void GAME_SEND_Eq_PACKET(Characters perso, long Taxe) {
  2904.         String packet = "Eq|1|" + Taxe;
  2905.         send(perso, packet);
  2906.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  2907.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  2908.     }
  2909.    
  2910.     public static void GAME_UPDATE_CELL(final Maps map, final String args) {
  2911.         final String packet = "GDC" + args;
  2912.         for (final Characters z : map.getPersos()) {
  2913.             send(z, packet);
  2914.             Logs.addToGameSockLog("Game: Send >> " + packet);      
  2915.         }
  2916.     }
  2917.  
  2918.     public static void GAME_UPDATE_CELL(final Characters p, final String args) {
  2919.         send(p, "GDC" + args);
  2920.     }
  2921.  
  2922.     public static void GAME_SEND_ACTION_TO_DOOR_FAST(final Characters perso, final int args, final boolean open) {
  2923.         String packet = "";
  2924.         if (open) {
  2925.             packet = "GDF|" + args + ";3";
  2926.         } else if (!open) {
  2927.             packet = "GDF|" + args + ";1";
  2928.         }
  2929.         send(perso, packet);
  2930.         Logs.addToGameSockLog("Game: Send >> " + packet);
  2931.     }
  2932.    
  2933.     public static void GAME_UPDATE_CELL_FAST(final Characters perso, final String args) {
  2934.         final String packet = "GDC" + args;
  2935.         send(perso, packet);
  2936.         Logs.addToGameSockLog("Game: Send >> " + packet);  
  2937.     }
  2938.    
  2939.     public static void GAME_SEND_Im_PACKET_TO_MAPS(Maps map, String s)
  2940.     {
  2941.         String packet = "Im"+s;
  2942.         for(Characters z : map.getPersos()) send(z,packet);
  2943.         Logs.addToGameSockLog("Game: Send >> " + packet);  
  2944.     }
  2945.    
  2946.     //Add ydainna (client)
  2947.     //=====================================================
  2948.     //Permet de send un message vert à all(comme announce rouge)
  2949.     public static void GAME_SEND_cs_PACKET_TO_ALL(String s)
  2950.     {
  2951.         String packet = "cs"+s;
  2952.         for(Characters perso : World.getOnlinePersos())
  2953.             send(perso,packet);
  2954.         Logs.addToGameSockLog("Game: Send >> " + packet);  
  2955.     }
  2956.    
  2957.     //Permet de delet les cellFights ou les selectCells de la map (visible)
  2958.     public static void GAME_SEND_FIGHT_PLACE_DELET_VIEWER_POS(Maps map, int cell)
  2959.     {
  2960.         String packet = "LV" + cell;
  2961.         for(Characters z : map.getPersos()) send(z,packet);
  2962.         Logs.addToGameSockLog("Game: Send>>"+packet);
  2963.     }
  2964.    
  2965.     //Permet d'afficher les cellFight hors combat sur la map
  2966.     public static void GAME_SEND_FIGHT_PLACE_VIEWER_POS(Maps map, int cell, int id)
  2967.     {
  2968.         String packet = "LW" + cell + "|" + id;
  2969.         for(Characters z : map.getPersos()) send(z,packet);
  2970.         Logs.addToGameSockLog("Game: Send>>"+packet);
  2971.     }
  2972.    
  2973.     //Permet de selectionner une cellid (id + colouleur + alpha) visible part les players de la map
  2974.     public static void GAME_SEND_SELECT_CELL(Maps map, int cell, int color, int alpha)
  2975.     {
  2976.         String packet = "LS" + cell + "|" + color + "|" + alpha;
  2977.         for(Characters z : map.getPersos()) send(z,packet);
  2978.         Logs.addToGameSockLog("Game: Send>>"+packet);
  2979.     }
  2980.    
  2981.     //Système d'annonce joueur (boutique) re-send au client
  2982.     public static void GAME_SEND_PANNOUNCE_TO_All(String msg) {
  2983.         String packet = "LA" + msg;
  2984.         for (Characters P : World.getOnlinePersos()) {
  2985.             send(P, packet);
  2986.         }
  2987.     }
  2988.    
  2989.     //Permet de send une notification à all-> sur le serveur (connecter)
  2990.     public static void GAME_SEND_NOTIF_TO_All(String msg) {
  2991.         String packet = "LN" + msg;
  2992.         for (Characters P : World.getOnlinePersos()) {
  2993.             send(P, packet);
  2994.         }
  2995.     }
  2996.    
  2997.     //Permet de send une notification à un player cible
  2998.     public static void GAME_SEND_NOTIF(Characters perso, String msg) {
  2999.         String packet = "LN" + msg;
  3000.         send(perso, packet);
  3001.     }
  3002.    
  3003.     //Permet de send un popup a un player cible
  3004.     public static void GAME_SEND_POPUP(Characters perso, String msg) {
  3005.         String packet = "LP" + msg;
  3006.         send(perso, packet);
  3007.         Logs.addToGameSockLog("Game: Send >> " + packet.toString() + " to " + perso.get_name() + "(" + perso.get_GUID()
  3008.         + ") ~ account : " + perso.get_compte().get_name() + "(" + perso.get_compte().get_GUID() + ")");
  3009.     }
  3010.  
  3011.     //Permet de send un popup à -> all (connecter)
  3012.     public static void GAME_SEND_POPUP_TO_All(String msg) {
  3013.         String packet = "LP" + msg;
  3014.         for (Characters P : World.getOnlinePersos()) {
  3015.             send(P, packet);
  3016.         }
  3017.         Logs.addToGameLog("Game: Send ALL(" + World.getOnlinePersos() +") >> " + packet);
  3018.     }  
  3019. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement