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

Get offline players #145

Open
KaKi87 opened this issue Feb 13, 2021 · 6 comments
Open

Get offline players #145

KaKi87 opened this issue Feb 13, 2021 · 6 comments

Comments

@KaKi87
Copy link

KaKi87 commented Feb 13, 2021

Hello,

How can I list offline players ?

Thanks

@oblx
Copy link
Contributor

oblx commented Feb 14, 2021

Hi, actually there is no method getOfflinePlayers but you might GET /player and then sort by online value :

{
"link": "string",
"name": "string",
"online": true,
"uuid": "string"
}

@KaKi87
Copy link
Author

KaKi87 commented Feb 14, 2021

Thanks, but I wouldn't have asked for this if the GET /player endpoint returned both online and offline players... :/

@Valandur
Copy link
Owner

Hi, getting the offline players proved to be pretty hard the last time I tried. But it was quite a while ago when I last tried.
I guess it has something to do with the fact that Minecraft doesn't know about the players until they join for the first time, and after they leave there is only really a player data file left.

@KaKi87
Copy link
Author

KaKi87 commented Feb 18, 2021

Wouldn't it be possible to loop over those data files ?

@Valandur
Copy link
Owner

Theoretically yes, I'm not sure if Sponge has a built-in way to do this. I'm currently rewriting this plugin from scratch to include support for other minecraft API (such as spigot/paper and forge) and I hope to have first draft version out sometime soon. I'll see if I can include an option to list offline players, and add that to the Sponge version as well.

@KaKi87
Copy link
Author

KaKi87 commented Feb 22, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants