Fast implementation of RequestHardWareInfo packet.
This commit is contained in:
parent
16f47a60b1
commit
3f51a97be6
4
trunk/dist/game/config/AdminCommands.xml
vendored
4
trunk/dist/game/config/AdminCommands.xml
vendored
@ -322,6 +322,10 @@
|
||||
<admin command="admin_html" accessLevel="100" />
|
||||
<admin command="admin_loadhtml" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN HWID -->
|
||||
<admin command="admin_hwid" accessLevel="100" />
|
||||
<admin command="admin_hwinfo" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN INSTANCE -->
|
||||
<admin command="admin_instance" accessLevel="100" />
|
||||
<admin command="admin_instances" accessLevel="100" />
|
||||
|
17
trunk/dist/game/config/Server.ini
vendored
17
trunk/dist/game/config/Server.ini
vendored
@ -78,7 +78,7 @@ AcceptAlternateID = True
|
||||
# Datapack root directory.
|
||||
# Defaults to current directory from which the server is started unless the below line is uncommented.
|
||||
# WARNING: <u><b><font color="red">If the specified path is invalid, it will lead to multiple errors!</font></b></u>
|
||||
#Default: .
|
||||
# Default: .
|
||||
DatapackRoot = .
|
||||
|
||||
# Define how many players are allowed to play simultaneously on your server.
|
||||
@ -109,6 +109,21 @@ ServerListAge = 0
|
||||
ServerListBrackets = False
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Player HWID settings (DO NOT USE)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Misc Player Settings
|
||||
# ---------------------------------------------------------------------------
|
||||
|
25
trunk/dist/game/data/html/admin/charhwinfo.htm
vendored
Normal file
25
trunk/dist/game/data/html/admin/charhwinfo.htm
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<html><title>Hardware Information: %name%</title><body>
|
||||
<center>
|
||||
<table width=290>
|
||||
<tr>
|
||||
<td width=45><button value="Main" action="bypass -h admin_admin" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
<td width=180><center>Hardware (%name%)</center></td>
|
||||
<td width=45><button value="Back" action="bypass -h admin_admin7" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width=290 border=0>
|
||||
<tr><td><table width=290 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">MAC Address:</font></td><td align=right width=170>%macAddress%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0><tr><td width=50><font color="LEVEL">CPU:</font></td><td align=right width=290>%cpuName%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">CPU Speed:</font></td><td align=right width=100>%cpuSpeed%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0><tr><td width=100><font color="LEVEL">CPU Core Count:</font></td><td align=right width=170>%cpuCoreCount%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">VGA:</font></td><td align=right width=170>%vgaName%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0><tr><td width=100><font color="LEVEL">VGA Version:</font></td><td align=right width=170>%vgaVersion%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">VGA Driver Version:</font></td><td align=right width=170>%vgaDriverVersion%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0><tr><td width=200><font color="LEVEL">Windows Platform Id:</font></td><td align=right width=170>%windowsPlatformId%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0 bgcolor=131210><tr><td width=200><font color="LEVEL">Windows Major Version:</font></td><td align=right width=170>%windowsMajorVersion%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0><tr><td width=200><font color="LEVEL">Windows Minor Version:</font></td><td align=right width=170>%windowsMinorVersion%</td></tr></table></td></tr>
|
||||
<tr><td><table width=290 border=0 bgcolor=131210><tr><td width=200><font color="LEVEL">Windows Build:</font></td><td align=right width=170>%windowsBuildNumber%</td></tr></table></td></tr>
|
||||
</table>
|
||||
</center>
|
||||
</body></html>
|
3
trunk/dist/game/data/html/admin/charinfo.htm
vendored
3
trunk/dist/game/data/html/admin/charinfo.htm
vendored
@ -35,6 +35,9 @@
|
||||
<td>Account IP: </td><td><font color="LEVEL"><a action="bypass -h admin_find_ip %ip%">%ip%</a></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hardware MAC: </td><td><font color="LEVEL"><a action="bypass -h admin_hwid">%hwid%</a></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Punishment: </td><td><font color="LEVEL"><a action="bypass -h admin_punishment player %name%">Info</a></font></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -86,6 +86,7 @@ import handlers.admincommandhandlers.AdminGraciaSeeds;
|
||||
import handlers.admincommandhandlers.AdminGrandBoss;
|
||||
import handlers.admincommandhandlers.AdminHeal;
|
||||
import handlers.admincommandhandlers.AdminHtml;
|
||||
import handlers.admincommandhandlers.AdminHwid;
|
||||
import handlers.admincommandhandlers.AdminInstance;
|
||||
import handlers.admincommandhandlers.AdminInstanceZone;
|
||||
import handlers.admincommandhandlers.AdminInvul;
|
||||
@ -363,6 +364,7 @@ public class MasterHandler
|
||||
AdminGrandBoss.class,
|
||||
AdminHeal.class,
|
||||
AdminHtml.class,
|
||||
AdminHwid.class,
|
||||
AdminInstance.class,
|
||||
AdminInstanceZone.class,
|
||||
AdminInvul.class,
|
||||
|
@ -1160,6 +1160,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
adminReply.replace("%access%", player.getAccessLevel().getLevel() + " (" + player.getAccessLevel().getName() + ")");
|
||||
adminReply.replace("%account%", player.getAccountName());
|
||||
adminReply.replace("%ip%", ip);
|
||||
adminReply.replace("%hwid%", (player.getClient() != null) && (player.getClient().getHardwareInfo() != null) ? player.getClient().getHardwareInfo().getMacAddress() : "Unknown");
|
||||
adminReply.replace("%ai%", String.valueOf(player.getAI().getIntention().name()));
|
||||
adminReply.replace("%inst%", player.isInInstance() ? "<tr><td>InstanceId:</td><td><a action=\"bypass -h admin_instance_spawns " + String.valueOf(player.getInstanceId()) + "\">" + String.valueOf(player.getInstanceId()) + "</a></td></tr>" : "");
|
||||
adminReply.replace("%noblesse%", player.isNoble() ? "Yes" : "No");
|
||||
|
66
trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminHwid.java
vendored
Normal file
66
trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminHwid.java
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.cache.HtmCache;
|
||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminHwid implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_hwid",
|
||||
"admin_hwinfo"
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||
{
|
||||
if ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer() || (activeChar.getTarget().getActingPlayer().getClient() == null) || (activeChar.getTarget().getActingPlayer().getClient().getHardwareInfo() == null))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
final L2PcInstance target = activeChar.getTarget().getActingPlayer();
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
|
||||
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/admin/charhwinfo.htm"));
|
||||
html.replace("%name%", target.getName());
|
||||
html.replace("%macAddress%", target.getClient().getHardwareInfo().getMacAddress());
|
||||
html.replace("%windowsPlatformId%", target.getClient().getHardwareInfo().getWindowsPlatformId());
|
||||
html.replace("%windowsMajorVersion%", target.getClient().getHardwareInfo().getWindowsMajorVersion());
|
||||
html.replace("%windowsMinorVersion%", target.getClient().getHardwareInfo().getWindowsMinorVersion());
|
||||
html.replace("%windowsBuildNumber%", target.getClient().getHardwareInfo().getWindowsBuildNumber());
|
||||
html.replace("%cpuName%", target.getClient().getHardwareInfo().getCpuName());
|
||||
html.replace("%cpuSpeed%", target.getClient().getHardwareInfo().getCpuSpeed());
|
||||
html.replace("%cpuCoreCount%", target.getClient().getHardwareInfo().getCpuCoreCount());
|
||||
html.replace("%vgaVersion%", target.getClient().getHardwareInfo().getVgaVersion());
|
||||
html.replace("%vgaName%", target.getClient().getHardwareInfo().getVgaName());
|
||||
html.replace("%vgaDriverVersion%", target.getClient().getHardwareInfo().getVgaDriverVersion());
|
||||
activeChar.sendPacket(html);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -850,6 +850,8 @@ public final class Config
|
||||
public static int DATABASE_MAX_CONNECTIONS;
|
||||
public static int DATABASE_MAX_IDLE_TIME;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
public static String CLAN_NAME_TEMPLATE;
|
||||
@ -1110,6 +1112,9 @@ public final class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -0,0 +1,218 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.model.holders;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ClientHardwareInfoHolder
|
||||
{
|
||||
private final String _macAddress;
|
||||
private final int _windowsPlatformId;
|
||||
private final int _windowsMajorVersion;
|
||||
private final int _windowsMinorVersion;
|
||||
private final int _windowsBuildNumber;
|
||||
private final int _directxVersion;
|
||||
private final int _directxRevision;
|
||||
private final String _cpuName;
|
||||
private final int _cpuSpeed;
|
||||
private final int _cpuCoreCount;
|
||||
private final int _vgaCount;
|
||||
private final int _vgaPcxSpeed;
|
||||
private final int _physMemorySlot1;
|
||||
private final int _physMemorySlot2;
|
||||
private final int _physMemorySlot3;
|
||||
private final int _videoMemory;
|
||||
private final int _vgaVersion;
|
||||
private final String _vgaName;
|
||||
private final String _vgaDriverVersion;
|
||||
|
||||
public ClientHardwareInfoHolder(String macAddress, int windowsPlatformId, int windowsMajorVersion, int windowsMinorVersion, int windowsBuildNumber, int directxVersion, int directxRevision, String cpuName, int cpuSpeed, int cpuCoreCount, int vgaCount, int vgaPcxSpeed, int physMemorySlot1, int physMemorySlot2, int physMemorySlot3, int videoMemory, int vgaVersion, String vgaName, String vgaDriverVersion)
|
||||
{
|
||||
_macAddress = macAddress;
|
||||
_windowsPlatformId = windowsPlatformId;
|
||||
_windowsMajorVersion = windowsMajorVersion;
|
||||
_windowsMinorVersion = windowsMinorVersion;
|
||||
_windowsBuildNumber = windowsBuildNumber;
|
||||
_directxVersion = directxVersion;
|
||||
_directxRevision = directxRevision;
|
||||
_cpuName = cpuName;
|
||||
_cpuSpeed = cpuSpeed;
|
||||
_cpuCoreCount = cpuCoreCount;
|
||||
_vgaCount = vgaCount;
|
||||
_vgaPcxSpeed = vgaPcxSpeed;
|
||||
_physMemorySlot1 = physMemorySlot1;
|
||||
_physMemorySlot2 = physMemorySlot2;
|
||||
_physMemorySlot3 = physMemorySlot3;
|
||||
_videoMemory = videoMemory;
|
||||
_vgaVersion = vgaVersion;
|
||||
_vgaName = vgaName;
|
||||
_vgaDriverVersion = vgaDriverVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the macAddress
|
||||
*/
|
||||
public String getMacAddress()
|
||||
{
|
||||
return _macAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the windowsPlatformId
|
||||
*/
|
||||
public int getWindowsPlatformId()
|
||||
{
|
||||
return _windowsPlatformId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the windowsMajorVersion
|
||||
*/
|
||||
public int getWindowsMajorVersion()
|
||||
{
|
||||
return _windowsMajorVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the windowsMinorVersion
|
||||
*/
|
||||
public int getWindowsMinorVersion()
|
||||
{
|
||||
return _windowsMinorVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the windowsBuildNumber
|
||||
*/
|
||||
public int getWindowsBuildNumber()
|
||||
{
|
||||
return _windowsBuildNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the directxVersion
|
||||
*/
|
||||
public int getDirectxVersion()
|
||||
{
|
||||
return _directxVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the directxRevision
|
||||
*/
|
||||
public int getDirectxRevision()
|
||||
{
|
||||
return _directxRevision;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cpuName
|
||||
*/
|
||||
public String getCpuName()
|
||||
{
|
||||
return _cpuName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cpuSpeed
|
||||
*/
|
||||
public int getCpuSpeed()
|
||||
{
|
||||
return _cpuSpeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cpuCoreCount
|
||||
*/
|
||||
public int getCpuCoreCount()
|
||||
{
|
||||
return _cpuCoreCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vgaCount
|
||||
*/
|
||||
public int getVgaCount()
|
||||
{
|
||||
return _vgaCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vgaPcxSpeed
|
||||
*/
|
||||
public int getVgaPcxSpeed()
|
||||
{
|
||||
return _vgaPcxSpeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the physMemorySlot1
|
||||
*/
|
||||
public int getPhysMemorySlot1()
|
||||
{
|
||||
return _physMemorySlot1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the physMemorySlot2
|
||||
*/
|
||||
public int getPhysMemorySlot2()
|
||||
{
|
||||
return _physMemorySlot2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the physMemorySlot3
|
||||
*/
|
||||
public int getPhysMemorySlot3()
|
||||
{
|
||||
return _physMemorySlot3;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the videoMemory
|
||||
*/
|
||||
public int getVideoMemory()
|
||||
{
|
||||
return _videoMemory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vgaVersion
|
||||
*/
|
||||
public int getVgaVersion()
|
||||
{
|
||||
return _vgaVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vgaName
|
||||
*/
|
||||
public String getVgaName()
|
||||
{
|
||||
return _vgaName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vgaDriverVersion
|
||||
*/
|
||||
public String getVgaDriverVersion()
|
||||
{
|
||||
return _vgaDriverVersion;
|
||||
}
|
||||
}
|
@ -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, null, ConnectionState.IN_GAME),
|
||||
REQUEST_HARDWARE_INFO(0xAE, RequestHardWareInfo::new, ConnectionState.IN_GAME),
|
||||
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),
|
||||
|
@ -53,6 +53,7 @@ import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.L2Event;
|
||||
import com.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
|
||||
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -86,7 +87,7 @@ public final class L2GameClient extends ChannelInboundHandler<L2GameClient>
|
||||
private L2PcInstance _activeChar;
|
||||
private final ReentrantLock _activeCharLock = new ReentrantLock();
|
||||
private SecondaryPasswordAuth _secondaryAuth;
|
||||
|
||||
private ClientHardwareInfoHolder _hardwareInfo;
|
||||
private boolean _isAuthedGG;
|
||||
private final long _connectionStartTime = System.currentTimeMillis();
|
||||
private CharSelectInfoPackage[] _charSlotMapping = null;
|
||||
@ -941,4 +942,20 @@ public final class L2GameClient extends ChannelInboundHandler<L2GameClient>
|
||||
{
|
||||
return _crypt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the hardwareInfo
|
||||
*/
|
||||
public ClientHardwareInfoHolder getHardwareInfo()
|
||||
{
|
||||
return _hardwareInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hardwareInfo
|
||||
*/
|
||||
public void setHardwareInfo(ClientHardwareInfoHolder hardwareInfo)
|
||||
{
|
||||
_hardwareInfo = hardwareInfo;
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ 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;
|
||||
@ -138,6 +139,32 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
@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)
|
||||
{
|
||||
|
@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
|
||||
import com.l2jmobius.gameserver.network.client.L2GameClient;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public final 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(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
_macAddress = packet.readS();
|
||||
_windowsPlatformId = packet.readD();
|
||||
_windowsMajorVersion = packet.readD();
|
||||
_windowsMinorVersion = packet.readD();
|
||||
_windowsBuildNumber = packet.readD();
|
||||
_directxVersion = packet.readD();
|
||||
_directxRevision = packet.readD();
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
packet.readC();
|
||||
}
|
||||
_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.readD();
|
||||
_vgaName = packet.readS();
|
||||
_vgaDriverVersion = packet.readS();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
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));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user