Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.95 KB | None | 0 0
  1. package net.sf.l2j.gameserver.clientpackets;
  2.  
  3. import com.lameguard.LameGuard;
  4. import com.lameguard.exception.LameGuardException;
  5. import java.util.logging.Logger;
  6. import net.sf.l2j.Config;
  7. import net.sf.l2j.gameserver.network.L2GameClient;
  8. import net.sf.l2j.gameserver.serverpackets.KeyPacket;
  9. import net.sf.l2j.gameserver.serverpackets.SendStatus;
  10. import org.mmocore.network.AbstractPacket;
  11. import org.mmocore.network.MMOClient;
  12. import org.mmocore.network.ReceivablePacket;
  13.  
  14. public final class ProtocolVersion extends L2GameClientPacket
  15. {
  16.   private static final String _C__00_PROTOCOLVERSION = "[C] 00 ProtocolVersion";
  17.   static Logger _log;
  18.   private int _version;
  19.   private byte[] __data;
  20.   private int __version;
  21.   private int __patch;
  22.   private int __instances;
  23.  
  24.   public ProtocolVersion()
  25.   {
  26.     this.__data = null; this.__version = 0; this.__patch = 0; this.__instances = 0;
  27.   }
  28.  
  29.   protected void runImplOld()
  30.   {
  31.     if (this.jdField__version_of_type_Int == 65534)
  32.     {
  33.       if (Config.jdField_DEBUG_of_type_Boolean) ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.info("Ping received");
  34.       ((L2GameClient)getClient()).closeNow();
  35.     }
  36.     else if (this.jdField__version_of_type_Int == 65533)
  37.     {
  38.       if (Config.RWHO_LOG)
  39.       {
  40.         ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.warning(((L2GameClient)getClient()).toString() + " WARNING ! Remote status request !!!11oNE0ne");
  41.       }
  42.       ((L2GameClient)getClient()).close(new SendStatus());
  43.     }
  44.     else if ((this.jdField__version_of_type_Int < Config.jdField_MIN_PROTOCOL_REVISION_of_type_Int) || (this.jdField__version_of_type_Int > Config.jdField_MAX_PROTOCOL_REVISION_of_type_Int))
  45.     {
  46.       ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.info("Client: " + ((L2GameClient)getClient()).toString() + " -> Protocol Revision: " + this.jdField__version_of_type_Int + " is invalid. Minimum is " + Config.jdField_MIN_PROTOCOL_REVISION_of_type_Int + " and Maximum is " + Config.jdField_MAX_PROTOCOL_REVISION_of_type_Int + " are supported. Closing connection.");
  47.       ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.warning("Wrong Protocol Version " + this.jdField__version_of_type_Int);
  48.       ((L2GameClient)getClient()).closeNow();
  49.     }
  50.     else
  51.     {
  52.       if (Config.jdField_DEBUG_of_type_Boolean)
  53.       {
  54.         ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.fine("Client Protocol Revision is ok: " + this.jdField__version_of_type_Int);
  55.       }
  56.  
  57.       KeyPacket pk = new KeyPacket(((L2GameClient)getClient()).enableCrypt());
  58.       ((L2GameClient)getClient()).sendPacket(pk);
  59.     }
  60.   }
  61.  
  62.   public String getType()
  63.   {
  64.     return "[C] 00 ProtocolVersion";
  65.   }
  66.  
  67.   static
  68.   {
  69.     ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger = Logger.getLogger(ProtocolVersion.class.getName());
  70.   }
  71.  
  72.   protected void readImpl()
  73.   {
  74.     this.jdField___data_of_type_ArrayOfByte = new byte[1024];
  75.     try
  76.     {
  77.       this.jdField__version_of_type_Int = readD();
  78.       this.jdField__version_of_type_Int = (int)(this.jdField__version_of_type_Int & 0xFFFF);
  79.     }
  80.     catch (Exception localException1)
  81.     {
  82.       getClient().closeNow();
  83.     }
  84.     try
  85.     {
  86.       this.jdField___version_of_type_Int = readH();
  87.       this.jdField___patch_of_type_Int = readH();
  88.       this.jdField___instances_of_type_Int = readH();
  89.       readB(this.jdField___data_of_type_ArrayOfByte);
  90.     }
  91.     catch (Exception localException2)
  92.     {
  93.       this.jdField___data_of_type_ArrayOfByte = null;
  94.     }
  95.   }
  96.  
  97.   protected void runImpl()
  98.   {
  99.     try
  100.     {
  101.       LameGuard.getInstance().onProtocolVersionPacket(getClient(), this.jdField__version_of_type_Int, this.jdField___version_of_type_Int, this.jdField___patch_of_type_Int, this.jdField___instances_of_type_Int, this.jdField___data_of_type_ArrayOfByte);
  102.       runImplOld();
  103.     }
  104.     catch (LameGuardException localLameGuardException)
  105.     {
  106.       getClient().closeNow();
  107.     }
  108.   }
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement