Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jFrozen_DataPack
- Index: sql/characters.sql
- ===================================================================
- --- sql/characters.sql (revision 986)
- +++ sql/characters.sql (working copy)
- @@ -88,3 +88,6 @@
- PRIMARY KEY (obj_Id),
- KEY `clanid` (`clanid`)
- ) ;
- +
- +ALTER TABLE `characters` ADD `pin` int(4) DEFAULT NULL;
- +ALTER TABLE `characters` ADD `pinsubmited` int(1) DEFAULT 1;
- \ No newline at end of file
- #P L2jFrozen_GameServer
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java (working copy)
- @@ -143,6 +143,12 @@
- activeChar.sendMessage("You may not chat while a chat ban is in effect.");
- return;
- }
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- if(activeChar.isInJail() && Config.JAIL_DISABLE_CHAT)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseDepositList.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseDepositList.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseDepositList.java (working copy)
- @@ -92,6 +92,12 @@
- if(manager == null || !player.isInsideRadius(manager, L2NpcInstance.INTERACTION_DISTANCE, false, false))
- return;
- +
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("deposit"))
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPrivateStoreSell.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPrivateStoreSell.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPrivateStoreSell.java (working copy)
- @@ -114,6 +114,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- L2Object object = L2World.getInstance().findObject(_storePlayerId);
- if (object == null || !(object instanceof L2PcInstance))
- return;
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendDel.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendDel.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendDel.java (working copy)
- @@ -75,6 +75,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- try
- {
- L2PcInstance friend = L2World.getInstance().getPlayer(_name);
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDropItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDropItem.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDropItem.java (working copy)
- @@ -74,6 +74,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // Flood protect drop to avoid packet lag
- if (!getClient().getFloodProtectors().getDropItem().tryPerformAction("drop item"))
- return;
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStartPledgeWar.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStartPledgeWar.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStartPledgeWar.java (working copy)
- @@ -60,6 +60,12 @@
- player.sendPacket(ActionFailed.STATIC_PACKET);
- return;
- }
- +
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- L2Clan clan = ClanTable.getInstance().getClanByName(_pledgeName);
- if(clan == null)
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDismissAlly.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDismissAlly.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDismissAlly.java (working copy)
- @@ -37,6 +37,12 @@
- if(activeChar == null)
- return;
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- if(!activeChar.isClanLeader())
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -23,6 +23,8 @@
- import java.util.regex.Pattern;
- import java.util.regex.PatternSyntaxException;
- +import javolution.text.TextBuilder;
- +
- import com.l2jfrozen.Config;
- import com.l2jfrozen.crypt.nProtect;
- import com.l2jfrozen.crypt.nProtect.RestrictionType;
- @@ -295,6 +297,45 @@
- if (Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)
- if (!activeChar.isAio())
- activeChar.checkAllowedSkills();
- +
- + if(!activeChar.getPincheck())
- + {
- + TextBuilder tb = new TextBuilder();
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- +
- + tb.append("<html><head><title>Character Pin Panel</title></head>");
- + tb.append("<body>");
- + tb.append("<center>");
- + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
- + tb.append("<tr>");
- + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
- + tb.append("<td valign=\"top\"><font color=\"FF6600\">Pin Panel</font>");
- + tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, use this interface to enable pin secirity.</td></tr></table></center>");
- + tb.append("<center>");
- + tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");
- + tb.append("</center>");
- + tb.append("<table width=\"350\" cellpadding=\"5\" bgcolor=\"000000\">");
- + tb.append("<tr>");
- + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"Icon.etc_old_key_i02\" width=\"32\" height=\"32\"></td>");
- + tb.append("<td valign=\"top\">Please enter your PIN:<edit var=\"dapin\" width=80 height=15>");
- + tb.append("<br1>info or something (can delete)</td>");
- + tb.append("</tr>");
- + tb.append("</table>");
- + tb.append("<br>");
- + tb.append("<center>");
- + tb.append("<button value=\"Submit\" action=\"bypass -h enterpin $dapin\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
- + tb.append("</center>");
- + tb.append("<center>");
- + tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
- + tb.append("<font color=\"FF6600\">By Elfocrash</font>");
- + tb.append("</center>");
- + tb.append("</body></html>");
- +
- + html.setHtml(tb.toString());
- + activeChar.sendPacket(html);
- + activeChar.setIsSubmitingPin(true);
- + activeChar.setIsImobilised(true);
- + }
- PetitionManager.getInstance().checkPetitionMessages(activeChar);
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -457,7 +457,7 @@
- /** SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, 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,good,evil,gve_kills 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, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, 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,pc_point,banchat_time,name_color,title_color,first_log,aio,aio_end 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, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, 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,"+/* in_jail, jail_timer,*/ "newbie, 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,pc_point"+/*,banchat_time*/",name_color,title_color,first_log,aio,aio_end 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, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, 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,"+/* in_jail, jail_timer,*/ "newbie, 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,pc_point"+/*,banchat_time*/",name_color,title_color,first_log,aio,aio_end,pinsubmited,pin FROM characters WHERE obj_id=?";
- /** The Constant STATUS_DATA_GET. */
- private static final String STATUS_DATA_GET = "SELECT hero, noble, donator, hero_end_date FROM characters_custom_data WHERE obj_Id = ?";
- @@ -10180,6 +10180,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"));
- @@ -20222,4 +20224,69 @@
- }
- sendSkillList();
- }
- +
- + public boolean _pincheck;
- + public int _pin;
- +
- + 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;
- + }
- +
- + public void updatePincheck()
- + {
- + Connection con = null;
- + try
- + {
- + 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);
- + }
- + finally
- + {
- + L2DatabaseFactory.close(con);
- + }
- + }
- }
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStopPledgeWar.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStopPledgeWar.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStopPledgeWar.java (working copy)
- @@ -45,6 +45,12 @@
- L2Clan playerClan = player.getClan();
- if(playerClan == null)
- return;
- +
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- L2Clan clan = ClanTable.getInstance().getClanByName(_pledgeName);
- if(clan == null)
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSetAllyCrest.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSetAllyCrest.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSetAllyCrest.java (working copy)
- @@ -69,6 +69,12 @@
- activeChar.sendMessage("The crest file size was too big (max 192 bytes).");
- return;
- }
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- if(activeChar.getAllyId() != 0)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
- @@ -96,6 +96,12 @@
- activeChar.sendMessage("Your trade canceled");
- return;
- }
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- // Fix enchant transactions
- if(activeChar.isProcessingTransaction())
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDestroyItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDestroyItem.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDestroyItem.java (working copy)
- @@ -58,8 +58,13 @@
- L2PcInstance activeChar = getClient().getActiveChar();
- if(activeChar == null)
- return;
- -
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if(_count <= 0)
- {
- if(_count < 0)
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java (working copy)
- @@ -62,6 +62,12 @@
- player.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
- return;
- }
- +
- + if (player.isSubmitingPin() || ((L2PcInstance) target).isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- L2PcInstance partner = (L2PcInstance) target;
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUnEquipItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUnEquipItem.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUnEquipItem.java (working copy)
- @@ -63,6 +63,12 @@
- activeChar.sendMessage("You can't unequip a CTF flag.");
- return;
- }
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- L2ItemInstance item = activeChar.getInventory().getPaperdollItemByL2ItemId(_slot);
- if(item != null && item.isWear())
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestCrystallizeItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestCrystallizeItem.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestCrystallizeItem.java (working copy)
- @@ -67,6 +67,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if(_count <= 0)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSellItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSellItem.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSellItem.java (working copy)
- @@ -91,6 +91,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // Alt game - Karma punishment
- if(!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() > 0)
- return;
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestExEnchantSkill.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestExEnchantSkill.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestExEnchantSkill.java (working copy)
- @@ -83,6 +83,12 @@
- if(player.getLevel() < 76)
- return;
- +
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- L2Skill skill = SkillTable.getInstance().getInfo(_skillId, _skillLvl);
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
- @@ -18,6 +18,10 @@
- */
- package com.l2jfrozen.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 java.util.logging.Logger;
- @@ -43,7 +47,9 @@
- import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
- import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
- import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- import com.l2jfrozen.gameserver.util.GMAudit;
- +import com.l2jfrozen.util.database.L2DatabaseFactory;
- public final class RequestBypassToServer extends L2GameClientPacket
- {
- @@ -61,7 +67,7 @@
- @Override
- protected void runImpl()
- {
- - L2PcInstance activeChar = getClient().getActiveChar();
- + final L2PcInstance activeChar = getClient().getActiveChar();
- if(activeChar == null)
- return;
- @@ -319,6 +325,131 @@
- {
- Olympiad.bypassChangeArena(_command, activeChar);
- }
- + 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;
- + }
- +
- + Connection con = null;
- + try
- + {
- + 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);
- + }
- + finally
- + {
- + L2DatabaseFactory.close(con);
- + }
- + }
- + }
- + 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());
- +
- + Connection con = null;
- + PreparedStatement statement = null;
- + try
- + {
- + 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.setIsImobilised(false);
- + activeChar.setIsSubmitingPin(false);
- + }
- + else
- + {
- + activeChar.sendMessage("Pin Code does not match with the submitted one.You will now get disconnected!");
- + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + activeChar.logout();
- + }
- + }, 2000);
- + }
- + }
- + catch (Exception e)
- + {
- +
- + activeChar.sendMessage("The Pin Code must be 4 numbers.");
- + }
- + finally
- + {
- + L2DatabaseFactory.close(con);
- + }
- + }
- + catch (Exception e)
- + {
- + //e.printStackTrace();
- + activeChar.sendMessage("The Pin Code MUST be 4 numbers.");
- + }
- +
- +
- +
- + }
- }
- catch(Exception e)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinAlly.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinAlly.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinAlly.java (working copy)
- @@ -54,6 +54,12 @@
- activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER));
- return;
- }
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- L2PcInstance target = (L2PcInstance) L2World.getInstance().findObject(_id);
- L2Clan clan = activeChar.getClan();
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeDone.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeDone.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeDone.java (working copy)
- @@ -48,7 +48,12 @@
- return;
- }
- -
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- TradeList trade = player.getActiveTradeList();
- if(trade == null)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy)
- @@ -75,6 +75,12 @@
- if (player == null)
- return;
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (!player.getAccessLevel().allowTransaction())
- {
- player.sendMessage("Transactions are disable for your Access Level");
- Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/Pin.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/Pin.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/Pin.java (revision 0)
- @@ -0,0 +1,84 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
- +
- +import javolution.text.TextBuilder;
- +
- +
- +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
- +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +
- +public class Pin implements IVoicedCommandHandler
- +{
- + private static String[] _voicedCommands =
- + {
- + "pincode"
- + };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + if(command.equalsIgnoreCase("pincode"))
- + {
- + if(activeChar.getPincheck())
- + {
- + TextBuilder tb = new TextBuilder();
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- +
- + tb.append("<html><head><title>Character Pin Panel</title></head>");
- + tb.append("<body>");
- + tb.append("<center>");
- + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
- + tb.append("<tr>");
- + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
- + tb.append("<td valign=\"top\"><font color=\"FF6600\">Pin Panel</font>");
- + tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, use this interface to enable pin secirity.</td></tr></table></center>");
- + tb.append("<center>");
- + tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");
- + tb.append("</center>");
- + tb.append("<table width=\"350\" cellpadding=\"5\" bgcolor=\"000000\">");
- + tb.append("<tr>");
- + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"Icon.etc_old_key_i02\" width=\"32\" height=\"32\"></td>");
- + tb.append("<td valign=\"top\">Please enter your PIN:<edit var=\"pin\" width=80 height=15>");
- + tb.append("<br1>info or something (can delete)</td>");
- + tb.append("</tr>");
- + tb.append("</table>");
- + tb.append("<br>");
- + tb.append("<center>");
- + tb.append("<button value=\"Submit\" action=\"bypass -h submitpin $pin\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
- + tb.append("</center>");
- + tb.append("<center>");
- + tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
- + tb.append("<font color=\"FF6600\">By Elfocrash</font>");
- + tb.append("</center>");
- + tb.append("</body></html>");
- +
- + html.setHtml(tb.toString());
- + activeChar.sendPacket(html);
- + }
- + else
- + activeChar.sendMessage("You have already submitted a Pin code");
- +
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return _voicedCommands;
- + }
- +}
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestWithdrawalPledge.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestWithdrawalPledge.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestWithdrawalPledge.java (working copy)
- @@ -58,6 +58,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- L2Clan clan = activeChar.getClan();
- clan.removeClanMember(activeChar.getName(), System.currentTimeMillis() + Config.ALT_CLAN_JOIN_DAYS * 86400000L); // 24*60*60*1000 = 86400000
- Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/L2Character.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java (working copy)
- @@ -11349,4 +11349,16 @@
- this.sendPacket(su);
- su = null;
- }
- +
- + public boolean _isSubmitingPin;
- +
- + public final void setIsSubmitingPin(boolean value)
- + {
- + _isSubmitingPin = value;
- + }
- +
- + public boolean isSubmitingPin()
- + {
- + return _isSubmitingPin;
- + }
- }
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPetition.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPetition.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPetition.java (working copy)
- @@ -47,6 +47,12 @@
- L2PcInstance activeChar = getClient().getActiveChar();
- 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))
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendInvite.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendInvite.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendInvite.java (working copy)
- @@ -65,6 +65,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin() || friend.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (activeChar.getBlockList().isInBlockList(_name))
- {
- sm = new SystemMessage(SystemMessageId.FAILED_TO_INVITE_A_FRIEND);
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSendFriendMsg.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSendFriendMsg.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSendFriendMsg.java (working copy)
- @@ -60,6 +60,12 @@
- activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME));
- return;
- }
- +
- + if (activeChar.isSubmitingPin() || targetPlayer.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- if(Config.LOG_CHAT)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseWithDrawList.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseWithDrawList.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseWithDrawList.java (working copy)
- @@ -87,6 +87,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- // Like L2OFF you can't confirm a withdraw when you are in trade.
- if(player.getActiveTradeList() != null)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (working copy)
- @@ -86,6 +86,12 @@
- return;
- }
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if (activeChar.getPrivateStoreType() != 0)
- {
- activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_TRADE_DISCARD_DROP_ITEM_WHILE_IN_SHOPMODE));
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java (working copy)
- @@ -96,6 +96,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- TradeList tradeList = player.getSellList();
- tradeList.clear();
- tradeList.setPackaged(_packageSale);
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinParty.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinParty.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinParty.java (working copy)
- @@ -66,6 +66,12 @@
- return;
- }
- + if (requestor.isSubmitingPin() || target.isSubmitingPin())
- + {
- + requestor.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- if ((requestor._inEventDM && (DM.is_teleport() || DM.is_started())) || (target._inEventDM && (DM.is_teleport() || DM.is_started())))
- {
- requestor.sendMessage("You can't invite that player in party!");
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPrivateStoreBuy.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (working copy)
- @@ -97,6 +97,12 @@
- return;
- }
- + if (player.isSubmitingPin())
- + {
- + player.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- +
- L2Object object = L2World.getInstance().findObject(_storePlayerId);
- if (object == null || !(object instanceof L2PcInstance))
- return;
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestShowMiniMap.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestShowMiniMap.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestShowMiniMap.java (working copy)
- @@ -39,6 +39,12 @@
- L2PcInstance activeChar = getClient().getActiveChar();
- if(activeChar == null)
- return;
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- activeChar.sendPacket(new ShowMiniMap(1665));
- }
- Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (working copy)
- @@ -32,6 +32,7 @@
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.OfflineShop;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Online;
- +import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Pin;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TvTCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VersionCmd;
- @@ -118,6 +119,8 @@
- registerVoicedCommandHandler(new OfflineShop());
- }
- + registerVoicedCommandHandler(new Pin());
- +
- _log.config("VoicedCommandHandler: Loaded " + _datatable.size() + " handlers.");
- }
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMagicSkillUse.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMagicSkillUse.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMagicSkillUse.java (working copy)
- @@ -70,6 +70,12 @@
- activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- return;
- }
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- // Get the L2Skill template corresponding to the skillID received from the client
- L2Skill skill = SkillTable.getInstance().getInfo(_magicId, level);
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java (revision 986)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java (working copy)
- @@ -61,6 +61,12 @@
- Util.handleIllegalPlayerAction(activeChar, "Warning!! Character " + activeChar.getName() + " of account " + activeChar.getAccountName() + " requested an internal Social Action.", Config.DEFAULT_PUNISH);
- return;
- }
- +
- + if (activeChar.isSubmitingPin())
- + {
- + activeChar.sendMessage("Unable to do any action while PIN is not submitted");
- + return;
- + }
- if(activeChar.getPrivateStoreType() == 0 && activeChar.getActiveRequester() == null && !activeChar.isAlikeDead() && (!activeChar.isAllSkillsDisabled() || activeChar.isInDuel()) && activeChar.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement