From 81961bb91d0c3a6e8dfc925d43d90e6e4ab9f165 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 18 Oct 2021 22:21:20 +0000 Subject: [PATCH] Addition of RequestHardWareInfo client packet. --- .../gameserver/network/ExIncomingPackets.java | 2 +- .../clientpackets/RequestHardWareInfo.java | 82 +++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestHardWareInfo.java diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 46f5f02d64..8b01b83ff2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -173,7 +173,7 @@ public enum ExIncomingPackets implements IIncomingPackets REQUEST_BR_LECTURE_MARK(0x90, null, ConnectionState.IN_GAME), REQUEST_GOODS_INVENTORY_INFO(0x91, null, ConnectionState.IN_GAME), REQUEST_USE_GOODS_INVENTORY_ITEM(0x92, null, ConnectionState.IN_GAME), - REQUEST_HARDWARE_INFO(0x96, null, ConnectionState.values()); + REQUEST_HARDWARE_INFO(0x96, RequestHardWareInfo::new, ConnectionState.values()); public static final ExIncomingPackets[] PACKET_ARRAY; static diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestHardWareInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestHardWareInfo.java new file mode 100644 index 0000000000..71418d930b --- /dev/null +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestHardWareInfo.java @@ -0,0 +1,82 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package org.l2jmobius.gameserver.network.clientpackets; + +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; +import org.l2jmobius.gameserver.network.GameClient; + +/** + * @author Mobius + */ +public class RequestHardWareInfo implements IClientIncomingPacket +{ + private String _macAddress; + private int _windowsPlatformId; + private int _windowsMajorVersion; + private int _windowsMinorVersion; + private int _windowsBuildNumber; + private int _directxVersion; + private int _directxRevision; + private String _cpuName; + private int _cpuSpeed; + private int _cpuCoreCount; + private int _vgaCount; + private int _vgaPcxSpeed; + private int _physMemorySlot1; + private int _physMemorySlot2; + private int _physMemorySlot3; + private int _videoMemory; + private int _vgaVersion; + private String _vgaName; + private String _vgaDriverVersion; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + _macAddress = packet.readS(); + _windowsPlatformId = packet.readD(); + _windowsMajorVersion = packet.readD(); + _windowsMinorVersion = packet.readD(); + _windowsBuildNumber = packet.readD(); + _directxVersion = packet.readD(); + _directxRevision = packet.readD(); + packet.readB(16); + _cpuName = packet.readS(); + _cpuSpeed = packet.readD(); + _cpuCoreCount = packet.readC(); + packet.readD(); + _vgaCount = packet.readD(); + _vgaPcxSpeed = packet.readD(); + _physMemorySlot1 = packet.readD(); + _physMemorySlot2 = packet.readD(); + _physMemorySlot3 = packet.readD(); + packet.readC(); + _videoMemory = packet.readD(); + packet.readD(); + _vgaVersion = packet.readH(); + _vgaName = packet.readS(); + _vgaDriverVersion = packet.readS(); + return true; + } + + @Override + public void run(GameClient client) + { + client.setHardwareInfo(new ClientHardwareInfoHolder(_macAddress, _windowsPlatformId, _windowsMajorVersion, _windowsMinorVersion, _windowsBuildNumber, _directxVersion, _directxRevision, _cpuName, _cpuSpeed, _cpuCoreCount, _vgaCount, _vgaPcxSpeed, _physMemorySlot1, _physMemorySlot2, _physMemorySlot3, _videoMemory, _vgaVersion, _vgaName, _vgaDriverVersion)); + } +} \ No newline at end of file