@rbxts/covenant 1.5.5 → 1.5.7
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 +3 -0
- package/src/covenant.luau +10 -0
package/package.json
CHANGED
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 and RunService:IsStudio() 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]
|