Jump to content

Recommended Posts

Posted

To all who have an error like this:

errorxan.png

 

Easy to fix:

Just merge both databases!

 

How to do it?

 

1) Close both Gameserver and Loginserver

2) Open database l2jls (your loginserver database)

3) Copy all tables from there

4) Open database l2jgs (your gameserver database)

5) Paste them there

 

6) Now go to */login/config/loginserver.properties

7) Scroll down to "Database" Section and then search for "l2jls" (your loginserver database)

8) Replace "l2jls" (loginserver database) with "l2jgs" (gameserver database)

 

Done.

 

Please give feedback I didn't test it but in theory it should work. I am still searching for solution from code-side

  • 1 month later...
Posted

Hello!

For TopZone the code works fine without problem.. but for HopZone don't work and I got error...

Can someone help me who to fix this??

Posted

Hello!

For TopZone the code works fine without problem.. but for HopZone don't work and I got error...

Can someone help me who to fix this??

 

use help section, post error and what you want to do, also you could try and that way you will learn something useful :)

Posted

Hi this is a nice share and i could really use it for my server, i put every thing in eclipse and every thing was fine but at the end i only have a 2 errors should be simple to fix i think but i have no idea what to change it to so mabey you guys will know, thanks :D

 

Untitled.jpg

  • 4 weeks later...
Posted
errorxan.png

To all who have an error like this:

Easy to fix:

Just merge both databases!

 

How to do it?

 

1) Close both Gameserver and Loginserver

2) Open database l2jls (your loginserver database)

3) Copy all tables from there

4) Open database l2jgs (your gameserver database)

5) Paste them there

 

6) Now go to */login/config/loginserver.properties

7) Scroll down to "Database" Section and then search for "l2jls" (your loginserver database)

8) Replace "l2jls" (loginserver database) with "l2jgs" (gameserver database)

 

Done.

 

Please give feedback I didn't test it but in theory it should work. I am still searching for solution from code-side

 

 

 

 

I got same error.... i did same fix... but when someone make new Account... will not get vote reward? Or?

 

 

Ahh to make both in 1 Database... smart :D

  • 1 month later...
Posted

if the account is created by page, you can send data to and l2jgs l2jls but if autocreate the data is sent and not update l2jls accounts l2jgs, another solution would be to edit the code to work with l2jls, this is for those who work with the new revision

  • 1 month later...
  • 3 weeks later...
Posted

[javac] Note: C:\workspace\KingServerBR\Server\java\king\server\gameserver\instancemanager\AutoVoteRewardHandler.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.

 

? ? ? ? ? ?

Posted

Fxied Problem by accident i deleted the + between getlastvotecount() + Config.votes for reward

 

Now i have new error in server when it loads up:

 

any ideas:

 

err.jpg

 

I have this error how to fix? My database name for login and game l2jls

  • 1 month later...
Posted

i installed all code in latest H5 core version=5816

builddate=25/02/2013 06:00

 

and i got only one error in AutoVoteRewardHandler also in Shutdown and Gameserver but is the same

 

package com.l2jserver.gameserver.instancemanager;
    
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.l2jserver.gameserver.model.item.instance.L2ItemInstance;
import com.l2jserver.Config;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
import com.l2jserver.gameserver.util.Broadcast;
    
public class AutoVoteRewardHandler
{
  private static Logger _log = Logger.getLogger(AutoVoteRewardHandler.class.getName());
  
  private static final int initialCheck  = 1 * 1000;
  private static final int delayForCheck = Config.DELAY_FOR_NEXT_REWARD * 1000;

  private static int lastVoteCount = 0;
      
  private AutoVoteRewardHandler()
  {
      _log.info("Vote Reward System: Vote reward system initiated.");
      if (Config.VOTE_REWARD_ENABLE)
          load();
      ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck, delayForCheck);
  }
      
  private class AutoReward implements Runnable
{
	@Override
	public void run()
	{
		int votes = getVotes(Config.VOTE_HTML_PATCH);
		System.out.println("Server Votes: " + votes);
		if (votes != 0 && getLastVoteCount() != 0 && votes >= getLastVoteCount() + Config.VOTES_FOR_REWARD)
		{
			Connection con = null;
			try
			{
				con = L2DatabaseFactory.getInstance().getConnection();
				PreparedStatement statement = con.prepareStatement("SELECT c.charId, c.char_name FROM characters AS c LEFT JOIN accounts AS a ON c.account_name = a.login WHERE c.online > 0 GROUP BY a.lastIP ORDER BY c.level DESC");
				ResultSet rset = statement.executeQuery();
				L2PcInstance player = null;
			        L2ItemInstance item = null;
				L2ItemInstance item2 = null;
				while (rset.next())
				{
					player = L2World.getInstance().getPlayer(rset.getInt("charId"));
					if (player != null && !player.getClient().isDetached())
					{
							item = player.getInventory().getItemByItemId(Config.VOTE_REWARD1_ID);
							if (item == null || item.getCount() < Config.MAX_REWARD_COUNT_FOR_STACK_ITEM1)
								player.addItem("reward", Config.VOTE_REWARD1_ID, Config.VOTE_REWARD1_COUNT, player, true);
							item2 = player.getInventory().getItemByItemId(Config.VOTE_REWARD1_ID);

							if (item2 == null || item2.getCount() < Config.MAX_REWARD_COUNT_FOR_STACK_ITEM1)
								player.addItem("reward", Config.VOTE_REWARD2_ID, Config.VOTE_REWARD2_COUNT, player, true);
					}
				}
				setLastVoteCount(getLastVoteCount() + Config.VOTES_FOR_REWARD);
				statement.close();
				_log.info("Vote Reward System: Reward for votes now!");
	            Broadcast.toAllOnlinePlayers(new CreatureSay(1, Say2.CRITICAL_ANNOUNCE, "", "Vote Manager: Reward for players! Thanks for Vote."));
		}
			catch (SQLException e)
			{
				e.printStackTrace();
			}
			finally
			{
				L2DatabaseFactory.close(con);
			}

			setLastVoteCount(getLastVoteCount() + Config.VOTES_FOR_REWARD);
		}
		Broadcast.toAllOnlinePlayers(new CreatureSay(1, Say2.CRITICAL_ANNOUNCE, "", "Vote Manager: Server votes: " + votes + " | Next Reward on " + (getLastVoteCount() + Config.VOTES_FOR_REWARD) + " Votes."));
		if (getLastVoteCount() == 0)
			setLastVoteCount(votes);
	}
}
      
  private int getVotes(String urlString)
  {
      URL url = null;
      InputStreamReader isr = null;
      BufferedReader in = null;
      try
      {
          url = new URL(urlString);
          isr = new InputStreamReader(url.openStream());
          in = new BufferedReader(isr);
          String inputLine;
          while ((inputLine = in.readLine()) != null)
          {
        	  if (Config.VOTE_REWARD_TOPZONE_ENABLE)
        	  {
        		  // for TopZone
        		  if (inputLine.contains("<tr><td><div align=\"center\"><b><font style=\"font-size:14px;color:#018BC1;\""))
        		  {
        			  return Integer.valueOf(inputLine.split(">")[5].replace("</font", ""));
        		  }
        	  }
        	  if (Config.VOTE_REWARD_HOPZONE_ENABLE)
       	  {
        		  // for HopZone
        		  if (inputLine.contains("rank anonymous tooltip"))
        		  {
        			  @SuppressWarnings("unused")
        			  int Sub = 12;
        			  switch (inputLine.length())
        			  {
        				  case 116:
        					  Sub = 13; 
        					  break;
        				  case 117:
        					  Sub = 14; 
        					  break;
        				  case 118:
        					  Sub = 15;
        					  break;
        				  case 119:
        					  Sub = 16; 
        					  break;
        			  }
        			  return Integer.valueOf(inputLine.split(">")[2].replace("</span", ""));
        		  }
              }
          }
      }
      catch (IOException e)
      {
          _log.warning("Vote Reward System: "+e);
      }
      finally
      {
          try
          {
              in.close();
          }
          catch (IOException e)
          {}
          try
          {
              isr.close();
          }
          catch (IOException e)
          {}
      }
      return 0;
  }
      
  private void setLastVoteCount(int voteCount)
  {
      lastVoteCount = voteCount;
  }
      
  private int getLastVoteCount()
  {
      return lastVoteCount;
  }
  
  private void load()
  {
      int votes = 0;
      Connection con = null;
      try
      {
          con = L2DatabaseFactory.getInstance().getConnection();
          PreparedStatement statement = con.prepareStatement("SELECT vote FROM votes LIMIT 1");
          ResultSet rset = statement.executeQuery();

          while (rset.next())
          {
              votes = rset.getInt("vote");
          }
          rset.close();
          statement.close();
      }
      catch (Exception e)
      {
          _log.log(Level.WARNING, "data error on vote: ", e);
      }
      finally
      {
          L2DatabaseFactory.close(con);
      }
      
      setLastVoteCount(votes);
  }
  
  public void save()
  {
      Connection con = null;
      try
      {
          con = L2DatabaseFactory.getInstance().getConnection();
          PreparedStatement statement = con.prepareStatement("UPDATE votes SET vote = ? WHERE id=1");
          statement.setInt(1, getLastVoteCount());
          statement.execute();
          statement.close();
      }
      catch (Exception e)
      {
          _log.log(Level.WARNING, "data error on vote: ", e);
      }
      finally
      {
          L2DatabaseFactory.close(con);
      }
  }
  
  public static AutoVoteRewardHandler getInstance()
  {
     return SingletonHolder._instance;
  }
      
  @SuppressWarnings("synthetic-access")
  private static class SingletonHolder
  {
      protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler();
  }
}

 

that give me error and

import com.l2jserver.gameserver.model.item.instance.L2ItemInstance; 

L2ItemInstance item = null;

L2ItemInstance item2 = null;

 

it says : "Multiple markers at this line

- Occurrence of 'L2ItemInstance'

- L2ItemInstance cannot be resolved

to a type"

 

how to fix that ?

 

  • 6 months later...

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



  • Posts

    • We can help your Telegram group or channel grow fast with real, targeted Telegram members, safely and efficiently.   Our Telegram Member Add service lets you add members to Telegram group or channel from real, active communities — not bots or fakes.   With this Telegram group growth service, you’ll see results within hours, backed by clear reporting and safe automation.   ✅ What We Offer   • Done-for-you Telegram Member Add campaigns (Groups · Channels) • Targeted Telegram members from real, active users • Fast growth — up to 10K members in 24 hours • English-speaking or regional audiences (US · UK · EU) • Fully managed Telegram channel growth service with reports & analytics   💡 Why Choose Us   We don’t use spam or fake accounts. Our process safely adds members to your Telegram group or channel through verified multi-account setups, proxy rotation, and opt-out compliance. This ensures lasting growth and minimizes churn. Every campaign is managed by experts using tested Telegram infrastructure and growth systems. We also recommend combining Member Add with Telegram Mass DM for better engagement and retention after join.   🧩 Works Best For   • Businesses or communities launching new Telegram channels • Crypto, SaaS, and marketing projects needing visibility • Influencers and agencies growing multiple Telegram groups • Anyone seeking a reliable Telegram group growth service with real members 📩 To Get More Information   Telegram : @TeleLoopPulse   Website : https://telegramgrowthstudio.com/telegram-member-add.html
    • well,its SharedCreatureData.h problem.   /* 0398 */ //WCHAR m_sResurrectSpellerName[25];   this variable will cause L2server.exe crash...  
    • Custom High Five server L2insolence will open 2025-10-17 21:00 GMT+2 ! ! ! Web site: http://www.l2insolence.eu All info updates on Discord: https://discord.gg/duMjnj3y9A Last wipe was more then 1 year ago. We have custom skill, farm zones, materials for items to buy. Custom wepons, armor, jewels and more. All items in game have own stats. With custom looks. Glowing etc. Rates XP, SP: 25x Spoil and Drop: 10x Adena: 20x Server Hard Farm Enchantment Safe enchant Weapon: +20099 Safe enchant Armor: +20099 Max enchant Weapon: +20099 Max enchant Armor: +20099 Normal scrolls: 100% Blessed scrolls: 100% You can use scrolls or item enchant NPC to make +++ abd life beter. NPC Buffer There's an NPC buffer in all of our main towns: Aden, Giran and Goddard. It supplies Prophet Buffs, Songs and Dances for a small fee. Include all buff. We have custom self buffs learned with npc with custom stats. Global Gatekeeper GM Shop with normal items and custom ones, vote NPC, Event NPC, item upgrader NPC. Raid Bosses, every zone have its own boss and drops for rare mats. Olympiad The olympiad is ongoing every two weeks. Meaning if you become a hero you will have your hero status for two weeks. And hero have own custom stats on items.
  • 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