Jump to content

Recommended Posts

Posted (edited)

You should not using this npc on live server.. But at least we can segregate crappy servers by vote manager ^_^

Edited by SweeTs
Posted

i use this on my server and works like i want...all works fine 

here is the fix for topzone 

use this link but change id https://l2topzone.com/tv.php?id=12609

public static int getTopZoneVotes()
	{
		int votes = -1;
		try
		{
			final URL obj = new URL(Config.VOTES_SITE_TOPZONE_URL);
			final HttpURLConnection con = (HttpURLConnection) obj.openConnection();
			con.addRequestProperty("User-Agent", "L2TopZone");
			con.setConnectTimeout(5000);
			
			final int responseCode = con.getResponseCode();
			if (responseCode == 200)
			{
				try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())))
				{
					String inputLine;
					while ((inputLine = in.readLine()) != null)
					{
						votes = Integer.valueOf(inputLine);
						break;
					}
				}
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
			System.out.println("TOPZONE is offline. We will check reward as it will be online again.");
		}
		
		return votes;
	}
Posted (edited)
 C:\Users\root\Desktop\NeWorksplace\L2Interlude\gameserver\head-src\com\l2jfrozen\gameserver\handler\voicedcommandhandlers\VoteHandler.java:259: error: cannot find symbol

    [javac] try (Connection con = L2DatabaseFactory.getInstance().getConnection())

    [javac]                      ^

    [javac]   symbol:   variable L2DatabaseFactory

    [javac]   location: class VoteHandler  

any idea??

Edited by xSko0tosX
Posted

Frozen is so old that it's using 'old school' way of db connection and the imports are another. You don't need "259 line", as the warning/error said what the issue is..

 

 

        Connection con = null;
        try
        {
            con = L2DatabaseFactory.getInstance().getConnection(false);
Posted

thanks Fixed.  now one more problem i have, i compilled all . all works  (i think) but.. 

i create the npc with  Type L2VoteManager1  and i cant spawn this npc ? X_X dunno what.s wrong ;x

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • 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