L2JMobius

Free Users => Solved/Invalid Bug Reports => Topic started by: Susuy on March 29, 2022, 05:02:47 PM

Title: characters returning to level 1 during the up
Post by: Susuy on March 29, 2022, 05:02:47 PM
most of the time the problem happens when the player is in the antharas lair region, after killing the monster the player goes back to level 1 losing all skills

Code: [Select]
Mar 29, 2022 10:11:12 AM org.l2jmobius.commons.network.codecs.PacketEncoder encode
WARNING: Failed sending Packet(org.l2jmobius.gameserver.network.serverpackets.UserInfo@50e734ab)
java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "java.util.Map.get(Object)" is null
at org.l2jmobius.gameserver.data.xml.ExperienceData.getExpForLevel(ExperienceData.java:82)
at org.l2jmobius.gameserver.network.serverpackets.UserInfo.write(UserInfo.java:87)
at org.l2jmobius.commons.network.codecs.PacketEncoder.encode(PacketEncoder.java:51)
at org.l2jmobius.commons.network.codecs.PacketEncoder.encode(PacketEncoder.java:33)
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764)
at io.netty.channel.AbstractChannelHandlerContext$WriteTask.run(AbstractChannelHandlerContext.java:1071)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)

after this message comes others showing more null returns and the server crashes. this has happened 4 times

Erro.log: https://www.mediafire.com/file/7dx4t9ne66xu7xw/error1.pdf/file
Title: Re: characters returning to level 1 during the up
Post by: Mobius on March 29, 2022, 05:47:13 PM
Do you have any modifications?
Try this.
Code: [Select]
Index: java/org/l2jmobius/gameserver/data/xml/ExperienceData.java
===================================================================
--- java/org/l2jmobius/gameserver/data/xml/ExperienceData.java (revision 9990)
+++ java/org/l2jmobius/gameserver/data/xml/ExperienceData.java (working copy)
@@ -79,7 +79,22 @@
  */
  public long getExpForLevel(int level)
  {
- return _expTable.get(level);
+ if (level <= 0)
+ {
+ LOGGER.warning(getClass().getSimpleName() + ": Requested exp for level " + level);
+ Thread.dumpStack();
+ return 0;
+ }
+
+ final Long exp = _expTable.get(level);
+ if (exp == null)
+ {
+ LOGGER.warning(getClass().getSimpleName() + ": Requested exp for level " + level);
+ Thread.dumpStack();
+ return _expTable.get((int) MAX_LEVEL);
+ }
+
+ return exp.longValue();
  }
 
  /**
Title: Re: characters returning to level 1 during the up
Post by: Susuy on March 30, 2022, 04:48:46 AM
I have some but they are all in the datapack, they are custom items. I already applied the diff, I'll put it online to test thanks
Title: Re: characters returning to level 1 during the up
Post by: Mobius on April 01, 2022, 01:06:57 PM
Any news?
Title: Re: characters returning to level 1 during the up
Post by: Susuy on April 02, 2022, 01:15:59 AM
Sorry for the delay, so far the problem has not been repeated. overflow, as few times waiting in all these months can take a while. ate now the player did not complain again.
Title: Re: characters returning to level 1 during the up
Post by: Mobius on April 02, 2022, 02:18:57 AM
Fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/79481a44f23f0723cefca3a947f4b9f9ea7b7ca7