#if i tempban a player using the banlist

1 messages · Page 1 of 1 (latest)

north gazelle
#

@soft mirage

#
[
  {
    "uuid": "25ec173a-0c50-4bd9-848f-67676b531533",
    "name": "TheTimeee",
    "created": "2022-05-07 09:21:35 +0000",
    "source": "TheTimeee",
    "expires": "2022-05-07 09:21:45 +0000",
    "reason": "Because that"
  }
]
#

the issue is after a tempban that looks like this ran out

#

the first time the player logs in

#

there is a null error thrown sec

#
07.05 10:14:43 [Server] Server thread/WARN Failed to handle packet for /79.197.243.206:51827
07.05 10:14:43 [Server] INFO java.lang.NullPointerException: Cannot invoke "net.minecraft.server.players.GameProfileBanEntry.f()" because the return value of "net.minecraft.server.players.GameProfileBanList.b(Object)" is null
07.05 10:14:43 [Server] INFO at net.minecraft.server.players.PlayerList.canPlayerLogin(PlayerList.java:586) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.network.LoginListener.d(LoginListener.java:156) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.network.LoginListener.c(LoginListener.java:74) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.network.NetworkManager.a(NetworkManager.java:258) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:172) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1352) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:429) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1237) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1047) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.lamb (/79.197.243.206:51827) has disconnected, reason: Internal server error
#

removed some lines

soft mirage
#

Keep in mind

north gazelle
#

cause char limit

soft mirage
#

It’s 3 am

#

For me

#

But

north gazelle
#

sorry xD

soft mirage
#

I think that’s an issue with spigot or you

#

Could be wrong here

north gazelle
#

if i call this

soft mirage
#

But

#

It looks like

north gazelle
#
    @EventHandler
    public static void onAsyncPlayerPreLogin(AsyncPlayerPreLoginEvent event)
    {
        TempbanCommand.onAsyncPlayerPreLogin(event.getName());
    }
soft mirage
#

It’s being deleted form hard storage

#

But not local memory

north gazelle
#
public static void onAsyncPlayerPreLogin(String name)
    {
Bukkit.getBanList(Type.NAME).getBanEntry(name);            
soft mirage
#

And then it try’s to update it in storage but it’s not there

north gazelle
#

the error doesnt occur

#

hm

soft mirage
#

Oh

north gazelle
#

if i call this method

soft mirage
#

Maybe it’s just one of those things

#

That has to be a sync

north gazelle
#

the error wont occur

soft mirage
#

There’s some methods

north gazelle
#

wait

soft mirage
#

That just have to be async for no apparent reason

north gazelle
#

thing is

north gazelle
#

for a tempban

#

so my tempban parsing correctly?

soft mirage
#

Does base Minecraft even have tempbans lol

#

Lemme check

#

On the formatting

north gazelle
#

i mean if thats a problem i could just as good write my own tempban system

#

but i prefer to use vanilla systems when they exist

soft mirage
#

You could just steal this guys code

#

Not steal

#

Be inspired by

#

Gotta scroll down a bit

north gazelle
#

i mean i could just as good write a method that checks in its own tempban file wheter or not guys being temp banned still

soft mirage
#

I gtg tho

north gazelle
#

gl man 😄

soft mirage
#

That’s what I would do

soft mirage
north gazelle
#

😉

#

i mean i got the serializer and stuff

#

that aint the problem

#

and i can check in the PlayerLoginEvent if that guys banned and kick him if so

soft mirage
#

Yea do that

north gazelle
#

since tempbans are rare tho ill prob not keep it in memory and just deserialize the file when someone logs in