Hey all,
I currently have PlayerLoggedInEvent for a whitelist mod I made. Only problem with this is it still shows the "X logged in" on the server to all of the players. This allows people to spam the chat when they try to connect.
Basically I'm catching people when they log in then kicking them if they aren't on the list. This seems very inefficient to me, but I haven't found an alternate at this point. I've looked in other mods that featured some sort of whitelist and they all seem to be doing roughly the same thing, maybe a different event but similar and still have the problem that the player connects before getting kicked.
The vanilla whitelist doesn't have this happen and seems to fire when they first attempt to make a connection to the server. During this phase I can see the UUID of a player and their Username but can't find how/if I can interact with them and essentially cancel their connection request and shoot back a message.
I don't want to add people to the vanilla whitelist because that also seems not quite right.
So, Is there an event that fires when a player attempts to connect, or is there a way to register a connection handler that I can intercept connections before the server sees them?
Also dealing with people crashing when getting kicked but only if there are X number of mods in the client.. but that is something for another day, since I don't even know the limit of mods before a crash happens.