Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package l2s.gameserver.network.clientpackets;
- import l2s.commons.configuration.Config;
- import l2s.gameserver.network.serverpackets.KeyPacket;
- import l2s.gameserver.network.serverpackets.L2GameServerPacket;
- import l2s.protection.jts.Protection;
- import l2s.protection.jts.ProtectionConfig;
- public final class ProtocolVersion extends L2GameClientPacket
- {
- private int version;
- private String HWid;
- private byte[] data;
- @Override
- protected void readImpl()
- {
- version = readD();
- //Protection section
- if (_buf.remaining() > 260)
- {
- data = new byte[260];
- readB(data);
- if (ProtectionConfig.PROTECTION_ENABLED_HWID_REQUEST)
- HWid = readS();
- }
- else if (Protection.isProtectEnabled())
- getClient().close(new KeyPacket(null));
- //Protection section end
- }
- @Override
- protected void runImpl()
- {
- if (version == -2)
- {
- getClient().close((L2GameServerPacket) null);
- }
- else if ((version < Config.MIN_PROTOCOL_REVISION) || (version > Config.MAX_PROTOCOL_REVISION))
- {
- _log.warn("Client: " + getClient().toString() + " -> Protocol Revision: " + version + " is invalid. Minimum and maximum allowed are: " + Config.MIN_PROTOCOL_REVISION + " and " + Config.MAX_PROTOCOL_REVISION + ". Closing connection.");
- getClient().close((L2GameServerPacket) null);
- }
- else
- {
- if (Protection.isProtectEnabled())
- getClient().setHWID(HWid);
- getClient().sendPacket(new KeyPacket(getClient().enableCrypt()));
- System.out.println("protocolverion lalalala");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement