Jump to content
  • 0

[HELP] npe στο spawntable - autospawnhandler


Question

Posted

καλησπερα στο forum!

εχω ενα error στον server μου που με ταλεπορει καιρο...

μηπως μπορει καποιος να βοηθησει??

 


AutoSpawnHandler??: An error occurred while initializing spawn instance (Object ID
268478949): java.lang.NullPointerException??

java.lang.NullPointerException??

    at javolution.util.FastMap??$Entry.access$100(Unknown Source)
    at javolution.util.FastMap??.addEntry(Unknown Source)
    at javolution.util.FastMap??.put(Unknown Source)
    at net.sf.l2j.gameserver.datatables.SpawnTable??.addNewSpawn(SpawnTable??.ja

va:170)

    at net.sf.l2j.gameserver.model.AutoSpawnHandler??$AutoSpawner??.run(AutoSpaw??

nHandler.java:523)

    at java.util.concurrent.Executors$RunnableAdapter??.call(Unknown Source)
    at java.util.concurrent.FutureTask??$Sync.innerRunAndReset(Unknown Source)

    at java.util.concurrent.FutureTask??.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor??$ScheduledFutureTask??.

access$101(Unknown Source)

    at java.util.concurrent.ScheduledThreadPoolExecutor??$ScheduledFutureTask??.

runPeriodic(Unknown Source)

    at java.util.concurrent.ScheduledThreadPoolExecutor??$ScheduledFutureTask??.

run(Unknown Source)

    at java.util.concurrent.ThreadPoolExecutor??$Worker.runTask(Unknown Source

)

    at java.util.concurrent.ThreadPoolExecutor??$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

6 answers to this question

Recommended Posts

  • 0
Posted

to code ειναι απο αλλο παλικαρι απλα εγω εχω το ιδιο error.

σε εμενα ειναι στη γραμμη 169

 

            _log.fine("SpawnTable: Spawning completed, total number of NPCs in the world: "
                + _npcSpawnCount);

    }

    public L2Spawn getTemplate(int id)
    {
        return _spawntable.get(id);
    }

    public void addNewSpawn(L2Spawn spawn, boolean storeInDb)
    {
        _highestId++;
        spawn.setId(_highestId);
        _spawntable.put(_highestId, spawn);            <<<<<<<<<<<<<< LINE 169

        if (storeInDb)
        {
            java.sql.Connection con = null;

            try
            {
                con = L2DatabaseFactory.getInstance().getConnection();
                PreparedStatement statement = con.prepareStatement("INSERT INTO spawnlist (id,count,npc_templateid,locx,locy,locz,heading,respawn_delay,loc_id) values(?,?,?,?,?,?,?,?,?)");
                statement.setInt(1, spawn.getId());
                statement.setInt(2, spawn.getA-beep-t());
                statement.setInt(3, spawn.getNpcid());
                statement.setInt(4, spawn.getLocx());
                statement.setInt(5, spawn.getLocy());
                statement.setInt(6, spawn.getLocz());
                statement.setInt(7, spawn.getHeading());
                statement.setInt(8, spawn.getRespawnDelay() / 1000);
                statement.setInt(9, spawn.getLocation());
                statement.execute();
                statement.close();
            }
            catch (Exception e)
            {
                // problem with storing spawn
                _log.warning("SpawnTable: Could not store spawn in the DB:" + e);
            }

  • 0
Posted

line 482 sto diko m

 

				if (locationIndex == locationCount)
					locationIndex = 0;

				spawnInst._lastLocIndex = locationIndex;
			}

			// Set the X, Y and Z co-ordinates, where this spawn will take
			// place.
			final int x = locationList[locationIndex].getX();
			final int y = locationList[locationIndex].getY();
			final int z = locationList[locationIndex].getZ();
			final int heading = locationList[locationIndex].getHeading();
                                                                                     <<<<<<<<<<< line 482
			// Fetch the template for this NPC ID and create a new spawn.
			L2NpcTemplate npcTemp = NpcTable.getInstance().getTemplate(spawnInst.getNpcId());
			if (npcTemp == null)
			{
				_log.warning("Couldnt find NPC id" + spawnInst.getNpcId()+ " Try to update your DP");
				return;
			}
			L2Spawn newSpawn = new L2Spawn(npcTemp);

			newSpawn.setLocx(x);
			newSpawn.setLocy(y);

 

ευχαρηστω π προσπαθεις να με βοηθησεις!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...