Initiate Mage
- Joined
- Jul 18, 2021
- Messages
- 1
- Reaction score
- 0
java.lang.NullPointerException
at tools.packet.PacketHelper.addSkillInfo(PacketHelper.java:142)
at tools.packet.PacketHelper.addCharacterInfo(PacketHelper.java:637)
at tools.packet.CField.getCharInfo(CField.java:1389)
at handling.channel.handler.InterServerHandler.Loggedin(InterServerHandler.java:178)
at handling.MapleServerHandler.handlePacket(MapleServerHandler.java:644)
at handling.MapleServerHandler.messageReceived(MapleServerHandler.java:490)
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.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Unknown Source)
Post addSkillInfo code
public static final void addSkillInfo(final MaplePacketLittleEndianWriter mplew, final MapleCharacter chr) { // 0x100
final Map<Skill, SkillEntry> skills = chr.getSkills();
boolean useOld = skills.size() < 500;
mplew.write(useOld ? 1 : 0); // To handle the old skill system or something?
if (useOld) {
mplew.writeShort(skills.size());
for (final Entry<Skill, SkillEntry> skill : skills.entrySet()) {
mplew.writeInt(skill.getKey().getId());
mplew.writeInt(skill.getValue().skillevel);
addExpirationTime(mplew, skill.getValue().expiration);
if (skill.getKey().isFourthJob()) {
mplew.writeInt(skill.getValue().masterlevel);
}
}
} else {
final Map<Integer, Integer> skillsWithoutMax = new LinkedHashMap<>();
final Map<Integer, Long> skillsWithExpiration = new LinkedHashMap<>();
final Map<Integer, Byte> skillsWithMax = new LinkedHashMap<>();
// Fill in these maps
for (final Entry<Skill, SkillEntry> skill : skills.entrySet()) {
skillsWithoutMax.put(skill.getKey().getId(), skill.getValue().skillevel);
if (skill.getValue().expiration > 0) { skillsWithExpiration.put(skill.getKey().getId(), skill.getValue().expiration);
}
if (skill.getKey().isFourthJob()) {
skillsWithMax.put(skill.getKey().getId(), skill.getValue().masterlevel);
}
}
int amount = skillsWithoutMax.size();
mplew.writeShort(amount);
for (final Entry<Integer, Integer> x : skillsWithoutMax.entrySet()) {
mplew.writeInt(x.getKey());
mplew.writeInt(x.getValue()); // 80000000, 80000001, 80001040 show cid if linked.
}
mplew.writeShort(0); // For each, int
amount = skillsWithExpiration.size();
mplew.writeShort(amount);
for (final Entry<Integer, Long> x : skillsWithExpiration.entrySet()) {
mplew.writeInt(x.getKey());
mplew.writeLong(x.getValue()); // Probably expiring skills here
} mplew.writeShort(0); // For each, int
amount = skillsWithMax.size();
mplew.writeShort(amount);
for (final Entry<Integer, Byte> x : skillsWithMax.entrySet()) {
mplew.writeInt(x.getKey());
mplew.writeInt(x.getValue());
}
mplew.writeShort(0); // For each, int
}
}
When do you see this pop-up? Can you replicate it to trigger the null pointer? If so, set a breakpoint then step into and follow where it shows null
Post <font color="#666666">addSkillInfo code</font>
What's the code in line 142? Because i don't see anything wrong on it
mplew.writeInt(skill.getKey().getId());