@rbxts/covenant 1.4.2 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/covenant",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "main": "src/init.luau",
5
5
  "scripts": {
6
6
  "build": "rbxtsc",
package/src/covenant.d.ts CHANGED
@@ -4,6 +4,7 @@ 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
+ requestPayload: () => void;
7
8
  replicationSend: (player: Player, worldChanges: WorldChangesForReplication) => void;
8
9
  replicationSendAll?: (worldChanges: WorldChangesForReplication) => void;
9
10
  replicationConnect: (callback: (worldChanges: WorldChangesForReplication) => void) => void;
@@ -23,12 +24,13 @@ export declare class Covenant {
23
24
  private started;
24
25
  private stringifiedComponentSubscribers;
25
26
  private stringifiedComponentValidators;
27
+ private requestPayload;
26
28
  private replicationSend;
27
29
  private replicationConnect;
28
30
  private replicationSendAll;
29
31
  private predictionSend;
30
32
  private predictionConnect;
31
- constructor({ replicationSend, replicationConnect, replicationSendAll, predictionSend, predictionConnect, }: CovenantProps);
33
+ constructor({ requestPayload, replicationSend, replicationConnect, replicationSendAll, predictionSend, predictionConnect, }: CovenantProps);
32
34
  private setupPredictionClient;
33
35
  private forEachComponentChanges;
34
36
  private setupPredictionServer;
package/src/covenant.luau CHANGED
@@ -40,6 +40,7 @@ do
40
40
  return self:constructor(...) or self
41
41
  end
42
42
  function Covenant:constructor(_param)
43
+ local requestPayload = _param.requestPayload
43
44
  local replicationSend = _param.replicationSend
44
45
  local replicationConnect = _param.replicationConnect
45
46
  local replicationSendAll = _param.replicationSendAll
@@ -56,6 +57,7 @@ do
56
57
  self.started = false
57
58
  self.stringifiedComponentSubscribers = {}
58
59
  self.stringifiedComponentValidators = {}
60
+ self.requestPayload = requestPayload
59
61
  self.replicationSend = replicationSend
60
62
  self.replicationConnect = replicationConnect
61
63
  self.replicationSendAll = replicationSendAll
@@ -314,6 +316,7 @@ do
314
316
  -- ▲ ReadonlyArray.forEach ▲
315
317
  end)
316
318
  end)
319
+ self.requestPayload()
317
320
  end
318
321
  function Covenant:preventPostStartCall()
319
322
  local _arg0 = not self.started