WasabiThumb / xclaim

A better chunk claiming system for Paper servers
Mozilla Public License 2.0
19 stars 10 forks source link

When you add a trusted player and then click on him server crashes #128

Closed Krayir5 closed 1 month ago

Krayir5 commented 2 months ago

So again in my server some player tried this and got a error and then i tried that on my alt server and here is what i got latest.log

WasabiThumb commented 1 month ago

It's regrettable that I no longer have time to test this stuff in multiplayer, hard to catch things like this by myself. For some reason fetching the trust database is taking an unreasonable amount of time on your system. It's not a deadlock, more like a.... barelyalivelock :). But Paper still sees that the server is unresponsive and kills it. Needless to say this shouldn't happen and I'll check it out when I get the chance.

WasabiThumb commented 1 month ago

If I had to guess, the issue is here:

        List<OfflinePlayer> list = getTrustedPlayers();
        boolean removed = false;
        while (list.contains(player)) {
            list.remove(player);
            removed = true;
        }
        return removed;

Suggesting that list.contains(player) is never false, even though list.remove(player) is ran repeatedly. Now I'll admit that some bad 4 year old design choices led to this situation, but it's still weird that it isn't working.

What I'll probably do is refactor the trusted players collection to be based on a Set<UUID>, eliminating the need for the loop.

WasabiThumb commented 1 month ago

Made those changes, but it might be a while until I can thoroughly test it. If you want, you can grab the CI build here (Artifacts > artifact; unzip)

Krayir5 commented 1 month ago

Works fine for me

WasabiThumb commented 1 month ago

Works fine for me

First try? Impossible 😂. Good to hear though, and I'll merge it when I can verify for myself.

Krayir5 commented 1 month ago

Works fine for me

First try? Impossible 😂. Good to hear though, and I'll merge it when I can verify for myself.

Yeah but i'm still testing for other things in case there's something else