Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.sf.l2j.gameserver.clientpackets;
- import com.lameguard.LameGuard;
- import com.lameguard.exception.LameGuardException;
- import java.util.logging.Logger;
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.network.L2GameClient;
- import net.sf.l2j.gameserver.serverpackets.KeyPacket;
- import net.sf.l2j.gameserver.serverpackets.SendStatus;
- import org.mmocore.network.AbstractPacket;
- import org.mmocore.network.MMOClient;
- import org.mmocore.network.ReceivablePacket;
- public final class ProtocolVersion extends L2GameClientPacket
- {
- private static final String _C__00_PROTOCOLVERSION = "[C] 00 ProtocolVersion";
- static Logger _log;
- private int _version;
- private byte[] __data;
- private int __version;
- private int __patch;
- private int __instances;
- public ProtocolVersion()
- {
- this.__data = null; this.__version = 0; this.__patch = 0; this.__instances = 0;
- }
- protected void runImplOld()
- {
- if (this.jdField__version_of_type_Int == 65534)
- {
- if (Config.jdField_DEBUG_of_type_Boolean) ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.info("Ping received");
- ((L2GameClient)getClient()).closeNow();
- }
- else if (this.jdField__version_of_type_Int == 65533)
- {
- if (Config.RWHO_LOG)
- {
- ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.warning(((L2GameClient)getClient()).toString() + " WARNING ! Remote status request !!!11oNE0ne");
- }
- ((L2GameClient)getClient()).close(new SendStatus());
- }
- 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))
- {
- 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.");
- ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.warning("Wrong Protocol Version " + this.jdField__version_of_type_Int);
- ((L2GameClient)getClient()).closeNow();
- }
- else
- {
- if (Config.jdField_DEBUG_of_type_Boolean)
- {
- ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger.fine("Client Protocol Revision is ok: " + this.jdField__version_of_type_Int);
- }
- KeyPacket pk = new KeyPacket(((L2GameClient)getClient()).enableCrypt());
- ((L2GameClient)getClient()).sendPacket(pk);
- }
- }
- public String getType()
- {
- return "[C] 00 ProtocolVersion";
- }
- static
- {
- ProtocolVersion.jdField__log_of_type_JavaUtilLoggingLogger = Logger.getLogger(ProtocolVersion.class.getName());
- }
- protected void readImpl()
- {
- this.jdField___data_of_type_ArrayOfByte = new byte[1024];
- try
- {
- this.jdField__version_of_type_Int = readD();
- this.jdField__version_of_type_Int = (int)(this.jdField__version_of_type_Int & 0xFFFF);
- }
- catch (Exception localException1)
- {
- getClient().closeNow();
- }
- try
- {
- this.jdField___version_of_type_Int = readH();
- this.jdField___patch_of_type_Int = readH();
- this.jdField___instances_of_type_Int = readH();
- readB(this.jdField___data_of_type_ArrayOfByte);
- }
- catch (Exception localException2)
- {
- this.jdField___data_of_type_ArrayOfByte = null;
- }
- }
- protected void runImpl()
- {
- try
- {
- 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);
- runImplOld();
- }
- catch (LameGuardException localLameGuardException)
- {
- getClient().closeNow();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement