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

Delete annotations/labels from within UE4 Agones SDK #2814

Closed
fcallet opened this issue Nov 15, 2022 · 4 comments
Closed

Delete annotations/labels from within UE4 Agones SDK #2814

fcallet opened this issue Nov 15, 2022 · 4 comments
Labels
kind/feature New features for Agones wontfix Sorry, but we're not going to do that.

Comments

@fcallet
Copy link

fcallet commented Nov 15, 2022

I have noticed that it is possible to add or update labels / annotations from within the UE4 SDK but not to remove them (you can't remove them at allocation as well, but I need to do it from within my server app).
Is it a feature that you consider adding in the future ? Or is it a bad practice to remove this server metadata ?

Best regards
François

@fcallet fcallet added the kind/feature New features for Agones label Nov 15, 2022
@markmandel
Copy link
Member

🤔 iiiinteresting - we've never had the ability to remove a label from the system. Can you expand on your use case, I'd like to dig in deeper and see why you need to be able to delete labels?

@fcallet
Copy link
Author

fcallet commented Nov 17, 2022

In order for players to join my server, I made an invitation system.
Each time my matchmaker finds a gameserver for the player, I generate a token and add a new annotation containing the token to the server.
This token is sent to the player. He will use it to connect himself to the gameserver.
At connection, the server checks if the token used by the player is present inside an annotation. If it is the case, then the player is allowed to join the server. The server then needs to delete the annotation, because it is not useful anymore (the token is only usable once). There is also a "timeout" mecanism that deletes invitations annotations that are too old.
The problem with this mecanism is that, because we can't delete existing annotations, the number of annotations will increase indefinitly.

For now, I have made a workaround : I store all the invitations inside a single annotation. The annotation value contains a JSON string representing an array of invitations. So if I want to delete invitations, I just have to update the JSON string inside the invitations annotation.

I don't know if I was clear enough. I am a beginner with Agones and Kubernetes, so pardon me if I ask silly questions.

Best regards,
François

@markmandel
Copy link
Member

For now, I have made a workaround : I store all the invitations inside a single annotation. The annotation value contains a JSON string representing an array of invitations. So if I want to delete invitations, I just have to update the JSON string inside the invitations annotation.

Honestly, I actually think this is the right answer (you could also comma delimit maybe?) -- since then you have a singular annotation that is a list -- rather than having to scan all annotations. This also ensures your updates are atomic.

It's also how we do a very similar thing in Quilkin:
https://googleforgames.github.io/quilkin/v0.4.0/book/xds/providers/agones.html#access-tokens

You may also be interested in #2716 for when that gets implemented as well.

@fcallet
Copy link
Author

fcallet commented Nov 21, 2022

Thank you for your answer.
Sincerely,
François

@fcallet fcallet closed this as completed Nov 21, 2022
@markmandel markmandel added the wontfix Sorry, but we're not going to do that. label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones wontfix Sorry, but we're not going to do that.
Projects
None yet
Development

No branches or pull requests

2 participants