Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

[BUG] [Fabric] The coordinate of the last disconnect is not saved #31

Open
1 of 2 tasks
Zailer43 opened this issue Oct 21, 2020 · 6 comments
Open
1 of 2 tasks

[BUG] [Fabric] The coordinate of the last disconnect is not saved #31

Zailer43 opened this issue Oct 21, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Zailer43
Copy link

Mod Loader

  • Fabric
  • Forge

Versions

  • SimpleAuth 1.6.1
  • Fabric API 0.22.1+build409

Describe the bug
You connect in a place you disconnected several days ago but not last time

To Reproduce
Steps to reproduce the behavior:

  1. Connect to the server
  2. Disconnect in one place
  3. Connect 3 minutes later
  4. Connecting and disconnecting multiple times
  5. Disconnect in a different place
  6. Connect and see that you're in the 1st place

Expected behavior
Connecting in the place of your last disconnection

Additional context
This has happened to 2 players in my survival

The first one has passed 2 times, has a very bad pc so sometimes when entering the server it crashes constantly until it finally manages to get in and be online for a good while

The second has a very bad internet and there are times that it is only 20 or 30 minutes just disconnecting and reconnecting, sometimes it has good connection for a few hours

My theory is that when disconnected multiple times it is not saved well and that is why the location is used 1 or 2 days before (although 3 times was only 1 day)

@Zailer43 Zailer43 added the bug Something isn't working label Oct 21, 2020
@Zailer43 Zailer43 changed the title [BUG] [Fabric] [BUG] [Fabric] The coordinate of the last disconnect is not saved Oct 21, 2020
@samolego
Copy link
Owner

samolego commented Oct 21, 2020

So if I understood correctly;
player leaves on A and upon rejoining is teleported to B (spawn). After successful login, player is teleported to A again. However when they stop playing (on C) they are teleported to A once more?

@samolego
Copy link
Owner

Humm, after lots of tries I cannot seem to be able to reproduce this. Even Alt+F4-ing the game during connection proccess it seems to be working normally ...

@Zailer43
Copy link
Author

So if I understood correctly;
player leaves on A and upon rejoining is teleported to B (spawn). After successful login, player is teleported to A again. However when they stop playing (on C) they are teleported to A once more?

something like this, if it goes into the server and had disconnected into B, it connects to A, then if the player has bad connection is disconnected after moving a few blocks, then when connecting it is back in A, then it repeats this a few times until it has stable connection, when it has already been connecting several minutes and disconnects in C it does not happen again

@Zailer43
Copy link
Author

More in context with what happened to the players of my survival:

The first player built his house, I put some logs, then he had to go (A), the next day he came and finished his house (B), the next day he connected where he had disconnected when he built the house (A), was inside logs and after loging he began to suffocate, after moving 2 or 3 blocks he left the connection (C) and when he returned he was back in the logs suffocating (A) , this is repeated a few times until it ends halfway through life with full netherite, when you get a stable connection and it doesn't last less than 2 minutes you end up decorating the inside of your home (D) and the next time you connect it's all right

The second player was looking for elitras in the end, disconnected in 2k (A), the next day he leaves as he had almost no food, then goes home (B), is a while disconnecting and connecting, that night when he has stable connection he will fight the dragon, dies, I do not know where he disconnected but I guess it was at home recovering his things (C) , the next day he comes and is in A

@IotaBread
Copy link

I think #34 could be related. What is described here and above is also what happens in #34:

  1. Player connects at location A, leaves at location B
  2. Player connects at location B, enters a wrong password and gets kicked
  3. Player connects back again, this time at location A.

Sadly, I don't have access to a Fabric server anymore, because the one I was having the issues with closed shortly after I opened #34.
I think this command could be a way to test it easily, but I'm not sure.

public class FooCommand {
    public static void register(CommandDispatcher dispatcher) {
        dispatcher.register(CommandManager.literal("foo").executes(context -> {
            ServerPlayerEntity player = context.getSource().getPlayer();
            player.networkHandler.disconnect(new LiteralText("Foo command"));
            return 1;
        }));
    }
}

@samolego
Copy link
Owner

Humm, how to describe this ...
It's normal that players get TP-ed around if you use spawnOnJoin, it's not normal, however, that they are not TP-ed back when they enter right password.

I'll try to reproduce it with above command, but I doubt it works differently than normal wrong password disconnect ..?
You can also enable debugMode in config, to see what's happening behind the scenes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants