Key mapping packets moved to settings package.

This commit is contained in:
MobiusDevelopment
2022-06-12 22:40:56 +00:00
parent d5b27c2272
commit 57d8a9dc87
172 changed files with 3522 additions and 3361 deletions

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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_SCORE = "CEREMONY_OF_CHAOS_SCORE";
public static final String CEREMONY_OF_CHAOS_MARKS = "CEREMONY_OF_CHAOS_MARKS"; public static final String CEREMONY_OF_CHAOS_MARKS = "CEREMONY_OF_CHAOS_MARKS";
public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS";

View File

@@ -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.primeshop.RequestBRRecentProductList;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient; 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 * @author KenM / mrTJO

View File

@@ -14,13 +14,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; 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.ConnectionState;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/** /**
* Request Save Key Mapping client packet. * Request Save Key Mapping client packet.
@@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient;
*/ */
public class RequestSaveKeyMapping implements IClientIncomingPacket public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private byte[] _uiKeyMapping; private byte[] _uiKeyMapping;
@Override @Override
@@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
uiKeyMapping += b + SPLIT_VAR; uiKeyMapping += b + SPLIT_VAR;
} }
player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping);
} }
} }

View File

@@ -14,27 +14,28 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.serverpackets; package org.l2jmobius.gameserver.network.serverpackets.settings;
import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player; 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.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ExUISetting implements IClientOutgoingPacket public class ExUISetting implements IClientOutgoingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private final byte[] _uiKeyMapping; private final byte[] _uiKeyMapping;
public ExUISetting(Player player) 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 else
{ {

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";
public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE"; public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE";

View File

@@ -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.primeshop.RequestBRRecentProductList;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient; 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 * @author KenM / mrTJO

View File

@@ -14,13 +14,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; 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.ConnectionState;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/** /**
* Request Save Key Mapping client packet. * Request Save Key Mapping client packet.
@@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient;
*/ */
public class RequestSaveKeyMapping implements IClientIncomingPacket public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private byte[] _uiKeyMapping; private byte[] _uiKeyMapping;
@Override @Override
@@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
uiKeyMapping += b + SPLIT_VAR; uiKeyMapping += b + SPLIT_VAR;
} }
player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping);
} }
} }

View File

@@ -14,27 +14,28 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.serverpackets; package org.l2jmobius.gameserver.network.serverpackets.settings;
import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player; 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.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ExUISetting implements IClientOutgoingPacket public class ExUISetting implements IClientOutgoingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private final byte[] _uiKeyMapping; private final byte[] _uiKeyMapping;
public ExUISetting(Player player) 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 else
{ {

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";
public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE"; public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE";

View File

@@ -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.primeshop.RequestBRRecentProductList;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient; 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 * @author KenM / mrTJO

View File

@@ -14,13 +14,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; 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.ConnectionState;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/** /**
* Request Save Key Mapping client packet. * Request Save Key Mapping client packet.
@@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient;
*/ */
public class RequestSaveKeyMapping implements IClientIncomingPacket public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private byte[] _uiKeyMapping; private byte[] _uiKeyMapping;
@Override @Override
@@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
uiKeyMapping += b + SPLIT_VAR; uiKeyMapping += b + SPLIT_VAR;
} }
player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping);
} }
} }

View File

@@ -14,27 +14,28 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.serverpackets; package org.l2jmobius.gameserver.network.serverpackets.settings;
import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player; 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.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ExUISetting implements IClientOutgoingPacket public class ExUISetting implements IClientOutgoingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private final byte[] _uiKeyMapping; private final byte[] _uiKeyMapping;
public ExUISetting(Player player) 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 else
{ {

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";
public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE"; public static final String CEREMONY_OF_CHAOS_SCORE = "CEREMONY_OF_CHAOS_SCORE";

View File

@@ -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.raidbossinfo.RequestRaidServerInfo;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient; 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 * @author KenM / mrTJO

View File

@@ -14,13 +14,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.clientpackets; package org.l2jmobius.gameserver.network.clientpackets.settings;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player; 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.ConnectionState;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/** /**
* Request Save Key Mapping client packet. * Request Save Key Mapping client packet.
@@ -28,8 +30,8 @@ import org.l2jmobius.gameserver.network.GameClient;
*/ */
public class RequestSaveKeyMapping implements IClientIncomingPacket public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private byte[] _uiKeyMapping; private byte[] _uiKeyMapping;
@Override @Override
@@ -60,6 +62,6 @@ public class RequestSaveKeyMapping implements IClientIncomingPacket
{ {
uiKeyMapping += b + SPLIT_VAR; uiKeyMapping += b + SPLIT_VAR;
} }
player.getVariables().set(UI_KEY_MAPPING_VAR, uiKeyMapping); player.getVariables().set(PlayerVariables.UI_KEY_MAPPING, uiKeyMapping);
} }
} }

View File

@@ -14,27 +14,28 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.l2jmobius.gameserver.network.serverpackets; package org.l2jmobius.gameserver.network.serverpackets.settings;
import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player; 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.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ExUISetting implements IClientOutgoingPacket public class ExUISetting implements IClientOutgoingPacket
{ {
public static final String UI_KEY_MAPPING_VAR = "UI_KEY_MAPPING";
public static final String SPLIT_VAR = " "; public static final String SPLIT_VAR = " ";
private final byte[] _uiKeyMapping; private final byte[] _uiKeyMapping;
public ExUISetting(Player player) 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 else
{ {

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";
public static final String DAILY_MISSION_COUNT = "DAILY_MISSION_COUNT"; public static final String DAILY_MISSION_COUNT = "DAILY_MISSION_COUNT";

View File

@@ -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.raidbossinfo.RequestRaidServerInfo;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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 CLIENT_SETTINGS = "CLIENT_SETTINGS";
public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";

View File

@@ -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.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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 CLIENT_SETTINGS = "CLIENT_SETTINGS";
public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";

View File

@@ -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.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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 CLIENT_SETTINGS = "CLIENT_SETTINGS";
public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";

View File

@@ -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.sayune.RequestFlyMoveStart;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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 CLIENT_SETTINGS = "CLIENT_SETTINGS";
public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";

View File

@@ -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.sayune.RequestFlyMoveStart;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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 CLIENT_SETTINGS = "CLIENT_SETTINGS";
public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";

View File

@@ -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.sayune.RequestFlyMoveStart;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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 CLIENT_SETTINGS = "CLIENT_SETTINGS";
public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";

View File

@@ -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.sayune.RequestFlyMoveStart;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -44,6 +44,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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 CLIENT_SETTINGS = "CLIENT_SETTINGS";
public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE"; public static final String ATTENDANCE_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";

View File

@@ -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.sayune.RequestFlyMoveStart;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify; import org.l2jmobius.gameserver.network.clientpackets.settings.ExInteractModify;
import org.l2jmobius.gameserver.network.clientpackets.settings.ExSaveItemAnnounceSetting; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";
public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS";

View File

@@ -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.primeshop.RequestBRRecentProductList;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -43,6 +43,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED"; 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 WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_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_DATE = "ATTENDANCE_DATE";
public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX"; public static final String ATTENDANCE_INDEX = "ATTENDANCE_INDEX";
public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS"; public static final String ABILITY_POINTS_MAIN_CLASS = "ABILITY_POINTS";

View File

@@ -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.raidbossinfo.RequestRaidServerInfo;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove; import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMove;
import org.l2jmobius.gameserver.network.clientpackets.sayune.RequestFlyMoveStart; 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.CannotMoveAnymoreInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle; import org.l2jmobius.gameserver.network.clientpackets.shuttle.MoveToLocationInShuttle;
import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff; import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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));
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}

Some files were not shown because too many files have changed in this diff Show More