mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 06:46:23 +00:00
add Util.GenerateUUID lua api
This api generates a pseudorandom RFC 4122 compliant UUID (https://www.ietf.org/rfc/rfc4122.txt). It's pseudorandom, so it is *unlikely* to have collisions.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "Http.h"
|
||||
#include "LuaAPI.h"
|
||||
#include "TLuaPlugin.h"
|
||||
#include "Uuid.h"
|
||||
#include "sol/object.hpp"
|
||||
|
||||
#include <chrono>
|
||||
@@ -818,6 +819,7 @@ TLuaEngine::StateThreadData::StateThreadData(const std::string& Name, TLuaStateI
|
||||
UtilTable.set_function("JsonUnflatten", &LuaAPI::MP::JsonUnflatten);
|
||||
UtilTable.set_function("JsonPrettify", &LuaAPI::MP::JsonPrettify);
|
||||
UtilTable.set_function("JsonMinify", &LuaAPI::MP::JsonMinify);
|
||||
UtilTable.set_function("GenerateUUID", &uuid::GenerateUuid);
|
||||
UtilTable.set_function("Random", [this] {
|
||||
return mUniformRealDistribution01(mMersenneTwister);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user