@quenty/cmdrservice 13.45.2 → 13.46.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
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
# [13.46.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/cmdrservice@13.45.2...@quenty/cmdrservice@13.46.0) (2026-07-14)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **cmdrservice:** convert package to --!strict ([b5662ad](https://github.com/Quenty/NevermoreEngine/commit/b5662adab31b5fad3e15977b45f50ee277c41299))
|
|
11
|
+
|
|
6
12
|
## [13.45.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/cmdrservice@13.45.1...@quenty/cmdrservice@13.45.2) (2026-06-03)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/cmdrservice",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.46.0",
|
|
4
4
|
"description": "Bridge between cmdr and Nevermore services using servicebag",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"@quenty/loader": "10.11.0",
|
|
32
32
|
"@quenty/maid": "3.9.0",
|
|
33
33
|
"@quenty/nevermore-test-runner": "1.4.0",
|
|
34
|
-
"@quenty/permissionprovider": "14.
|
|
34
|
+
"@quenty/permissionprovider": "14.39.0",
|
|
35
35
|
"@quenty/promise": "10.18.1",
|
|
36
36
|
"@quenty/remoting": "12.32.1",
|
|
37
37
|
"@quenty/servicebag": "11.18.1",
|
|
38
38
|
"@quenty/string": "3.3.7",
|
|
39
|
-
"@quenty/templateprovider": "11.
|
|
39
|
+
"@quenty/templateprovider": "11.39.0",
|
|
40
40
|
"@quentystudios/cmdr": "^1.12.0-quenty.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "13f0162f4971a77378e55e9b7236aea94f0dd3a8"
|
|
46
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
Loads cmdr on the client. See [CmdrService] for the server equivalent.
|
|
4
4
|
|
|
@@ -23,19 +23,29 @@ local promiseChild = require("promiseChild")
|
|
|
23
23
|
local CmdrServiceClient = {}
|
|
24
24
|
CmdrServiceClient.ServiceName = "CmdrServiceClient"
|
|
25
25
|
|
|
26
|
+
export type CmdrServiceClient = typeof(setmetatable(
|
|
27
|
+
{} :: {
|
|
28
|
+
_serviceBag: ServiceBag.ServiceBag,
|
|
29
|
+
_maid: Maid.Maid,
|
|
30
|
+
_permissionServiceClient: any,
|
|
31
|
+
_cmdrPromise: Promise.Promise<any>?,
|
|
32
|
+
},
|
|
33
|
+
{} :: typeof({ __index = CmdrServiceClient })
|
|
34
|
+
))
|
|
35
|
+
|
|
26
36
|
--[=[
|
|
27
37
|
Starts the cmdr service on the client. Should be done via [ServiceBag].
|
|
28
38
|
@param serviceBag ServiceBag
|
|
29
39
|
]=]
|
|
30
|
-
function CmdrServiceClient
|
|
31
|
-
assert(not self._serviceBag, "Already initialized")
|
|
40
|
+
function CmdrServiceClient.Init(self: CmdrServiceClient, serviceBag: ServiceBag.ServiceBag): ()
|
|
41
|
+
assert(not (self :: any)._serviceBag, "Already initialized")
|
|
32
42
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
33
43
|
self._maid = Maid.new()
|
|
34
44
|
|
|
35
45
|
self._permissionServiceClient = self._serviceBag:GetService(PermissionServiceClient)
|
|
36
46
|
|
|
37
47
|
self:PromiseCmdr():Then(function(cmdr)
|
|
38
|
-
cmdr.Registry:RegisterHook("BeforeRun", function(context)
|
|
48
|
+
cmdr.Registry:RegisterHook("BeforeRun", function(context): string?
|
|
39
49
|
-- allow!
|
|
40
50
|
if context.Executor == nil then
|
|
41
51
|
return nil
|
|
@@ -78,26 +88,23 @@ end
|
|
|
78
88
|
--[=[
|
|
79
89
|
Starts the service. Should be done via [ServiceBag].
|
|
80
90
|
]=]
|
|
81
|
-
function CmdrServiceClient
|
|
82
|
-
assert(self._serviceBag, "Not initialized")
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
:GivePromise(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
cmdr:SetActivationKeys({})
|
|
96
|
-
end
|
|
97
|
-
end)
|
|
91
|
+
function CmdrServiceClient.Start(self: CmdrServiceClient): ()
|
|
92
|
+
assert(self._serviceBag, "Not initialized");
|
|
93
|
+
(self._maid:GivePromise(PromiseUtils.all({
|
|
94
|
+
self:PromiseCmdr(),
|
|
95
|
+
self._maid:GivePromise(self._permissionServiceClient:PromisePermissionProvider()):Then(function(provider)
|
|
96
|
+
return provider:PromiseIsAdmin()
|
|
97
|
+
end),
|
|
98
|
+
})) :: any):Then(function(cmdr: any, isAdmin: any)
|
|
99
|
+
if isAdmin then
|
|
100
|
+
self:_setBindings(cmdr)
|
|
101
|
+
else
|
|
102
|
+
cmdr:SetActivationKeys({})
|
|
103
|
+
end
|
|
104
|
+
end)
|
|
98
105
|
end
|
|
99
106
|
|
|
100
|
-
function CmdrServiceClient
|
|
107
|
+
function CmdrServiceClient._setBindings(self: CmdrServiceClient, cmdr: any): ()
|
|
101
108
|
cmdr:SetActivationUnlocksMouse(true)
|
|
102
109
|
cmdr:SetActivationKeys({ Enum.KeyCode.F2 })
|
|
103
110
|
|
|
@@ -119,7 +126,7 @@ end
|
|
|
119
126
|
Retrieves the cmdr for the client.
|
|
120
127
|
@return Promise<CmdrClient>
|
|
121
128
|
]=]
|
|
122
|
-
function CmdrServiceClient
|
|
129
|
+
function CmdrServiceClient.PromiseCmdr(self: CmdrServiceClient): Promise.Promise<any>
|
|
123
130
|
assert(self._serviceBag, "Not initialized")
|
|
124
131
|
|
|
125
132
|
if self._cmdrPromise then
|
|
@@ -132,20 +139,21 @@ function CmdrServiceClient:PromiseCmdr()
|
|
|
132
139
|
timeout = 1e10
|
|
133
140
|
end
|
|
134
141
|
|
|
135
|
-
|
|
142
|
+
local cmdrPromise = self._maid
|
|
136
143
|
:GivePromise(promiseChild(ReplicatedStorage, "CmdrClient", timeout))
|
|
137
144
|
:Then(function(cmdClient)
|
|
138
|
-
return Promise.spawn(function(resolve, _reject)
|
|
145
|
+
return (Promise :: any).spawn(function(resolve: any, _reject: any)
|
|
139
146
|
-- Requiring cmdr can yield
|
|
140
|
-
return resolve(require(cmdClient))
|
|
147
|
+
return resolve((require :: any)(cmdClient))
|
|
141
148
|
end)
|
|
142
149
|
end)
|
|
143
|
-
self.
|
|
150
|
+
self._cmdrPromise = cmdrPromise
|
|
151
|
+
self._maid:GiveTask(cmdrPromise)
|
|
144
152
|
|
|
145
|
-
return
|
|
153
|
+
return cmdrPromise
|
|
146
154
|
end
|
|
147
155
|
|
|
148
|
-
function CmdrServiceClient
|
|
156
|
+
function CmdrServiceClient.Destroy(self: CmdrServiceClient): ()
|
|
149
157
|
self._maid:DoCleaning()
|
|
150
158
|
end
|
|
151
159
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
Bridge to https://eryn.io/Cmdr/
|
|
4
4
|
|
|
@@ -36,19 +36,19 @@ export type CmdrService = typeof(setmetatable(
|
|
|
36
36
|
{} :: typeof({ __index = CmdrService })
|
|
37
37
|
))
|
|
38
38
|
|
|
39
|
-
local GLOBAL_REGISTRY = setmetatable({}, { __mode = "kv" })
|
|
39
|
+
local GLOBAL_REGISTRY: { [string]: CmdrService } = setmetatable({}, { __mode = "kv" }) :: any
|
|
40
40
|
|
|
41
41
|
--[=[
|
|
42
42
|
Initializes the CmdrService. Should be done via [ServiceBag].
|
|
43
43
|
@param serviceBag ServiceBag
|
|
44
44
|
]=]
|
|
45
|
-
function CmdrService.Init(self: CmdrService, serviceBag: ServiceBag.ServiceBag)
|
|
45
|
+
function CmdrService.Init(self: CmdrService, serviceBag: ServiceBag.ServiceBag): ()
|
|
46
46
|
assert(not (self :: any)._serviceBag, "Already initialized")
|
|
47
47
|
self._maid = Maid.new()
|
|
48
48
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
49
49
|
|
|
50
50
|
-- External
|
|
51
|
-
self._permissionService = self._serviceBag:GetService(PermissionService)
|
|
51
|
+
self._permissionService = self._serviceBag:GetService(PermissionService) :: any
|
|
52
52
|
|
|
53
53
|
-- Internal
|
|
54
54
|
self._cmdrTemplateProviderServer = self._serviceBag:GetService(CmdrTemplateProviderServer)
|
|
@@ -79,7 +79,7 @@ function CmdrService.Init(self: CmdrService, serviceBag: ServiceBag.ServiceBag)
|
|
|
79
79
|
cmdr:RegisterDefaultCommands()
|
|
80
80
|
end)
|
|
81
81
|
|
|
82
|
-
cmdr.Registry:RegisterHook("BeforeRun", function(context)
|
|
82
|
+
cmdr.Registry:RegisterHook("BeforeRun", function(context): string?
|
|
83
83
|
-- allow!
|
|
84
84
|
if context.Executor == nil then
|
|
85
85
|
return nil
|
|
@@ -115,7 +115,7 @@ end
|
|
|
115
115
|
Returns cmdr
|
|
116
116
|
@return Promise<Cmdr>
|
|
117
117
|
]=]
|
|
118
|
-
function CmdrService.PromiseCmdr(self: CmdrService)
|
|
118
|
+
function CmdrService.PromiseCmdr(self: CmdrService): Promise.Promise<any>
|
|
119
119
|
assert(self._promiseCmdr, "Not initialized")
|
|
120
120
|
|
|
121
121
|
return self._promiseCmdr
|
|
@@ -197,13 +197,13 @@ end
|
|
|
197
197
|
@return CmdrService
|
|
198
198
|
@private
|
|
199
199
|
]=]
|
|
200
|
-
function CmdrService.__getServiceFromId(_self: CmdrService, cmdrServiceId: string)
|
|
200
|
+
function CmdrService.__getServiceFromId(_self: CmdrService, cmdrServiceId: string): CmdrService?
|
|
201
201
|
assert(type(cmdrServiceId) == "string", "Bad cmdrServiceId")
|
|
202
202
|
|
|
203
203
|
return GLOBAL_REGISTRY[cmdrServiceId]
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
-
function CmdrService.Destroy(self: CmdrService)
|
|
206
|
+
function CmdrService.Destroy(self: CmdrService): ()
|
|
207
207
|
self._maid:DoCleaning()
|
|
208
208
|
end
|
|
209
209
|
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
Generic command definition template which we can use to
|
|
4
4
|
@class CmdrExecutionTemplate
|
|
5
5
|
]=]
|
|
6
6
|
|
|
7
|
-
local function waitForValue(objectValue)
|
|
8
|
-
local value = objectValue.Value
|
|
7
|
+
local function waitForValue(objectValue: Instance): any
|
|
8
|
+
local value = (objectValue :: any).Value
|
|
9
9
|
if value then
|
|
10
10
|
return value
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
return objectValue.Changed:Wait()
|
|
13
|
+
return (objectValue :: any).Changed:Wait()
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
local cmdrServiceId = waitForValue(script:WaitForChild("CmdrServiceId"))
|
|
17
17
|
local cmdrCommandId = waitForValue(script:WaitForChild("CmdrCommandId"))
|
|
18
|
-
local commandServiceDefinition = require(
|
|
18
|
+
local commandServiceDefinition = (require :: any)(
|
|
19
|
+
waitForValue(script:WaitForChild("CmdrServiceTarget")) :: ModuleScript
|
|
20
|
+
)
|
|
19
21
|
local cmdrService = commandServiceDefinition:__getServiceFromId(cmdrServiceId)
|
|
20
22
|
|
|
21
|
-
return function(
|
|
23
|
+
return function(...: any): any
|
|
22
24
|
return cmdrService:__executeCommand(cmdrCommandId, ...)
|
|
23
25
|
end
|