@quenty/resetservice 11.47.0 → 11.49.0
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/CHANGELOG.md +8 -0
- package/package.json +15 -14
- package/src/Client/ResetServiceClient.spec.lua +29 -17
- package/src/Server/ResetService.spec.lua +17 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [11.49.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/resetservice@11.48.0...@quenty/resetservice@11.49.0) (2026-08-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/resetservice
|
|
9
|
+
|
|
10
|
+
# [11.48.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/resetservice@11.47.0...@quenty/resetservice@11.48.0) (2026-08-28)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @quenty/resetservice
|
|
13
|
+
|
|
6
14
|
# [11.47.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/resetservice@11.46.2...@quenty/resetservice@11.47.0) (2026-08-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/resetservice
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/resetservice",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.49.0",
|
|
4
4
|
"description": "Handles reset requests since Roblox's reset system doesn't handle ragdolls correctly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -29,24 +29,25 @@
|
|
|
29
29
|
"Quenty"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@quenty/characterutils": "12.
|
|
33
|
-
"@quenty/coreguiutils": "10.
|
|
32
|
+
"@quenty/characterutils": "12.43.0",
|
|
33
|
+
"@quenty/coreguiutils": "10.25.0",
|
|
34
|
+
"@quenty/jestutils": "1.1.0",
|
|
34
35
|
"@quenty/loader": "10.11.1",
|
|
35
|
-
"@quenty/maid": "3.
|
|
36
|
-
"@quenty/nevermore-test-runner": "1.
|
|
37
|
-
"@quenty/playermock": "1.
|
|
38
|
-
"@quenty/playerutils": "8.
|
|
39
|
-
"@quenty/promise": "10.
|
|
40
|
-
"@quenty/remoting": "12.
|
|
41
|
-
"@quenty/rigbuilderutils": "10.
|
|
42
|
-
"@quenty/rx": "13.
|
|
43
|
-
"@quenty/servicebag": "11.
|
|
44
|
-
"@quenty/statestack": "14.
|
|
36
|
+
"@quenty/maid": "3.12.0",
|
|
37
|
+
"@quenty/nevermore-test-runner": "1.6.0",
|
|
38
|
+
"@quenty/playermock": "1.8.0",
|
|
39
|
+
"@quenty/playerutils": "8.43.0",
|
|
40
|
+
"@quenty/promise": "10.24.0",
|
|
41
|
+
"@quenty/remoting": "12.43.0",
|
|
42
|
+
"@quenty/rigbuilderutils": "10.46.0",
|
|
43
|
+
"@quenty/rx": "13.34.0",
|
|
44
|
+
"@quenty/servicebag": "11.21.0",
|
|
45
|
+
"@quenty/statestack": "14.39.0",
|
|
45
46
|
"@quenty/table": "3.9.2",
|
|
46
47
|
"@quentystudios/jest-lua": "3.10.0-quenty.2"
|
|
47
48
|
},
|
|
48
49
|
"publishConfig": {
|
|
49
50
|
"access": "public"
|
|
50
51
|
},
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "346201e192e467cb71160f43029863853be855b5"
|
|
52
53
|
}
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
local require = require(script.Parent.loader).load(script)
|
|
12
12
|
|
|
13
13
|
local Jest = require("Jest")
|
|
14
|
+
local JestUtils = require("JestUtils")
|
|
15
|
+
local Maid = require("Maid")
|
|
14
16
|
local PlayerMock = require("PlayerMock")
|
|
15
17
|
local PlayerMockService = require("PlayerMockService")
|
|
16
18
|
local PlayerMockServiceClient = require("PlayerMockServiceClient")
|
|
@@ -32,6 +34,8 @@ local specCounter = 0
|
|
|
32
34
|
local function setup()
|
|
33
35
|
specCounter += 1
|
|
34
36
|
|
|
37
|
+
local maid = Maid.new()
|
|
38
|
+
|
|
35
39
|
local serverBag = ServiceBag.new()
|
|
36
40
|
local resetService: any = serverBag:GetService(ResetService)
|
|
37
41
|
local playerMockService: any = serverBag:GetService(PlayerMockService)
|
|
@@ -47,7 +51,14 @@ local function setup()
|
|
|
47
51
|
playerMockServiceClient:SetLocalPlayer(mock)
|
|
48
52
|
clientBag:Start()
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
maid:GiveTask(function()
|
|
55
|
+
-- Client bags first: the server bag owns the mock, and destroying it out from under a
|
|
56
|
+
-- live client is not something production ever does.
|
|
57
|
+
clientBag:Destroy()
|
|
58
|
+
serverBag:Destroy()
|
|
59
|
+
end)
|
|
60
|
+
|
|
61
|
+
local controller = {
|
|
51
62
|
serverBag = serverBag,
|
|
52
63
|
clientBag = clientBag,
|
|
53
64
|
resetService = resetService,
|
|
@@ -57,13 +68,14 @@ local function setup()
|
|
|
57
68
|
local character = PlayerMock.loadCharacterAsync(mock, RigBuilderUtils.createR6BaseRig())
|
|
58
69
|
return character, assert(character:FindFirstChildOfClass("Humanoid"), "No humanoid in rig")
|
|
59
70
|
end,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-- live client is not something production ever does.
|
|
63
|
-
clientBag:Destroy()
|
|
64
|
-
serverBag:Destroy()
|
|
71
|
+
Destroy = function(_self)
|
|
72
|
+
maid:DoCleaning()
|
|
65
73
|
end,
|
|
66
74
|
}
|
|
75
|
+
|
|
76
|
+
maid:GiveTask(JestUtils.afterThis(controller))
|
|
77
|
+
|
|
78
|
+
return controller
|
|
67
79
|
end
|
|
68
80
|
|
|
69
81
|
describe("ResetServiceClient dual-realm boot", function()
|
|
@@ -73,7 +85,7 @@ describe("ResetServiceClient dual-realm boot", function()
|
|
|
73
85
|
expect(controller.resetService).never.toBeNil()
|
|
74
86
|
expect(controller.resetServiceClient).never.toBeNil()
|
|
75
87
|
|
|
76
|
-
controller:
|
|
88
|
+
controller:Destroy()
|
|
77
89
|
end)
|
|
78
90
|
end)
|
|
79
91
|
|
|
@@ -98,7 +110,7 @@ describe("ResetServiceClient.PromiseResetCharacter", function()
|
|
|
98
110
|
expect(humanoid.Health).toBe(0)
|
|
99
111
|
expect(resetPlayers).toEqual({ controller.mock })
|
|
100
112
|
|
|
101
|
-
controller:
|
|
113
|
+
controller:Destroy()
|
|
102
114
|
end)
|
|
103
115
|
|
|
104
116
|
it("respawns the character through the default reset provider", function()
|
|
@@ -115,7 +127,7 @@ describe("ResetServiceClient.PromiseResetCharacter", function()
|
|
|
115
127
|
expect(newCharacter).never.toBe(character)
|
|
116
128
|
expect(character.Parent).toBeNil()
|
|
117
129
|
|
|
118
|
-
controller:
|
|
130
|
+
controller:Destroy()
|
|
119
131
|
end)
|
|
120
132
|
|
|
121
133
|
it("resets without a character", function()
|
|
@@ -129,7 +141,7 @@ describe("ResetServiceClient.PromiseResetCharacter", function()
|
|
|
129
141
|
expect(PromiseTestUtils.awaitSettled(promise, 10)).toBe(true)
|
|
130
142
|
expect(promise:IsFulfilled()).toBe(true)
|
|
131
143
|
|
|
132
|
-
controller:
|
|
144
|
+
controller:Destroy()
|
|
133
145
|
end)
|
|
134
146
|
end)
|
|
135
147
|
|
|
@@ -151,7 +163,7 @@ describe("ResetServiceClient.RequestResetCharacter", function()
|
|
|
151
163
|
expect(humanoid.Health).toBe(0)
|
|
152
164
|
expect(resetPlayers).toEqual({ controller.mock })
|
|
153
165
|
|
|
154
|
-
controller:
|
|
166
|
+
controller:Destroy()
|
|
155
167
|
end)
|
|
156
168
|
end)
|
|
157
169
|
|
|
@@ -161,7 +173,7 @@ describe("ResetServiceClient.PushDisable", function()
|
|
|
161
173
|
|
|
162
174
|
expect(controller.resetServiceClient:IsDisabled()).toBe(false)
|
|
163
175
|
|
|
164
|
-
controller:
|
|
176
|
+
controller:Destroy()
|
|
165
177
|
end)
|
|
166
178
|
|
|
167
179
|
it("disables while a state is held and re-enables once it is popped", function()
|
|
@@ -173,7 +185,7 @@ describe("ResetServiceClient.PushDisable", function()
|
|
|
173
185
|
cancel()
|
|
174
186
|
expect(controller.resetServiceClient:IsDisabled()).toBe(false)
|
|
175
187
|
|
|
176
|
-
controller:
|
|
188
|
+
controller:Destroy()
|
|
177
189
|
end)
|
|
178
190
|
|
|
179
191
|
it("stays disabled until every pushed state is popped", function()
|
|
@@ -188,7 +200,7 @@ describe("ResetServiceClient.PushDisable", function()
|
|
|
188
200
|
cancelSecond()
|
|
189
201
|
expect(controller.resetServiceClient:IsDisabled()).toBe(false)
|
|
190
202
|
|
|
191
|
-
controller:
|
|
203
|
+
controller:Destroy()
|
|
192
204
|
end)
|
|
193
205
|
|
|
194
206
|
it("emits each disabled state to observers", function()
|
|
@@ -205,7 +217,7 @@ describe("ResetServiceClient.PushDisable", function()
|
|
|
205
217
|
expect(states).toEqual({ false, true, false })
|
|
206
218
|
|
|
207
219
|
sub:Destroy()
|
|
208
|
-
controller:
|
|
220
|
+
controller:Destroy()
|
|
209
221
|
end)
|
|
210
222
|
|
|
211
223
|
it("still resets programmatically while disabled", function()
|
|
@@ -224,7 +236,7 @@ describe("ResetServiceClient.PushDisable", function()
|
|
|
224
236
|
expect(promise:IsFulfilled()).toBe(true)
|
|
225
237
|
expect(resetPlayers).toEqual({ controller.mock })
|
|
226
238
|
|
|
227
|
-
controller:
|
|
239
|
+
controller:Destroy()
|
|
228
240
|
end)
|
|
229
241
|
end)
|
|
230
242
|
|
|
@@ -248,6 +260,6 @@ describe("ResetServiceClient reset button callback", function()
|
|
|
248
260
|
expect(humanoid.Health).toBe(0)
|
|
249
261
|
expect(resetPlayers).toEqual({ controller.mock })
|
|
250
262
|
|
|
251
|
-
controller:
|
|
263
|
+
controller:Destroy()
|
|
252
264
|
end)
|
|
253
265
|
end)
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
8
|
local Jest = require("Jest")
|
|
9
|
+
local JestUtils = require("JestUtils")
|
|
10
|
+
local Maid = require("Maid")
|
|
9
11
|
local PlayerMock = require("PlayerMock")
|
|
10
12
|
local PlayerMockService = require("PlayerMockService")
|
|
11
13
|
local Promise = require("Promise")
|
|
@@ -24,7 +26,8 @@ local specCounter = 0
|
|
|
24
26
|
local function setup()
|
|
25
27
|
specCounter += 1
|
|
26
28
|
|
|
27
|
-
local
|
|
29
|
+
local maid = Maid.new()
|
|
30
|
+
local serviceBag = maid:Add(ServiceBag.new())
|
|
28
31
|
local resetService: any = serviceBag:GetService(ResetService)
|
|
29
32
|
local playerMockService: any = serviceBag:GetService(PlayerMockService)
|
|
30
33
|
|
|
@@ -33,14 +36,18 @@ local function setup()
|
|
|
33
36
|
|
|
34
37
|
local mock = playerMockService:CreatePlayer({ UserId = 77341200 + specCounter })
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
local controller = {
|
|
37
40
|
serviceBag = serviceBag,
|
|
38
41
|
resetService = resetService,
|
|
39
42
|
mock = mock,
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
Destroy = function(_self)
|
|
44
|
+
maid:DoCleaning()
|
|
42
45
|
end,
|
|
43
46
|
}
|
|
47
|
+
|
|
48
|
+
maid:GiveTask(JestUtils.afterThis(controller))
|
|
49
|
+
|
|
50
|
+
return controller
|
|
44
51
|
end
|
|
45
52
|
|
|
46
53
|
describe("ResetService.PromiseResetCharacter", function()
|
|
@@ -57,7 +64,7 @@ describe("ResetService.PromiseResetCharacter", function()
|
|
|
57
64
|
expect(character).never.toBeNil()
|
|
58
65
|
expect(character:FindFirstChildOfClass("Humanoid")).never.toBeNil()
|
|
59
66
|
|
|
60
|
-
controller:
|
|
67
|
+
controller:Destroy()
|
|
61
68
|
end)
|
|
62
69
|
|
|
63
70
|
it("rejects a player that is not in the DataModel", function()
|
|
@@ -70,7 +77,7 @@ describe("ResetService.PromiseResetCharacter", function()
|
|
|
70
77
|
expect(promise:IsRejected()).toBe(true)
|
|
71
78
|
|
|
72
79
|
orphan:Destroy()
|
|
73
|
-
controller:
|
|
80
|
+
controller:Destroy()
|
|
74
81
|
end)
|
|
75
82
|
|
|
76
83
|
it("rejects a bad player", function()
|
|
@@ -80,7 +87,7 @@ describe("ResetService.PromiseResetCharacter", function()
|
|
|
80
87
|
controller.resetService:PromiseResetCharacter(nil)
|
|
81
88
|
end).toThrow()
|
|
82
89
|
|
|
83
|
-
controller:
|
|
90
|
+
controller:Destroy()
|
|
84
91
|
end)
|
|
85
92
|
end)
|
|
86
93
|
|
|
@@ -105,7 +112,7 @@ describe("ResetService.PushResetProvider", function()
|
|
|
105
112
|
-- The default provider never ran, so no character was spawned.
|
|
106
113
|
expect(PlayerMock.read(controller.mock, "Character")).toBeNil()
|
|
107
114
|
|
|
108
|
-
controller:
|
|
115
|
+
controller:Destroy()
|
|
109
116
|
end)
|
|
110
117
|
|
|
111
118
|
it("restores the previous provider once the pushed one is popped", function()
|
|
@@ -135,7 +142,7 @@ describe("ResetService.PushResetProvider", function()
|
|
|
135
142
|
expect(afterValue).toBe("first")
|
|
136
143
|
expect(firstCount).toBe(1)
|
|
137
144
|
|
|
138
|
-
controller:
|
|
145
|
+
controller:Destroy()
|
|
139
146
|
end)
|
|
140
147
|
|
|
141
148
|
it("rejects a bad provider", function()
|
|
@@ -145,6 +152,6 @@ describe("ResetService.PushResetProvider", function()
|
|
|
145
152
|
controller.resetService:PushResetProvider("not a function")
|
|
146
153
|
end).toThrow()
|
|
147
154
|
|
|
148
|
-
controller:
|
|
155
|
+
controller:Destroy()
|
|
149
156
|
end)
|
|
150
157
|
end)
|