@quenty/timesyncservice 8.1.1 → 8.2.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
+ # [8.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timesyncservice@8.1.1...@quenty/timesyncservice@8.2.0) (2023-12-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Allow TimeSyncService to initialize in test mode ([bb53e48](https://github.com/Quenty/NevermoreEngine/commit/bb53e48443997beac4ff9ef6a193130d8128eb86))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [8.1.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timesyncservice@8.1.0...@quenty/timesyncservice@8.1.1) (2023-10-28)
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": "8.1.1",
3
+ "version": "8.2.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.0.0",
30
- "@quenty/loader": "^7.0.0",
29
+ "@quenty/baseobject": "^7.1.0",
30
+ "@quenty/loader": "^7.1.0",
31
31
  "@quenty/maid": "^2.6.0",
32
- "@quenty/promise": "^7.0.0",
33
- "@quenty/remoting": "^7.1.1",
34
- "@quenty/rx": "^8.1.1",
35
- "@quenty/signal": "^3.0.0",
36
- "@quenty/table": "^3.3.0"
32
+ "@quenty/promise": "^7.1.0",
33
+ "@quenty/remoting": "^7.2.0",
34
+ "@quenty/rx": "^8.2.0",
35
+ "@quenty/signal": "^3.1.0",
36
+ "@quenty/table": "^3.4.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "440aca7ce2b50b74317ee05fdc0b8d1e58001af3"
41
+ "gitHead": "2c2dbbc0cb2fbb46b4f3270c559c63890fe18b26"
42
42
  }
@@ -33,11 +33,12 @@ function TimeSyncService:Init()
33
33
 
34
34
  self._maid = Maid.new()
35
35
 
36
- self._clockPromise = Promise.new()
37
- self._maid:GiveTask(self._clockPromise)
36
+ self._clockPromise = self._maid:Add(Promise.new())
38
37
 
39
38
  if not RunService:IsRunning() then
40
- error("Cannot initialize in test mode")
39
+ -- Assume we're in server mode
40
+ self._clockPromise:Resolve(self:_buildMasterClock())
41
+ -- selene: allow(if_same_then_else)
41
42
  elseif RunService:IsServer() then
42
43
  self._clockPromise:Resolve(self:_buildMasterClock())
43
44
  elseif RunService:IsClient() then
@@ -136,8 +137,7 @@ function TimeSyncService:_buildMasterClock()
136
137
  local remoteEvent = GetRemoteEvent(TimeSyncConstants.REMOTE_EVENT_NAME)
137
138
  local remoteFunction = GetRemoteFunction(TimeSyncConstants.REMOTE_FUNCTION_NAME)
138
139
 
139
- local clock = MasterClock.new(remoteEvent, remoteFunction)
140
- self._maid:GiveTask(clock)
140
+ local clock = self._maid:Add(MasterClock.new(remoteEvent, remoteFunction))
141
141
 
142
142
  return clock
143
143
  end
@@ -147,8 +147,8 @@ function TimeSyncService:_promiseSlaveClock()
147
147
  PromiseGetRemoteEvent(TimeSyncConstants.REMOTE_EVENT_NAME);
148
148
  PromiseGetRemoteFunction(TimeSyncConstants.REMOTE_FUNCTION_NAME);
149
149
  })):Then(function(remoteEvent, remoteFunction)
150
- local clock = SlaveClock.new(remoteEvent, remoteFunction)
151
- self._maid:GiveTask(clock)
150
+ local clock = self._maid:Add(SlaveClock.new(remoteEvent, remoteFunction))
151
+
152
152
  return TimeSyncUtils.promiseClockSynced(clock)
153
153
  end)
154
154
  end