RequestHardWareInfo improvements.
This commit is contained in:
@@ -261,7 +261,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
||||
REQUEST_GOODS_INVENTORY_ITEM(0xAB, null, ConnectionState.IN_GAME),
|
||||
REQUEST_FIRST_PLAY_START(0xAC, null, ConnectionState.IN_GAME),
|
||||
REQUEST_FLY_MOVE_START(0xAD, RequestFlyMoveStart::new, ConnectionState.IN_GAME),
|
||||
REQUEST_HARDWARE_INFO(0xAE, RequestHardWareInfo::new, ConnectionState.IN_GAME),
|
||||
REQUEST_HARDWARE_INFO(0xAE, RequestHardWareInfo::new, ConnectionState.values()),
|
||||
SEND_CHANGE_ATTRIBUTE_TARGET_ITEM(0xB0, null, ConnectionState.IN_GAME),
|
||||
REQUEST_CHANGE_ATTRIBUTE_ITEM(0xB1, null, ConnectionState.IN_GAME),
|
||||
REQUEST_CHANGE_ATTRIBUTE_CANCEL(0xB2, null, ConnectionState.IN_GAME),
|
||||
|
@@ -19,6 +19,7 @@ package com.l2jmobius.gameserver.network.clientpackets;
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.LoginServerThread;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.cache.HtmCache;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
|
||||
@@ -94,7 +95,6 @@ import com.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListAll;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.QuestList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ServerClose;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SkillList;
|
||||
@@ -119,13 +119,6 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
packet.readB(32); // Unknown Byte Array
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readB(32); // Unknown Byte Array
|
||||
packet.readD(); // Unknown Value
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
for (int o = 0; o < 4; o++)
|
||||
@@ -133,38 +126,18 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
tracert[i][o] = packet.readC();
|
||||
}
|
||||
}
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readD(); // Unknown Value
|
||||
packet.readB(64); // Unknown Byte Array
|
||||
packet.readD(); // Unknown Value
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
// HWID
|
||||
if (Config.HARDWARE_INFO_ENABLED)
|
||||
{
|
||||
if (client.getHardwareInfo() == null)
|
||||
{
|
||||
client.close(ServerClose.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||
{
|
||||
if ((player.isOnlineInt() == 1) && (player.getClient().getHardwareInfo().equals(client.getHardwareInfo())))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
client.close(ServerClose.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final L2PcInstance activeChar = client.getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
@@ -355,7 +328,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Send GG check
|
||||
activeChar.queryGameGuard();
|
||||
// activeChar.queryGameGuard();
|
||||
|
||||
// Send Dye Information
|
||||
activeChar.sendPacket(new HennaInfo(activeChar));
|
||||
@@ -656,6 +629,18 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
activeChar.sendPacket(new ExAutoSoulShot(0, false, 2));
|
||||
activeChar.sendPacket(new ExAutoSoulShot(0, false, 3));
|
||||
}
|
||||
|
||||
if (Config.HARDWARE_INFO_ENABLED)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(() ->
|
||||
{
|
||||
if (client.getHardwareInfo() == null)
|
||||
{
|
||||
client.closeNow();
|
||||
return;
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -16,7 +16,10 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
|
||||
import com.l2jmobius.gameserver.network.client.L2GameClient;
|
||||
|
||||
@@ -55,10 +58,7 @@ public final class RequestHardWareInfo implements IClientIncomingPacket
|
||||
_windowsBuildNumber = packet.readD();
|
||||
_directxVersion = packet.readD();
|
||||
_directxRevision = packet.readD();
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
packet.readC();
|
||||
}
|
||||
packet.readB(16);
|
||||
_cpuName = packet.readS();
|
||||
_cpuSpeed = packet.readD();
|
||||
_cpuCoreCount = packet.readC();
|
||||
@@ -71,7 +71,7 @@ public final class RequestHardWareInfo implements IClientIncomingPacket
|
||||
packet.readC();
|
||||
_videoMemory = packet.readD();
|
||||
packet.readD();
|
||||
_vgaVersion = packet.readD();
|
||||
_vgaVersion = packet.readH();
|
||||
_vgaName = packet.readS();
|
||||
_vgaDriverVersion = packet.readS();
|
||||
return true;
|
||||
@@ -81,5 +81,21 @@ public final class RequestHardWareInfo implements IClientIncomingPacket
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
client.setHardwareInfo(new ClientHardwareInfoHolder(_macAddress, _windowsPlatformId, _windowsMajorVersion, _windowsMinorVersion, _windowsBuildNumber, _directxVersion, _directxRevision, _cpuName, _cpuSpeed, _cpuCoreCount, _vgaCount, _vgaPcxSpeed, _physMemorySlot1, _physMemorySlot2, _physMemorySlot3, _videoMemory, _vgaVersion, _vgaName, _vgaDriverVersion));
|
||||
if (Config.HARDWARE_INFO_ENABLED && (Config.MAX_PLAYERS_PER_HWID > 0))
|
||||
{
|
||||
int count = 0;
|
||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||
{
|
||||
if ((player.isOnlineInt() == 1) && (player.getClient().getHardwareInfo().equals(client.getHardwareInfo())))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
client.closeNow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user