-
Posts
917 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by Saruman
-
java.lang.NumberFormatException: For input string: "<!DOCTYPE html>" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at com.l2jfrozen.gameserver.handler.VoteHandler.getTopZoneVotes(VoteHandler.java:68) at com.l2jfrozen.gameserver.handler.VoteHandler.tzvote(VoteHandler.java:84) at com.l2jfrozen.gameserver.model.actor.instance.L2VoteManager1Instance.onBypassFeedback(L2VoteManag at com.l2jfrozen.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServe at com.l2jfrozen.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:77) at com.l2jfrozen.gameserver.network.L2GameClient.run(L2GameClient.java:1213) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) java.lang.NumberFormatException: For input string: "<!DOCTYPE html>" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at com.l2jfrozen.gameserver.handler.VoteHandler.getTopZoneVotes(VoteHandler.java:68) at com.l2jfrozen.gameserver.handler.VoteHandler$1tzvotetask.run(VoteHandler.java:99) at com.l2jfrozen.gameserver.thread.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:95) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) i get this error on gs console.
-
what a fail you are on your topzone banner it says another enchant rates than here,PROSERVERUCOMINGSOON
- 44 replies
-
- l2revo reopen
- l2revo
-
(and 2 more)
Tagged with:
-
My vote system was working correctly,but today it doesnt? any help? thanks /* * 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; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import org.apache.log4j.Logger; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.util.CloseUtil; import com.l2jfrozen.util.database.L2DatabaseFactory; public class VoteHandler { protected static final Logger LOGGER = Logger.getLogger(VoteHandler.class); public VoteHandler() { } protected static int getTopZoneVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(Config.VOTES_SITE_TOPZONE_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2TopZone"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("Votes")) { String votesLine = inputLine; votes = Integer.valueOf(votesLine.split(">")[2].replace("</div", "")); break; } } } catch (Exception e) { e.printStackTrace(); } return votes; } public static void tzvote(final L2PcInstance player) { long LastTZVote = 0L; long voteDelay = 43200000L; final int actualvotes; actualvotes = getTopZoneVotes(); class tzvotetask implements Runnable { private final L2PcInstance p; public tzvotetask(L2PcInstance player) { p = player; } @Override public void run() { if (actualvotes < getTopZoneVotes()) { p.setIsVoting(false); VoteHandler.updateLastTZVote(p); p.sendPacket(new ExShowScreenMessage("Thanks for Voting. You are rewarded with 10 Vote Stone.", 6000)); p.sendMessage("Thanks for Voting. You are rewarded with 10 Vote Stone."); player.getInventory().addItem("TZreward", 7570, 10, player, null); } else { p.setIsVoting(false); p.sendPacket(new ExShowScreenMessage("You didn't vote. Try Again Later", 6000)); p.sendMessage("You didn't vote. Try Again Later."); } } } PreparedStatement statement = null; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); statement = con.prepareStatement("SELECT LastTZVote FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { LastTZVote = rset.getLong("LastTZVote"); } rset.close(); rset = null; statement.execute(); statement.close(); statement = null; } catch (Exception e) { e.printStackTrace(); } finally { CloseUtil.close(con); con = null; } if ((LastTZVote + voteDelay) < System.currentTimeMillis()) { for (L2PcInstance actualchar : L2World.getInstance().getAllPlayers()) { if (actualchar.isVoting()) { player.sendPacket(new ExShowScreenMessage(actualchar.getName()+", is voting now. Please wait for a while.", 6000)); player.sendMessage(actualchar.getName()+", is voting now. Please wait for a while."); return; } } player.setIsVoting(true); player.sendPacket(new ExShowScreenMessage("You have 40 Seconds to vote on Topzone.", 6000)); player.sendMessage("You have 40 Seconds to vote on Topzone."); ThreadPoolManager.getInstance().scheduleGeneral(new tzvotetask(player), 40 * 880); } else { player.sendPacket(new ExShowScreenMessage("You can vote only once every 12 hours.", 6000)); player.sendMessage("You can vote only once every 12 hours."); } } public static void updateLastTZVote(L2PcInstance player) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement statement = con.prepareStatement("UPDATE characters SET LastTZVote=? WHERE obj_Id=?"); statement.setLong(1, System.currentTimeMillis()); statement.setInt(2, player.getObjectId()); statement.execute(); statement.close(); statement = null; } catch (Exception e) { e.printStackTrace(); } finally { CloseUtil.close(con); con = null; } } protected static int getHopZoneVotes() { int votes = -1; try { final WebClient webClient = new WebClient(BrowserVersion.CHROME); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setPrintContentOnFailingStatusCode(false); webClient.setJavaScriptEngine(new JavaScriptEngine(webClient)); final HtmlPage page = webClient.getPage(Config.VOTES_SITE_HOPZONE_URL); String fullPage = page.asXml(); int constrainA = fullPage.indexOf("rank anonymous tooltip") + 24; String voteSection = fullPage.substring(constrainA); int constrainB = voteSection.indexOf("span") - 2; voteSection = voteSection.substring(0, constrainB).trim(); votes = Integer.parseInt(voteSection); page.cleanUp(); webClient.getJavaScriptEngine().shutdown(); webClient.closeAllWindows(); } catch (IOException e) { System.out.println("[VoteRewardManager]: Problem occured while getting Hopzone votes. Error Trace: " + e.getMessage()); } return votes; } public static void HZvote(final L2PcInstance player) { long LastHZVote = 0L; long voteDelay = 43200000L; final int actualvotes; actualvotes = getHopZoneVotes(); class hpvotetask implements Runnable { private final L2PcInstance p; public hpvotetask(L2PcInstance player) { p = player; } @Override public void run() { if (actualvotes < getHopZoneVotes()) { p.setIsVoting(false); VoteHandler.updateLastHZVote(p); p.sendPacket(new ExShowScreenMessage("Thanks for Voting. You are rewarded with 10 Vote Stone.", 6000)); p.sendMessage("Thanks for Voting. You are rewarded with 10 Vote Stone."); player.getInventory().addItem("TZreward", 7570, 10, player, null); } else { p.setIsVoting(false); p.sendPacket(new ExShowScreenMessage("You didn't vote. Try Again Later", 6000)); p.sendMessage("You didn't vote. Try Again Later."); } } } PreparedStatement statement = null; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); statement = con.prepareStatement("SELECT LastHZVote FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { LastHZVote = rset.getLong("LastHZVote"); } rset.close(); rset = null; statement.execute(); statement.close(); statement = null; } catch (Exception e) { e.printStackTrace(); } finally { CloseUtil.close(con); con = null; } if ((LastHZVote + voteDelay) < System.currentTimeMillis()) { for (L2PcInstance actualchar : L2World.getInstance().getAllPlayers()) { if (actualchar.isVoting()) { player.sendPacket(new ExShowScreenMessage(actualchar.getName()+", is voting now. Please wait for a while.", 6000)); player.sendMessage(actualchar.getName()+", is voting now. Please wait for a while."); return; } } player.setIsVoting(true); player.sendPacket(new ExShowScreenMessage("You have 40 Seconds to vote on Hopzone.", 6000)); player.sendMessage("You have 40 Seconds to vote on Hopzone."); ThreadPoolManager.getInstance().scheduleGeneral(new hpvotetask(player), 40 * 880); } else { player.sendPacket(new ExShowScreenMessage("You can vote only once every 12 hours.", 6000)); player.sendMessage("You can vote only once every 12 hours"); } } public static void updateLastHZVote(L2PcInstance player) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement statement = con.prepareStatement("UPDATE characters SET LastHZVote=? WHERE obj_Id=?"); statement.setLong(1, System.currentTimeMillis()); statement.setInt(2, player.getObjectId()); statement.execute(); statement.close(); statement = null; } catch (Exception e) { e.printStackTrace(); } finally { CloseUtil.close(con); con = null; } } protected static int getL2NetworkVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(Config.VOTES_SITE_L2NETWORK_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2Network"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("color:#e7ebf2")) { votes = Integer.valueOf(inputLine.split(">")[2].replace("</b", "")); break; } } } catch (Exception e) { e.printStackTrace(); } return votes; } public static void NZvote(final L2PcInstance player) { long LastNZVote = 0L; long voteDelay = 43200000L; final int actualvotes; actualvotes = getL2NetworkVotes(); class nzvotetask implements Runnable { private final L2PcInstance p; public nzvotetask(L2PcInstance player) { p = player; } @Override public void run() { if (actualvotes < getL2NetworkVotes()) { p.setIsVoting(false); VoteHandler.updateLastNZVote(p); p.sendPacket(new ExShowScreenMessage("Thanks for Voting. You are rewarded with 10 Vote Stone.", 6000)); p.sendMessage("Thanks for Voting. You are rewarded with 10 Vote Stone."); player.getInventory().addItem("NZreward", 7570, 10, player, null); } else { p.setIsVoting(false); p.sendPacket(new ExShowScreenMessage("You didn't vote. Try Again Later", 6000)); p.sendMessage("You didn't vote. Try Again Later."); } } } PreparedStatement statement = null; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); statement = con.prepareStatement("SELECT LastNZVote FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { LastNZVote = rset.getLong("LastNZVote"); } rset.close(); rset = null; statement.execute(); statement.close(); statement = null; } catch (Exception e) { e.printStackTrace(); } finally { CloseUtil.close(con); con = null; } if ((LastNZVote + voteDelay) < System.currentTimeMillis()) { for (L2PcInstance actualchar : L2World.getInstance().getAllPlayers()) { if (actualchar.isVoting()) { player.sendPacket(new ExShowScreenMessage(actualchar.getName()+", is voting now. Please wait for a while.", 6000)); player.sendMessage(actualchar.getName()+", is voting now. Please wait for a while."); return; } } player.setIsVoting(true); player.setIsVoting(true); player.sendPacket(new ExShowScreenMessage("You have 40 Seconds to vote on Network.", 6000)); player.sendMessage("You have 40 Seconds to vote on Network."); ThreadPoolManager.getInstance().scheduleGeneral(new nzvotetask(player), 40 * 880); } else { player.sendPacket(new ExShowScreenMessage("You can vote only once every 12 hours.", 6000)); player.sendMessage("You can vote only once every 12 hours."); } } public static void updateLastNZVote(L2PcInstance player) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement statement = con.prepareStatement("UPDATE characters SET LastNZVote=? WHERE obj_Id=?"); statement.setLong(1, System.currentTimeMillis()); statement.setInt(2, player.getObjectId()); statement.execute(); statement.close(); statement = null; } catch (Exception e) { e.printStackTrace(); } finally { CloseUtil.close(con); con = null; } } } autovoterewardhandler package com.l2jfrozen.gameserver.handler; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import org.apache.log4j.Level; import org.apache.log4j.Logger; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.powerpak.PowerPakConfig; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; public class AutoVoteRewardHandler { protected static final Logger LOGGER = Logger.getLogger(AutoVoteRewardHandler.class); private int _l2networkVotesCount = 0; private int hopzoneVotesCount = 0; private int topzoneVotesCount = 0; protected List<String> already_rewarded; protected static boolean l2network = false; protected static boolean topzone = false; protected static boolean hopzone = false; private AutoVoteRewardHandler() { LOGGER.info("Vote Reward System Initiated."); if (hopzone) { int hopzone_votes = getHopZoneVotes(); if (hopzone_votes == -1) { hopzone_votes = 0; } setHopZoneVoteCount(hopzone_votes); } if (l2network) { int l2network_votes = getL2NetworkVotes(); if (l2network_votes == -1) { l2network_votes = 0; } setL2NetworkVoteCount(l2network_votes); } if (topzone) { int topzone_votes = getTopZoneVotes(); if (topzone_votes == -1) { topzone_votes = 0; } setTopZoneVoteCount(topzone_votes); } ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), 1000 * 60 * PowerPakConfig.VOTES_SYSYEM_INITIAL_DELAY, 1000 * 60 * PowerPakConfig.VOTES_SYSYEM_STEP_DELAY); } protected class AutoReward implements Runnable { @Override public void run() { final int minutes = (PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 1000) / 60; if (hopzone) { final int hopzone_votes = getHopZoneVotes(); if (hopzone_votes != -1) { LOGGER.info("Server on HopZone have: " + hopzone_votes +" Votes!"); Announcements.getInstance().gameAnnounceToAll("[Vote System] L2Server Votes on Hopzone " + hopzone_votes); if (hopzone_votes != 0 && hopzone_votes >= getHopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[Vote System] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setHopZoneVoteCount(hopzone_votes); } Announcements.getInstance().gameAnnounceToAll("[Vote System] Next Reward in " + minutes + " minutes at " + (getHopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[Vote System] " + PowerPakConfig.SERVER_WEB_SITE); } } if (topzone && hopzone && PowerPakConfig.VOTES_SYSYEM_STEP_DELAY > 0) try { Thread.sleep(PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 2); } catch (final InterruptedException e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } if (topzone) { final int topzone_votes = getTopZoneVotes(); if (topzone_votes != -1) { LOGGER.info("Server on TopZone have: " + topzone_votes +" Votes!"); Announcements.getInstance().gameAnnounceToAll("[Vote System] L2Server Votes on Topzone " + topzone_votes); if (topzone_votes != 0 && topzone_votes >= getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[Vote System] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setTopZoneVoteCount(topzone_votes); } Announcements.getInstance().gameAnnounceToAll("[Vote System] Next Reward in " + minutes + " minutes at " + (getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[Vote System] " + PowerPakConfig.SERVER_WEB_SITE); } } if (topzone && hopzone && l2network && PowerPakConfig.VOTES_SYSYEM_STEP_DELAY > 0) { try { Thread.sleep(PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 2); } catch (final InterruptedException e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } } if (l2network) { final int l2network_votes = getL2NetworkVotes(); if (l2network_votes != -1) { LOGGER.info("Server on L2NetWork have: " + l2network_votes +" Votes!"); Announcements.getInstance().gameAnnounceToAll("[Vote System] L2Server Votes on L2Network " + l2network_votes); if (l2network_votes != 0 && l2network_votes >= getL2NetworkVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[Vote System] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setL2NetworkVoteCount(l2network_votes); } Announcements.getInstance().gameAnnounceToAll("[Vote System] Next Reward in " + minutes + " minutes at " + (getL2NetworkVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[Vote System] " + PowerPakConfig.SERVER_WEB_SITE); } } } } protected boolean checkSingleBox(final L2PcInstance player) { if (player.getClient() != null && player.getClient().getConnection() != null && !player.getClient().getConnection().isClosed() && !player.isInOfflineMode()) { final String playerip = player.getClient().getConnection().getInetAddress().getHostAddress(); if (already_rewarded.contains(playerip)) return false; already_rewarded.add(playerip); return true; } return false; } protected int getHopZoneVotes() { int votes; votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { String inputLine; url = new URL(PowerPakConfig.VOTES_SITE_HOPZONE_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "Mozilla/4.76"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); while ((inputLine = in.readLine()) != null) { if (!inputLine.contains("rank anonymous tooltip")) continue; votes = Integer.valueOf(inputLine.split(">")[2].replace("</span", "")); break; } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server HOPZONE is offline or something is wrong in link"); Announcements.getInstance().gameAnnounceToAll("[AutoVoteReward] HOPZONE is offline. We will check reward as it will be online again"); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } protected int getTopZoneVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(PowerPakConfig.VOTES_SITE_TOPZONE_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2TopZone"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { votes = Integer.valueOf(inputLine); break; } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server TOPZONE is offline or something is wrong in link"); // Announcements.getInstance().gameAnnounceToAll("[AutoVoteReward] TOPZONE is offline. We will check reward as it will be online again"); // e.printStackTrace(); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } protected int getL2NetworkVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(PowerPakConfig.VOTES_SITE_L2NETWORK_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2Network"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("color:#e7ebf2")) { votes = Integer.valueOf(inputLine.split(">")[2].replace("</b", "")); break; } } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server L2NETWORK is offline or something is wrong in link"); // e.printStackTrace(); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } protected void setHopZoneVoteCount(final int voteCount) { hopzoneVotesCount = voteCount; } protected int getHopZoneVoteCount() { return hopzoneVotesCount; } protected void setTopZoneVoteCount(final int voteCount) { topzoneVotesCount = voteCount; } protected int getTopZoneVoteCount() { return topzoneVotesCount; } protected void setL2NetworkVoteCount(final int voteCount) { _l2networkVotesCount = voteCount; } protected int getL2NetworkVoteCount() { return _l2networkVotesCount; } public static AutoVoteRewardHandler getInstance() { Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF); if (PowerPakConfig.VOTES_SITE_HOPZONE_URL != null && !PowerPakConfig.VOTES_SITE_HOPZONE_URL.equals("")) { hopzone = true; } if (PowerPakConfig.VOTES_SITE_TOPZONE_URL != null && !PowerPakConfig.VOTES_SITE_TOPZONE_URL.equals("")) { topzone = true; } if (PowerPakConfig.VOTES_SITE_L2NETWORK_URL != null && !PowerPakConfig.VOTES_SITE_L2NETWORK_URL.equals("")) { l2network = true; } if (topzone || hopzone || l2network) return SingletonHolder._instance; return null; } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler(); } }
-
not smth against you,but with these features,max 2-3 days.
-
50 or less on,confirmed.
-
Still looking for this,pm me with previews.
-
ok :)
-
baksteen server=i need codes plz some1 help me
-
Im looking for Donate Manager for interlude l2jfrozen sources,pm me with preview/prices. i want things like: Buy Augment active/passive Clan level up/skills Weapon/armor/jewel + to the max and more.
-
WTS Website Full With Domain + Hosting
Saruman replied to Deathboss's topic in Web Development/Designing
Best of luck but with this price it gonna be hard i think. -
Help Cant Connect To Vanganath Server
Saruman replied to zemaitis's question in Request Server Development Help [L2OFF]
server side settings probably. -
why you cant accept money safe?with a moneysafe and a paypal account the buyer can choose the 2nd method of payments and pay you with "paypal"
-
good luck.
-
yes,its local now,so it may be the problem,thanks,ill check it again once my vps is ready :)
-
i vote but it doesnt work.it says: you haven't voted: /* 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 2, 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package com.l2jfrozen.gameserver.model.actor.instance; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.handler.VoteHandler; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; public class L2VoteManagerInstance extends L2FolkInstance { public L2VoteManagerInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { if(player == null) { return; } if (command.startsWith("votetopzone")) { VoteHandler.tzvote(player); } if (command.startsWith("votehopzone")) { VoteHandler.HZvote(player); } if (command.startsWith("votenetwork")) { VoteHandler.NZvote(player); } } @Override public void onAction(L2PcInstance player) { if (!canTarget(player)) { return; } if (this != player.getTarget()) { player.setTarget(this); player.sendPacket(new MyTargetSelected(getObjectId(), 0)); player.sendPacket(new ValidateLocation(this)); } else if (!canInteract(player)) { player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); } else { showHtmlWindow(player); } player.sendPacket(new ActionFailed()); } private void showHtmlWindow(L2PcInstance activeChar) { activeChar.sendPacket(ActionFailed.STATIC_PACKET); String filename = "data/html/vote.htm"; NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(filename); html.replace("%objectId%", String.valueOf(getObjectId())); activeChar.sendPacket(html); } }
-
As the title says,pm me with-for informations. Pack/Source/Backup/Patch
-
WTB Anti-Bot (Adrenaline/l2Tower/l2Phx As Well Etc.)
Saruman replied to svipben's topic in Marketplace [L2Packs & Files]
why should i be mad from brain damaged peoples in forums ? :o -
WTB Anti-Bot (Adrenaline/l2Tower/l2Phx As Well Etc.)
Saruman replied to svipben's topic in Marketplace [L2Packs & Files]
wow,seems you are smarter than your antibot that u're looking for. -
WTB Anti-Bot (Adrenaline/l2Tower/l2Phx As Well Etc.)
Saruman replied to svipben's topic in Marketplace [L2Packs & Files]
u cant protect your server at 100%,simple. -
they wont understand it :)
- 178 replies
-
- Advanced Gameplay
- Grand Tournament
- (and 5 more)
-
ill not even stay 3 days on with 30 online,not smth against u but peoples does not like that type of servers.
- 178 replies
-
- Advanced Gameplay
- Grand Tournament
- (and 5 more)
-
<javac destdir="${build.classes}" includeantruntime="false" optimize="on" debug="on" source="1.7" target="1.7" encoding="utf-8" nowarn="off">
-
Armor New Armor For Interlude Chronicle
Saruman replied to Dan7E2's topic in Client Development Discussion
hmm,do it:) -
L2Realize accept me on skype or check forum message


