mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-07 08:16:24 +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:
@@ -118,6 +118,7 @@ set(BeamMP_Sources
|
||||
include/TPluginMonitor.h src/TPluginMonitor.cpp
|
||||
include/Environment.h
|
||||
include/BoostAliases.h
|
||||
include/Uuid.h src/Uuid.cpp
|
||||
)
|
||||
|
||||
set(BeamMP_Includes
|
||||
@@ -161,8 +162,6 @@ if (UNIX)
|
||||
-Werror=missing-field-initializers
|
||||
-Werror=write-strings
|
||||
-Werror=ctor-dtor-privacy
|
||||
-Wswitch-enum
|
||||
-Wswitch-default
|
||||
-Werror=old-style-cast
|
||||
-Werror=overloaded-virtual
|
||||
-Werror=overloaded-virtual
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# v3.2.0
|
||||
|
||||
- ADDED `settings` command, which lets you `get`, `list`, and `set` config options from the console
|
||||
- ADDED `Util.GenerateUUID()`, which generates an RFC4122 UUID (universally unique identifier)
|
||||
|
||||
# v3.1.1
|
||||
|
||||
|
||||
@@ -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