Jump to content

Recommended Posts

Posted

i find the problem...

 

if i use one character that have on my db and this character have any pvp points... when the system update the table it cause conflict and cause the errro(i think xD)...

but i make 2 characters new without any pvp points and it work without error.

Posted (edited)

I have a problem.. i compile without  errors but when i click a player i have no info about him .i have info just when i m killed ..

 

and /pvpinfo  or. pvpinfo command not work :((

 

 can help me with some advice?

 

 Thanks for your great work!!!!

Edited by hades25
Posted

I have a problem.. i compile without  errors but when i click a player i have no info about him .i have info just when i m killed ..

 

and /pvpinfo  or. pvpinfo command not work :((

 

 can help me with some advice?

 

 Thanks for your great work!!!!

 Fixed :P :))) i just edit CommandName-e.dat  :P

  • 3 weeks later...
Posted (edited)


// try to add this check:

else if(param.startsWith("RewardList:"))

{

System.out.println(param); // <- here, I want to know about the parameters.

 

try

{

 

Edited by << Masterio >>
Posted

DEBUG: 

Untitled-1.jpg

 

CODE:

		else if(param.startsWith("RewardList:"))
		{
			log.info("DEBUG: Enter Reward list");
			System.out.println("DEBUG: param: "+param);
			try
			{
				int rankId = Integer.valueOf(command.split(":", 2)[2].trim().split(",", 2)[0].trim());
				int pageNo = Integer.valueOf(command.split(":", 1)[2].trim().split(",", 2)[1].trim());
				log.info("DEBUG: Try: Success RankId" +rankId + " pageNo "+pageNo);
				log.info("DEBUG: param: "+param);
				RankPvpSystemRewardList.sendPage(activeChar, pageNo, rankId);			
			}
			catch(Exception e)
			{
				log.info(e.getMessage());
			}
			log.info("DEBUG: Exit Reward list");
		}
Posted (edited)

I 'reinstall' the mod, and I remembered that in LUCERA  this method "ExecuteTask" has not 

 

if you need my source, i send for you...

 

MY IMG CODE: 

Untitled-2.jpg

 

MY CODE:

	public void runPvpTask(L2PcInstance player, L2Character target)
	{
		if(RankPvpSystemConfig.RANK_PVP_SYSTEM_ENABLED)
		{
			if(player != null && target != null && target instanceof L2PcInstance)
			{
				// set Victim handler for Killer
				//setTarget((L2PcInstance)target);	// [not required]
				
				// set Killer handler for Victim
				((L2PcInstance)target).getRankPvpSystemPc().setTarget(player);
				
				ThreadPoolManager.getInstance().executeTask(new RankPvpSystemPvpTask(player, (L2PcInstance)target));
			}
		}
	}

MY ThreadPoolManager

 

package ru.catssoftware.gameserver;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import ru.catssoftware.Config;
import ru.catssoftware.gameserver.mmocore.ReceivablePacket;
import ru.catssoftware.gameserver.network.L2GameClient;
import ru.catssoftware.gameserver.threadmanager.L2ThreadFactory;
import ru.catssoftware.gameserver.threadmanager.ScheduledFutureWrapper;
import ru.catssoftware.util.concurrent.L2RejectedExecutionHandler;


public final class ThreadPoolManager
{
	private static final long		MAX_DELAY						= TimeUnit.NANOSECONDS.toMillis(Long.MAX_VALUE - System.nanoTime()) / 2;
	private static final			ThreadPoolManager _instance		= new ThreadPoolManager();

	public static ThreadPoolManager getInstance()
	{
		return _instance;
	}

	private final ScheduledThreadPoolExecutor _general = new ScheduledThreadPoolExecutor(Config.GENERAL_THREAD_POOL_SIZE, new L2ThreadFactory("ThreadPool(General)", Thread.NORM_PRIORITY), new L2RejectedExecutionHandler());
	
	private final ScheduledThreadPoolExecutor _moving = new ScheduledThreadPoolExecutor(Config.GENERAL_THREAD_POOL_SIZE, new L2ThreadFactory("ThreadPool(Moving)", Thread.NORM_PRIORITY), new L2RejectedExecutionHandler());

	private final ScheduledThreadPoolExecutor _effect = new ScheduledThreadPoolExecutor(Config.EFFECT_THREAD_POOL_SIZE, new L2ThreadFactory("ThreadPool(Effect)", Thread.NORM_PRIORITY+1), new L2RejectedExecutionHandler());
	
	private final ScheduledThreadPoolExecutor _ai = new ScheduledThreadPoolExecutor(Config.AI_THREAD_POOL_SIZE, new L2ThreadFactory("ThreadPool(AI)", Thread.NORM_PRIORITY), new L2RejectedExecutionHandler());

	private final ScheduledThreadPoolExecutor _pcai = new ScheduledThreadPoolExecutor(Config.AI_THREAD_POOL_SIZE, new L2ThreadFactory("ThreadPool(PCAI)", Thread.NORM_PRIORITY+3), new L2RejectedExecutionHandler());
	private final ScheduledThreadPoolExecutor _lsgs = new ScheduledThreadPoolExecutor(10, new L2ThreadFactory("ThreadPool(LSGS)", Thread.NORM_PRIORITY), new L2RejectedExecutionHandler());
	
	private final ThreadPoolExecutor _packet = new ThreadPoolExecutor(Config.PACKET_THREAD_POOL_SIZE, Config.PACKET_THREAD_POOL_SIZE, 1L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new L2ThreadFactory("Executor(Packet)", Thread.MAX_PRIORITY), new L2RejectedExecutionHandler()); 
	
	private ThreadPoolManager()
	{
	}
	
	public final void startPurgeTask(long period)
	{
		scheduleGeneralAtFixedRate(new PurgeTask(), period, period);
	}

	private final class PurgeTask implements Runnable
	{
		public void run()
		{
			purge();
		}
	}

	private final long validate(long delay)
	{
		return Math.max(0, Math.min(MAX_DELAY, delay));
	}

	public ScheduledFuture<?> schedule(Runnable r, long delay)
	{
		
		return new ScheduledFutureWrapper(_general.schedule(r, validate(delay), TimeUnit.MILLISECONDS));
	}

	public void executeLSGSPacket(Runnable r)
    {
		_lsgs.execute(r);
	}

	public ScheduledFuture<?> scheduleAtFixedRate(Runnable r, long delay, long period)
	{
		return new ScheduledFutureWrapper(_general.scheduleAtFixedRate(r, validate(delay), validate(period), TimeUnit.MILLISECONDS));
	}

	public ScheduledFuture<?> scheduleGeneral(Runnable r, long delay)
	{
		if(delay<= 0 )
        {
			_general.execute(r);
			return null;
		}
		return new ScheduledFutureWrapper(_general.schedule(r, validate(delay), TimeUnit.MILLISECONDS));
	}

	public ScheduledFuture<?> scheduleGeneralAtFixedRate(Runnable r, long delay, long period)
	{
		return new ScheduledFutureWrapper(_general.scheduleAtFixedRate(r, validate(delay), validate(period), TimeUnit.MILLISECONDS));
	}

	public void executeGeneral(Runnable r)
	{
		_general.execute(r);
	}

	public ScheduledFuture<?> scheduleEffect(Runnable r, long delay)
	{
		return new ScheduledFutureWrapper(_effect.schedule(r, validate(delay), TimeUnit.MILLISECONDS));
	}

	public ScheduledFuture<?> scheduleEffectAtFixedRate(Runnable r, long delay, long period)
	{
		return new ScheduledFutureWrapper(_effect.scheduleAtFixedRate(r, validate(delay), validate(period), TimeUnit.MILLISECONDS));
	}

	public void executeEffect(Runnable r)
	{
		_effect.execute(r);
	}

	public ScheduledFuture<?> scheduleAi(Runnable r, long delay, boolean pc)
	{
		if(pc)
			return new ScheduledFutureWrapper(_pcai.schedule(r, validate(delay), TimeUnit.MILLISECONDS));
		return new ScheduledFutureWrapper(_ai.schedule(r, validate(delay), TimeUnit.MILLISECONDS));
	}

	public ScheduledFuture<?> scheduleAiAtFixedRate(Runnable r, long delay, long period, boolean pc)
	{
		if (pc)
			return new ScheduledFutureWrapper(_pcai.scheduleAtFixedRate(r, validate(delay), validate(period), TimeUnit.MILLISECONDS));
		return new ScheduledFutureWrapper(_ai.scheduleAtFixedRate(r, validate(delay), validate(period), TimeUnit.MILLISECONDS));
	}

	public void executeAi(Runnable r)
	{
		_ai.execute(r);
	}

	public void executePacket(Runnable r)
	{
		_packet.execute(r);
	}

	public CharSequence getStats()
	{
		StringBuilder list = new StringBuilder();
		
		String newline = System.getProperty("line.separator");
		
		list.append("ThreadPool (General)" + newline);
		list.append("=================================================" + newline);
		list.append("\tgetActiveCount: ...... " + _general.getActiveCount() + newline);
		list.append("\tgetCorePoolSize: ..... " + _general.getCorePoolSize() + newline);
		list.append("\tgetPoolSize: ......... " + _general.getPoolSize() + newline);
		list.append("\tgetLargestPoolSize: .. " + _general.getLargestPoolSize() + newline);
		list.append("\tgetMaximumPoolSize: .. " + _general.getMaximumPoolSize() + newline);
		list.append("\tgetCompletedTaskCount: " + _general.getCompletedTaskCount() + newline);
		list.append("\tgetQueuedTaskCount: .. " + _general.getQueue().size() + newline);
		list.append("\tgetTaskCount: ........ " + _general.getTaskCount() + newline);
		list.append(newline);
		list.append("ThreadPool (Effects)" + newline);
		list.append("=================================================" + newline);
		list.append("\tgetActiveCount: ...... " + _effect.getActiveCount() + newline);
		list.append("\tgetCorePoolSize: ..... " + _effect.getCorePoolSize()+ newline);
		list.append("\tgetPoolSize: ......... " + _effect.getPoolSize() + newline);
		list.append("\tgetLargestPoolSize: .. " + _effect.getLargestPoolSize() + newline);
		list.append("\tgetMaximumPoolSize: .. " + _effect.getMaximumPoolSize() + newline);
		list.append("\tgetCompletedTaskCount: " + _effect.getCompletedTaskCount() + newline);
		list.append("\tgetQueuedTaskCount: .. " + _effect.getQueue().size() + newline);
		list.append("\tgetTaskCount: ........ " + _effect.getTaskCount() + newline);
		list.append(newline);
		list.append("ThreadPool (AI)" + newline);
		list.append("=================================================" + newline);
		list.append("\tgetActiveCount: ...... " + _ai.getActiveCount() + newline);
		list.append("\tgetCorePoolSize: ..... " + _ai.getCorePoolSize() + newline);
		list.append("\tgetPoolSize: ......... " + _ai.getPoolSize() + newline);
		list.append("\tgetLargestPoolSize: .. " + _ai.getLargestPoolSize() + newline);
		list.append("\tgetMaximumPoolSize: .. " + _ai.getMaximumPoolSize() + newline);
		list.append("\tgetCompletedTaskCount: " + _ai.getCompletedTaskCount() + newline);
		list.append("\tgetQueuedTaskCount: .. " + _ai.getQueue().size() + newline);
		list.append("\tgetTaskCount: ........ " + _ai.getTaskCount() + newline);
		list.append(newline);
		list.append("ThreadPoolExecutor (Packet)" + newline);
		
		return list;
	}
		
	private boolean _inshutdown = false;

	public void shutdown()
	{
		_inshutdown = true;
		_general.shutdown();
		_effect.shutdown();
		_ai.shutdown();
		_pcai.shutdown();
		_moving.shutdown();
		_lsgs.shutdown();
		_packet.shutdown();
		System.out.println("ThreadPoolManager: all threads stopped");
	}
	
	public void purge()
	{
		_general.purge();
		_effect.purge();
		_ai.purge();
		_pcai.purge();
		_moving.purge();
		_packet.purge();
	}

	public ScheduledFuture<?> scheduleMove(Runnable r, long delay) {
		return new ScheduledFutureWrapper(_moving.schedule(r, validate(delay), TimeUnit.MILLISECONDS));
	}

	public ScheduledFuture<?> scheduleMoveAtFixedRate(Runnable r, long delay, long period)
    {
		return new ScheduledFutureWrapper(_general.scheduleAtFixedRate(r, validate(delay), validate(period), TimeUnit.MILLISECONDS));
	}

	public static class PriorityThreadFactory implements ThreadFactory
	{
		private int _prio;
		private String _name;
		private AtomicInteger _threadNumber = new AtomicInteger(1);
		private ThreadGroup _group;

		public PriorityThreadFactory(String name, int prio)
		{
			_prio = prio;
			_name = name;
			_group = new ThreadGroup(_name);
		}

		@Override
		public Thread newThread(Runnable r)
		{
			Thread t = new Thread(_group, r);
			t.setName(_name + "-" + _threadNumber.getAndIncrement());
			t.setPriority(_prio);
			return t;
		}

		public ThreadGroup getGroup()
		{
			return _group;
		}
	}

	public void executeIOPacket(ReceivablePacket<L2GameClient> r)
    {
		executePacket(r);
	}

	public boolean isShutdown()
    {
		return _inshutdown;
	}

}
Edited by ProTeaM
Posted (edited)

i havent freya client so i dont. ;)

from photos you have check it in hi5 i think? if not or freya

 

Edit: Tested and works on FREYA! ty for your work!

Edited by nikosdevil20
Guest
This topic is now closed to further replies.



×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..