Closed Andre601 closed 5 months ago
Use the UUIDManager for the uuid parameter
I would assume it's UUIDManager#getInMemoryName(String)
here?
Or should the getNameFromUUID(String, boolean)
be used here? If so, should I also force init on it?
And finally, why does AdvancedBan handle UUIDs like that (As Strings)? Why not utilize actual UUID instances and have the resolving done behind the scenes (As in making a method like getPunishments
that actually takes a UUID parameter and then have it resolved in the method using the UUIDManager)?
This here feels like a lot of extra work that devs shouldn't really need, not to mention a lot of confusion on what you need to provide for what method.
But given this resource hasn't seen an active commit since 2 years would my suggestions most likely not see any possible implementation here...
Also, looking at the getPunishments
method's description, I cannot see where using UUIDManager is helpful here...
The description for the target
parameter says "the uuid or ip to search for", so it should accept a String of a UUID, which I do give here... So what does the UUIDManager do differently here?
I found the problem, which from what I get is, that AdvancedBan wants UUIDs without dashes which is.... why? If you use UUIDs, support the default format?
Either way, it seems to work now.
I found the problem, which from what I get is, that AdvancedBan wants UUIDs without dashes which is.... why? If you use UUIDs, support the default format?
Either way, it seems to work now.
This is to keep the lookups on UUIDs consistent.
The reason why the UUIDManager exists is to also support the lookup of non-premium users. So best is to stick with it rather than using the getUniqueID one
Well, I don't support nor endorse offline-mode servers or proxies, so there is another reason now for why I won't use the UUIDManager... The solution I have right now seems to work, and if people complain will I simply tell them the same as I just did here: That I don't support offline mode.
What version of AdvancedBan (
/AdvancedBan
) are you using? 2.3.0 (Latest downloaded from Spigot)What kind of server do you have (
Bungeecord/single server
)? BungeeCordWhat server version (/version) are you using? Proxy: 1.20-R0.2-SNAPSHOT (92b5149 build 562)
Please provide the EXACT steps required to reproduce the problem...
PunishmentManager.get()
PunishmentManager#getPunishments(uuid, type, boolean);
Any error/log post it through pastebin.com and link it here. (Also include /plugins/AdvancedBan/logs/latest.log) No latest.log available by the plugin. Folder is empty.
Add any additional information below. I'm currently in the process of implementing an addon for my own plugin to allow placeholders using AdvancedBan data on the proxy... But right now whenever my plugin tries to obtain a Punishment from a guaranteed punished player is the List empty, resulting in a false negative output.
The full Class where I handle placeholders and use the PunishmentManager of AdvancedBan:
The logs print as follows:
This shows that the PunishmentType is Ban, which I used for testing here, yet getPunishments with a valid UUID and punishment type returns an empty list...
I'm out of ideas what the issue is. My only guess would be either that the database does not have the UUID stored and instead assumes "target" is a username? Alternatively is this a caching issue on your end, or an issue with the boolean arg to get recent and not historical punishments.
Either way, I would appreciate some help here, because Javadocs don't help with this at all and the plugin lacks a proper wiki for developers to work with this plugin...