- Joined
- Apr 21, 2012
- Messages
- 337
- Reaction score
- 145
Please send me the fix for Reactors so Bosses can spawn and Boxes...what is going on I thought this was working?
Error Bat
java.lang.NullPointerException
at scripting.reactor.ReactorScriptManager.act(ReactorScriptManager.java:
58)
at server.maps.MapleReactor.hitReactor(MapleReactor.java:182)
at server.maps.MapleReactor.hitReactor(MapleReactor.java:138)
at server.maps.MapleMap$ActivateItemReactor.run(MapleMap.java:1803)
at server.TimerManager$LoggingSaveRunnable.run(TimerManager.java:137)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1734)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2019)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1937)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1922)
at client.MapleCharacter.saveToDB(MapleCharacter.java:3555)
at scripting.event.EventManager.updateRankings(EventManager.java:182)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.org.mozilla.javascript.internal.MemberBox.invoke(Unknown Source)
at sun.org.mozilla.javascript.internal.NativeJavaMethod.call(Unknown Sou
rce)
at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Unknown
Source)
at sun.org.mozilla.javascript.internal.Interpreter.interpret(Unknown Sou
rce)
at sun.org.mozilla.javascript.internal.InterpretedFunction.call(Unknown
Source)
at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(Unknown
Source)
at com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(Unknown
Source)
at com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(Unknown Sourc
e)
at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(Unknown S
ource)
at sun.org.mozilla.javascript.internal.InterpretedFunction.call(Unknown
Source)
at com.sun.script.javascript.RhinoScriptEngine.invoke(Unknown Source)
at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(Unknown So
urce)
at scripting.event.EventManager$2.run(EventManager.java:102)
at server.TimerManager$LoggingSaveRunnable.run(TimerManager.java:137)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The Source of the Reactor
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <[email protected]>
Matthias Butz <[email protected]>
Jan Christian Meyer <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package scripting.reactor;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.script.Invocable;
import client.MapleClient;
import tools.DatabaseConnection;
import scripting.AbstractScriptManager;
import server.maps.MapleReactor;
import server.maps.ReactorDropEntry;
/**
* @author Lerk
*/
public class ReactorScriptManager extends AbstractScriptManager {
private static ReactorScriptManager instance = new ReactorScriptManager();
private Map<Integer, List<ReactorDropEntry>> drops = new HashMap<Integer, List<ReactorDropEntry>>();
public synchronized static ReactorScriptManager getInstance() {
return instance;
}
public void act(MapleClient c, MapleReactor reactor) {
try {
ReactorActionManager rm = new ReactorActionManager(c, reactor);
Invocable iv = getInvocable("reactor/" + reactor.getId() + ".js", c);
// System.out.println(reactor.getId());
if (iv == null) {
return;
}
engine.put("rm", rm);
ReactorScript rs = iv.getInterface(ReactorScript.class);
rs.act();
} catch (Exception e) {
e.printStackTrace();
}
}
public List<ReactorDropEntry> getDrops(int rid) {
List<ReactorDropEntry> ret = drops.get(rid);
if (ret == null) {
ret = new LinkedList<ReactorDropEntry>();
try {
PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("SELECT itemid, chance FROM reactordrops WHERE reactorid = ? AND chance >= 0");
ps.setInt(1, rid);
ResultSet rs = ps.executeQuery();
while (rs.next()) {
ret.add(new ReactorDropEntry(rs.getInt("itemid"), rs.getInt("chance")));
}
rs.close();
ps.close();
} catch (Exception e) {
e.printStackTrace();
}
drops.put(rid, ret);
}
return ret;
}
public void clearDrops() {
drops.clear();
}
public void touch(MapleClient c, MapleReactor reactor) {
touching(c, reactor, true);
}
public void untouch(MapleClient c, MapleReactor reactor) {
touching(c, reactor, false);
}
public void touching(MapleClient c, MapleReactor reactor, boolean touching) {
try {
ReactorActionManager rm = new ReactorActionManager(c, reactor);
Invocable iv = getInvocable("reactor/" + reactor.getId() + ".js", c);
if (iv == null) {
return;
}
engine.put("rm", rm);
ReactorScript rs = iv.getInterface(ReactorScript.class);
if (touching) {
rs.touch();
} else {
rs.untouch();
}
} catch (Exception e) {
}
}
}
I don't have this issue, and I cannot seem to replicate it, it must be an issue with your setup.

