Web-API icon indicating copy to clipboard operation
Web-API copied to clipboard

Get offline players

Open KaKi87 opened this issue 4 years ago • 6 comments

Hello,

How can I list offline players ?

Thanks

KaKi87 avatar Feb 13 '21 16:02 KaKi87

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"
}

oblx avatar Feb 14 '21 19:02 oblx

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

KaKi87 avatar Feb 14 '21 19:02 KaKi87

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.

Valandur avatar Feb 17 '21 21:02 Valandur

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

KaKi87 avatar Feb 18 '21 07:02 KaKi87

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.

Valandur avatar Feb 22 '21 13:02 Valandur

Actually, please prioritize Spigot support 😉


From: Marco [email protected] Sent: Monday, February 22, 2021 2:27:42 PM To: Valandur/Web-API [email protected] Cc: KaKi87 [email protected]; Author [email protected] Subject: Re: [Valandur/Web-API] Get offline players (#145)

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Valandur/Web-API/issues/145#issuecomment-783373053, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFCMJ6LNZBTL6AYF5FWYBRDTAJLU5ANCNFSM4XSIKOFQ.

KaKi87 avatar Feb 22 '21 13:02 KaKi87