NotSomething0 / Valkyrie

Open source FiveM anticheat
GNU General Public License v3.0
76 stars 21 forks source link

[SUGGESTION] Make UUID's actually unique #9

Closed Ruqen closed 2 years ago

Ruqen commented 2 years ago

As seen on https://gist.github.com/jrus/3197011, using math.randomseed to seed math.random actually unique numbers is a pretty good idea and overall will improve math.random's quality.

Quote from shmoli-itrs:

"Need to seed math.random to avoid generating the same uuid in subsequent runs"

This can be done by adding only 1 line in sv_banmanager.lua's UUID function:

math.randomseed(os.time())

If approved, I'll make and pull request these changes.

NotSomething0 commented 2 years ago

Oops forgot to add lua54 'yes' to the manifest, this should be fixed now. Note Lua 5.4 added a new implementation for math.random which doesn't require a seed for uniqueness. Thanks for bringing this up though! 7a65092