Couldn't Spawn Fake Player With LuckPerms
Xiaoyi311 opened this issue · 4 comments
Command:/player <player> spawn at ~ ~ ~
Mod List:
- LuckPerms v5.4.134
- Carpet 1.4.147+v240613
Server Log:
[01:54:42 INFO] [Netty Server IO #5]: [BetterFabricConsole] Xiaoyi311 issued server command: /player <player> spawn at ~ ~ ~
[01:54:42 INFO] [Server thread]: [PlayerList] <player>[local] logged in with entity id 454 at (-193.44999998807907, -54.4375, 503.7422109020281)
[01:54:42 WARN] [Server thread]: [luckperms] User xxxx-xxxx-xxxx-xxxx-xxxx - <player> doesn't currently have data pre-loaded - denying login.
After using the command, there was no output from the client. Attempting to kill resulted in the error "Can only manipulate existing players"
LuckPerms Issues: LuckPerms/LuckPerms#3566
Which side's problem is this? I have reviewed Carpet's previous issues regarding this issue, but there is no definitive solution.
By comparing the LuckPerms logs with those of normal players who successfully logged in, it was found that there were indeed missing information
Normal Player:
[03:02:53 INFO] [Server thread]: [luckperms] Processing pre-login (sync phase) for xxxx-xxxx-xxxx-xxxx-xxxx - <NormalPlayer>
[03:02:53 INFO] [luckperms-worker-1]: [luckperms] Processing pre-login (async phase) for xxxx-xxxx-xxxx-xxxx-xxxx - <NormalPlayer>
[03:02:56 INFO] [Server thread]: [PlayerList] <NormalPlayer>[/x.x.x.x:xxxxx] logged in with entity id 2198 at (54.00060282828072, -55.0, 82.05169159060367)
[03:02:56 INFO] [Server thread]: [luckperms] Processing login for xxxx-xxxx-xxxx-xxxx-xxxx - <NormalPlayer>
[03:02:56 INFO] [Server thread]: [DedicatedServer] <NormalPlayer>加入了游戏
Fake Player(Carpet):
[03:03:32 INFO] [Netty Server IO #0]: [BetterFabricConsole] Xiaoyi311 issued server command: /player dream spawn
[03:03:34 INFO] [Server thread]: [PlayerList] <FakePlayer>[local] logged in with entity id 2230 at (-722.0, -57.0, -230.0)
[03:03:34 INFO] [Server thread]: [luckperms] Processing login for xxxx-xxxx-xxxx-xxxx-xxxx - <FakePlayer>
[03:03:34 WARN] [Server thread]: [luckperms] User xxxx-xxxx-xxxx-xxxx-xxxx - <FakePlayer> doesn't currently have data pre-loaded - denying login.
Clearly missing pre logic steps, may it be due to improper Carpet packaging?
By browsing through the LuckPerms source code "me.lucko.luckterms.fabric.listeners.FabricConnectListener$registrant Listeners", it was found that pre login actually listens to ServerLoginConnectionEvents.QUERY_START
, This means that this event was not triggered correctly when Fake Player joined the game
By viewing the Fabric API source code The only invoice for ServerLoginConnectionEvents.QUERY_START is on net.fabricmc.fabric.mixin.networking.ServerLoginNetworkHandlerMixin$handlePlayerJoin
, it redirected net.minecraft.server.network.ServerLoginPacketListenerImpl$tick
The code is as follows
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerLoginNetworkHandler;tickVerify(Lcom/mojang/authlib/GameProfile;)V"))
private void handlePlayerJoin(ServerLoginPacketListenerImpl instance, GameProfile profile) {
// Do not accept the player, thereby moving into play stage until all login futures being waited on are completed
if (this.addon.queryTick()) {
this.tickVerify(profile);
}
}
That's mean tick method was not triggered?