Jump to content
  • 0

Vote L2Network Check Problem


iAlreadyExist

Question

hello there i have problem with l2network vote check

i have use the same check for my autovote reward its working fine but the npc got problem can u help me :C here is the code.

/*
 * 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 Extensions.Vote;

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 java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

import Extensions.Vote.Tasks.MonthlyResetTask;
import Extensions.Vote.Tasks.TriesResetTask;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
import com.l2jfrozen.util.database.L2DatabaseFactory;

public class VoteManager
{
	protected static final Logger _log = Logger.getLogger(VoteManager.class.getName());

	private static boolean hasVotedHop;
	private static boolean hasVotedTop;

	public VoteManager()
	{
	}

	public static void load()
	{
		_log.log(Level.INFO, "VoteManager: initialized.");
		TriesResetTask.getInstance();
		MonthlyResetTask.getInstance();
	}

	protected static int getHopZoneVotes()
	{
	int votes = -1;
	URL url = null;
	URLConnection con = null;
	InputStream is = null;
	InputStreamReader isr = null;
	BufferedReader in = null;


	try
	{
	url = new URL(Config.VOTE_LINK_HOPZONE);
	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)
	{
	// 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 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.VOTE_LINK_TOPZONE);
			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(">")[3].replace("</div", ""));
					break;
				}
			}
		}
		catch (Exception e)
		{
			if (Config.DEVELOPER)
			{
				e.printStackTrace();
			}
		}
		return votes;
	}

	public static String hopCd(L2PcInstance player)
	{
		long hopCdMs = 0;
		long voteDelay = 43200000L;
		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteHopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				hopCdMs = rset.getLong("lastVoteHopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		 
		SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");

		Date resultdate = new Date(hopCdMs + voteDelay);
		return sdf.format(resultdate);
	}

	public static String topCd(L2PcInstance player)
	{
		long topCdMs = 0;
		long voteDelay = 43200000L;
		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteTopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				topCdMs = rset.getLong("lastVoteTopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		 
		SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");

		Date resultdate = new Date(topCdMs + voteDelay);
		return sdf.format(resultdate);
	}

	public static String whosVoting()
	{
		for (L2PcInstance voter : L2World.getInstance().getAllPlayers())
		{
			if (voter.isVoting())
			{
				return voter.getName();
			}
		}
		return "None";
	}

	public static void hopvote(final L2PcInstance player)
	{
		long lastVoteHopzone = 0L;
		long voteDelay = 43200000L;
		final int firstvoteshop;

		firstvoteshop = getHopZoneVotes();

		class hopvotetask implements Runnable
		{
			private final L2PcInstance p;

			public hopvotetask(L2PcInstance player)
			{
				p = player;
			}

			@Override
			public void run()
			{
				if (firstvoteshop < getHopZoneVotes())
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					VoteManager.setHasVotedHop(player);
					p.sendMessage("Thank you for voting for us!");
					player.addItem("Reward", Config.VOTE_REWARD_ID1, Config.VOTE_REWARD_AMOUNT1, player, true);
					VoteManager.updateLastVoteHopzone(p);
					VoteManager.updateVotes(p);
				}
				else
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					p.sendMessage("You did not vote.Please try again.");
					VoteManager.setTries(player, VoteManager.getTries(p) - 1);
				}
			}

		}

		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteHopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				lastVoteHopzone = rset.getLong("lastVoteHopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }

		if (((lastVoteHopzone + voteDelay) < System.currentTimeMillis()) && (getTries(player) > 0))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("" + VoteManager.whosVoting() +" is already voting.Wait for your turn please!");
					return;
				}
			}

			player.setIsVoting(true);
			player.setIsImobilised(false);
			player.sendMessage("Go fast on the site and vote on the Network banner!");
			player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!");
			ThreadPoolManager.getInstance().scheduleGeneral(new hopvotetask(player), Config.SECS_TO_VOTE * 1000);
		}
		else if ((getTries(player) <= 0) && ((lastVoteHopzone + voteDelay) < System.currentTimeMillis()))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("" + VoteManager.whosVoting() +" is already voting.Wait for your turn please!");
					return;
				}
			}

			player.setIsVoting(true);
			player.setIsImobilised(false);
			player.sendMessage("Go fast on the site and vote on the Network banner!");
			player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!");
			ThreadPoolManager.getInstance().scheduleGeneral(new hopvotetask(player), Config.SECS_TO_VOTE * 1000);

		}
		else
		{
			player.sendMessage("12 hours have to pass till you are able to vote again.");
		}

	}

	public static void topvote(final L2PcInstance player)
	{
		long lastVoteTopzone = 0L;
		long voteDelay = 43200000L;
		final int firstvotestop;

		firstvotestop = getTopZoneVotes();

		class topvotetask implements Runnable
		{
			private final L2PcInstance p;

			public topvotetask(L2PcInstance player)
			{
				p = player;
			}

			@Override
			public void run()
			{
				if (firstvotestop < getTopZoneVotes())
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					VoteManager.setHasVotedTop(p);
					p.sendMessage("Thank you for voting for us!");
					player.addItem("Reward", Config.VOTE_REWARD_ID1, Config.VOTE_REWARD_AMOUNT1, player, true);
					VoteManager.updateLastVoteTopzone(p);
					VoteManager.updateVotes(p);
				}
				else
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					p.sendMessage("You did not vote.Please try again.");
					VoteManager.setTries(p, VoteManager.getTries(p) - 1);
				}
			}

		}

		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteTopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				lastVoteTopzone = rset.getLong("lastVoteTopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }

		if ((getTries(player) <= 0) && ((lastVoteTopzone + voteDelay) < System.currentTimeMillis()))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("" + VoteManager.whosVoting() +" is already voting.Wait for your turn please!");
					return;
				}
			}
			player.setIsVoting(true);
			player.setIsImobilised(false);
			player.sendMessage("Go fast on the site and vote on the topzone banner!");
			player.sendMessage((new StringBuilder()).append("You have ").append(Config.SECS_TO_VOTE).append(" seconds.Hurry!").toString());
			ThreadPoolManager.getInstance().scheduleGeneral(new topvotetask(player), Config.SECS_TO_VOTE * 1000);
		}
		else if (((lastVoteTopzone + voteDelay) < System.currentTimeMillis()) && (getTries(player) > 0))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("" + VoteManager.whosVoting() +" is already voting.Wait for your turn please!");
					return;
				}
			}
			player.setIsVoting(true);
			player.setIsImobilised(false);
			player.sendMessage("Go fast on the site and vote on the topzone banner!");
			player.sendMessage((new StringBuilder()).append("You have ").append(Config.SECS_TO_VOTE).append(" seconds.Hurry!").toString());
			ThreadPoolManager.getInstance().scheduleGeneral(new topvotetask(player), Config.SECS_TO_VOTE * 1000);
		}
		else
		{
			player.sendMessage("12 hours have to pass till you are able to vote again.");
		}

	}

	public static void hasVotedHop(L2PcInstance player)
	{
		int hasVotedHop = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT hasVotedHop FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				hasVotedHop = rset.getInt("hasVotedHop");
			}

			if (hasVotedHop == 1)
			{
				setHasVotedHop(true);
			}
			else if (hasVotedHop == 0)
			{
				setHasVotedHop(false);
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void hasVotedTop(L2PcInstance player)
	{
		int hasVotedTop = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT hasVotedTop FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				hasVotedTop = rset.getInt("hasVotedTop");
			}

			if (hasVotedTop == 1)
			{
				setHasVotedTop(true);
			}
			else if (hasVotedTop == 0)
			{
				setHasVotedTop(false);
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void updateVotes(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET monthVotes=?, totalVotes=? WHERE obj_Id=?");

			statement.setInt(1, getMonthVotes(activeChar) + 1);
			statement.setInt(2, getTotalVotes(activeChar) + 1);
			statement.setInt(3, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasVotedHop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedHop=? WHERE obj_Id=?");

			statement.setInt(1, 1);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasVotedTop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedTop=? WHERE obj_Id=?");

			statement.setInt(1, 1);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasNotVotedHop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedHop=? WHERE obj_Id=?");

			statement.setInt(1, 0);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasNotVotedTop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedTop=? WHERE obj_Id=?");

			statement.setInt(1, 0);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static int getTries(L2PcInstance player)
	{
		int tries = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT tries FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());
			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				tries = rset.getInt("tries");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return tries;
	}

	public static void setTries(L2PcInstance player, int tries)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET tries=? WHERE obj_Id=?");

			statement.setInt(1, tries);
			statement.setInt(2, player.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static int getMonthVotes(L2PcInstance player)
	{
		int monthVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT monthVotes FROM characters WHERE obj_Id=?");

			statement.setInt(1, player.getObjectId());
			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				monthVotes = rset.getInt("monthVotes");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return monthVotes;
	}

	public static int getTotalVotes(L2PcInstance player)
	{
		int totalVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT totalVotes FROM characters WHERE obj_Id=?");

			statement.setInt(1, player.getObjectId());
			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				totalVotes = rset.getInt("totalVotes");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return totalVotes;
	}

	public static int getBigTotalVotes(L2PcInstance player)
	{
		int bigTotalVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT SUM(totalVotes) FROM characters");

			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				bigTotalVotes = rset.getInt("SUM(totalVotes)");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return bigTotalVotes;
	}

	public static int getBigMonthVotes(L2PcInstance player)
	{
		int bigMonthVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT SUM(monthVotes) FROM characters");

			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				bigMonthVotes = rset.getInt("SUM(monthVotes)");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return bigMonthVotes;
	}

	public static void updateLastVoteHopzone(L2PcInstance player)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET lastVoteHopzone=? WHERE obj_Id=?");
			statement.setLong(1, System.currentTimeMillis());
			statement.setInt(2, player.getObjectId());
			statement.execute();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void updateLastVoteTopzone(L2PcInstance player)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET lastVoteTopzone=? WHERE obj_Id=?");
			statement.setLong(1, System.currentTimeMillis());
			statement.setInt(2, player.getObjectId());
			statement.execute();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	// Getters and Setters
	public static boolean hasVotedHop()
	{
		return hasVotedHop;
	}

	public static void setHasVotedHop(boolean hasVotedHop)
	{
		VoteManager.hasVotedHop = hasVotedHop;
	}

	public static boolean hasVotedTop()
	{
		return hasVotedTop;
	}

	public static void setHasVotedTop(boolean hasVotedTop)
	{
		VoteManager.hasVotedTop = hasVotedTop;
	}
}
Edited by haskovo
Link to comment
Share on other sites

Recommended Posts

  • 0

first just remove the l2network second this code is a mess

the guy who wrote this has no respect for himself

about fixing it ... is better to remove it

Link to comment
Share on other sites

  • 0

first just remove the l2network second this code is a mess

the guy who wrote this has no respect for himself

about fixing it ... is better to remove it

 

Give me  good reason and show us how mad are you that we have a toplist...What ever you answer im gonna laugh

Link to comment
Share on other sites

  • 0

http://prntscr.com/6z890y
its a copy forum of another... no hate i am not mad but this guy wants to open hes server... the code for this web dont work

conclusion your site blocks hes oppening

simple and fast solution with no bad coding inside was given no reason to discuss anything else.

Link to comment
Share on other sites

  • 0

why you dont ask in their forum they are good programmers, look at the forum they build i am sure they will share a small code like this :happyforever:

Edited by Nightw0lf
Link to comment
Share on other sites

  • 0

http://prntscr.com/6z890y

its a copy forum of another... no hate i am not mad but this guy wants to open hes server... the code for this web dont work

conclusion your site blocks hes oppening

simple and fast solution with no bad coding inside was given no reason to discuss anything else.

 

the link WTF is that?

i cant understand you, you wrote something for nothing just to take a few more posts!

its a copy forum? what forum? the code for this web dont work? he should download our code is working fine...

My/his site  block his opening? explain nobody understand you...

 

The Code that he posted its not our code so simply can download our code from our Toplist

 

Man do not post just to take some more posts - your answer is useless for anybody here

Link to comment
Share on other sites

  • 0

the link WTF is that?

i cant understand you, you wrote something for nothing just to take a few more posts!

its a copy forum? what forum? the code for this web dont work? he should download our code is working fine...

My/his site  block his opening? explain nobody understand you...

 

The Code that he posted its not our code so simply can download our code from our Toplist

 

Man do not post just to take some more posts - your answer is useless for anybody here

you're propably lost the point and you're out of topic

1) yes your forum is a copy from l2topzone.com

2) if you know how to fix this please... share

3) this code is BAD and i recommend him to remove it because he cant obviously open hes server cause of this.

4) this screenshot has a deeper meaning, search it you might find it.

Link to comment
Share on other sites

  • 0

yeah only spam and u guys not help me like that i dont care if it is copy or no if u can help do it if you cant dont even post trash post in my topic

i know again some mod will say me dont disrespect people who trying to help u or he will give me warning but u no helping me with spaming.

Edited by haskovo
Link to comment
Share on other sites

  • 0

im need fix for this code becouse i dont have other becouse i dont understand to make on my own

i think there is some mistake becouse my autovoteward manager check for l2network is working but this code where i put in first post have problem with check :C

Link to comment
Share on other sites

  • 0

you're propably lost the point and you're out of topic

1) yes your forum is a copy from l2topzone.com

2) if you know how to fix this please... share

3) this code is BAD and i recommend him to remove it because he cant obviously open hes server cause of this.

4) this screenshot has a deeper meaning, search it you might find it.

 

1) We dont use any forum for our list is independent code with mutch better from ancient topzone...( if you find a simple code from topzone send me)

2) is not about how to fix it -  for sure if i had the solution it will be my pleasure to share it -  but as i know TOP vote system is with Command.

3) this code isnt bad just need a small update for Java7 or 8 we are gonna make it for java 8.

4) Nobody talks with puzzles

 

@haskovo

 

Please try to find an other vote system not in-game NPC "my opinion" thare are individuals systems if you search abit

Link to comment
Share on other sites

  • 0

1) We dont use any forum for our list is independent code with mutch better from ancient topzone...( if you find a simple code from topzone send me)

2) is not about how to fix it -  for sure if i had the solution it will be my pleasure to share it -  but as i know TOP vote system is with Command.

3) this code isnt bad just need a small update for Java7 or 8 we are gonna make it for java 8.

4) Nobody talks with puzzles

1) i told you that your forum is a copy of a copy and you tell me that its better from "ancient" topzone and i could make a bet on your ( if you find a simple code from topzone send me) you both have used FASART that used SMF with portal system edited dont try to bullshit me i know more

2) That means you're totaly unaware and unskilled of holding a forum like l2network

3) I LOLED HARD HERE cause your previous answer conflicts with your coding skills

4) Use search its a small photo some things work some not and there is a BIG number of users you guys rock

Link to comment
Share on other sites

  • 0

1) i told you that your forum is a copy of a copy and you tell me that its better from "ancient" topzone and i could make a bet on your ( if you find a simple code from topzone send me) you both have used FASART that used SMF with portal system edited dont try to bullshit me i know more

2) That means you're totaly unaware and unskilled of holding a forum like l2network

3) I LOLED HARD HERE cause your previous answer conflicts with your coding skills

4) Use search its a small photo some things work some not and there is a BIG number of users you guys rock

 

1) YOU ARE TOTALY OUT!

Where did you see that l2network use SMF and and Where Did you see that FASRT IS CODER of l2network and not  simple designer.

The L2Network DONT USE FORUMS LIKE TOPZONE

 

2) (your answer is totaly out for what i wrote) If we are unaware as you said why you didnt help @haskovo as i did and now his system working? ( maybe someone else is totaly unaware and unskilled )

 

3) As i said i am not Java dev but i tried

 

4) again with puzzles!!! send here the photo. Why you say "its a small photo" there are not small/big/huge photos its just a photo post it here ( challenge you )

Just make a simple search on google type some keywords like: l2top, l2top servers, lineage2 servers etc... just to see where we are

 

Do something for yourSelf and dont stay here just for some more posts...

 

( οσα λιγοτερα γνωριζεις τοσο περισσοτερα νομιζεις οτι ξερεις )

Edited by L2Network.eu
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • MidnightSell team WTB/WTS GOLD TWW EU/US all servers Cataclysm all servers Payment Visa/Master/Btc/Eth/Trc-20/Erc-20 (all payments within 10 min) For all question pls dm Discord https://discord.gg/h8AN57qJjK Or Telegram @MidnightSell
    • GOSTEI MUITO DO VIASUAL DO SERVE COMO POSSO ADQUIRI ESSA REV PACK   
    • Helly everyone . I use L2jmobius interlude , i did everything , installed the db compiled the Build in eclipse Gameserver seems to lead OK , but it fails to connect to loginserver When i click to start the loginserver it says  "Loginserver terminated abnormally" This is wheat gameserver shows me :    [05/10 17:25:12] LoginServerThread: Connecting to login on 127.0.0.1:9014 [05/10 17:25:12] LoginServerThread: LoginServer not available, trying to reconnect... [05/10 17:25:17] LoginServerThread: Connecting to login on 127.0.0.1:9014 [05/10 17:25:17] LoginServerThread: LoginServer not available, trying to reconnect... [05/10 17:25:22] LoginServerThread: Connecting to login on 127.0.0.1:9014 [05/10 17:25:22] LoginServerThread: LoginServer not available, trying to reconnect...   And This is my login config file:   # --------------------------------------------------------------------------- # Login Server Settings # --------------------------------------------------------------------------- # This is the server configuration file. Here you can set up the connection information for your server. # This was written with the assumption that you are behind a router. # Dumbed Down Definitions... # LAN (LOCAL area network) - typically consists of computers connected to the same router as you. # WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet). # x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers. # --------------------------------------------------------------------------- # Networking # --------------------------------------------------------------------------- # Bind ip of the LoginServer, use 0.0.0.0 to bind on all available IPs # WARNING: <u><b><font color="red">Please don't change default IPs here if you don't know what are you doing!</font></b></u> # WARNING: <u><b><font color="red">External/Internal IPs are now inside "ipconfig.xml" file.</font></b></u> # Default: 0.0.0.0 LoginserverHostname = 0.0.0.0 # Default: 2106 LoginserverPort = 2106 # The address on which login will listen for GameServers, use * to bind on all available IPs # WARNING: <u><b><font color="red">Please don't change default IPs here if you don't know what are you doing!</font></b></u> # WARNING: <u><b><font color="red">External/Internal IPs are now inside "ipconfig.xml" file.</font></b></u> # Default: 127.0.0.1 LoginHostname = 127.0.0.1 # The port on which login will listen for GameServers # Default: 9014 LoginPort = 9014 # --------------------------------------------------------------------------- # Database # --------------------------------------------------------------------------- # Specify the JDBC driver class for your database. # Default: org.mariadb.jdbc.Driver Driver = org.mariadb.jdbc.Driver # Database URL # Default: jdbc:mariadb://localhost/l2jmobiusinterlude?useUnicode=true&characterEncoding=utf-8&useSSL=false&connectTimeout=10000&interactiveClient=true&sessionVariables=wait_timeout=600,interactive_timeout=600&autoReconnect=true URL = jdbc:mariadb://localhost/l2jmobiusinterlude?useUnicode=true&characterEncoding=utf-8&useSSL=false&connectTimeout=10000&interactiveClient=true&sessionVariables=wait_timeout=600,interactive_timeout=600&autoReconnect=true # Database user info. Default is "root" but it's not recommended. Login = root # Database user password, leave empty for no password. Password = root # Maximum number of database connections to maintain in the pool. # Default: 5 MaximumDatabaseConnections = 5 # Determine whether database connections should be tested for availability. # Default: False TestDatabaseConnections = False # --------------------------------------------------------------------------- # Automatic Database Backup Settings # --------------------------------------------------------------------------- # Generate database backups when server restarts or shuts down.  BackupDatabase = False # Path to MySQL bin folder. Only necessary on Windows. MySqlBinLocation = C:/xampp/mysql/bin/ # Path where MySQL backups are stored. BackupPath = ../backup/ # Maximum number of days that backups will be kept. # Old files in backup folder will be deleted. # Set to 0 to disable. BackupDays = 30 # --------------------------------------------------------------------------- # Thread Configuration # --------------------------------------------------------------------------- # Defines the number of threads in the scheduled thread pool. # If set to -1, this will be determined by available processors divided by 2. ScheduledThreadPoolSize = 2 # Defines the number of threads in the instant thread pool. # If set to -1, this will be determined by available processors divided by 2. InstantThreadPoolSize = 2 # --------------------------------------------------------------------------- # Security # --------------------------------------------------------------------------- # How many times you can provide an invalid account/pass before the IP gets banned. # Default: 5 LoginTryBeforeBan = 5 # Time you won't be able to login back again after LoginTryBeforeBan tries to login. # Default: 900 (15 minutes) LoginBlockAfterBan = 900 # If set to True any GameServer can register on your login's free slots # Default: True AcceptNewGameServer = True # Flood Protection. All values are in milliseconds. # Default: True EnableFloodProtection = True # Default: 15 FastConnectionLimit = 15 # Default: 700 NormalConnectionTime = 700 # Default: 350 FastConnectionTime = 350 # Default: 50 MaxConnectionPerIP = 50 # --------------------------------------------------------------------------- # Misc Login Settings # --------------------------------------------------------------------------- # If False, the license (after the login) will not be shown. # Default: True ShowLicence = True # Default: True AutoCreateAccounts = True # Datapack root directory. # Defaults to current directory from which the server is started. DatapackRoot = . # --------------------------------------------------------------------------- # Scheduled Login Restart # --------------------------------------------------------------------------- # Enable disable scheduled login restart. # Default: False LoginRestartSchedule = False # Time in hours. # Default: 24 LoginRestartTime = 24    
  • Topics

×
×
  • Create New...