add 'network' permission

This commit is contained in:
MihailRis
2025-12-08 19:21:50 +03:00
committed by ShiftyX1
parent 56d808e3e2
commit dd40780334
10 changed files with 67 additions and 27 deletions
+5 -1
View File
@@ -15,7 +15,11 @@ using namespace scripting;
static int l_start_debug_instance(lua::State* L) {
int port = lua::tointeger(L, 1);
if (port == 0) {
port = engine->getNetwork().findFreePort();
auto network = engine->getNetwork();
if (network == nullptr) {
throw std::runtime_error("project has no network permission");
}
port = network->findFreePort();
if (port == -1) {
throw std::runtime_error("could not find free port");
}