Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Geyser/Offline] Placeholder {id} isn't replaced #34

Closed
bobhenl opened this issue Feb 13, 2024 · 10 comments
Closed

[Geyser/Offline] Placeholder {id} isn't replaced #34

bobhenl opened this issue Feb 13, 2024 · 10 comments
Assignees
Labels
bug Something isn't working pending A fix has been completed, pending release

Comments

@bobhenl
Copy link

bobhenl commented Feb 13, 2024

Please include the following information with your report

  • Server type and version (ex. Spigot 1.18.2)
  • Tebex plugin version (ex. 2.0.1)
  • Description of the issue with any error messages, stack traces, or relevant logs.

Purpur 1.20.1
Tebex 20.0.3

Hi, there's issue with replacing placeholders, like I have this command in my store:
lp user {id} parent addtemp gold 1mo accumulate
and it's not being replaced...

in processed commands there's:
lp user 43f296ecd69f8673840d66990de6b49e parent addtemp gold 1mo accumulate

BUT when I look in-game it didn't replace the rank:
lp user 43f296ecd69f8673840d66990de6b49e parent addtemp gold 1mo accumulate

After buying the rank:
[16:01:26] [Server thread/INFO]: [Tebex] Dispatching command 'lp user {id} parent addtemp gold 1mo accumulate' for player 'Peachy_Keen19'.
[LP] A user for {id} could not be found.

After resending the command:
[16:12:28] [Server thread/INFO]: [Tebex] Dispatching command 'lp user {id} parent addtemp gold 1mo accumulate' for player 'Peachy_Keen19'.
[16:12:28] [luckperms-command-executor/INFO]: [LP] A user for {id} could not be found.

Do you think it can be fixed, please?

I guess it's related to the #30

Debug:

[16:22:29] [Craft Scheduler Thread - 8296 - Tebex/INFO]: [Tebex] [DEBUG] Checking for due players..
[16:22:29] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG]  -> GET https://plugin.tebex.io/queue | No body
[16:22:29] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG] 200 <- GET https://plugin.tebex.io/queue 
[16:22:29] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG]  | {"meta":{"execute_offline":false,"next_check":60,"more":false},"players":[{"id":12132492,"name":"Peachy_Keen19","uuid":null}]}
[16:22:29] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG] Found 1 player with pending commands.
[16:22:29] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG] Processing online commands for player 'Peachy_Keen19'...
[16:22:29] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG]  -> GET https://plugin.tebex.io/queue/online-commands/12132492 | No body
[16:22:30] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG] 200 <- GET https://plugin.tebex.io/queue/online-commands/12132492 
[16:22:30] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG]  | {"player":{"id":"43f296ecd69f8673840d66990de6b49e","username":"Peachy_Keen19","meta":null},"commands":[{"id":561162437,"command":"lp user {id} parent addtemp gold 1mo accumulate","payment":71568580,"package":6012688,"conditions":{"delay":0,"slots":0}}]}
[16:22:30] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG] Found 1 online command.
[16:22:30] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG]  -> DELETE https://plugin.tebex.io/queue | {
  "ids": [
    561162437
  ]
}
[16:22:30] [Server thread/INFO]: [Tebex] Dispatching command 'lp user {id} parent addtemp gold 1mo accumulate' for player 'Peachy_Keen19'.
[16:22:30] [luckperms-command-executor/INFO]: [LP] A user for {id} could not be found.
[16:22:30] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG] 204 <- DELETE https://plugin.tebex.io/queue 
[16:22:30] [OkHttp https://plugin.tebex.io/.../INFO]: [Tebex] [DEBUG]  | 
@l3nnartt
Copy link

yes!

@l3nnartt
Copy link

there is also a post on the https://suggestions.tebex.io/337 nolt board

@WildBamaBoy
Copy link
Collaborator

Thanks for the report and the logs. Apologies that this is a recurring issue. Is anyone experiencing this issue also running Geyser?

I can see that Tebex provides both the username and ID no problem...in 6834c99 as long as the player ID is present we will replace {id}. Again based on these logs the player ID is in the response but for some reason player.getUuid() is not returning the appropriate value...

@WildBamaBoy WildBamaBoy added bug Something isn't working question Further information is requested labels Feb 21, 2024
@WildBamaBoy WildBamaBoy self-assigned this Feb 21, 2024
@bobhenl
Copy link
Author

bobhenl commented Feb 22, 2024

Yeah, I have geyser on the server as well. But the player buying the package is java player with online uuid (non offline premium players have still the premium uuid on my server). Cannot it be due to it? That player has both offline and online uuid if he's the premium one ( even when he should use the premium one everywhere)? But uses the online one?

Examples - online premium user:
UUID: f056080a-7356-4de9-ac87-39ebe22dfd51 OnlineUUID: f056080a-7356-4de9-ac87-39ebe22dfd51
--> problem is happening for this online user
offline user:
UUID: 207229ba-e0d0-3fc1-a4cc-004417da12aa OnlineUUID: 7b7af4c6-372e-406c-a3b6-cea58fc73ad1

@l3nnartt
Copy link

We don't use Geyser but RedisBungee and have 3 Waterfall instances and the same issue, maybe that has something to do with it?

@WildBamaBoy WildBamaBoy changed the title Placeholder {id} isn't replaced [Geyser/Offline] Placeholder {id} isn't replaced Feb 23, 2024
WildBamaBoy added a commit that referenced this issue Feb 23, 2024
For Geyser, the UUID returned from Tebex will not be valid. {id} in this case will be replaced with the username as an identifier. Otherwise {id} will contain the user's true valid UUID.
@WildBamaBoy WildBamaBoy added pending A fix has been completed, pending release and removed question Further information is requested labels Feb 23, 2024
@bobhenl
Copy link
Author

bobhenl commented Feb 24, 2024

Also do you think that you can send some build where we can test it @WildBamaBoy earlier, please?

@l3nnartt
Copy link

l3nnartt commented Feb 24, 2024

You can clone the project & checkout the 2.0.4 Branch.
There is the build.sh which you can run but you have to adjust the version in the build.gradle.kts

alternative you can download it here
https://drive.google.com/drive/folders/1o93d2p07F3gvLV1HLKEmcaYCUOfFnGKb

@bobhenl
Copy link
Author

bobhenl commented Feb 25, 2024

image
Seems working, although I made the manual payment from the Payments section -> Create payment, and the package name wasn't replaced, not sure why

WildBamaBoy added a commit that referenced this issue Feb 26, 2024
* fix: ensure received player uuid is string before casting #37

* fix: geyser/offline servers properly replace all name variable tags #34

For Geyser, the UUID returned from Tebex will not be valid. {id} in this case will be replaced with the username as an identifier. Otherwise {id} will contain the user's true valid UUID.

* chore: bump versions
@bobhenl
Copy link
Author

bobhenl commented Feb 26, 2024

Just question @WildBamaBoy , shouldn't be UUID still replaced correctly for players with correct online UUID? Like if I have enabled online UUIDs for people with bought Minecraft, then the UUID could work for them in case they change their name or so. Like now it wouldn't make sense to use {uuid} if it get's replaced by player name. It would be good if it can distinguish if the player uses online/offline UUID even on the offline server

@WildBamaBoy
Copy link
Collaborator

image Seems working, although I made the manual payment from the Payments section -> Create payment, and the package name wasn't replaced, not sure why

This should've already been replaced by our API on delivery. Do you have a transaction ID you can share for this? We can look into it further. The plugin will only fill {id}, {name}, {username}, and {uuid}. All other variables should be filled by our API before delivery to the plugin.

Just question @WildBamaBoy , shouldn't be UUID still replaced correctly for players with correct online UUID? Like if I have enabled online UUIDs for people with bought Minecraft, then the UUID could work for them in case they change their name or so. Like now it wouldn't make sense to use {uuid} if it get's replaced by player name. It would be good if it can distinguish if the player uses online/offline UUID even on the offline server

The short answer is that we can't rely on the UUIDs provided by any offline store.

For Geyser servers we're working sometimes with legitimate Mojang UUIDs and other times fake IDs generated by Geyser. We would have to do a Mojang lookup every time someone logs into an Offline store which may not always work.

We understand why this feature is needed but to allow UUIDs sometimes would lead to confusion. This is a point that we have been discussing internally, and we believe the proper solution is for us to build a webstore that can handle multiple username services (in this case Mojang and Xbox Live). We're not there yet, though, but we are aware and investigating solutions for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending A fix has been completed, pending release
Projects
None yet
Development

No branches or pull requests

3 participants