Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Disconnect after character selection

Newbie Spellweaver
Joined
Nov 9, 2017
Messages
22
Reaction score
0
Hello everyone, currently I'm doing v179.4 in my local host. I'm using this source . But I got disconnect after typing PIC and choose character. Here is the error in bat. Tks a lot for your help
java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at handling.OpcodeManager.handle(OpcodeManager.java:138) at handling.MapleServerHandler.messageReceived(MapleServerHandler.java:192) at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220) at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) at java.base/java.lang.Thread.run(Unknown Source)Caused by: java.lang.NullPointerException at client.MapleCharacter.loadCharFromDB(MapleCharacter.java:630) at client.MapleCharacter.loadCharFromDB(MapleCharacter.java:523) at handling.handlers.login.PlayerLoggedInHandler.handle(PlayerLoggedInHandler.java:73) ... 21 more[UNHANDLED] Recv [PLAYER_LOGGEDIN] found
 
Junior Spellweaver
Joined
Sep 16, 2017
Messages
156
Reaction score
36
Let's see what the cause of this could be.
If you look into that stack trace, paying attention to the bottom of the list, you'll notice this:

[...] java.base/java.lang.Thread.run(Unknown Source)Caused by: java.lang.NullPointerException at
client.MapleCharacter.loadCharFromDB(MapleCharacter.java:630)
at
client.MapleCharacter.loadCharFromDB(MapleCharacter.java:523) at
handling.handlers.login.PlayerLoggedInHandler.handle(PlayerLoggedInHandler.java:73)[...]


Now, looking at the source, at line 630 of MapleCharacter.java we have this:
PHP:
MaplePortal portal = ret.map.getPortal(ret.initialSpawnPoint);

Something here is the null pointer that's causing everything to go bonkers. What could be our culprit null value?
Definitely not ret, otherwise the error would have been thrown way earlier.
ret.initialSpawnPoint would likely throw an error inside the function it's been passed as argument of, not in here.
I'd say it's likely to be ret.map. So, you would be trying to call getPortal(int) of a null, thing that would obviously throw a null pointer exception.

So, if that's the case; we gotta ask ourselves how ret.map is set.

There's a null handling right before line 630:
PHP:
if (ret.map == null) { //char is on a map that doesn't exist warp it to spinel forest
     ret.map = mapFactory.getMap(100000000);
}
(100000000 is the map ID for Henesys, by the way, might wanna check on that)

ret.map was intended to be set as the result of a character database query from the column "spawnpoint" ( ); I'll assume you actually do have that column. Besides, it wouldn't be our current issue, so let's ignore that now.

If "spawnpoint" is not an int that corresponds to any map, ret.map will be null, and that "safety measure" up there will be called.
This would call the getMap overload with 4 arguments ( ): if my guess is correct, then the map that this function returns is a null.
To verify that, I'd suggest adding some log message right before the final "return map;" at line 398.
Something like
PHP:
Logger.getLogger(MapleMapFactory.class.getName()).log(Level.INFO, (map == null).toString());
If this prints "true", then you know that the map you're being given is null.

EDIT: don't forget to add the two imports, at the beginning of MapleMapFactory:
PHP:
import java.util.logging.Level;
import java.util.logging.Logger;
 
Upvote 0
Back
Top