rbxstudio-mcp 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/studio-plugin/plugin.luau +16 -15
package/package.json
CHANGED
|
@@ -4374,23 +4374,16 @@ end
|
|
|
4374
4374
|
|
|
4375
4375
|
handlers.stopPlay = function(requestData)
|
|
4376
4376
|
local success, result = pcall(function()
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
if not wasRunning then
|
|
4380
|
-
return {
|
|
4381
|
-
success = true,
|
|
4382
|
-
wasRunning = false,
|
|
4383
|
-
message = "Play test was not running"
|
|
4384
|
-
}
|
|
4385
|
-
end
|
|
4377
|
+
-- NOTE: RunService:IsRunning() returns false from plugin context even when play test is running
|
|
4378
|
+
-- So we always try to stop via StudioTestService first
|
|
4386
4379
|
|
|
4387
|
-
-- Try StudioTestService:EndTest first
|
|
4380
|
+
-- Try StudioTestService:EndTest first (matches ExecutePlayModeAsync)
|
|
4388
4381
|
local studioTestSuccess, studioTestService = pcall(function()
|
|
4389
4382
|
return game:GetService("StudioTestService")
|
|
4390
4383
|
end)
|
|
4391
4384
|
|
|
4392
4385
|
if studioTestSuccess and studioTestService then
|
|
4393
|
-
local endSuccess = pcall(function()
|
|
4386
|
+
local endSuccess, endError = pcall(function()
|
|
4394
4387
|
studioTestService:EndTest()
|
|
4395
4388
|
end)
|
|
4396
4389
|
|
|
@@ -4398,20 +4391,28 @@ handlers.stopPlay = function(requestData)
|
|
|
4398
4391
|
activePlayTestTask = nil
|
|
4399
4392
|
return {
|
|
4400
4393
|
success = true,
|
|
4401
|
-
wasRunning = true,
|
|
4402
4394
|
method = "StudioTestService:EndTest",
|
|
4403
|
-
message = "Stopped play test
|
|
4395
|
+
message = "Stopped play test"
|
|
4396
|
+
}
|
|
4397
|
+
else
|
|
4398
|
+
-- EndTest failed, try RunService:Stop as fallback
|
|
4399
|
+
RunService:Stop()
|
|
4400
|
+
activePlayTestTask = nil
|
|
4401
|
+
return {
|
|
4402
|
+
success = true,
|
|
4403
|
+
method = "RunService:Stop (fallback)",
|
|
4404
|
+
message = "Stopped play test",
|
|
4405
|
+
warning = "EndTest failed: " .. tostring(endError) .. ". Used RunService:Stop() which does NOT restore pre-play state."
|
|
4404
4406
|
}
|
|
4405
4407
|
end
|
|
4406
4408
|
end
|
|
4407
4409
|
|
|
4408
|
-
--
|
|
4410
|
+
-- No StudioTestService, use RunService:Stop
|
|
4409
4411
|
RunService:Stop()
|
|
4410
4412
|
activePlayTestTask = nil
|
|
4411
4413
|
|
|
4412
4414
|
return {
|
|
4413
4415
|
success = true,
|
|
4414
|
-
wasRunning = true,
|
|
4415
4416
|
method = "RunService:Stop",
|
|
4416
4417
|
message = "Stopped play test",
|
|
4417
4418
|
warning = "Note: RunService:Stop() does NOT restore pre-play state. Objects created/modified during play remain changed."
|