Jump to content

Recommended Posts

  • 2 months later...
Posted (edited)

There was a problem on getting server votes.

There was a problem on getting server votes.

 

la vita e bella
no steal make love
no votes here

 

But they haven't changed the  class="rank anonymous tooltip"

 

Can someone share the fix?

or skype

im paying for this fix

pm me please if you have

 

EDIT:

Thank you mirsadse

 

On the line 305 you will see this
 

if (line.contains("Anonymous User Votes"))

Replace it with:
if (line.contains("rank anonymous tooltip"))
 
Edited by rildojr
  • 1 month later...
Posted
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/custom/VoteRewardHopzone.java
===================================================================
--- java/net/sf/l2j/custom/VoteRewardHopzone.java	(revision 0)
+++ java/net/sf/l2j/custom/VoteRewardHopzone.java	(revision 0)
@@ -0,0 +1,317 @@
+/*
+ * 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.custom;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Collection;
+import java.util.HashMap;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+/**
+ * @author Anarchy
+ *
+ */
+public class VoteRewardHopzone
+{
+	// Configurations.
+	private static String hopzoneUrl = Config.HOPZONE_SERVER_LINK;
+	private static String page1Url = Config.HOPZONE_FIRST_PAGE_LINK;
+	private static int voteRewardVotesDifference = Config.HOPZONE_VOTES_DIFFERENCE;
+	private static int firstPageRankNeeded = Config.HOPZONE_FIRST_PAGE_RANK_NEEDED;
+	private static int checkTime = 60*1000*Config.HOPZONE_REWARD_CHECK_TIME;
+	
+	// Don't-touch variables.
+	private static int lastVotes = 0;
+	private static HashMap<String, Integer> playerIps = new HashMap<>();
+	
+	public static void updateConfigurations()
+	{
+		hopzoneUrl = Config.HOPZONE_SERVER_LINK;
+		page1Url = Config.HOPZONE_FIRST_PAGE_LINK;
+		voteRewardVotesDifference = Config.HOPZONE_VOTES_DIFFERENCE;
+		firstPageRankNeeded = Config.HOPZONE_FIRST_PAGE_RANK_NEEDED;
+		checkTime = 60*1000*Config.HOPZONE_REWARD_CHECK_TIME;
+	}
+	
+	public static void getInstance()
+	{
+		System.out.println("Hopzone - Vote reward system initialized.");
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
+		{
+			@Override
+			public void run()
+			{
+				if (Config.ALLOW_HOPZONE_VOTE_REWARD)
+				{
+					reward();
+				}
+				else
+				{
+					return;
+				}
+			}
+		}, checkTime/2, checkTime);
+	}
+	
+	static void reward()
+	{
+		int firstPageVotes = getFirstPageRankVotes();
+		int currentVotes = getVotes();
+		
+		if (firstPageVotes == -1 || currentVotes == -1)
+		{
+			if (firstPageVotes == -1)
+			{
+				System.out.println("There was a problem on getting Hopzone votes from server with rank "+firstPageRankNeeded+".");
+			}
+			if (currentVotes == -1)
+			{
+				System.out.println("There was a problem on getting Hopzone server votes.");
+			}
+			
+			return;
+		}
+		
+		if (lastVotes == 0)
+		{
+			lastVotes = currentVotes;
+			Announcements.announceToAll("Hopzone: Vote count is "+currentVotes+".");
+			Announcements.announceToAll("Hopzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for reward.");
+			if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+			{
+				System.out.println("Server votes on hopzone: "+currentVotes);
+				System.out.println("Votes needed for reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+			}
+			if (firstPageVotes-lastVotes <= 0)
+			{
+				Announcements.announceToAll("Hopzone: We are in the top "+firstPageRankNeeded+", so the reward will be big.");
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of hopzone.");
+				}
+			}
+			else
+			{
+				Announcements.announceToAll("Hopzone: We need "+(firstPageVotes-lastVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of Hopzone for big reward.");
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+				}
+			}
+			return;
+		}
+		
+		if (currentVotes >= lastVotes+voteRewardVotesDifference)
+		{
+			Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server is on the first page of hopzone.");
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Everyone has been rewarded with big reward.");
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.HOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.HOPZONE_BIG_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.HOPZONE_BIG_REWARD[i][0], Config.HOPZONE_BIG_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.HOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			else
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server votes needed for first page: "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Everyone has been rewarded with small reward.");
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Hopzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of Hopzone for big reward.");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.HOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.HOPZONE_SMALL_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.HOPZONE_SMALL_REWARD[i][0], Config.HOPZONE_SMALL_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.HOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			
+			lastVotes = currentVotes;
+		}
+		else
+		{
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server is on the first page of hopzone.");
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Hopzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for big reward.");
+			}
+			else
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server votes needed for first page: "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Hopzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for small reward.");
+				Announcements.announceToAll("Hopzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of Hopzone for big reward.");
+			}
+		}
+	}
+	
+	private static int getFirstPageRankVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(page1Url).openConnection();
+			con.addRequestProperty("User-Agent", "Mozilla/4.76");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			String line;
+			int i = 0;
+			while ((line = br.readLine()) != null)
+			{
+				if (line.contains("<span class=\"no\">"+firstPageRankNeeded+"</span>"))
+				{
+					i++;
+				}
+				if (line.contains("<span class=\"rank anonymous tooltip\"") && i == 1)
+				{
+					i = 0;
+					int votes = Integer.valueOf(line.replaceAll("[^\\d]", ""));
+					return votes;
+				}
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting Hopzone server vote count.");
+		}
+		
+		return -1;
+	}
+	
+	private static int getVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(hopzoneUrl).openConnection();
+			con.addRequestProperty("User-Agent", "Mozilla/4.76");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			String line;
+			while ((line = br.readLine()) != null)
+			{
+				if (line.contains("no steal make love")||line.contains("no votes here")||line.contains("bang, you don't have votes")|| line.contains("la vita e bella"))
+				{
+					int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));
+					return votes;
+				}
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting server vote count.");
+		}
+		
+		return -1;
+	}
+}
\ No newline at end of file
Index: java/net/sf/l2j/custom/VoteRewardTopzone.java
===================================================================
--- java/net/sf/l2j/custom/VoteRewardTopzone.java	(revision 0)
+++ java/net/sf/l2j/custom/VoteRewardTopzone.java	(revision 0)
@@ -0,0 +1,314 @@
+/*
+ * 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.custom;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Collection;
+import java.util.HashMap;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+/**
+ * @author Anarchy
+ *
+ */
+public class VoteRewardTopzone
+{
+	// Configurations.
+	private static String topzoneUrl = Config.TOPZONE_SERVER_LINK;
+	private static String page1Url = Config.TOPZONE_FIRST_PAGE_LINK;
+	private static int voteRewardVotesDifference = Config.TOPZONE_VOTES_DIFFERENCE;
+	private static int firstPageRankNeeded = Config.TOPZONE_FIRST_PAGE_RANK_NEEDED;
+	private static int checkTime = 60*1000*Config.TOPZONE_REWARD_CHECK_TIME;
+	
+	// Don't-touch variables.
+	private static int lastVotes = 0;
+	private static HashMap<String, Integer> playerIps = new HashMap<>();
+	
+	public static void updateConfigurations()
+	{
+		topzoneUrl = Config.TOPZONE_SERVER_LINK;
+		page1Url = Config.TOPZONE_FIRST_PAGE_LINK;
+		voteRewardVotesDifference = Config.TOPZONE_VOTES_DIFFERENCE;
+		firstPageRankNeeded = Config.TOPZONE_FIRST_PAGE_RANK_NEEDED;
+		checkTime = 60*1000*Config.TOPZONE_REWARD_CHECK_TIME;
+	}
+	
+	public static void getInstance()
+	{
+		System.out.println("Topzone - Vote reward system initialized.");
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
+		{
+			@Override
+			public void run()
+			{
+				if (Config.ALLOW_TOPZONE_VOTE_REWARD)
+				{
+					reward();
+				}
+				else
+				{
+					return;
+				}
+			}
+		}, checkTime/2, checkTime);
+	}
+	
+	static void reward()
+	{
+		int firstPageVotes = getFirstPageRankVotes();
+		int currentVotes = getVotes();
+		
+		if (firstPageVotes == -1 || currentVotes == -1)
+		{
+			if (firstPageVotes == -1)
+			{
+				System.out.println("There was a problem on getting Topzone votes from server with rank "+firstPageRankNeeded+".");
+			}
+			if (currentVotes == -1)
+			{
+				System.out.println("There was a problem on getting Topzone server votes.");
+			}
+			
+			return;
+		}
+		
+		if (lastVotes == 0)
+		{
+			lastVotes = currentVotes;
+			Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+			Announcements.announceToAll("Topzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for reward.");
+			if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+			{
+				System.out.println("Server votes on topzone: "+currentVotes);
+				System.out.println("Votes needed for reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+			}
+			if (firstPageVotes-lastVotes <= 0)
+			{
+				Announcements.announceToAll("Topzone: We are in the top "+firstPageRankNeeded+" of topzone, so the reward will be big.");
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of topzone.");
+				}
+			}
+			else
+			{
+				Announcements.announceToAll("Topzone: We need "+(firstPageVotes-lastVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of topzone for big reward.");
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+				}
+			}
+			return;
+		}
+		
+		if (currentVotes >= lastVotes+voteRewardVotesDifference)
+		{
+			Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of topzone.");
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Everyone has been rewarded with big reward.");
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.TOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.TOPZONE_BIG_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.TOPZONE_BIG_REWARD[i][0], Config.TOPZONE_BIG_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.TOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			else
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Everyone has been rewarded with small reward.");
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Topzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of topzone for big reward.");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.TOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.TOPZONE_SMALL_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.TOPZONE_SMALL_REWARD[i][0], Config.TOPZONE_SMALL_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.TOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			
+			lastVotes = currentVotes;
+		}
+		else
+		{
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of topzone.");
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Topzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for big reward.");
+			}
+			else
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Topzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for small reward.");
+				Announcements.announceToAll("Topzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of topzone for big reward.");
+			}
+		}
+	}
+	
+	private static int getFirstPageRankVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(page1Url).openConnection();
+			con.addRequestProperty("User-Agent", "L2TopZone");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			String line;
+			while ((line = br.readLine()) != null)
+			{
+				if(line.contains("<div class=\"slr\">"+firstPageRankNeeded))
+                {
+					int votes = Integer.valueOf(line.split(">")[4].replace("</span", ""));
+                	return votes;
+                }
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting server vote count.");
+		}
+		
+		return -1;
+	}
+	
+	private static int getVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(topzoneUrl).openConnection();
+			con.addRequestProperty("User-Agent", "L2TopZone");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			boolean got = false;
+			
+			String line;
+			while ((line = br.readLine()) != null)
+			{
+				if (line.contains("<div class=\"rank\"><div class=\"votes2\">Votes:<br>") && !got)
+				{
+					got = true;
+					int votes = Integer.valueOf(line.split("<div class=\"rank\"><div class=\"votes2\">Votes:<br>")[1].replace("</div></div>", ""));
+					return votes;
+				}
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting server vote count.");
+		}
+		
+		return -1;
+	}
+}
\ No newline at end of file

I just fixed the code cause Topzone changed some things , its for aCis 300 , working 100%

24m8c9x.jpg

Posted
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/custom/VoteRewardHopzone.java
===================================================================
--- java/net/sf/l2j/custom/VoteRewardHopzone.java	(revision 0)
+++ java/net/sf/l2j/custom/VoteRewardHopzone.java	(revision 0)
@@ -0,0 +1,317 @@
+/*
+ * 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.custom;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Collection;
+import java.util.HashMap;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+/**
+ * @author Anarchy
+ *
+ */
+public class VoteRewardHopzone
+{
+	// Configurations.
+	private static String hopzoneUrl = Config.HOPZONE_SERVER_LINK;
+	private static String page1Url = Config.HOPZONE_FIRST_PAGE_LINK;
+	private static int voteRewardVotesDifference = Config.HOPZONE_VOTES_DIFFERENCE;
+	private static int firstPageRankNeeded = Config.HOPZONE_FIRST_PAGE_RANK_NEEDED;
+	private static int checkTime = 60*1000*Config.HOPZONE_REWARD_CHECK_TIME;
+	
+	// Don't-touch variables.
+	private static int lastVotes = 0;
+	private static HashMap<String, Integer> playerIps = new HashMap<>();
+	
+	public static void updateConfigurations()
+	{
+		hopzoneUrl = Config.HOPZONE_SERVER_LINK;
+		page1Url = Config.HOPZONE_FIRST_PAGE_LINK;
+		voteRewardVotesDifference = Config.HOPZONE_VOTES_DIFFERENCE;
+		firstPageRankNeeded = Config.HOPZONE_FIRST_PAGE_RANK_NEEDED;
+		checkTime = 60*1000*Config.HOPZONE_REWARD_CHECK_TIME;
+	}
+	
+	public static void getInstance()
+	{
+		System.out.println("Hopzone - Vote reward system initialized.");
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
+		{
+			@Override
+			public void run()
+			{
+				if (Config.ALLOW_HOPZONE_VOTE_REWARD)
+				{
+					reward();
+				}
+				else
+				{
+					return;
+				}
+			}
+		}, checkTime/2, checkTime);
+	}
+	
+	static void reward()
+	{
+		int firstPageVotes = getFirstPageRankVotes();
+		int currentVotes = getVotes();
+		
+		if (firstPageVotes == -1 || currentVotes == -1)
+		{
+			if (firstPageVotes == -1)
+			{
+				System.out.println("There was a problem on getting Hopzone votes from server with rank "+firstPageRankNeeded+".");
+			}
+			if (currentVotes == -1)
+			{
+				System.out.println("There was a problem on getting Hopzone server votes.");
+			}
+			
+			return;
+		}
+		
+		if (lastVotes == 0)
+		{
+			lastVotes = currentVotes;
+			Announcements.announceToAll("Hopzone: Vote count is "+currentVotes+".");
+			Announcements.announceToAll("Hopzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for reward.");
+			if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+			{
+				System.out.println("Server votes on hopzone: "+currentVotes);
+				System.out.println("Votes needed for reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+			}
+			if (firstPageVotes-lastVotes <= 0)
+			{
+				Announcements.announceToAll("Hopzone: We are in the top "+firstPageRankNeeded+", so the reward will be big.");
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of hopzone.");
+				}
+			}
+			else
+			{
+				Announcements.announceToAll("Hopzone: We need "+(firstPageVotes-lastVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of Hopzone for big reward.");
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+				}
+			}
+			return;
+		}
+		
+		if (currentVotes >= lastVotes+voteRewardVotesDifference)
+		{
+			Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server is on the first page of hopzone.");
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Everyone has been rewarded with big reward.");
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.HOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.HOPZONE_BIG_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.HOPZONE_BIG_REWARD[i][0], Config.HOPZONE_BIG_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.HOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			else
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server votes needed for first page: "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Everyone has been rewarded with small reward.");
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Hopzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of Hopzone for big reward.");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.HOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.HOPZONE_SMALL_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.HOPZONE_SMALL_REWARD[i][0], Config.HOPZONE_SMALL_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.HOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			
+			lastVotes = currentVotes;
+		}
+		else
+		{
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server is on the first page of hopzone.");
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Hopzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for big reward.");
+			}
+			else
+			{
+				if (Config.ALLOW_HOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on hopzone: "+currentVotes);
+					System.out.println("Server votes needed for first page: "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Hopzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Hopzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for small reward.");
+				Announcements.announceToAll("Hopzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of Hopzone for big reward.");
+			}
+		}
+	}
+	
+	private static int getFirstPageRankVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(page1Url).openConnection();
+			con.addRequestProperty("User-Agent", "Mozilla/4.76");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			String line;
+			int i = 0;
+			while ((line = br.readLine()) != null)
+			{
+				if (line.contains("<span class=\"no\">"+firstPageRankNeeded+"</span>"))
+				{
+					i++;
+				}
+				if (line.contains("<span class=\"rank anonymous tooltip\"") && i == 1)
+				{
+					i = 0;
+					int votes = Integer.valueOf(line.replaceAll("[^\\d]", ""));
+					return votes;
+				}
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting Hopzone server vote count.");
+		}
+		
+		return -1;
+	}
+	
+	private static int getVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(hopzoneUrl).openConnection();
+			con.addRequestProperty("User-Agent", "Mozilla/4.76");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			String line;
+			while ((line = br.readLine()) != null)
+			{
+				if (line.contains("no steal make love")||line.contains("no votes here")||line.contains("bang, you don't have votes")|| line.contains("la vita e bella"))
+				{
+					int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));
+					return votes;
+				}
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting server vote count.");
+		}
+		
+		return -1;
+	}
+}
\ No newline at end of file
Index: java/net/sf/l2j/custom/VoteRewardTopzone.java
===================================================================
--- java/net/sf/l2j/custom/VoteRewardTopzone.java	(revision 0)
+++ java/net/sf/l2j/custom/VoteRewardTopzone.java	(revision 0)
@@ -0,0 +1,314 @@
+/*
+ * 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.custom;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Collection;
+import java.util.HashMap;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+/**
+ * @author Anarchy
+ *
+ */
+public class VoteRewardTopzone
+{
+	// Configurations.
+	private static String topzoneUrl = Config.TOPZONE_SERVER_LINK;
+	private static String page1Url = Config.TOPZONE_FIRST_PAGE_LINK;
+	private static int voteRewardVotesDifference = Config.TOPZONE_VOTES_DIFFERENCE;
+	private static int firstPageRankNeeded = Config.TOPZONE_FIRST_PAGE_RANK_NEEDED;
+	private static int checkTime = 60*1000*Config.TOPZONE_REWARD_CHECK_TIME;
+	
+	// Don't-touch variables.
+	private static int lastVotes = 0;
+	private static HashMap<String, Integer> playerIps = new HashMap<>();
+	
+	public static void updateConfigurations()
+	{
+		topzoneUrl = Config.TOPZONE_SERVER_LINK;
+		page1Url = Config.TOPZONE_FIRST_PAGE_LINK;
+		voteRewardVotesDifference = Config.TOPZONE_VOTES_DIFFERENCE;
+		firstPageRankNeeded = Config.TOPZONE_FIRST_PAGE_RANK_NEEDED;
+		checkTime = 60*1000*Config.TOPZONE_REWARD_CHECK_TIME;
+	}
+	
+	public static void getInstance()
+	{
+		System.out.println("Topzone - Vote reward system initialized.");
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
+		{
+			@Override
+			public void run()
+			{
+				if (Config.ALLOW_TOPZONE_VOTE_REWARD)
+				{
+					reward();
+				}
+				else
+				{
+					return;
+				}
+			}
+		}, checkTime/2, checkTime);
+	}
+	
+	static void reward()
+	{
+		int firstPageVotes = getFirstPageRankVotes();
+		int currentVotes = getVotes();
+		
+		if (firstPageVotes == -1 || currentVotes == -1)
+		{
+			if (firstPageVotes == -1)
+			{
+				System.out.println("There was a problem on getting Topzone votes from server with rank "+firstPageRankNeeded+".");
+			}
+			if (currentVotes == -1)
+			{
+				System.out.println("There was a problem on getting Topzone server votes.");
+			}
+			
+			return;
+		}
+		
+		if (lastVotes == 0)
+		{
+			lastVotes = currentVotes;
+			Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+			Announcements.announceToAll("Topzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for reward.");
+			if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+			{
+				System.out.println("Server votes on topzone: "+currentVotes);
+				System.out.println("Votes needed for reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+			}
+			if (firstPageVotes-lastVotes <= 0)
+			{
+				Announcements.announceToAll("Topzone: We are in the top "+firstPageRankNeeded+" of topzone, so the reward will be big.");
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of topzone.");
+				}
+			}
+			else
+			{
+				Announcements.announceToAll("Topzone: We need "+(firstPageVotes-lastVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of topzone for big reward.");
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+				}
+			}
+			return;
+		}
+		
+		if (currentVotes >= lastVotes+voteRewardVotesDifference)
+		{
+			Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of topzone.");
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Everyone has been rewarded with big reward.");
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.TOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.TOPZONE_BIG_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.TOPZONE_BIG_REWARD[i][0], Config.TOPZONE_BIG_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.TOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			else
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((currentVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Everyone has been rewarded with small reward.");
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Topzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of topzone for big reward.");
+				for (L2PcInstance p : pls)
+				{
+					boolean canReward = false;
+					String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
+					if (playerIps.containsKey(pIp))
+					{
+						int count = playerIps.get(pIp);
+						if (count < Config.TOPZONE_DUALBOXES_ALLOWED)
+						{
+							playerIps.remove(pIp);
+							playerIps.put(pIp, count+1);
+							canReward = true;
+						}
+					}
+					else
+					{
+						canReward = true;
+						playerIps.put(pIp, 1);
+					}
+					if (canReward)
+					{
+						for (int i = 0; i < Config.TOPZONE_SMALL_REWARD.length; i++)
+						{
+							p.addItem("Vote reward.", Config.TOPZONE_SMALL_REWARD[i][0], Config.TOPZONE_SMALL_REWARD[i][1], p, true);
+						}
+					}
+					else
+					{
+						p.sendMessage("Already "+Config.TOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
+					}
+				}
+				playerIps.clear();
+			}
+			
+			lastVotes = currentVotes;
+		}
+		else
+		{
+			if (firstPageVotes-currentVotes <= 0)
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server is on the top "+firstPageRankNeeded+" of topzone.");
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Topzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for big reward.");
+			}
+			else
+			{
+				if (Config.ALLOW_TOPZONE_GAME_SERVER_REPORT)
+				{
+					System.out.println("Server votes on topzone: "+currentVotes);
+					System.out.println("Server votes needed for top "+firstPageRankNeeded+": "+(firstPageVotes-lastVotes));
+					System.out.println("Votes needed for next reward: "+((lastVotes+voteRewardVotesDifference)-currentVotes));
+				}
+				Announcements.announceToAll("Topzone: Current vote count is "+currentVotes+".");
+				Announcements.announceToAll("Topzone: We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for small reward.");
+				Announcements.announceToAll("Topzone: We need "+(firstPageVotes-currentVotes)+" vote(s) to get to the top "+firstPageRankNeeded+" of topzone for big reward.");
+			}
+		}
+	}
+	
+	private static int getFirstPageRankVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(page1Url).openConnection();
+			con.addRequestProperty("User-Agent", "L2TopZone");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			String line;
+			while ((line = br.readLine()) != null)
+			{
+				if(line.contains("<div class=\"slr\">"+firstPageRankNeeded))
+                {
+					int votes = Integer.valueOf(line.split(">")[4].replace("</span", ""));
+                	return votes;
+                }
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting server vote count.");
+		}
+		
+		return -1;
+	}
+	
+	private static int getVotes()
+	{
+		InputStreamReader isr = null;
+		BufferedReader br = null;
+		
+		try
+		{
+			URLConnection con = new URL(topzoneUrl).openConnection();
+			con.addRequestProperty("User-Agent", "L2TopZone");
+			isr = new InputStreamReader(con.getInputStream());
+			br = new BufferedReader(isr);
+			
+			boolean got = false;
+			
+			String line;
+			while ((line = br.readLine()) != null)
+			{
+				if (line.contains("<div class=\"rank\"><div class=\"votes2\">Votes:<br>") && !got)
+				{
+					got = true;
+					int votes = Integer.valueOf(line.split("<div class=\"rank\"><div class=\"votes2\">Votes:<br>")[1].replace("</div></div>", ""));
+					return votes;
+				}
+			}
+			
+			br.close();
+			isr.close();
+		}
+		catch (Exception e)
+		{
+			System.out.println(e);
+			System.out.println("Error while getting server vote count.");
+		}
+		
+		return -1;
+	}
+}
\ No newline at end of file

I just fixed the code cause Topzone changed some things , its for aCis 300 , working 100%

24m8c9x.jpg

 

GZ SPIDEY with some adapt with this code work on freya and work and topzone and hopzone! GZ!

  • 4 weeks later...
  • 8 months later...
Posted
Exception in thread "GeneralSTPool-8" java.lang.NullPointerException
	at net.sf.l2j.gameserver.model.entity.VoteRewardTopzone.reward(VoteRewardTopzone.java:183)
	at net.sf.l2j.gameserver.model.entity.VoteRewardTopzone$1.run(VoteRewardTopzone.java:65)
	at net.sf.l2j.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:85)

183 line in my code - 

String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();

Maybe it's beacause of offline shops?

  • 1 month later...
Posted

you have to edit your getVotes() on hopzone ...... :) change your getVotes() with mine working aswell :)

 

protected static int getVotes()
{
InputStreamReader isr = null;
BufferedReader br = null;

try
{
if(!hopzoneUrl.endsWith(".html"))
hopzoneUrl+=".html";

URLConnection con = new URL(hopzoneUrl).openConnection();


con.addRequestProperty("User-L2Hopzone", "Mozilla/4.76");
isr = new InputStreamReader(con.getInputStream());
br = new BufferedReader(isr);

String line;
while ((line = br.readLine()) != null)
{
if (line.contains("no steal make love")||line.contains("no votes here")||line.contains("bang, you don't have votes")|| line.contains("la vita e bella"))
{
int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));

return votes;
}
}

br.close();
isr.close();
}
catch (Exception e)
{
System.out.println("[VoteRewardManager]: Problem occured while getting Hopzone votes. Error Trace: " + e.getMessage());
}
return -1;
}
  • 2 months later...
Posted

Does the reward go to all the players or only the players who voted? because i cant test it now. And if it goes to all the players can someone change it so only the players who vote get reward? Thanks.

  • 6 months later...
Posted (edited)

 

Hi, now topzone not working.

 

No get votes..

 

 
TopzoneFirstPageLink = http://l2topzone.com/lineage2/list

 

http://pastebin.com/ZtZhQw6q

 

Take the new one.

Edited by Devlin
Posted

Hello, i see most of you use old links from l2topzone.com. That why most of you get error and this system will not work.


Try to replace old link with the new one.


 


Old link :



http://l2topzone.com/lineage2/server-list/top.html

is now :



http://l2topzone.com/lineage2/list

Old server info link :



http://l2topzone.com/lineage2/server-info/7737/L2SpiritCustom.html

is now:



http://l2topzone.com/lineage/server-info/7737/l2sp-custom

Also if your vote reward is based on our previews design use this link to get  total votes:



http://l2topzone.com/totalvotes.php?id=YOUR_SERVER_ID

Good luck.


Guest
This topic is now closed to further replies.



  • Posts

    • 亲爱的朋友们! 我们非常高兴地与您分享来自 SocNet 团队的两条好消息! 1. 我们的 SMM 面板更新啦! 我们已全面审查并更新了可用服务列表 —— 现在面板中仅包含最相关、最稳定且真正有效的解决方案。 强烈推荐您立即体验全新升级的服务! ➡ 针对新客户的特别优惠:创建一个支持工单,主题填写 “Get Trial Balance”,即可获得 $1 余额,用于测试我们的任何 SMM 面板服务。 2. 我们的 Telegram Stars 机器人重大更新! 经过大量改进工作,我们很高兴向您展示全新版本的 SocNet Telegram Stars Bot,这是我们在过去一个月中精心开发的成果: ➡ 新增支持通过俄罗斯银行卡支付,并具备自动支付验证功能。 ➡ 实现自动汇率调整 —— 价格始终保持市场最低,包括 Split。 ➡ 新增独特的“礼物老虎机”游戏,每个人都有机会公平赢取丰厚奖品:Telegram Stars、Premium、高价值礼物、SOCNET.STORE 余额以及来自我们合作伙伴的更多惊喜。 感谢您一直以来的支持!✨ 加入我们 —— 每周我们都会在 Telegram 频道举办 Telegram Stars 和其他奖品的抽奖活动! SOCNET 商店有效链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 – 通过 Telegram 消息应用轻松访问商店。 Telegram Stars 购买机器人:前往 – 快速、便捷地购买 Telegram Stars。 SMM 面板:前往 – 推广您的社交媒体账户。 我们为您准备了当前平台的优惠与特别活动清单: 1. 优惠码 OCTOBER2025(8% 折扣)—— 在九月期间于我们的商店(网站或机器人)购物时使用! 您还可以使用首次购买优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在网站注册后,按照以下格式发布您的用户名:“SEND ME BONUS, MY USERNAME IS...” —— 在我们的论坛帖子中留言即可! 3. 获得 $1 SMM 面板首次试用余额 —— 只需在网站(支持中心)创建主题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道以及 Telegram Stars 购买机器人中都会举行 Telegram Stars 抽奖活动! 新闻动态: ➡ Telegram 频道:https://t.me/accsforyou_shop ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器:https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram:https://t.me/socnet_support ➡ WhatsApp:https://wa.me/79051904467 ➡ Discord:socnet_support ➡ ✉ 邮箱:solomonbog@socnet.store
    • 亲爱的朋友们! 我们非常高兴地与您分享来自 SocNet 团队的两条好消息! 1. 我们的 SMM 面板更新啦! 我们已全面审查并更新了可用服务列表 —— 现在面板中仅包含最相关、最稳定且真正有效的解决方案。 强烈推荐您立即体验全新升级的服务! ➡ 针对新客户的特别优惠:创建一个支持工单,主题填写 “Get Trial Balance”,即可获得 $1 余额,用于测试我们的任何 SMM 面板服务。 2. 我们的 Telegram Stars 机器人重大更新! 经过大量改进工作,我们很高兴向您展示全新版本的 SocNet Telegram Stars Bot,这是我们在过去一个月中精心开发的成果: ➡ 新增支持通过俄罗斯银行卡支付,并具备自动支付验证功能。 ➡ 实现自动汇率调整 —— 价格始终保持市场最低,包括 Split。 ➡ 新增独特的“礼物老虎机”游戏,每个人都有机会公平赢取丰厚奖品:Telegram Stars、Premium、高价值礼物、SOCNET.STORE 余额以及来自我们合作伙伴的更多惊喜。 感谢您一直以来的支持!✨ 加入我们 —— 每周我们都会在 Telegram 频道举办 Telegram Stars 和其他奖品的抽奖活动! SOCNET 商店有效链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 – 通过 Telegram 消息应用轻松访问商店。 Telegram Stars 购买机器人:前往 – 快速、便捷地购买 Telegram Stars。 SMM 面板:前往 – 推广您的社交媒体账户。 我们为您准备了当前平台的优惠与特别活动清单: 1. 优惠码 OCTOBER2025(8% 折扣)—— 在九月期间于我们的商店(网站或机器人)购物时使用! 您还可以使用首次购买优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在网站注册后,按照以下格式发布您的用户名:“SEND ME BONUS, MY USERNAME IS...” —— 在我们的论坛帖子中留言即可! 3. 获得 $1 SMM 面板首次试用余额 —— 只需在网站(支持中心)创建主题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道以及 Telegram Stars 购买机器人中都会举行 Telegram Stars 抽奖活动! 新闻动态: ➡ Telegram 频道:https://t.me/accsforyou_shop ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器:https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram:https://t.me/socnet_support ➡ WhatsApp:https://wa.me/79051904467 ➡ Discord:socnet_support ➡ ✉ 邮箱:solomonbog@socnet.store
    • 亲爱的朋友们! 我们非常高兴地与您分享来自 SocNet 团队的两条好消息! 1. 我们的 SMM 面板更新啦! 我们已全面审查并更新了可用服务列表 —— 现在面板中仅包含最相关、最稳定且真正有效的解决方案。 强烈推荐您立即体验全新升级的服务! ➡ 针对新客户的特别优惠:创建一个支持工单,主题填写 “Get Trial Balance”,即可获得 $1 余额,用于测试我们的任何 SMM 面板服务。 2. 我们的 Telegram Stars 机器人重大更新! 经过大量改进工作,我们很高兴向您展示全新版本的 SocNet Telegram Stars Bot,这是我们在过去一个月中精心开发的成果: ➡ 新增支持通过俄罗斯银行卡支付,并具备自动支付验证功能。 ➡ 实现自动汇率调整 —— 价格始终保持市场最低,包括 Split。 ➡ 新增独特的“礼物老虎机”游戏,每个人都有机会公平赢取丰厚奖品:Telegram Stars、Premium、高价值礼物、SOCNET.STORE 余额以及来自我们合作伙伴的更多惊喜。 感谢您一直以来的支持!✨ 加入我们 —— 每周我们都会在 Telegram 频道举办 Telegram Stars 和其他奖品的抽奖活动! SOCNET 商店有效链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 – 通过 Telegram 消息应用轻松访问商店。 Telegram Stars 购买机器人:前往 – 快速、便捷地购买 Telegram Stars。 SMM 面板:前往 – 推广您的社交媒体账户。 我们为您准备了当前平台的优惠与特别活动清单: 1. 优惠码 OCTOBER2025(8% 折扣)—— 在九月期间于我们的商店(网站或机器人)购物时使用! 您还可以使用首次购买优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在网站注册后,按照以下格式发布您的用户名:“SEND ME BONUS, MY USERNAME IS...” —— 在我们的论坛帖子中留言即可! 3. 获得 $1 SMM 面板首次试用余额 —— 只需在网站(支持中心)创建主题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道以及 Telegram Stars 购买机器人中都会举行 Telegram Stars 抽奖活动! 新闻动态: ➡ Telegram 频道:https://t.me/accsforyou_shop ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器:https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram:https://t.me/socnet_support ➡ WhatsApp:https://wa.me/79051904467 ➡ Discord:socnet_support ➡ ✉ 邮箱:solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock