@rbxts/covenant 1.5.12 → 1.5.13
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/src/covenant.d.ts +1 -0
- package/src/covenant.luau +57 -8
package/package.json
CHANGED
package/src/covenant.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare class Covenant {
|
|
|
24
24
|
private replicatedStringifiedComponents;
|
|
25
25
|
private predictedStringifiedComponents;
|
|
26
26
|
private internalStringifiedComponents;
|
|
27
|
+
private prioritizedStringifiedComponents;
|
|
27
28
|
private started;
|
|
28
29
|
private stringifiedComponentSubscribers;
|
|
29
30
|
private stringifiedComponentValidators;
|
package/src/covenant.luau
CHANGED
|
@@ -61,6 +61,7 @@ do
|
|
|
61
61
|
self.replicatedStringifiedComponents = {}
|
|
62
62
|
self.predictedStringifiedComponents = {}
|
|
63
63
|
self.internalStringifiedComponents = {}
|
|
64
|
+
self.prioritizedStringifiedComponents = {}
|
|
64
65
|
self.started = false
|
|
65
66
|
self.stringifiedComponentSubscribers = {}
|
|
66
67
|
self.stringifiedComponentValidators = {}
|
|
@@ -154,9 +155,9 @@ do
|
|
|
154
155
|
local worldReconciliation = {}
|
|
155
156
|
-- ▼ ReadonlyMap.forEach ▼
|
|
156
157
|
local _callback_1 = function(componentChanges, stringifiedComponent)
|
|
157
|
-
local
|
|
158
|
+
local _prioritizedStringifiedComponents = self.prioritizedStringifiedComponents
|
|
158
159
|
local _stringifiedComponent = stringifiedComponent
|
|
159
|
-
if not (
|
|
160
|
+
if not (_prioritizedStringifiedComponents[_stringifiedComponent] ~= nil) then
|
|
160
161
|
return nil
|
|
161
162
|
end
|
|
162
163
|
self:forEachComponentChanges(player, worldReconciliation, componentChanges, stringifiedComponent)
|
|
@@ -169,7 +170,13 @@ do
|
|
|
169
170
|
local _callback_2 = function(componentChanges, stringifiedComponent)
|
|
170
171
|
local _internalStringifiedComponents = self.internalStringifiedComponents
|
|
171
172
|
local _stringifiedComponent = stringifiedComponent
|
|
172
|
-
|
|
173
|
+
local _condition = not (_internalStringifiedComponents[_stringifiedComponent] ~= nil)
|
|
174
|
+
if _condition then
|
|
175
|
+
local _prioritizedStringifiedComponents = self.prioritizedStringifiedComponents
|
|
176
|
+
local _stringifiedComponent_1 = stringifiedComponent
|
|
177
|
+
_condition = _prioritizedStringifiedComponents[_stringifiedComponent_1] ~= nil
|
|
178
|
+
end
|
|
179
|
+
if _condition then
|
|
173
180
|
return nil
|
|
174
181
|
end
|
|
175
182
|
self:forEachComponentChanges(player, worldReconciliation, componentChanges, stringifiedComponent)
|
|
@@ -178,6 +185,19 @@ do
|
|
|
178
185
|
_callback_2(_v, _k, worldChanges)
|
|
179
186
|
end
|
|
180
187
|
-- ▲ ReadonlyMap.forEach ▲
|
|
188
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
189
|
+
local _callback_3 = function(componentChanges, stringifiedComponent)
|
|
190
|
+
local _internalStringifiedComponents = self.internalStringifiedComponents
|
|
191
|
+
local _stringifiedComponent = stringifiedComponent
|
|
192
|
+
if _internalStringifiedComponents[_stringifiedComponent] ~= nil then
|
|
193
|
+
return nil
|
|
194
|
+
end
|
|
195
|
+
self:forEachComponentChanges(player, worldReconciliation, componentChanges, stringifiedComponent)
|
|
196
|
+
end
|
|
197
|
+
for _k, _v in worldChanges do
|
|
198
|
+
_callback_3(_v, _k, worldChanges)
|
|
199
|
+
end
|
|
200
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
181
201
|
if not (next(worldReconciliation) == nil) then
|
|
182
202
|
self.replicationSend(player, worldReconciliation)
|
|
183
203
|
end
|
|
@@ -275,9 +295,9 @@ do
|
|
|
275
295
|
end
|
|
276
296
|
-- ▼ ReadonlyMap.forEach ▼
|
|
277
297
|
local _callback_2 = function(state, stringifiedComponent)
|
|
278
|
-
local
|
|
298
|
+
local _prioritizedStringifiedComponents = self.prioritizedStringifiedComponents
|
|
279
299
|
local _stringifiedComponent = stringifiedComponent
|
|
280
|
-
if not (
|
|
300
|
+
if not (_prioritizedStringifiedComponents[_stringifiedComponent] ~= nil) then
|
|
281
301
|
return nil
|
|
282
302
|
end
|
|
283
303
|
local component = tonumber(stringifiedComponent)
|
|
@@ -295,7 +315,13 @@ do
|
|
|
295
315
|
local _callback_3 = function(state, stringifiedComponent)
|
|
296
316
|
local _internalStringifiedComponents = self.internalStringifiedComponents
|
|
297
317
|
local _stringifiedComponent = stringifiedComponent
|
|
298
|
-
|
|
318
|
+
local _condition = not (_internalStringifiedComponents[_stringifiedComponent] ~= nil)
|
|
319
|
+
if _condition then
|
|
320
|
+
local _prioritizedStringifiedComponents = self.prioritizedStringifiedComponents
|
|
321
|
+
local _stringifiedComponent_1 = stringifiedComponent
|
|
322
|
+
_condition = _prioritizedStringifiedComponents[_stringifiedComponent_1] ~= nil
|
|
323
|
+
end
|
|
324
|
+
if _condition then
|
|
299
325
|
return nil
|
|
300
326
|
end
|
|
301
327
|
local component = tonumber(stringifiedComponent)
|
|
@@ -309,6 +335,24 @@ do
|
|
|
309
335
|
_callback_3(_v, _k, entityData)
|
|
310
336
|
end
|
|
311
337
|
-- ▲ ReadonlyMap.forEach ▲
|
|
338
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
339
|
+
local _callback_4 = function(state, stringifiedComponent)
|
|
340
|
+
local _internalStringifiedComponents = self.internalStringifiedComponents
|
|
341
|
+
local _stringifiedComponent = stringifiedComponent
|
|
342
|
+
if _internalStringifiedComponents[_stringifiedComponent] ~= nil then
|
|
343
|
+
return nil
|
|
344
|
+
end
|
|
345
|
+
local component = tonumber(stringifiedComponent)
|
|
346
|
+
if state == Remove then
|
|
347
|
+
self:worldSet(entity, component, nil, true)
|
|
348
|
+
else
|
|
349
|
+
self:worldSet(entity, component, state, true)
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
for _k, _v in entityData do
|
|
353
|
+
_callback_4(_v, _k, entityData)
|
|
354
|
+
end
|
|
355
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
312
356
|
end
|
|
313
357
|
for _k, _v in worldChanges do
|
|
314
358
|
_callback_1(_v, _k, worldChanges)
|
|
@@ -549,9 +593,14 @@ do
|
|
|
549
593
|
_undefinedStringifiedComponents[_arg0] = true
|
|
550
594
|
return c
|
|
551
595
|
end
|
|
552
|
-
function Covenant:worldInternalComponent()
|
|
596
|
+
function Covenant:worldInternalComponent(prioritized)
|
|
553
597
|
self:preventPostStartCall()
|
|
554
598
|
local c = self._world:component()
|
|
599
|
+
if prioritized then
|
|
600
|
+
local _prioritizedStringifiedComponents = self.prioritizedStringifiedComponents
|
|
601
|
+
local _arg0 = tostring(c)
|
|
602
|
+
_prioritizedStringifiedComponents[_arg0] = true
|
|
603
|
+
end
|
|
555
604
|
local _internalStringifiedComponents = self.internalStringifiedComponents
|
|
556
605
|
local _arg0 = tostring(c)
|
|
557
606
|
_internalStringifiedComponents[_arg0] = true
|
|
@@ -707,7 +756,7 @@ do
|
|
|
707
756
|
local replicated = _param.replicated
|
|
708
757
|
local predictionValidator = _param.predictionValidator
|
|
709
758
|
self:checkComponentDefined(childIdentityComponent)
|
|
710
|
-
local parentEntityTrackerComponent = self:worldInternalComponent()
|
|
759
|
+
local parentEntityTrackerComponent = self:worldInternalComponent(true)
|
|
711
760
|
local parentComponent = self:worldInternalComponent()
|
|
712
761
|
self:defineComponentNetworkBehavior(parentComponent, replicated, predictionValidator)
|
|
713
762
|
self:defineComponentNetworkBehavior(parentEntityTrackerComponent, replicated, false)
|