diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 595f01b700..57f9904567 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE"; public static final String CEREMONY_OF_CHAOS_MARKS = "CEREMONY_OF_CHAOS_MARKS"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 8b2be2392f..512cf4d0a8 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -81,6 +81,8 @@ import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRProduct import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRRecentProductList; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java similarity index 83% rename from L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java rename to L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java index 9793d6e1d8..01a2ec7415 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -14,13 +14,14 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; /** * @author KenM / mrTJO diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java similarity index 83% rename from L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java rename to L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java index edd7168438..a0f45591b8 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -14,13 +14,15 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.ConnectionState; import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; /** * Request Save Key Mapping client packet. @@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient; */ public class RequestSaveKeyMapping implements IClientIncomingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; + private byte[] _uiKeyMapping; @Override @@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket { uiKeyMapping += b + SPLIT_VAR; } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); } } diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java similarity index 76% rename from L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java rename to L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java index 7bcddd964d..6e5534b23b 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -14,27 +14,28 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.l2jmobius.gameserver.network.serverpackets; +package org.l2jmobius.gameserver.network.serverpackets.settings; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** * @author Mobius */ public class ExUISetting implements IClientOutgoingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; private final byte[] _uiKeyMapping; public ExUISetting(Player player) { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); } else { diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index b65041b6e1..58878be1b0 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE"; diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 328f6b76ac..05d9f33963 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -89,6 +89,8 @@ import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRProduct import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRRecentProductList; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java similarity index 83% rename from L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java rename to L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java index 9793d6e1d8..01a2ec7415 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -14,13 +14,14 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; /** * @author KenM / mrTJO diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java similarity index 83% rename from L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java rename to L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java index edd7168438..a0f45591b8 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -14,13 +14,15 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.ConnectionState; import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; /** * Request Save Key Mapping client packet. @@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient; */ public class RequestSaveKeyMapping implements IClientIncomingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; + private byte[] _uiKeyMapping; @Override @@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket { uiKeyMapping += b + SPLIT_VAR; } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); } } diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java similarity index 76% rename from L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java rename to L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java index 7bcddd964d..6e5534b23b 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -14,27 +14,28 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.l2jmobius.gameserver.network.serverpackets; +package org.l2jmobius.gameserver.network.serverpackets.settings; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** * @author Mobius */ public class ExUISetting implements IClientOutgoingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; private final byte[] _uiKeyMapping; public ExUISetting(Player player) { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); } else { diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index b65041b6e1..58878be1b0 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE"; diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 66b853a695..191ae1e15b 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -90,6 +90,8 @@ import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRProduct import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRRecentProductList; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java similarity index 83% rename from L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java rename to L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java index 9793d6e1d8..01a2ec7415 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -14,13 +14,14 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; /** * @author KenM / mrTJO diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java similarity index 83% rename from L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java rename to L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java index edd7168438..a0f45591b8 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -14,13 +14,15 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.ConnectionState; import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; /** * Request Save Key Mapping client packet. @@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient; */ public class RequestSaveKeyMapping implements IClientIncomingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; + private byte[] _uiKeyMapping; @Override @@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket { uiKeyMapping += b + SPLIT_VAR; } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); } } diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java similarity index 76% rename from L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java rename to L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java index 7bcddd964d..6e5534b23b 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -14,27 +14,28 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.l2jmobius.gameserver.network.serverpackets; +package org.l2jmobius.gameserver.network.serverpackets.settings; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** * @author Mobius */ public class ExUISetting implements IClientOutgoingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; private final byte[] _uiKeyMapping; public ExUISetting(Player player) { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); } else { diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index e47eec0cf4..1e21d59868 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE"; diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 4dec8c5fcf..0aa5fe2c5b 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -97,6 +97,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidBo import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidServerInfo; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java similarity index 83% rename from L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java rename to L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java index 9793d6e1d8..01a2ec7415 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -14,13 +14,14 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; /** * @author KenM / mrTJO diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java similarity index 83% rename from L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java rename to L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java index edd7168438..a0f45591b8 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -14,13 +14,15 @@ * 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; +package org.l2jmobius.gameserver.network.clientpackets.settings; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.ConnectionState; import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; /** * Request Save Key Mapping client packet. @@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient; */ public class RequestSaveKeyMapping implements IClientIncomingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; + private byte[] _uiKeyMapping; @Override @@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket { uiKeyMapping += b + SPLIT_VAR; } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); } } diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java similarity index 76% rename from L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java rename to L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java index 7bcddd964d..6e5534b23b 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -14,27 +14,28 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.l2jmobius.gameserver.network.serverpackets; +package org.l2jmobius.gameserver.network.serverpackets.settings; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** * @author Mobius */ public class ExUISetting implements IClientOutgoingPacket { - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; public static final String SPLIT_VAR = " "; private final byte[] _uiKeyMapping; public ExUISetting(Player player) { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); } else { diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 3bb7295d41..a04c85dd31 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String DAILY_MISSION_COUNT = "DAILY_MISSION_COUNT"; diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 7bceb91932..2eddf2bbd7 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -106,6 +106,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidBo import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidServerInfo; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 3525c3122f..60b0a8ab8d 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 07d277ca7d..97f34eb78f 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -107,6 +107,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidSe import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 3525c3122f..60b0a8ab8d 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 76328c9ff6..537cb40ec5 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -108,6 +108,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidSe import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index ef74168537..4e93ae46f3 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 6b8bfc4e72..cd4c25bce8 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -120,6 +120,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 045bce2688..34f1dedc0d 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index e180adfecc..e78808ad72 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -133,6 +133,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index e7ed7f79d9..1bd9892a87 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 983792745e..6f20378cd0 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -143,6 +143,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index e7ed7f79d9..1bd9892a87 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index b0721035ab..97faf0b214 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -145,6 +145,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index e7ed7f79d9..1bd9892a87 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index eb058aae54..c0e3e1e6a5 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -157,6 +157,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 30b0f7b9c2..ccc2f58f67 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index f9101d3b6a..42a533284f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -77,6 +77,8 @@ import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRProduct import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRRecentProductList; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 30b0f7b9c2..ccc2f58f67 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index f32def2100..54f65f61bc 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -80,6 +80,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidBo import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidServerInfo; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 30b0f7b9c2..ccc2f58f67 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 321598c407..24bf734b5f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -80,6 +80,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidBo import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidServerInfo; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index c9285dc5a4..1753e9d155 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index a7809a6904..be906bd839 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -91,6 +91,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidSe import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index c9285dc5a4..1753e9d155 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index caba3c9067..4150637edf 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -92,6 +92,8 @@ import org.l2jmobius.gameserver.network.clientpackets.raidbossinfo.RequestRaidSe import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index e5cf8ba2f7..60feb19d8a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 7c32ce906b..a40ef6a527 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -104,6 +104,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 30b0f7b9c2..ccc2f58f67 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index bd43120859..d301d01cda 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -76,6 +76,8 @@ import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRProduct import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRRecentProductList; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index e5a2ab3b7b..90867caea7 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index cc9ea6ca54..af7d6c932c 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -128,6 +128,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 28b69b9409..e24538a5da 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 39b08ad5b3..fb48debcc6 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -142,6 +142,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 2e08fc92cb..d40fc41a63 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 09c1f802f7..6ee0b8fe77 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -154,6 +154,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index c6b80c82e8..e7c0ae175b 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED"; public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED"; + public static final String UI_KEY_MAPPING = "UI_KEY_MAPPING"; public static final String CLIENT_SETTINGS = "CLIENT_SETTINGS"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 77bbc1266d..fd209d8bca 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -165,6 +165,8 @@ import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestKeyMapping; +import org.l2jmobius.gameserver.network.clientpackets.settings.RequestSaveKeyMapping; import org.l2jmobius.gameserver.network.clientpackets.shuttle.CannotMoveAnymoreInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java deleted file mode 100644 index 9793d6e1d8..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/RequestKeyMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.GameClient; -import org.l2jmobius.gameserver.network.serverpackets.ExUISetting; - -/** - * @author KenM / mrTJO - */ -public class RequestKeyMapping implements IClientIncomingPacket -{ - @Override - public boolean read(GameClient client, PacketReader packet) - { - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (player == null) - { - return; - } - - if (Config.STORE_UI_SETTINGS) - { - player.sendPacket(new ExUISetting(player)); - } - } -} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java deleted file mode 100644 index edd7168438..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/RequestSaveKeyMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Config; -import org.l2jmobius.commons.network.PacketReader; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.ConnectionState; -import org.l2jmobius.gameserver.network.GameClient; - -/** - * Request Save Key Mapping client packet. - * @author Mobius - */ -public class RequestSaveKeyMapping implements IClientIncomingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - private byte[] _uiKeyMapping; - - @Override - public boolean read(GameClient client, PacketReader packet) - { - final int dataSize = packet.readD(); - if (dataSize > 0) - { - _uiKeyMapping = packet.readB(dataSize); - } - return true; - } - - @Override - public void run(GameClient client) - { - final Player player = client.getPlayer(); - if (!Config.STORE_UI_SETTINGS || // - (player == null) || // - (_uiKeyMapping == null) || // - (client.getConnectionState() != ConnectionState.IN_GAME)) - { - return; - } - - String uiKeyMapping = ""; - for (Byte b : _uiKeyMapping) - { - uiKeyMapping += b + SPLIT_VAR; - } - player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); - } -} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java new file mode 100644 index 0000000000..01a2ec7415 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestKeyMapping.java @@ -0,0 +1,51 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.settings.ExUISetting; + +/** + * @author KenM / mrTJO + */ +public class RequestKeyMapping implements IClientIncomingPacket +{ + @Override + public boolean read(GameClient client, PacketReader packet) + { + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (player == null) + { + return; + } + + if (Config.STORE_UI_SETTINGS) + { + player.sendPacket(new ExUISetting(player)); + } + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java new file mode 100644 index 0000000000..a0f45591b8 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/settings/RequestSaveKeyMapping.java @@ -0,0 +1,67 @@ +/* + * 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.settings; + +import org.l2jmobius.Config; +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.ConnectionState; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * Request Save Key Mapping client packet. + * @author Mobius + */ +public class RequestSaveKeyMapping implements IClientIncomingPacket +{ + public static final String SPLIT_VAR = " "; + + private byte[] _uiKeyMapping; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + final int dataSize = packet.readD(); + if (dataSize > 0) + { + _uiKeyMapping = packet.readB(dataSize); + } + return true; + } + + @Override + public void run(GameClient client) + { + final Player player = client.getPlayer(); + if (!Config.STORE_UI_SETTINGS || // + (player == null) || // + (_uiKeyMapping == null) || // + (client.getConnectionState() != ConnectionState.IN_GAME)) + { + return; + } + + String uiKeyMapping = ""; + for (Byte b : _uiKeyMapping) + { + uiKeyMapping += b + SPLIT_VAR; + } + player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java deleted file mode 100644 index 7bcddd964d..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/ExUISetting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.serverpackets; - -import org.l2jmobius.commons.network.PacketWriter; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.network.OutgoingPackets; - -/** - * @author Mobius - */ -public class ExUISetting implements IClientOutgoingPacket -{ - public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING"; - public static final String SPLIT_VAR = " "; - - private final byte[] _uiKeyMapping; - - public ExUISetting(Player player) - { - if (player.getVariables().hasVariable(UI_KEY_MAPPING_VAR)) - { - _uiKeyMapping = player.getVariables().getByteArray(UI_KEY_MAPPING_VAR, SPLIT_VAR); - } - else - { - _uiKeyMapping = null; - } - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_UI_SETTING.writeId(packet); - if (_uiKeyMapping != null) - { - packet.writeD(_uiKeyMapping.length); - packet.writeB(_uiKeyMapping); - } - else - { - packet.writeD(0); - } - return true; - } -} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java new file mode 100644 index 0000000000..6e5534b23b --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/settings/ExUISetting.java @@ -0,0 +1,61 @@ +/* + * 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.serverpackets.settings; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExUISetting implements IClientOutgoingPacket +{ + public static final String SPLIT_VAR = " "; + + private final byte[] _uiKeyMapping; + + public ExUISetting(Player player) + { + if (player.getVariables().hasVariable(PlayerVariables.UI_KEY_MAPPING)) + { + _uiKeyMapping = player.getVariables().getByteArray(PlayerVariables.UI_KEY_MAPPING, SPLIT_VAR); + } + else + { + _uiKeyMapping = null; + } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_UI_SETTING.writeId(packet); + if (_uiKeyMapping != null) + { + packet.writeD(_uiKeyMapping.length); + packet.writeB(_uiKeyMapping); + } + else + { + packet.writeD(0); + } + return true; + } +}