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

Giving an unique ID ? #2

Closed
Karnak19 opened this issue Jan 19, 2019 · 5 comments
Closed

Giving an unique ID ? #2

Karnak19 opened this issue Jan 19, 2019 · 5 comments

Comments

@Karnak19
Copy link

Hey Solinur, I love the job you do on CombatMetrics, surely the best add-on in the game !

I'm wondering if you can add an unique ID for each fight datas ?

@Solinur
Copy link
Owner

Solinur commented Jan 20, 2019

At the moment the timestamp would be the unique ID.
Wouldn't this suffice? Or do you have something different in mind?

@Karnak19
Copy link
Author

hummm yes it's not that false.
Actually, if i'm not wrong when I delete my fight 1, the fight 2 become the fight 1 and so on ?
Wouldn't be better to auto-increment the ID ? Like if I delete my fight 1, my fight 2 will still be 2, for his whole life.

I currently have in mind to create a parse-sharing web platform using these SavedVariables, and I don't really know how to handle this ID issue while having a clean and not too heavy code ^^

@Solinur
Copy link
Owner

Solinur commented Jan 22, 2019

Yes that is just the local index in the table and for technical reasons in lua this has to be continuous, starting at 1. I'd really recommend using the timestamp as a unique id for your purposes.

@Solinur
Copy link
Owner

Solinur commented Jan 22, 2019

Every fight has a field "date" which actually is a standard unix timestamp (which is converted on display)

@Karnak19
Copy link
Author

Oh yes I didn't notice the date field, good ! thanks

@Solinur Solinur closed this as completed Jan 29, 2019
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

2 participants