@rbxts/covenant 1.5.0 → 1.5.1
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 +5 -3
- package/src/covenant.luau +6 -4
package/package.json
CHANGED
package/src/covenant.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { Remove, Delete } from "./stringEnums";
|
|
|
4
4
|
export type WorldChangesForReplication = Map<string, Delete | Map<string, defined | Remove>>;
|
|
5
5
|
export type WorldChangesForPrediction = Map<string, Map<string, defined | Remove>>;
|
|
6
6
|
export interface CovenantProps {
|
|
7
|
-
|
|
7
|
+
requestPayloadSend: () => void;
|
|
8
|
+
requestPayloadConnect: (callback: (player: Player) => void) => void;
|
|
8
9
|
replicationSend: (player: Player, worldChanges: WorldChangesForReplication) => void;
|
|
9
10
|
replicationSendAll?: (worldChanges: WorldChangesForReplication) => void;
|
|
10
11
|
replicationConnect: (callback: (worldChanges: WorldChangesForReplication) => void) => void;
|
|
@@ -24,13 +25,14 @@ export declare class Covenant {
|
|
|
24
25
|
private started;
|
|
25
26
|
private stringifiedComponentSubscribers;
|
|
26
27
|
private stringifiedComponentValidators;
|
|
27
|
-
private
|
|
28
|
+
private requestPayloadSend;
|
|
29
|
+
private requestPayloadConnect;
|
|
28
30
|
private replicationSend;
|
|
29
31
|
private replicationConnect;
|
|
30
32
|
private replicationSendAll;
|
|
31
33
|
private predictionSend;
|
|
32
34
|
private predictionConnect;
|
|
33
|
-
constructor({
|
|
35
|
+
constructor({ requestPayloadSend, requestPayloadConnect, replicationSend, replicationConnect, replicationSendAll, predictionSend, predictionConnect, }: CovenantProps);
|
|
34
36
|
private setupPredictionClient;
|
|
35
37
|
private forEachComponentChanges;
|
|
36
38
|
private setupPredictionServer;
|
package/src/covenant.luau
CHANGED
|
@@ -40,7 +40,8 @@ do
|
|
|
40
40
|
return self:constructor(...) or self
|
|
41
41
|
end
|
|
42
42
|
function Covenant:constructor(_param)
|
|
43
|
-
local
|
|
43
|
+
local requestPayloadSend = _param.requestPayloadSend
|
|
44
|
+
local requestPayloadConnect = _param.requestPayloadConnect
|
|
44
45
|
local replicationSend = _param.replicationSend
|
|
45
46
|
local replicationConnect = _param.replicationConnect
|
|
46
47
|
local replicationSendAll = _param.replicationSendAll
|
|
@@ -57,7 +58,8 @@ do
|
|
|
57
58
|
self.started = false
|
|
58
59
|
self.stringifiedComponentSubscribers = {}
|
|
59
60
|
self.stringifiedComponentValidators = {}
|
|
60
|
-
self.
|
|
61
|
+
self.requestPayloadSend = requestPayloadSend
|
|
62
|
+
self.requestPayloadConnect = requestPayloadConnect
|
|
61
63
|
self.replicationSend = replicationSend
|
|
62
64
|
self.replicationConnect = replicationConnect
|
|
63
65
|
self.replicationSendAll = replicationSendAll
|
|
@@ -187,7 +189,7 @@ do
|
|
|
187
189
|
end, math.huge)
|
|
188
190
|
end
|
|
189
191
|
function Covenant:setupReplicationPayload()
|
|
190
|
-
|
|
192
|
+
self.requestPayloadConnect(function(player)
|
|
191
193
|
task.defer(function()
|
|
192
194
|
if not player:IsDescendantOf(Players) then
|
|
193
195
|
return nil
|
|
@@ -316,7 +318,7 @@ do
|
|
|
316
318
|
-- ▲ ReadonlyArray.forEach ▲
|
|
317
319
|
end)
|
|
318
320
|
end)
|
|
319
|
-
self.
|
|
321
|
+
self.requestPayloadSend()
|
|
320
322
|
end
|
|
321
323
|
function Covenant:preventPostStartCall()
|
|
322
324
|
local _arg0 = not self.started
|