error with autospawnhandler and cabal npc

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
darknessneo
Posts: 196
Joined: Mon Apr 26, 2010 11:00 pm

error with autospawnhandler and cabal npc

Post by darknessneo »

L2J Revision Number:4330
L2JDP Revision Number:7279

hello, here is a prob with seven sign npc:
Image
its same code for alls cabal npc...
darknessneo
Posts: 196
Joined: Mon Apr 26, 2010 11:00 pm

Re: error with autospawnhandler and cabal npc

Post by darknessneo »

i try a little up
hope
Posts: 1160
Joined: Thu Aug 30, 2007 5:17 pm

Re: error with autospawnhandler and cabal npc

Post by hope »

you spawned 31094 dont spawn this npc it auto spawns when it should
darknessneo
Posts: 196
Joined: Mon Apr 26, 2010 11:00 pm

Re: error with autospawnhandler and cabal npc

Post by darknessneo »

nah, i dont spawned this npc, when seven sign ended all orator spwn in town. but they dont spawn in my server, i have this error.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: error with autospawnhandler and cabal npc

Post by janiii »

you used the admin command //respawnall or //spawn_reload . just dont do it ;) respawning the npcs can ruin the quests or other scripts.


or try this patch for the exception:

Code: Select all

Index: java/com/l2jserver/gameserver/model/AutoSpawnHandler.java===================================================================--- java/com/l2jserver/gameserver/model/AutoSpawnHandler.java	(revision 4223)+++ java/com/l2jserver/gameserver/model/AutoSpawnHandler.java	(working copy)@@ -73,16 +73,13 @@ 	private static final int DEFAULT_RESPAWN = 3600000; // 1 hour in millisecs 	private static final int DEFAULT_DESPAWN = 3600000; // 1 hour in millisecs -	protected Map<Integer, AutoSpawnInstance> _registeredSpawns;-	protected Map<Integer, ScheduledFuture<?>> _runningSpawns;+	protected Map<Integer, AutoSpawnInstance> _registeredSpawns = new FastMap<Integer, AutoSpawnInstance>();+	protected Map<Integer, ScheduledFuture<?>> _runningSpawns = new FastMap<Integer, ScheduledFuture<?>>();  	protected boolean _activeState = true;  	private AutoSpawnHandler() 	{-		_registeredSpawns = new FastMap<Integer, AutoSpawnInstance>();-		_runningSpawns = new FastMap<Integer, ScheduledFuture<?>>();-		 		restoreSpawnData(); 	} @@ -98,12 +95,6 @@  	public void reload() 	{-		// stop all timers-		for (ScheduledFuture<?> sf : _runningSpawns.values())-		{-			if (sf != null)-				sf.cancel(true);-		} 		// unregister all registered spawns 		for (AutoSpawnInstance asi : _registeredSpawns.values()) 		{@@ -111,10 +102,17 @@ 				this.removeSpawn(asi); 		} -		// create clean list-		_registeredSpawns = new FastMap<Integer, AutoSpawnInstance>();-		_runningSpawns = new FastMap<Integer, ScheduledFuture<?>>();+		// stop all timers+		for (ScheduledFuture<?> sf : _runningSpawns.values())+		{+			if (sf != null)+				sf.cancel(true);+		} +		// clean list+		_registeredSpawns.clear();+		_runningSpawns.clear();+		 		// load 		restoreSpawnData(); 	}@@ -256,7 +254,8 @@  			// Cancel the currently associated running scheduled task. 			ScheduledFuture<?> respawnTask = _runningSpawns.remove(spawnInst._objectId);-			respawnTask.cancel(false);+			if (respawnTask != null)+				respawnTask.cancel(false);  			if (Config.DEBUG) 				_log.info("AutoSpawnHandler: Removed auto spawn for NPC ID " + spawnInst._npcId + " (Object ID = " + spawnInst._objectId
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
darknessneo
Posts: 196
Joined: Mon Apr 26, 2010 11:00 pm

Re: error with autospawnhandler and cabal npc

Post by darknessneo »

well, if i use reload npc, what this script make exactly? this command try to spawn cabal npc? If a don't use it, they spawn correctly in the next end of seven sign?
i added your patch, no more error now, but just :

AutoSpawnHandler: No spawn registered for object ID = 268479993
AutoSpawnHandler: No spawn registered for object ID = 268479994
AutoSpawnHandler: No spawn registered for object ID = 268479995
AutoSpawnHandler: No spawn registered for object ID = 268479992
AutoSpawnHandler: No spawn registered for object ID = 268479996

but thx for your patch.
hope
Posts: 1160
Joined: Thu Aug 30, 2007 5:17 pm

Re: error with autospawnhandler and cabal npc

Post by hope »

dont use that command on a live server it will mess it all up
darknessneo
Posts: 196
Joined: Mon Apr 26, 2010 11:00 pm

Re: error with autospawnhandler and cabal npc

Post by darknessneo »

i need to reset all npc spawn or all come to normal in somes days?
hope
Posts: 1160
Joined: Thu Aug 30, 2007 5:17 pm

Re: error with autospawnhandler and cabal npc

Post by hope »

restart server
gremlin
Posts: 5
Joined: Mon Sep 13, 2010 10:23 pm

Re: error with autospawnhandler and cabal npc

Post by gremlin »

I have this error on my server, I put the janii's patch but when Spawns the night skip the error and makes all the scripts stops working and end up falling off the server :(
In error.log i have this:

Code: Select all

Feb 26, 2011 11:22:53 PM com.l2jserver.gameserver.model.AutoSpawnHandler$AutoDespawner runWARNING: AutoSpawnHandler: An error occurred while despawning spawn (Object ID = 268482332): 0java.lang.ArrayIndexOutOfBoundsException: 0    at javolution.util.FastCollection.toArray(FastCollection.java:383)    at com.l2jserver.gameserver.model.AutoSpawnHandler$AutoSpawnInstance.getNPCInstanceList(AutoSpawnHandler.java:706)    at com.l2jserver.gameserver.model.AutoSpawnHandler$AutoDespawner.run(AutoSpawnHandler.java:587)    at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:86)    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)    at java.util.concurrent.FutureTask.run(FutureTask.java:166)    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)    at java.lang.Thread.run(Thread.java:636) 
and then I get very many of these

Code: Select all

Feb 26, 2011 11:23:04 PM com.l2jserver.gameserver.model.AutoSpawnHandler$AutoDespawner runWARNING: AutoSpawnHandler: An error occurred while despawning spawn (Object ID = 268482332): nulljava.lang.ArrayIndexOutOfBoundsException 

Please help
Post Reply