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

Feature Request: TO_LAST_CONNECTED option for send-on-login #112

Closed
RealTriassic opened this issue Jul 31, 2023 · 7 comments
Closed

Feature Request: TO_LAST_CONNECTED option for send-on-login #112

RealTriassic opened this issue Jul 31, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@RealTriassic
Copy link
Contributor

A similar feature request for something like this is still open on the AuthMeBungee repository, I have made a very basic implementation of this as seen here, except it's functionality is limited to only Bungeecord & AuthMeBungee.

I believe since AuthMeVelocity is fairly actively maintained unlike AuthMeBungee, this simple functionality could be built straight into the plugin instead of having a seperate plugin for it, but, unfortunately I am too unfamiliar with this code base and Velocity as a whole to implement this myself.

It isn't exactly difficult to implement as evident by my implementation on Bungeecord, whilst being basic, it is completely functional, the player's last server is written to a yml file on server switch and when the player leaves the server and then once the player logs back onto the server, they are returned back to the server defined in the yml file.

@4drian3d 4drian3d added the enhancement New feature or request label Jul 31, 2023
@4drian3d
Copy link
Owner

A similar feature request for something like this is still open on the AuthMeBungee repository, I have made a very basic implementation of this as seen here, except it's functionality is limited to only Bungeecord & AuthMeBungee.

I believe since AuthMeVelocity is fairly actively maintained unlike AuthMeBungee, this simple functionality could be built straight into the plugin instead of having a seperate plugin for it, but, unfortunately I am too unfamiliar with this code base and Velocity as a whole to implement this myself.

It isn't exactly difficult to implement as evident by my implementation on Bungeecord, whilst being basic, it is completely functional, the player's last server is written to a yml file on server switch and when the player leaves the server and then once the player logs back onto the server, they are returned back to the server defined in the yml file.

I think it would be best to implement this functionality in another plugin, as it is not the purpose of AuthMeVelocity to store the last server a user joined, plus probably other functions need to be added. Also, I would not want to make a configuration file storage system, which would be too inefficient. A simple local database in sqlite or H2 would be best.
Also, unlike AuthMeBungee, in AuthMeVelocity it would be too easy to implement this feature externally, just use the https://javadoc.io/doc/io.github.4drian3d/authmevelocity-api-velocity/latest/io.github._4drian3d.authmevelocity.api.velocity/io/github/_4drian3d/authmevelocity/api/velocity/event/PreSendOnLoginEvent.html event

@RealTriassic
Copy link
Contributor Author

A similar feature request for something like this is still open on the AuthMeBungee repository, I have made a very basic implementation of this as seen here, except it's functionality is limited to only Bungeecord & AuthMeBungee.
I believe since AuthMeVelocity is fairly actively maintained unlike AuthMeBungee, this simple functionality could be built straight into the plugin instead of having a seperate plugin for it, but, unfortunately I am too unfamiliar with this code base and Velocity as a whole to implement this myself.
It isn't exactly difficult to implement as evident by my implementation on Bungeecord, whilst being basic, it is completely functional, the player's last server is written to a yml file on server switch and when the player leaves the server and then once the player logs back onto the server, they are returned back to the server defined in the yml file.

I think it would be best to implement this functionality in another plugin, as it is not the purpose of AuthMeVelocity to store the last server a user joined, plus probably other functions need to be added. Also, I would not want to make a configuration file storage system, which would be too inefficient. A simple local database in sqlite or H2 would be best. Also, unlike AuthMeBungee, in AuthMeVelocity it would be too easy to implement this feature externally, just use the https://javadoc.io/doc/io.github.4drian3d/authmevelocity-api-velocity/latest/io.github._4drian3d.authmevelocity.api.velocity/io/github/_4drian3d/authmevelocity/api/velocity/event/PreSendOnLoginEvent.html event

Alright, thank you for your reply, I will look into this

@4drian3d
Copy link
Owner

https://github.com/4drian3d/AuthMeVelocity-LastServerAddon in a few minutes I will finish it

@4drian3d
Copy link
Owner

done https://github.com/4drian3d/AuthMeVelocity-LastServerAddon/releases/tag/1.0.0
The plugin has not been tested, but it should work fine. In case of any error, you can report it in the corresponding repository

@RealTriassic
Copy link
Contributor Author

done https://github.com/4drian3d/AuthMeVelocity-LastServerAddon/releases/tag/1.0.0 The plugin has not been tested, but it should work fine. In case of any error, you can report it in the corresponding repository

Wow this is really cool, I really like how you've used h2 instead of yml files like me. That is a way better way of storing this data!

It would be really cool if there was a way to require players to have a specific permission to return to their last connected server, but apart from that, it looks really good

@RealTriassic
Copy link
Contributor Author

done https://github.com/4drian3d/AuthMeVelocity-LastServerAddon/releases/tag/1.0.0 The plugin has not been tested, but it should work fine. In case of any error, you can report it in the corresponding repository

After looking over the plugin's code, it appears that it doesn't make any checks to ensure that the last server isn't set to a login server on save and also doesn't check to make sure that the player's last server is online

On Bungeecord, checking this would be as easy as doing something like this
image

I am not certain if this possible on Velocity though, but if the player's last server is offline, I'd assume the player gets stuck in the login server. On ReturnMe, if lastServer.ping returns any error, it sends the player to the default server that is defined in the configuration file, maybe something something similar could be done here?

@4drian3d
Copy link
Owner

4drian3d commented Aug 2, 2023

done https://github.com/4drian3d/AuthMeVelocity-LastServerAddon/releases/tag/1.0.0 The plugin has not been tested, but it should work fine. In case of any error, you can report it in the corresponding repository

After looking over the plugin's code, it appears that it doesn't make any checks to ensure that the last server isn't set to a login server on save and also doesn't check to make sure that the player's last server is online

On Bungeecord, checking this would be as easy as doing something like this image

I am not certain if this possible on Velocity though, but if the player's last server is offline, I'd assume the player gets stuck in the login server. On ReturnMe, if lastServer.ping returns any error, it sends the player to the default server that is defined in the configuration file, maybe something something similar could be done here?

4drian3d/AuthMeVelocity-LastServerAddon@fa6c0c9

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

No branches or pull requests

2 participants