Inventory-Rollback-Plus icon indicating copy to clipboard operation
Inventory-Rollback-Plus copied to clipboard

Bug report: Problem with showing offline player data

Open pjindras opened this issue 1 year ago • 15 comments

Bug description:

When I want to see offline player data, which are in DB with correct UUID, it shows, that the player never played on this server.

Server details:

  • Purpur 1.20.4, offline mod
  • InventoryRollbackPlus version: 1.16.6

How to reproduce:

Try to view offline player data.

What was expected:

Data, from DB, they are there, with correct uuid (compared with luckperms) but I cannot see it in game

I can provide any other information.

pjindras avatar May 30 '24 17:05 pjindras

You need to setup your server configuration files correctly. Given what you are telling me, I will assume that you are running an offline server under a proxy such as velocity or bungeecord. However, I would be able to check this if you had provided me with logs as requested...

Make sure that each sub-server is listed as proxy-online mode + bukkit offline mode for these lookups to work correctly.

TechnicallyCoded avatar May 30 '24 20:05 TechnicallyCoded

I am using offline server under Velocity, but I am using the plugin only on the one offline server, not on the proxy or other servers. This is my config, what is wrong there or how it should be installed: https://mclo.gs/GTVJJzt

You mean, that I should have in paper global:

  velocity:
    enabled: true
    online-mode: true

And than in bukkit and velocity.toml online mode = false?

Will the server work for offline mode players? Thank you!

pjindras avatar May 31 '24 08:05 pjindras

Are you a fully offline server? Or simply a premium network with offline backends?

TechnicallyCoded avatar May 31 '24 09:05 TechnicallyCoded

We are fully offline server.

pjindras avatar May 31 '24 10:05 pjindras

Is it bug or is it config issue on my side? @TechnicallyCoded

pjindras avatar Jun 19 '24 19:06 pjindras

I save all the data into mysql and all plugins (luckperms etc. ) work fine with the offline data

pjindras avatar Jun 19 '24 19:06 pjindras

Online mode should be false (off) everywhere

TechnicallyCoded avatar Jun 19 '24 20:06 TechnicallyCoded

I have online mode false everywhere

pjindras avatar Jun 19 '24 21:06 pjindras

Online mode should be false (off) everywhere

Hi, please the issue still presists, I can show you video if you need, but for every offline mode player, I cannot restore their inventory, it shows me that the player never played on this server, when he joins, its possible, when he leaves and is not online, it is broken.

I use Velocity (but not IRP plugin for velocity, I can if necessary) I use Paper / Purpur 1.21.1

I have offline mode server (offline mode everywhere).

Please do you have some idea, what could be the issue? Thank you!

@TechnicallyCoded

pjindras avatar Sep 03 '24 16:09 pjindras

@TechnicallyCoded it mus be bug, look, in playerdata, uuid is correct, in luckperms and every other plugin, its correct. In IRP DB its correct. Only when the player is offline, it is calling for his online mode uuid, which doesn't exist and which must be bug in my case or some deficiency in the plugin code how its calling for uuids or players in database.

When I use /lastuuid player and /irp restore and this uuid from there, it works fine, so only it needs an improvement in case of conversion player -> uuid somehow.

pjindras avatar Dec 15 '24 12:12 pjindras

The "conversion" you mention is handled by the server, not the plugin. I'll even send you a link to the exact place in the code, so that you can review it for yourself. That's why I was asking about your server configuration...

TechnicallyCoded avatar Dec 15 '24 17:12 TechnicallyCoded

Link to the line of code that does this conversion

https://github.com/TechnicallyCoded/Inventory-Rollback-Plus/blob/ba0ecb38fdcdd625ae19d2b5eb95f2607c888d49/src/main/java/com/nuclyon/technicallycoded/inventoryrollback/commands/inventoryrollback/RestoreSubCmd.java#L78

TechnicallyCoded avatar Dec 15 '24 17:12 TechnicallyCoded

Link to the JavaDocs describing the behavior of this function https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Bukkit.html#getOfflinePlayer(java.lang.String)

TechnicallyCoded avatar Dec 15 '24 17:12 TechnicallyCoded

The way this getOfflinePlayer system works is:

  • check if a player with that name is actually online -> use that
  • check the online/offline state of the server
    • online? check the cache file in the server root
    • online & not in cache? make a request to Mojang
    • offline? use the name as an input to the function to convert name -> UUID, the seed used is the hashCode of "OfflinePlayer:USERNAME_HERE" string

(from memory, there could be some subtle mistakes, but this is basically how it works.)

It is common for other plugins to get around misconfigured servers by keeping a registry of NAME -> UUID in their own plugin data. That's why you may not see the effects of this issue in other plugins: they've given up trying to fix other people's problems all the time, as such, they fix the symptom in their plugin and move on.

TechnicallyCoded avatar Dec 15 '24 17:12 TechnicallyCoded

Additionally, you have still not provided server log files as requested. I will now stop replying until sufficient information is provided (full log file (including boot and shutdown) + every single config file (bukkit.yml, spigot.yml, server.properties, paper-global.yml) + a full list of every plugin copied directly from /plugins).

I really can't fix your server if you don't even want to provide a server log... I really can't.. I'm no magician..

(yes, you can censor any database IP and passwords, but nothing else is sensitive)

TechnicallyCoded avatar Dec 15 '24 17:12 TechnicallyCoded

No reply

TechnicallyCoded avatar Mar 14 '25 10:03 TechnicallyCoded