Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestDismissAlly.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestDismissAlly.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestDismissAlly.java (working copy)
- @@ -31,6 +31,13 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- +
- if (!activeChar.isClanLeader())
- {
- activeChar.sendPacket(SystemMessageId.FEATURE_ONLY_FOR_ALLIANCE_LEADER);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseDepositList.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseDepositList.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseDepositList.java (working copy)
- @@ -73,6 +73,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (player.getActiveEnchantItem() != null)
- {
- player.setActiveEnchantItem(null);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestStartPledgeWar.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestStartPledgeWar.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestStartPledgeWar.java (working copy)
- @@ -38,6 +38,12 @@
- if (player == null)
- return;
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- final L2Clan attackerClan = player.getClan();
- if (attackerClan == null)
- return;
- Index: java/net/sf/l2j/gameserver/handler/usercommandhandlers/Pin.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/usercommandhandlers/Pin.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/usercommandhandlers/Pin.java (revision 0)
- @@ -0,0 +1,78 @@
- +/*
- + * 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 net.sf.l2j.gameserver.handler.usercommandhandlers;
- +
- +import net.sf.l2j.gameserver.handler.IUserCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +
- +public class Pin implements IUserCommandHandler
- +{
- + private static final int[] COMMAND_IDS =
- + {
- + 666
- + };
- +
- + @Override
- + public boolean useUserCommand(int id, L2PcInstance activeChar)
- + {
- + if(activeChar.getPincheck())
- + {
- + StringBuilder sb = new StringBuilder();
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- +
- + sb.append("<html><head><title>Character Pin Panel</title></head>");
- + sb.append("<body>");
- + sb.append("<center>");
- + sb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
- + sb.append("<tr>");
- + sb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
- + sb.append("<td valign=\"top\"><font color=\"FF6600\">PIN Panel</font>");
- + sb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, use this interface to enable PIN security.</td></tr></table></center>");
- + sb.append("<center>");
- + sb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");
- + sb.append("</center>");
- + sb.append("<table width=\"350\" cellpadding=\"5\" bgcolor=\"000000\">");
- + sb.append("<tr>");
- + sb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"Icon.etc_old_key_i02\" width=\"32\" height=\"32\"></td>");
- + sb.append("<td valign=\"top\">Please enter your PIN:<edit var=\"pin\" width=80 height=15>");
- + sb.append("<br>Must contain 4 digits</td>");
- + sb.append("</tr>");
- + sb.append("</table>");
- + sb.append("<br>");
- + sb.append("<center>");
- + sb.append("<button value=\"Submit\" action=\"bypass -h submitpin $pin\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
- + sb.append("</center>");
- + sb.append("<center>");
- + sb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
- + sb.append("<font color=\"FF6600\">By Elfocrash</font>");
- + sb.append("</center>");
- + sb.append("</body></html>");
- +
- + html.setHtml(sb.toString());
- + activeChar.sendPacket(html);
- + }
- + else
- + activeChar.sendMessage("You have already submitted a Pin code");
- +
- + return true;
- + }
- +
- + @Override
- + public int[] getUserCommandList()
- + {
- + return COMMAND_IDS;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java (working copy)
- @@ -73,6 +73,12 @@
- if (!player.isInsideRadius(storePlayer, 150, true, false))
- return;
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (storePlayer.getPrivateStoreType() != L2PcInstance.STORE_PRIVATE_BUY)
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java (working copy)
- @@ -76,6 +76,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) || (player.isCastingNow() || player.isCastingSimultaneouslyNow()) || player.isInDuel())
- {
- player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java (working copy)
- @@ -48,6 +48,12 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- int count = _count;
- if (count <= 0)
- {
- Index: java/net/sf/l2j/gameserver/handler/UserCommandHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/UserCommandHandler.java (revision 315)
- +++ java/net/sf/l2j/gameserver/handler/UserCommandHandler.java (working copy)
- @@ -30,6 +30,7 @@
- import net.sf.l2j.gameserver.handler.usercommandhandlers.Mount;
- import net.sf.l2j.gameserver.handler.usercommandhandlers.OlympiadStat;
- import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
- +import net.sf.l2j.gameserver.handler.usercommandhandlers.Pin;
- import net.sf.l2j.gameserver.handler.usercommandhandlers.SiegeStatus;
- import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
- @@ -58,6 +59,7 @@
- registerUserCommandHandler(new Mount());
- registerUserCommandHandler(new OlympiadStat());
- registerUserCommandHandler(new PartyInfo());
- + registerUserCommandHandler(new Pin());
- registerUserCommandHandler(new SiegeStatus());
- registerUserCommandHandler(new Time());
- }
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (working copy)
- @@ -72,6 +72,12 @@
- if (storePlayer == null)
- return;
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (player.isCursedWeaponEquipped())
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java (working copy)
- @@ -61,6 +61,12 @@
- return;
- }
- + if (player.isSubmitingPin() || target.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // Alt game - Karma punishment
- if (!Config.KARMA_PLAYER_CAN_TRADE && (player.getKarma() > 0 || target.getKarma() > 0))
- {
- Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 315)
- +++ java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
- @@ -145,6 +145,7 @@
- private L2Skill _lastSkillCast;
- private L2Skill _lastSimultaneousSkillCast;
- + public boolean _isSubmitingPin;
- private boolean _isImmobilized = false;
- private boolean _isOverloaded = false;
- private boolean _isParalyzed = false;
- @@ -1910,6 +1911,16 @@
- return _isParalyzed || isAffected(L2EffectFlag.PARALYZED);
- }
- + public final void setIsSubmitingPin(boolean value)
- + {
- + _isSubmitingPin = value;
- + }
- +
- + public boolean isSubmitingPin()
- + {
- + return _isSubmitingPin;
- + }
- +
- public final void setIsParalyzed(boolean value)
- {
- _isParalyzed = value;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java (working copy)
- @@ -45,6 +45,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- final L2PcInstance target = L2World.getInstance().getPlayer(_id);
- if (target == null)
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -233,6 +233,45 @@
- sendPacket(html);
- }
- + if(!activeChar.getPincheck())
- + {
- + StringBuilder sb = new StringBuilder();
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- +
- + sb.append("<html><head><title>Character Pin Panel</title></head>");
- + sb.append("<body>");
- + sb.append("<center>");
- + sb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
- + sb.append("<tr>");
- + sb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
- + sb.append("<td valign=\"top\"><font color=\"FF6600\">Pin Panel</font>");
- + sb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, use this interface to enable pin secirity.</td></tr></table></center>");
- + sb.append("<center>");
- + sb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");
- + sb.append("</center>");
- + sb.append("<table width=\"350\" cellpadding=\"5\" bgcolor=\"000000\">");
- + sb.append("<tr>");
- + sb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"Icon.etc_old_key_i02\" width=\"32\" height=\"32\"></td>");
- + sb.append("<td valign=\"top\">Please enter your PIN:<edit var=\"dapin\" width=80 height=15>");
- + sb.append("<br1>info or something (can delete)</td>");
- + sb.append("</tr>");
- + sb.append("</table>");
- + sb.append("<br>");
- + sb.append("<center>");
- + sb.append("<button value=\"Submit\" action=\"bypass -h enterpin $dapin\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
- + sb.append("</center>");
- + sb.append("<center>");
- + sb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
- + sb.append("<font color=\"FF6600\">By Elfocrash</font>");
- + sb.append("</center>");
- + sb.append("</body></html>");
- +
- + html.setHtml(sb.toString());
- + activeChar.sendPacket(html);
- + activeChar.setIsSubmitingPin(true);
- + activeChar.setIsImmobilized(true);
- + }
- +
- PetitionManager.getInstance().checkPetitionMessages(activeChar);
- // no broadcast needed since the player will already spawn dead to others
- Index: java/net/sf/l2j/gameserver/network/clientpackets/TradeDone.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/TradeDone.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/TradeDone.java (working copy)
- @@ -73,6 +73,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // Sender under enchant process, close it.
- if (owner.getActiveEnchantItem() != null)
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestWithDrawalParty.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestWithDrawalParty.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestWithDrawalParty.java (working copy)
- @@ -40,6 +40,12 @@
- if (party == null)
- return;
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (party.isInDimensionalRift() && !party.getDimensionalRift().getRevivedAtWaitingRoom().contains(player))
- player.sendMessage("You can't exit party when you are in Dimensional Rift.");
- else
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestSendFriendMsg.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestSendFriendMsg.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestSendFriendMsg.java (working copy)
- @@ -59,6 +59,18 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- + if (targetPlayer.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted by the target");
- + return;
- + }
- +
- if (Config.LOG_CHAT)
- {
- LogRecord record = new LogRecord(Level.INFO, _message);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestSetAllyCrest.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestSetAllyCrest.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestSetAllyCrest.java (working copy)
- @@ -58,6 +58,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (activeChar.getAllyId() != 0)
- {
- L2Clan leaderclan = ClanTable.getInstance().getClan(activeChar.getAllyId());
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestShowMiniMap.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestShowMiniMap.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestShowMiniMap.java (working copy)
- @@ -31,6 +31,12 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- activeChar.sendPacket(ShowMiniMap.REGULAR_MAP);
- }
- }
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestCrystallizeItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestCrystallizeItem.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestCrystallizeItem.java (working copy)
- @@ -46,6 +46,12 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (_count <= 0)
- {
- Util.handleIllegalPlayerAction(activeChar, "[RequestCrystallizeItem] " + activeChar.getName() + "tried to crystallize an object but count was inferior to 0", IllegalPlayerAction.PUNISH_KICK);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java (working copy)
- @@ -55,6 +55,19 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- + if (friend.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted by the target");
- + return;
- + }
- +
- +
- if (BlockList.isBlocked(activeChar, friend))
- {
- activeChar.sendMessage("You have blocked " + _name + ".");
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestSocialAction.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestSocialAction.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestSocialAction.java (working copy)
- @@ -45,6 +45,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // check if the actionId is allowed
- if (_actionId < 2 || _actionId > 13)
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java (working copy)
- @@ -49,6 +49,13 @@
- if (activeChar == null || activeChar.isDead())
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- +
- if (!getClient().getFloodProtectors().getDropItem().tryPerformAction("dropItem"))
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java (working copy)
- @@ -109,6 +109,12 @@
- player.addAdena("Sell", totalPrice, merchant, false);
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // Send the htm, if existing.
- String htmlFolder = "";
- if (merchant instanceof L2MerchantInstance)
- Index: java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseWithDrawList.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseWithDrawList.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseWithDrawList.java (working copy)
- @@ -81,6 +81,12 @@
- player.sendPacket(SystemMessageId.ENCHANT_SCROLL_CANCELLED);
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- final ItemContainer warehouse = player.getActiveWarehouse();
- if (warehouse == null)
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java (working copy)
- @@ -43,6 +43,12 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (activeChar.isOutOfControl())
- {
- activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy)
- @@ -75,6 +75,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) || (player.isCastingNow() || player.isCastingSimultaneouslyNow()) || player.isInDuel())
- {
- player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (working copy)
- @@ -141,6 +141,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (_text.isEmpty())
- {
- _log.warning(activeChar.getName() + ": sending empty text. Possible packet hack.");
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestUnEquipItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestUnEquipItem.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestUnEquipItem.java (working copy)
- @@ -49,6 +49,12 @@
- if (item == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // Prevent of unequiping a cursed weapon
- if (_slot == L2Item.SLOT_LR_HAND && activeChar.isCursedWeaponEquipped())
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
- @@ -14,10 +14,14 @@
- */
- package net.sf.l2j.gameserver.network.clientpackets;
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- import java.util.StringTokenizer;
- import java.util.logging.Level;
- import net.sf.l2j.Config;
- +import net.sf.l2j.L2DatabaseFactory;
- import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
- import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
- import net.sf.l2j.gameserver.handler.AdminCommandHandler;
- @@ -179,6 +183,103 @@
- final int arenaId = Integer.parseInt(_command.substring(12).trim());
- activeChar.enterOlympiadObserverMode(arenaId);
- }
- + else if (_command.startsWith("submitpin"))
- + {
- + try
- + {
- + String value = _command.substring(9);
- + StringTokenizer s = new StringTokenizer(value," ");
- + int _pin = activeChar.getPin();
- +
- + try
- + {
- + if(activeChar.getPincheck())
- + {
- + _pin = Integer.parseInt(s.nextToken());
- + if(Integer.toString(_pin).length() != 4)
- + {
- + activeChar.sendMessage("You have to fill the pin box with 4 numbers.Not more, not less.");
- + return;
- + }
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET pin=? WHERE obj_id=?");
- +
- + statement.setInt(1, _pin);
- + statement.setInt(2, activeChar.getObjectId());
- + statement.execute();
- + statement.close();
- + activeChar.setPincheck(false);
- + activeChar.updatePincheck();
- + activeChar.sendMessage("You successfully submitted your pin code.You will need it in order to login.");
- + activeChar.sendMessage("Your Pin Code is: " + _pin );
- + }
- + catch(Exception e)
- + {
- + e.printStackTrace();
- + _log.warning("could not set char first login:" + e);
- + }
- + }
- + }
- + catch(Exception e)
- + {
- + activeChar.sendMessage("The Pin Code must be 4 numbers.");
- + }
- + }
- + catch(Exception e)
- + {
- + activeChar.sendMessage("The Pin Code must be 4 numbers.");
- + }
- +
- + }
- + else if(_command.startsWith("enterpin"))
- + {
- + try
- + {
- + String value = _command.substring(8);
- + StringTokenizer s = new StringTokenizer(value," ");
- + int dapin = 0;
- + int pin = 0;
- + dapin = Integer.parseInt(s.nextToken());
- +
- + PreparedStatement statement = null;
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + statement = con.prepareStatement("SELECT pin FROM characters WHERE obj_Id=?");
- + statement.setInt(1, activeChar.getObjectId());
- + ResultSet rset = statement.executeQuery();
- +
- + while (rset.next())
- + {
- + pin = rset.getInt("pin");
- + }
- +
- + if(pin == dapin)
- + {
- + activeChar.sendMessage("Pin Code Authenticated Successfully.You are now free to move.");
- + activeChar.setIsImmobilized(false);
- + activeChar.setIsSubmitingPin(false);
- + }
- + else
- + {
- + activeChar.sendMessage("Pin Code does not match with the submitted one.You will now get disconnected!");
- + wait(2);
- + activeChar.logout();
- + }
- + }
- + catch (Exception e)
- + {
- + activeChar.sendMessage("The Pin Code must be 4 numbers.");
- + }
- + }
- + catch (Exception e)
- + {
- + //e.printStackTrace();
- + activeChar.sendMessage("The Pin Code MUST be 4 numbers.");
- + }
- + }
- }
- catch (Exception e)
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java (working copy)
- @@ -52,6 +52,18 @@
- return;
- }
- + if (target.isSubmitingPin())
- + {
- + requestor.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- + if (requestor.isSubmitingPin())
- + {
- + requestor.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (BlockList.isBlocked(target, requestor))
- {
- requestor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_ADDED_YOU_TO_IGNORE_LIST).addPcName(target));
- Index: java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (working copy)
- @@ -77,6 +77,12 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (activeChar.isInStoreMode())
- {
- activeChar.sendPacket(SystemMessageId.ITEMS_UNAVAILABLE_FOR_STORE_MANUFACTURE);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestStopPledgeWar.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestStopPledgeWar.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestStopPledgeWar.java (working copy)
- @@ -50,6 +50,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (!playerClan.isAtWarWith(clan.getClanId()))
- {
- player.sendPacket(SystemMessageId.NOT_INVOLVED_IN_WAR);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java (working copy)
- @@ -56,6 +56,12 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (activeChar.getClassId().level() < 3 || activeChar.getLevel() < 76)
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendDel.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendDel.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendDel.java (working copy)
- @@ -43,6 +43,13 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- +
- int id = CharNameTable.getInstance().getIdByName(_name);
- if (id == -1 || !activeChar.getFriendList().contains(id))
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
- @@ -58,6 +58,13 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- +
- if (activeChar.isProcessingTransaction() || activeChar.isInStoreMode())
- {
- activeChar.sendPacket(SystemMessageId.CANNOT_ENCHANT_WHILE_STORE);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestWithdrawalPledge.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestWithdrawalPledge.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestWithdrawalPledge.java (working copy)
- @@ -42,6 +42,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (activeChar.isClanLeader())
- {
- activeChar.sendPacket(SystemMessageId.CLAN_LEADER_CANNOT_WITHDRAW);
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 315)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -262,7 +262,7 @@
- // Character SQL String Definitions:
- private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,nobless,power_grade,last_recom_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?";
- - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?";
- + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pinsubmited,pin FROM characters WHERE obj_id=?";
- // Character Subclass SQL String Definitions:
- private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
- @@ -385,6 +385,9 @@
- private PcAppearance _appearance;
- private int _charId = 0x00030b7a;
- + public boolean _pincheck;
- + public int _pin;
- +
- private long _expBeforeDeath;
- private int _karma;
- private int _pvpKills;
- @@ -5337,6 +5340,35 @@
- return _party;
- }
- + public void setPincheck(boolean pincheck)
- + {
- + _pincheck = pincheck;
- + }
- +
- + public void setPincheck(int pincheck)
- + {
- + _pincheck = false;
- + if(pincheck == 1)
- + {
- + _pincheck = true;
- + }
- + }
- +
- + public boolean getPincheck()
- + {
- + return _pincheck;
- + }
- +
- + public void setPin(int pin)
- + {
- + _pin = pin;
- + }
- +
- + public int getPin()
- + {
- + return _pin;
- + }
- +
- /**
- * Return True if the L2PcInstance is a GM.
- */
- @@ -5478,6 +5510,34 @@
- }
- }
- + public void updatePincheck()
- + {
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET pinsubmited=? WHERE obj_id=?");
- +
- + int _pin;
- +
- + if(getPincheck())
- + {
- + _pin = 1;
- + }
- + else
- + {
- + _pin = 0;
- + }
- + statement.setInt(1, _pin);
- + statement.setInt(2, getObjectId());
- + statement.execute();
- + statement.close();
- + }
- + catch(Exception e)
- + {
- + e.printStackTrace();
- + _log.warning("could not set char first login:" + e);
- + }
- + }
- +
- /**
- * Create a new player in the characters table of the database.
- * @return true if successful.
- @@ -5570,6 +5630,8 @@
- player.setHeading(rset.getInt("heading"));
- + player.setPincheck(rset.getInt("pinsubmited"));
- + player.setPin(rset.getInt("pin"));
- player.setKarma(rset.getInt("karma"));
- player.setPvpKills(rset.getInt("pvpkills"));
- player.setPkKills(rset.getInt("pkkills"));
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestPetition.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestPetition.java (revision 315)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestPetition.java (working copy)
- @@ -51,6 +51,12 @@
- if (activeChar == null)
- return;
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (!GmListTable.getInstance().isGmOnline(false))
- {
- activeChar.sendPacket(SystemMessageId.NO_GM_PROVIDING_SERVICE_NOW);
Advertisement
Add Comment
Please, Sign In to add comment