- Joined
- Aug 3, 2008
- Messages
- 172
- Reaction score
- 26
Hey everyone -
Trying to get the openPortal command to work, particularly in the Fitness Waiting Room map (109040000):
OpenPortalCommand:
After finding the correct portal ID via !debug portal (23), then doing !openportal 23 I get the following error:
Here's the exact error log:
I thought maybe it was because I'm stating params[0] as the parameter instead of params[1], but that doesn't work (just how the commands are setup).
I'd like some help at being able to troubleshoot this.
I see jthere's obviously a NullPointerException at the command, but then is it the same error for all the lines below it? If so, what exactly does a NPE require me to do?
Thanks in advance
Trying to get the openPortal command to work, particularly in the Fitness Waiting Room map (109040000):
OpenPortalCommand:
PHP:
public class OpenPortalCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !openportal <portalid>");
return;
}
player.getMap().getPortal(params[0]).setPortalState(true);
}
}
After finding the correct portal ID via !debug portal (23), then doing !openportal 23 I get the following error:
Here's the exact error log:
PHP:
Error for player ; XXXX on map ; 109040000 - account ; YYYY
All: 31 00 0E 00 21 6F 70 65 6E 70 6F 72 74 61 6C 20 32 38 00
Now: 00
java.lang.NullPointerException
at client.command.commands.gm3.OpenPortalCommand.execute(OpenPortalCommand.java:42)
at client.command.CommandsExecutor.handleInternal(CommandsExecutor.java:133)
at client.command.CommandsExecutor.handle(CommandsExecutor.java:93)
at net.server.channel.handlers.GeneralChatHandler.handlePacket(GeneralChatHandler.java:52)
at net.MapleServerHandler.messageReceived(MapleServerHandler.java:197)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:997)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:641)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1114)
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:437)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:256)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:641)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1114)
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:121)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:641)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:634)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:539)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$1200(AbstractPollingIoProcessor.java:68)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.process(AbstractPollingIoProcessor.java:1242)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.process(AbstractPollingIoProcessor.java:1231)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:683)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I thought maybe it was because I'm stating params[0] as the parameter instead of params[1], but that doesn't work (just how the commands are setup).
I'd like some help at being able to troubleshoot this.
I see jthere's obviously a NullPointerException at the command, but then is it the same error for all the lines below it? If so, what exactly does a NPE require me to do?
Thanks in advance
Last edited: