@quenty/timesyncservice 13.18.0 → 13.18.1-canary.545.2374fb2.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
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## [13.18.1-canary.545.2374fb2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timesyncservice@13.18.0...@quenty/timesyncservice@13.18.1-canary.545.2374fb2.0) (2025-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [13.18.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timesyncservice@13.17.2...@quenty/timesyncservice@13.18.0) (2025-04-02)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/timesyncservice
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/timesyncservice",
|
|
3
|
-
"version": "13.18.0",
|
|
3
|
+
"version": "13.18.1-canary.545.2374fb2.0",
|
|
4
4
|
"description": "Quenty's TimeSyncService keeps time synchronized between all clients and the server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/baseobject": "
|
|
30
|
-
"@quenty/loader": "
|
|
31
|
-
"@quenty/maid": "
|
|
32
|
-
"@quenty/promise": "
|
|
33
|
-
"@quenty/remoting": "
|
|
34
|
-
"@quenty/rx": "
|
|
35
|
-
"@quenty/signal": "
|
|
36
|
-
"@quenty/table": "
|
|
37
|
-
"@quenty/valueobject": "
|
|
29
|
+
"@quenty/baseobject": "10.8.1-canary.545.2374fb2.0",
|
|
30
|
+
"@quenty/loader": "10.8.1-canary.545.2374fb2.0",
|
|
31
|
+
"@quenty/maid": "3.4.1-canary.545.2374fb2.0",
|
|
32
|
+
"@quenty/promise": "10.10.2-canary.545.2374fb2.0",
|
|
33
|
+
"@quenty/remoting": "12.18.1-canary.545.2374fb2.0",
|
|
34
|
+
"@quenty/rx": "13.17.1-canary.545.2374fb2.0",
|
|
35
|
+
"@quenty/signal": "7.10.1-canary.545.2374fb2.0",
|
|
36
|
+
"@quenty/table": "3.7.2-canary.545.2374fb2.0",
|
|
37
|
+
"@quenty/valueobject": "13.17.1-canary.545.2374fb2.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "2374fb2b043cfbe0e9b507b3316eec46a4e353a0"
|
|
43
43
|
}
|
|
@@ -19,7 +19,7 @@ MasterClock.ClassName = "MasterClock"
|
|
|
19
19
|
@param remoteFunction RemoteFunction
|
|
20
20
|
@return MasterClock
|
|
21
21
|
]=]
|
|
22
|
-
function MasterClock.new(remoteEvent, remoteFunction)
|
|
22
|
+
function MasterClock.new(remoteEvent: RemoteEvent, remoteFunction: RemoteFunction)
|
|
23
23
|
local self = setmetatable(BaseObject.new(), MasterClock)
|
|
24
24
|
|
|
25
25
|
self._remoteEvent = remoteEvent or error("No remoteEvent")
|
|
@@ -29,7 +29,7 @@ function MasterClock.new(remoteEvent, remoteFunction)
|
|
|
29
29
|
return self:_handleDelayRequest(timeThree)
|
|
30
30
|
end
|
|
31
31
|
self._maid:GiveTask(self._remoteEvent.OnServerEvent:Connect(function(player)
|
|
32
|
-
|
|
32
|
+
self._remoteEvent:FireClient(player, self:GetTime())
|
|
33
33
|
end))
|
|
34
34
|
|
|
35
35
|
local alive = true
|
|
@@ -73,7 +73,7 @@ end
|
|
|
73
73
|
Returns true if the manager has synced with the server
|
|
74
74
|
@return boolean
|
|
75
75
|
]=]
|
|
76
|
-
function MasterClock:IsSynced()
|
|
76
|
+
function MasterClock:IsSynced(): boolean
|
|
77
77
|
return true
|
|
78
78
|
end
|
|
79
79
|
|
|
@@ -81,7 +81,7 @@ end
|
|
|
81
81
|
Returns estimated ping in seconds
|
|
82
82
|
@return number
|
|
83
83
|
]=]
|
|
84
|
-
function MasterClock:GetPing()
|
|
84
|
+
function MasterClock:GetPing(): number
|
|
85
85
|
return self._offset
|
|
86
86
|
end
|
|
87
87
|
|
|
@@ -89,7 +89,7 @@ end
|
|
|
89
89
|
Returns the sycncronized time
|
|
90
90
|
@return number
|
|
91
91
|
]=]
|
|
92
|
-
function MasterClock:GetTime()
|
|
92
|
+
function MasterClock:GetTime(): number
|
|
93
93
|
return tick()
|
|
94
94
|
end
|
|
95
95
|
|
|
@@ -99,7 +99,7 @@ function MasterClock:_forceSync()
|
|
|
99
99
|
self._remoteEvent:FireAllClients(timeOne)
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
function MasterClock:_handleDelayRequest(timeThree)
|
|
102
|
+
function MasterClock:_handleDelayRequest(timeThree: number)
|
|
103
103
|
-- Client sends back message to get the SM_Difference.
|
|
104
104
|
-- returns slaveMasterDifference
|
|
105
105
|
local timeFour = self:GetTime()
|
|
@@ -20,7 +20,7 @@ SlaveClock._offset = -1 -- Set uncalculated values to -1
|
|
|
20
20
|
@param remoteFunction RemoteFunction
|
|
21
21
|
@return SlaveClock
|
|
22
22
|
]=]
|
|
23
|
-
function SlaveClock.new(remoteEvent, remoteFunction)
|
|
23
|
+
function SlaveClock.new(remoteEvent: RemoteEvent, remoteFunction: RemoteFunction)
|
|
24
24
|
local self = setmetatable(BaseObject.new(), SlaveClock)
|
|
25
25
|
|
|
26
26
|
self._remoteEvent = remoteEvent or error("No remoteEvent")
|
|
@@ -69,7 +69,7 @@ end
|
|
|
69
69
|
Returns the sycncronized time
|
|
70
70
|
@return number
|
|
71
71
|
]=]
|
|
72
|
-
function SlaveClock:GetTime()
|
|
72
|
+
function SlaveClock:GetTime(): number
|
|
73
73
|
if not self:IsSynced() then
|
|
74
74
|
error("[SlaveClock.GetTime] - Slave clock is not yet synced")
|
|
75
75
|
end
|
|
@@ -81,7 +81,7 @@ end
|
|
|
81
81
|
Returns true if the manager has synced with the server
|
|
82
82
|
@return boolean
|
|
83
83
|
]=]
|
|
84
|
-
function SlaveClock:IsSynced()
|
|
84
|
+
function SlaveClock:IsSynced(): boolean
|
|
85
85
|
return self._offset ~= -1
|
|
86
86
|
end
|
|
87
87
|
|
|
@@ -94,7 +94,7 @@ end
|
|
|
94
94
|
Returns estimated ping in seconds
|
|
95
95
|
@return number
|
|
96
96
|
]=]
|
|
97
|
-
function SlaveClock:GetPing()
|
|
97
|
+
function SlaveClock:GetPing(): number
|
|
98
98
|
return self._ping.Value
|
|
99
99
|
end
|
|
100
100
|
|
|
@@ -16,7 +16,7 @@ local TimeSyncUtils = {}
|
|
|
16
16
|
@param clock MasterClock | SlaveClock
|
|
17
17
|
@return Promise<MasterClock | SlaveClock>
|
|
18
18
|
]=]
|
|
19
|
-
function TimeSyncUtils.promiseClockSynced(clock)
|
|
19
|
+
function TimeSyncUtils.promiseClockSynced(clock: any): Promise.Promise<any>
|
|
20
20
|
if clock:IsSynced() then
|
|
21
21
|
return Promise.resolved(clock)
|
|
22
22
|
end
|