mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'debugging' permission
This commit is contained in:
parent
b3ae6eb59a
commit
87deff97f3
2 changed files with 7 additions and 1 deletions
|
|
@ -13,9 +13,10 @@ namespace scripting {
|
|||
}
|
||||
|
||||
struct Permissions {
|
||||
static inline std::string DEBUGGING = "debugging";
|
||||
static inline std::string NETWORK = "network";
|
||||
static inline std::string RECORD_AUDIO = "record-audio";
|
||||
static inline std::string WRITE_TO_USER = "write-to-user";
|
||||
static inline std::string NETWORK = "network";
|
||||
|
||||
std::set<std::string> permissions;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "content/ContentControl.hpp"
|
||||
#include "engine/Engine.hpp"
|
||||
#include "engine/EnginePaths.hpp"
|
||||
#include "devtools/Project.hpp"
|
||||
#include "network/Network.hpp"
|
||||
#include "util/platform.hpp"
|
||||
#include "window/Window.hpp"
|
||||
|
|
@ -13,6 +14,10 @@
|
|||
using namespace scripting;
|
||||
|
||||
static int l_start_debug_instance(lua::State* L) {
|
||||
if (!engine->getProject().permissions.has(Permissions::DEBUGGING)) {
|
||||
throw std::runtime_error("project has no debugging permission");
|
||||
}
|
||||
|
||||
int port = lua::tointeger(L, 1);
|
||||
if (port == 0) {
|
||||
auto network = engine->getNetwork();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue