diff --git a/Communication/Communication.cpp b/Communication/Communication.cpp index 491c4be..af6bd36 100644 --- a/Communication/Communication.cpp +++ b/Communication/Communication.cpp @@ -358,13 +358,16 @@ bool Communication::CanAccessScriptSource() const { return this->m_bAllowScriptS logger->PrintWarning(RbxStu::Communication, "Access to .Source on scripts has been allowed.!"); communication->m_bAllowScriptSourceAccess = sourceAccess; + environmentManager->SetServiceBlocked("ScriptEditorService", false); } else if (ret == IDNO) { logger->PrintWarning(RbxStu::Communication, "Access to .Source on scripts has been kept disabled!"); + environmentManager->SetServiceBlocked("ScriptEditorService", true); } } else { logger->PrintWarning(RbxStu::Communication, "Access to .Source has been disabled"); communication->m_bAllowScriptSourceAccess = sourceAccess; + environmentManager->SetServiceBlocked("ScriptEditorService", true); } wasSuccess = true; diff --git a/Communication/Communication.hpp b/Communication/Communication.hpp index b7afc65..b2e14e6 100644 --- a/Communication/Communication.hpp +++ b/Communication/Communication.hpp @@ -26,7 +26,7 @@ class Communication final { std::queue m_qExecutionReportsQueue; - RBX::DataModelType lCurrentExecutionDataModel = RBX::DataModelType_PlayClient; + RBX::DataModelType lCurrentExecutionDataModel = RBX::DataModelType_Edit; // RBX::DataModelType_PlayClient; std::string m_szFingerprintHeader = "Solara-Fingerprint"; // Sorry quiving, imma steal it. diff --git a/Environment/EnvironmentManager.cpp b/Environment/EnvironmentManager.cpp index ce4ba89..2c3d2cd 100644 --- a/Environment/EnvironmentManager.cpp +++ b/Environment/EnvironmentManager.cpp @@ -71,7 +71,8 @@ static std::vector blockedServices = {"linkingservice", "sessionservice", "studioservice", "platformcloudstorageservice", - "startpageservice"}; + "startpageservice", + "scripteditorservice"}; static std::vector blockedFunctions = { "openvideosfolder", "openscreenshotsfolder", "getrobuxbalance", @@ -201,7 +202,8 @@ void EnvironmentManager::PushEnvironment(_In_ lua_State *L) { } } - if (!Communication::GetSingleton()->CanAccessScriptSource() && loweredIndex.find("source") != std::string::npos) { + if (!Communication::GetSingleton()->CanAccessScriptSource() && + loweredIndex.find("source") != std::string::npos) { Utilities::checkInstance(L, 1, "LuaSourceContainer"); lua_pushstring(L, ""); return 1; @@ -381,8 +383,10 @@ void EnvironmentManager::PushEnvironment(_In_ lua_State *L) { Scheduler::GetSingleton()->ScheduleJob(SchedulerJob( R"( local insertservice_LoadLocalAsset = clonefunction(cloneref(game.GetService(game, "InsertService")).LoadLocalAsset) +local insertservice_LoadAsset = clonefunction(cloneref(game.GetService(game, "InsertService")).LoadAsset) local table_insert = clonefunction(table.insert) local getreg = clonefunction(getreg) +local string_gsub = clonefunction(string.gsub) local typeof = clonefunction(typeof) local error = clonefunction(error) local getfenv = clonefunction(getfenv) @@ -505,7 +509,12 @@ end getgenv().GetObjects = function(assetId) local oldId = getidentity() setidentity(8) - local obj = { insertservice_LoadLocalAsset(cloneref(game:GetService("InsertService")), assetId) } + local obj = {} + if (game:GetService("RunService"):IsClient()) then + obj = { insertservice_LoadLocalAsset(cloneref(game:GetService("InsertService")), assetId) } + else + obj = { insertservice_LoadAsset(cloneref(game:GetService("InsertService")), string_gsub(assetId, "rbxassetid://", "")) } + end setIdentity_c(oldId) return obj end