@quenty/timesyncservice 8.3.1-canary.d08dd64.0 → 8.4.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/CHANGELOG.md +5 -2
- package/package.json +10 -10
- package/src/Shared/Clocks/MasterClock.lua +13 -0
- package/src/Shared/Clocks/SlaveClock.lua +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [8.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timesyncservice@8.3.0...@quenty/timesyncservice@8.4.0) (2024-01-08)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add GetClockFunction() as a method ([131a04d](https://github.com/Quenty/NevermoreEngine/commit/131a04dba7212d07b81baea33a513aba4756ed93))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/timesyncservice",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.0",
|
|
4
4
|
"description": "Quenty's TimeSyncService keeps time synchronized between all clients and the server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/baseobject": "7.
|
|
30
|
-
"@quenty/loader": "7.
|
|
31
|
-
"@quenty/maid": "2.6.0",
|
|
32
|
-
"@quenty/promise": "7.
|
|
33
|
-
"@quenty/remoting": "7.
|
|
34
|
-
"@quenty/rx": "8.
|
|
35
|
-
"@quenty/signal": "3.
|
|
36
|
-
"@quenty/table": "3.4.0"
|
|
29
|
+
"@quenty/baseobject": "^7.2.0",
|
|
30
|
+
"@quenty/loader": "^7.3.0",
|
|
31
|
+
"@quenty/maid": "^2.6.0",
|
|
32
|
+
"@quenty/promise": "^7.2.0",
|
|
33
|
+
"@quenty/remoting": "^7.4.0",
|
|
34
|
+
"@quenty/rx": "^8.4.0",
|
|
35
|
+
"@quenty/signal": "^3.2.0",
|
|
36
|
+
"@quenty/table": "^3.4.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "075fb03a03f12ade8758f667767ba738204e0c4b"
|
|
42
42
|
}
|
|
@@ -36,6 +36,10 @@ function MasterClock.new(remoteEvent, remoteFunction)
|
|
|
36
36
|
alive = false
|
|
37
37
|
end)
|
|
38
38
|
|
|
39
|
+
self._clockFunction = function()
|
|
40
|
+
return self:GetTime()
|
|
41
|
+
end
|
|
42
|
+
|
|
39
43
|
task.delay(5, function()
|
|
40
44
|
while alive do
|
|
41
45
|
self:_forceSync()
|
|
@@ -46,6 +50,15 @@ function MasterClock.new(remoteEvent, remoteFunction)
|
|
|
46
50
|
return self
|
|
47
51
|
end
|
|
48
52
|
|
|
53
|
+
--[=[
|
|
54
|
+
Gets a function that can be used as a clock, like `time` and `tick` are.
|
|
55
|
+
|
|
56
|
+
@return function
|
|
57
|
+
]=]
|
|
58
|
+
function MasterClock:GetClockFunction()
|
|
59
|
+
return self._clockFunction
|
|
60
|
+
end
|
|
61
|
+
|
|
49
62
|
--[=[
|
|
50
63
|
Returns true if the manager has synced with the server
|
|
51
64
|
@return boolean
|
|
@@ -35,9 +35,22 @@ function SlaveClock.new(remoteEvent, remoteFunction)
|
|
|
35
35
|
self._syncedBindable = Instance.new("BindableEvent")
|
|
36
36
|
self.SyncedEvent = self._syncedBindable.Event
|
|
37
37
|
|
|
38
|
+
self._clockFunction = function()
|
|
39
|
+
return self:GetTime()
|
|
40
|
+
end
|
|
41
|
+
|
|
38
42
|
return self
|
|
39
43
|
end
|
|
40
44
|
|
|
45
|
+
--[=[
|
|
46
|
+
Gets a function that can be used as a clock, like `time` and `tick` are.
|
|
47
|
+
|
|
48
|
+
@return function
|
|
49
|
+
]=]
|
|
50
|
+
function SlaveClock:GetClockFunction()
|
|
51
|
+
return self._clockFunction
|
|
52
|
+
end
|
|
53
|
+
|
|
41
54
|
--[=[
|
|
42
55
|
Converts the syncedTime to the original tick value.
|
|
43
56
|
@param syncedTime number
|