@rbxts/covenant 1.5.4 → 1.5.6

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.5.4",
3
+ "version": "1.5.6",
4
4
  "main": "src/init.luau",
5
5
  "scripts": {
6
6
  "build": "rbxtsc",
package/src/covenant.d.ts CHANGED
@@ -34,6 +34,9 @@ export declare class Covenant {
34
34
  private predictionSend;
35
35
  private predictionConnect;
36
36
  constructor({ requestPayloadSend, requestPayloadConnect, replicationSend, replicationConnect, replicationSendAll, predictionSend, predictionConnect, }: CovenantProps);
37
+ private logging;
38
+ enableLogging(): void;
39
+ disableLogging(): void;
37
40
  private setupPredictionClient;
38
41
  private forEachComponentChanges;
39
42
  private setupPredictionServer;
package/src/covenant.luau CHANGED
@@ -62,6 +62,7 @@ do
62
62
  self.started = false
63
63
  self.stringifiedComponentSubscribers = {}
64
64
  self.stringifiedComponentValidators = {}
65
+ self.logging = false
65
66
  self.requestPayloadSend = requestPayloadSend
66
67
  self.requestPayloadConnect = requestPayloadConnect
67
68
  self.replicationSend = replicationSend
@@ -72,6 +73,12 @@ do
72
73
  self:setupReplication()
73
74
  self:setupPrediction()
74
75
  end
76
+ function Covenant:enableLogging()
77
+ self.logging = true
78
+ end
79
+ function Covenant:disableLogging()
80
+ self.logging = false
81
+ end
75
82
  function Covenant:setupPredictionClient()
76
83
  self:schedule(RunService.Heartbeat, function()
77
84
  if next(self.worldChangesForPrediction) == nil then
@@ -363,6 +370,9 @@ do
363
370
  else
364
371
  self._world:set(entity, component, newState)
365
372
  end
373
+ if self.logging then
374
+ print(`{entity}.{component}:{lastState}->{newState}`)
375
+ end
366
376
  local _stringifiedComponentSubscribers = self.stringifiedComponentSubscribers
367
377
  local _arg0 = tostring(component)
368
378
  local _result = _stringifiedComponentSubscribers[_arg0]
@@ -751,8 +761,6 @@ do
751
761
  local childEntity = entityTracker[key]
752
762
  local _arg0 = childEntity ~= nil
753
763
  assert(_arg0)
754
- local _arg0_1 = self:worldContains(childEntity)
755
- assert(_arg0_1)
756
764
  self:worldSet(childEntity, childIdentityComponent, value)
757
765
  end
758
766
  for _k, _v in entriesChanged do
@@ -766,8 +774,6 @@ do
766
774
  local childEntity = _entityTracker[_key]
767
775
  local _arg0 = childEntity ~= nil
768
776
  assert(_arg0)
769
- local _arg0_1 = self:worldContains(childEntity)
770
- assert(_arg0_1)
771
777
  self:worldDelete(childEntity)
772
778
  local _entityTracker_1 = entityTracker
773
779
  local _key_1 = key