SamB440 / Tale-of-Kingdoms

An adventure of glory in the world of Minecraft - Revival of Tale of Kingdoms mod
GNU General Public License v3.0
16 stars 2 forks source link

Can't enter the server with this mod again(Invalid Player Data) #67

Closed SamB440 closed 2 years ago

SamB440 commented 2 years ago

In GitLab by @ld213ld on Aug 26, 2021, 23:23

When used on a server with offline mode enabled, you can enter the server for the first time, but the start conquest page won't appear and manually using the start new conquest key won't work either, there is no castle generated in the server weather it's a new world or an existing world, and if you log off the server and try to log in again, the server will deny your connection request and send an error message of Invalid Player Data. I'm on Mod version 1.0.2 Minecraft 1.17.1 Fabric Loader 0.11.6 Fabric Api 0.38.2

SamB440 commented 2 years ago

"Invalid Player Data" is a vanilla message not a ToK one.

The start conquest menu will not appear on servers. It will be automatically generated near 0,0 when the first player joins.

SamB440 commented 2 years ago

In GitLab by @ld213ld on Aug 27, 2021, 21:16

Hi, I understand what you mean, but I did a little more testing and found out this: First of all, the mod worked perfectly in my client when playing single player game, To rule out any mod compatibility issues, I deleted all mods and only left ToK 1.02 and Fabric API left on my server, deleted all worlds in my server, no plugins or anything, a clean new Fabric 1.17 server in offline mode(server.properties->onlinemode=false), and without this mod, I won't encounter the disconnect: Invalid Player Data issue whatsoever but as soon as I added the ToK mod, the first login session after this crashed my client and my server side log window gave a large amount of error reports regards the castle generation process(before starting the server I already deleted all worlds again and started the server with the mod), and after restarting my client will now always crash when trying to join the server, all login attempts after that first one will return the disconnect: Invalid Player Data issue, so I can't rule out the possibility that ToK caused this problem, can you review this a bit more please? I appreciate for the effort you made. And If I made any grammar mistake I'm sorry cause I'm a Chinese university student majoring in CS so I fully understand the pain of programming and debugging, so thanks a lot in advance.

P.S. even if this really isn't a problem of your side, or you can't fix it any time soon, maybe I could help translate this mod to Chinese cause I'm really interested in this mod and also I had experience in help translating games to Chinese (my previous project is a game on Steam called Hobo: Tough Life, and my name is in the credits of translators.)

Again, thanks in advance for your potential reply of this issue and your hard work for bringing this awesome mod for us!

Client-side Crash Report:

Time: 2021/8/28 上午3:55 Description: Unexpected error

java.lang.NullPointerException: Cannot read field "field_13073" because "☃" is null at net.minecraft.class_2874.method_31108(class_2874.java:353) at com.aether.util.RegistryUtil.dimensionMatches(RegistryUtil.java:14) at net.minecraft.class_758.redirect$bgm000$adjustVoidVector(class_758.java:1017) at net.minecraft.class_758.method_3210(class_758.java:143) at net.minecraft.class_761.method_22710(class_761.java:1127) at net.minecraft.class_757.method_3188(class_757.java:1026) at net.minecraft.class_757.method_3192(class_757.java:810) at net.minecraft.class_310.method_1523(class_310.java:1112) at net.minecraft.class_310.method_1514(class_310.java:728) at net.minecraft.client.main.Main.main(Main.java:217) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:234) at net.fabricmc.loader.launch.knot.Knot.launch(Knot.java:153) at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head -- Thread: Render thread Stacktrace: at net.minecraft.class_2874.method_31108(class_2874.java:353) at com.aether.util.RegistryUtil.dimensionMatches(RegistryUtil.java:14) at net.minecraft.class_758.redirect$bgm000$adjustVoidVector(class_758.java:1017) at net.minecraft.class_758.method_3210(class_758.java:143) at net.minecraft.class_761.method_22710(class_761.java:1127) at net.minecraft.class_757.method_3188(class_757.java:1026)

-- Affected level -- Details: All players: 1 total; [class_746['213LD'/533, l='ClientLevel', x=8.50, y=65.00, z=8.50]] Chunk stats: 4096, 0 Level dimension: minecraft:overworld Level spawn location: World: (8,64,8), Section: (at 8,0,8 in 0,4,0; chunk contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 0 game time, 0 day time Server brand: fabric Server type: Non-integrated multiplayer server Stacktrace: at net.minecraft.class_638.method_8538(class_638.java:370) at net.minecraft.class_310.method_1587(class_310.java:2399) at net.minecraft.class_310.method_1514(class_310.java:752) at net.minecraft.client.main.Main.main(Main.java:217) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:234) at net.fabricmc.loader.launch.knot.Knot.launch(Knot.java:153) at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28)

Server-side cmd window prompt:

after I saw the server successfully started, I immediately logged in the server with an offline-mode Minecraft client

[03:55:43] [Server thread/INFO]: Loading schematic, please wait: GUILD_CASTLE

I can see the entering the world prompt in my client

[03:55:47] [Server thread/INFO]: Summoning citizens of the realm...

This is when my client crashed

[03:55:47] [Server thread/INFO]: [STDERR]: java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_3244.method_14364(net.minecraft.class_2596)" because "player.field_13987" is null [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:757) [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731) [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2178) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.create(GameInstanceListener.java:128) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$new$5(GameInstanceListener.java:58) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.execute(class_1255.java:101) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.TaleOfKingdomsAPI.executeOnDedicatedServer(TaleOfKingdomsAPI.java:131) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$new$6(GameInstanceListener.java:41) [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.util.Optional.ifPresent(Optional.java:178) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$new$7(GameInstanceListener.java:40) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.event.PlayerJoinCallback.lambda$static$0(PlayerJoinCallback.java:13) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3324.handler$zel001$onPlayerConnect(class_3324.java:2964) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3324.method_14570(class_3324.java) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.method_33800(class_3248.java:129) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.method_14384(class_3248.java:117) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.redirect$zcm000$handlePlayerJoin(class_3248.java:563) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.method_18785(class_3248.java:67) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2535.method_10754(class_2535.java:234) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3242.method_14357(class_3242.java:183) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:902) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3176.method_3813(class_3176.java:335) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:831) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697) [03:55:47] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270) [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.lang.Thread.run(Thread.java:831) [03:55:47] [Server thread/INFO]: [STDERR]: Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_3244.method_14364(net.minecraft.class_2596)" because "player.field_13987" is null [03:55:47] [Server thread/INFO]: [STDERR]: at net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking.send(ServerPlayNetworking.java:251) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.server.packet.ServerPacketHandler.sendPacket(ServerPacketHandler.java:30) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.server.packet.outgoing.OutgoingInstanceSyncPacketHandler.handleOutgoingPacket(OutgoingInstanceSyncPacketHandler.java:48) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.world.ServerConquestInstance.lambda$sync$0(ServerConquestInstance.java:129) [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.util.Optional.ifPresent(Optional.java:178) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.world.ServerConquestInstance.sync(ServerConquestInstance.java:127) [03:55:47] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$create$13(GameInstanceListener.java:143) [03:55:47] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753) [03:55:47] [Server thread/INFO]: [STDERR]: ... 24 more

After this, my client won't start up anymore and will always crash on start.

SamB440 commented 2 years ago

The first two crashes you give are from the Aether mod.

The final crash seems to say the networkHandler field is null on your player, which should be impossible.

Please make sure you are using this jar on both server and client: https://cdn.discordapp.com/attachments/766366257742086166/878274822252163082/taleofkingdoms-1.0.2.jar

As for localisation, I am currently working on setting up a Crowdin page.

SamB440 commented 2 years ago

In GitLab by @ld213ld on Aug 29, 2021, 14:00

Hello, I found out that I previously used your 1.17 release on curseForge in both my client and my server, and I compared the MD5 between the CurseForge one and your discord one, and the result returned that those two MD5 are different. So this time, I deleted all Mods on both of my client and server fully with only ToK(Discord link one) and Fabric API left on both of my client and server. After using the Discord release one, your mod worked as intended on my server, generated castle on (0,0,0) and my client didn't crash, but I still get the Invalid Player Data error after the first successful login session. But this time, it returned this in my log:

[20:50:55] [Server thread/INFO]: Loading schematic, please wait: GUILD_CASTLE [20:50:57] [Server thread/INFO]: Summoning citizens of the realm... [20:50:57] [Server thread/INFO]: [STDERR]: java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_3244.method_14364(net.minecraft.class_2596)" because "player.field_13987" is null [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:757) [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731) [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2178) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.create(GameInstanceListener.java:128) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$new$5(GameInstanceListener.java:58) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.execute(class_1255.java:101) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.TaleOfKingdomsAPI.executeOnDedicatedServer(TaleOfKingdomsAPI.java:131) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$new$6(GameInstanceListener.java:41) [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.util.Optional.ifPresent(Optional.java:178) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$new$7(GameInstanceListener.java:40) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.event.PlayerJoinCallback.lambda$static$0(PlayerJoinCallback.java:13) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3324.handler$zel001$onPlayerConnect(class_3324.java:2964) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3324.method_14570(class_3324.java) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.method_33800(class_3248.java:129) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.method_14384(class_3248.java:117) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.redirect$zcm000$handlePlayerJoin(class_3248.java:563) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3248.method_18785(class_3248.java:67) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2535.method_10754(class_2535.java:234) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3242.method_14357(class_3242.java:183) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:902) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3176.method_3813(class_3176.java:335) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:831) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697) [20:50:57] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270) [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.lang.Thread.run(Thread.java:831) [20:50:57] [Server thread/INFO]: [STDERR]: Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_3244.method_14364(net.minecraft.class_2596)" because "player.field_13987" is null [20:50:57] [Server thread/INFO]: [STDERR]: at net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking.send(ServerPlayNetworking.java:251) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.server.packet.ServerPacketHandler.sendPacket(ServerPacketHandler.java:30) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.server.packet.outgoing.OutgoingInstanceSyncPacketHandler.handleOutgoingPacket(OutgoingInstanceSyncPacketHandler.java:48) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.world.ServerConquestInstance.lambda$sync$0(ServerConquestInstance.java:129) [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.util.Optional.ifPresent(Optional.java:178) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.world.ServerConquestInstance.sync(ServerConquestInstance.java:127) [20:50:57] [Server thread/INFO]: [STDERR]: at com.convallyria.taleofkingdoms.common.listener.GameInstanceListener.lambda$create$13(GameInstanceListener.java:143) [20:50:57] [Server thread/INFO]: [STDERR]: at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753) [20:50:57] [Server thread/INFO]: [STDERR]: ... 24 more [20:50:57] [Server thread/INFO]: 213LD[/114.245.156.114:10789] logged in with entity id 477 at (-171.5, 73.0, 191.5) [20:50:57] [Server thread/INFO]: 213LD joined the game [20:50:58] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2569ms or 51 ticks behind [20:51:06] [Server thread/INFO]: 213LD lost connection: Disconnected [20:51:06] [Server thread/INFO]: 213LD left the game [20:51:06] [Server thread/INFO]: Saved data [20:51:12] [Server thread/INFO]: com.mojang.authlib.GameProfile@9b1a735[id=e95fc3cb-4134-369d-bcc2-8c21aa42bd2a,name=213LD,properties={},legacy=false] (/114.245.156.114:10796) lost connection: Invalid player data [20:51:12] [Server thread/WARN]: handleDisconnection() called twice

Thanks for your help very much and I will keep an eye out for your Crowdin project! Have a nice day!

SamB440 commented 2 years ago

In GitLab by @ld213ld on Aug 29, 2021, 14:08

BTW, I suspected Fabric API was the culprit of the connection problem, but after I updated my fabric API(from 0.38 to latest release 0.39.2) the problem still exsists.

SamB440 commented 2 years ago

Yes, the jar from Discord is more up-to-date and fixes a crash issue relating to localisation if you have your computer language set to something other than English.

Both of the errors you provided still seem to be pointing to the networkHandler being null.

On further investigation I was able to reproduce the bug, but it seems like this is a fabric API bug.

SamB440 commented 2 years ago

taleofkingdoms-1.0.2.jar

I've been able to fix it with this. It seems the API (or 1.17) changed so that the networkHandler is not available until a player has entered a world.

SamB440 commented 2 years ago

In GitLab by @ld213ld on Aug 29, 2021, 18:28

Okay so thanks so much for replaying and investigating the issue, and I can confirm the fix is working, it's awesome to see it's finally fixed, I hope you for the best in the future!

SamB440 commented 2 years ago

Hi, like you asked, I'm letting you know that I have setup Crowdin: https://crwd.in/tale-of-kingdoms

SamB440 commented 2 years ago

mentioned in commit a913220cb7d926b4f84478dec0e7c5cd06bec4ce

SamB440 commented 2 years ago

In GitLab by @ld213ld on Sep 9, 2021, 17:24

Okay great, awesome! I'll see what can I help.