Skip to content

Conversation

JRoy
Copy link
Member

@JRoy JRoy commented Apr 11, 2020

Properly save userdata and mark the player's last logout time when the server is shutting down.

Note: This method was added in Paper 1.15.2 and won't support lower versions unless we use reflection.

Fixes #2764

@JRoy JRoy requested a review from Ichbinjoe April 12, 2020 04:25
@mdcfe mdcfe added this to the 2.18.0 milestone Apr 13, 2020
@mdcfe
Copy link
Member

mdcfe commented Apr 13, 2020

Even though Paper now has API to expose MinecraftServer#isRunning, I'm still inclined to believe we should use reflection to support older servers and CB/Spigot - we could do this through providers, with one for the Paper API method (in case it gets added later to Spigot) and a fallback for NMS.

JRoy added 3 commits April 13, 2020 17:00
# Conflicts:
#	Essentials/src/com/earth2me/essentials/Essentials.java
@JRoy JRoy requested review from Ichbinjoe and mdcfe April 13, 2020 22:18
@pop4959 pop4959 added the type: enhancement Features and feature requests. label Apr 14, 2020
@JRoy
Copy link
Member Author

JRoy commented Apr 27, 2020

@md678685 Your changes were applied in case you didn't notice, there is now proper fallback

Ichbinjoe
Ichbinjoe previously approved these changes May 2, 2020
@pop4959
Copy link
Member

pop4959 commented May 7, 2020

I'm assuming MD's comment here also applies to this issue. Probably shouldn't dump all of the NMS code directly into the Essentials class.

@JRoy
Copy link
Member Author

JRoy commented May 7, 2020

Would want @md678685 to have a look since this is very simple reflection and deals with mapped method names, moving this to provider classes would break on every update.

@mdcfe
Copy link
Member

mdcfe commented May 7, 2020

Providers != building against NMS (the nms/ directory is confusing though). They're used when we need access to any functionality exposed by different methods on different implementations but they can still use Bukkit API calls or reflection.

@mdcfe mdcfe changed the title Add Bukkit#isStopping support (Fixes #2764) Save player logout times on shutdown May 11, 2020
@mdcfe mdcfe merged commit fc2b7b6 into EssentialsX:2.x May 11, 2020
@mdcfe mdcfe deleted the feature/2764 branch May 11, 2020 13:53
ressidell pushed a commit to ressidell/Essentials that referenced this pull request Apr 27, 2025
Properly save userdata and mark the player's last logout time when the server is shutting down.

Fixes EssentialsX#2764.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Features and feature requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Last logout time for /seen not updated on server restart

4 participants