com.puzzlescapegames.services 1.0.6 → 1.0.8

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.
@@ -4,7 +4,6 @@ using System.Net;
4
4
  using System.Net.Sockets;
5
5
  using System.Threading;
6
6
  using UnityEngine;
7
- using Zenject;
8
7
 
9
8
  namespace PuzzlescapeGames.Services.NTPService
10
9
  {
@@ -31,7 +30,6 @@ namespace PuzzlescapeGames.Services.NTPService
31
30
  private float _responseReceivedTime;
32
31
  private byte[] _receivedNtpData;
33
32
  private Socket _socket;
34
- private Thread _syncThread;
35
33
  private volatile bool _responseReceived;
36
34
  private CancellationTokenSource _cancellationSource;
37
35
 
@@ -79,7 +77,6 @@ namespace PuzzlescapeGames.Services.NTPService
79
77
 
80
78
  private void SynchronizeDate()
81
79
  {
82
- _syncThread?.Abort();
83
80
  _socket?.Close();
84
81
 
85
82
  _cancellationSource?.Cancel();
@@ -87,9 +84,8 @@ namespace PuzzlescapeGames.Services.NTPService
87
84
  _cancellationSource = new();
88
85
 
89
86
  _responseReceived = false;
90
- _syncThread = new Thread( Request );
91
- _syncThread.Start();
92
87
 
88
+ UniTask.RunOnThreadPool( Request, cancellationToken: _cancellationSource.Token ).Forget();
93
89
  WaitForResponse( _cancellationSource.Token ).Forget();
94
90
 
95
91
  Debug.Log( "[NTPDateTimeService] request started." );
@@ -9,9 +9,9 @@ namespace PuzzlescapeGames.Services.VibrationService
9
9
 
10
10
  public void Vibrate()
11
11
  {
12
- #if UNITY_IOS
12
+ #if UNITY_IOS && !UNITY_EDITOR
13
13
  Vibration.VibrateIOS( ImpactFeedbackStyle.Soft );
14
- #elif UNITY_ANDROID
14
+ #elif UNITY_ANDROID && !UNITY_EDITOR
15
15
  Vibration.VibratePop();
16
16
  #endif
17
17
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name" : "com.puzzlescapegames.services",
3
3
  "displayName" : "Puzzlescape Games Services",
4
- "version" : "1.0.6",
4
+ "version" : "1.0.8",
5
5
  "author" : "Puzzlescape Games",
6
6
  "description" : "Common services.",
7
7
  "repository": {