app.hypergames.hypersdk 1.11.0-beta.17 → 1.11.0-beta.19
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 +14 -0
- package/Runtime/Internal/Core/HyperRuntime.cs +63 -1
- package/Runtime/Internal/Managers/EventManager.cs +7 -1
- package/Runtime/Internal/Managers/ReplayManager.cs +4 -1
- package/Runtime/Internal/Replay/ReplaySessionState.cs +6 -3
- package/Runtime/Internal/UI/Components/ReplayController.cs +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.11.0-beta.19](https://github.com/mvmhyper/hyper-sdk/compare/v1.11.0-beta.18...v1.11.0-beta.19) (2026-09-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **replay:** stop seeking at requested progress ([54bf74a](https://github.com/mvmhyper/hyper-sdk/commit/54bf74a4b66b7c19e1398acd611a7d9557ccbcf3))
|
|
7
|
+
|
|
8
|
+
# [1.11.0-beta.18](https://github.com/mvmhyper/hyper-sdk/compare/v1.11.0-beta.17...v1.11.0-beta.18) (2026-09-01)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **replay:** support custom replay restarts ([bf722ab](https://github.com/mvmhyper/hyper-sdk/commit/bf722abe48add18c356922c60231cb2017e28443))
|
|
14
|
+
|
|
1
15
|
# [1.11.0-beta.17](https://github.com/mvmhyper/hyper-sdk/compare/v1.11.0-beta.16...v1.11.0-beta.17) (2026-09-01)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -15,6 +15,8 @@ namespace Hyper.Internal
|
|
|
15
15
|
/// </summary>
|
|
16
16
|
internal static class HyperRuntime
|
|
17
17
|
{
|
|
18
|
+
private const float ReplayCustomRestartTimeoutSeconds = 10f;
|
|
19
|
+
|
|
18
20
|
private static HyperRuntimeHost _host;
|
|
19
21
|
private static GameObject _singletonObject;
|
|
20
22
|
|
|
@@ -22,6 +24,7 @@ namespace Hyper.Internal
|
|
|
22
24
|
private static bool _isSoftRestarting;
|
|
23
25
|
private static bool _replayRandomResetPending;
|
|
24
26
|
private static bool _replayCustomRestartPending;
|
|
27
|
+
private static int _replayCustomRestartVersion;
|
|
25
28
|
private static bool _customLoadingComplete;
|
|
26
29
|
private static bool _customLoadingActive;
|
|
27
30
|
private static float _customLoadingProgress;
|
|
@@ -123,7 +126,8 @@ namespace Hyper.Internal
|
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
/// <summary>
|
|
126
|
-
/// Restarts replay playback
|
|
129
|
+
/// Restarts replay playback while preserving replay session data. Uses the configured
|
|
130
|
+
/// game-owned custom restart flow when available and falls back to HyperLoader.
|
|
127
131
|
/// </summary>
|
|
128
132
|
internal static void RestartReplaySession()
|
|
129
133
|
{
|
|
@@ -147,8 +151,64 @@ namespace Hyper.Internal
|
|
|
147
151
|
|
|
148
152
|
_replayCustomRestartPending = false;
|
|
149
153
|
_replayRandomResetPending = false;
|
|
154
|
+
int restartVersion = ++_replayCustomRestartVersion;
|
|
150
155
|
_replayManager?.PrepareForRestart();
|
|
151
156
|
|
|
157
|
+
if (_settings != null && _settings.useCustomRestartFlow &&
|
|
158
|
+
_host != null && _gameManager != null && _eventManager != null)
|
|
159
|
+
{
|
|
160
|
+
_replayCustomRestartPending = true;
|
|
161
|
+
_replayRandomResetPending = true;
|
|
162
|
+
_gameManager.ResetUIStateForCustomRestart();
|
|
163
|
+
|
|
164
|
+
try
|
|
165
|
+
{
|
|
166
|
+
if (!_eventManager.InvokeCustomRestartEvent())
|
|
167
|
+
{
|
|
168
|
+
HyperDebug.LogWarning(
|
|
169
|
+
"[Replay] Custom restart has no handler; falling back to HyperLoader.");
|
|
170
|
+
BeginReplaySceneRestart(restartVersion);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
_host.StartCoroutine(WaitForReplayCustomRestart(restartVersion));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
catch (Exception exception)
|
|
178
|
+
{
|
|
179
|
+
HyperDebug.LogWarning(
|
|
180
|
+
$"[Replay] Custom restart failed; falling back to HyperLoader: {exception.Message}");
|
|
181
|
+
BeginReplaySceneRestart(restartVersion);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
BeginReplaySceneRestart(restartVersion);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private static IEnumerator WaitForReplayCustomRestart(int restartVersion)
|
|
190
|
+
{
|
|
191
|
+
float timeoutAt = Time.realtimeSinceStartup + ReplayCustomRestartTimeoutSeconds;
|
|
192
|
+
while (_replayCustomRestartPending && restartVersion == _replayCustomRestartVersion &&
|
|
193
|
+
Time.realtimeSinceStartup < timeoutAt)
|
|
194
|
+
{
|
|
195
|
+
yield return null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (!_replayCustomRestartPending || restartVersion != _replayCustomRestartVersion) yield break;
|
|
199
|
+
|
|
200
|
+
HyperDebug.LogWarning(
|
|
201
|
+
$"[Replay] Custom restart did not complete within {ReplayCustomRestartTimeoutSeconds:0} seconds; " +
|
|
202
|
+
"falling back to HyperLoader.");
|
|
203
|
+
BeginReplaySceneRestart(restartVersion);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private static void BeginReplaySceneRestart(int restartVersion)
|
|
207
|
+
{
|
|
208
|
+
if (restartVersion != _replayCustomRestartVersion) return;
|
|
209
|
+
|
|
210
|
+
_replayCustomRestartPending = false;
|
|
211
|
+
_replayRandomResetPending = false;
|
|
152
212
|
if (_host != null)
|
|
153
213
|
{
|
|
154
214
|
_host.StartCoroutine(RestartSessionCoroutine());
|
|
@@ -443,6 +503,7 @@ namespace Hyper.Internal
|
|
|
443
503
|
_customLoadingProgress = 0f;
|
|
444
504
|
_replayRandomResetPending = false;
|
|
445
505
|
_replayCustomRestartPending = false;
|
|
506
|
+
_replayCustomRestartVersion++;
|
|
446
507
|
_fixedSimulationTimeSeconds = 0d;
|
|
447
508
|
|
|
448
509
|
if (_singletonObject != null)
|
|
@@ -504,6 +565,7 @@ namespace Hyper.Internal
|
|
|
504
565
|
_customLoadingProgress = 0f;
|
|
505
566
|
_replayRandomResetPending = false;
|
|
506
567
|
_replayCustomRestartPending = false;
|
|
568
|
+
_replayCustomRestartVersion++;
|
|
507
569
|
_fixedSimulationTimeSeconds = 0d;
|
|
508
570
|
}
|
|
509
571
|
}
|
|
@@ -79,7 +79,13 @@ namespace Hyper.Internal.Managers
|
|
|
79
79
|
internal void InvokeGameEndedEvent() => OnGameEnded?.Invoke();
|
|
80
80
|
internal void InvokeLivesExhaustedEvent() => OnLivesExhausted?.Invoke();
|
|
81
81
|
internal void InvokeHealthExhaustedEvent() => OnHealthExhausted?.Invoke();
|
|
82
|
-
internal
|
|
82
|
+
internal bool InvokeCustomRestartEvent()
|
|
83
|
+
{
|
|
84
|
+
Action handler = OnCustomRestart;
|
|
85
|
+
if (handler == null) return false;
|
|
86
|
+
handler.Invoke();
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
83
89
|
internal void InvokeConnectionLostEvent() => OnInternetConnectionLost?.Invoke();
|
|
84
90
|
internal void InvokeConnectionFoundEvent() => OnInternetConnectionFound?.Invoke();
|
|
85
91
|
internal void InvokeBackendSocketManuallyClosedEvent() => OnBackendSocketManuallyClosed?.Invoke();
|
|
@@ -36,7 +36,10 @@ namespace Hyper.Internal.Managers
|
|
|
36
36
|
{
|
|
37
37
|
if (_playback == null || !_playback.IsPlaying) return;
|
|
38
38
|
_playback.Tick();
|
|
39
|
-
ReplaySessionState.SetProgress(_playback.Progress01)
|
|
39
|
+
if (ReplaySessionState.SetProgress(_playback.Progress01))
|
|
40
|
+
{
|
|
41
|
+
UnityEngine.Time.timeScale = ReplaySessionState.PlaybackSpeed;
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
internal void PrepareForRestart()
|
|
@@ -83,10 +83,10 @@ namespace Hyper.Internal
|
|
|
83
83
|
AvatarTexture = texture;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
public static
|
|
86
|
+
public static bool SetProgress(float progress)
|
|
87
87
|
{
|
|
88
|
-
if (!IsActive) return;
|
|
89
|
-
if (IsSeeking && !_seekPlaybackReady) return;
|
|
88
|
+
if (!IsActive) return false;
|
|
89
|
+
if (IsSeeking && !_seekPlaybackReady) return false;
|
|
90
90
|
float rawProgress = Math.Max(0f, Math.Min(1f, progress));
|
|
91
91
|
Progress01 = GameplayStartProgress01 >= 1f
|
|
92
92
|
? 0f
|
|
@@ -101,7 +101,10 @@ namespace Hyper.Internal
|
|
|
101
101
|
PlaybackSpeed = UserPlaybackSpeed;
|
|
102
102
|
RestoreAudioAfterSeek();
|
|
103
103
|
SeekCompleted?.Invoke(PlaybackSpeed);
|
|
104
|
+
return true;
|
|
104
105
|
}
|
|
106
|
+
|
|
107
|
+
return false;
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
public static void SetPlaybackSpeed(float speed)
|
|
@@ -253,7 +253,6 @@ namespace Hyper.Internal
|
|
|
253
253
|
private void RestorePlaybackAfterSeek(float playbackSpeed)
|
|
254
254
|
{
|
|
255
255
|
float speed = SanitizePlaybackSpeed(playbackSpeed);
|
|
256
|
-
Time.timeScale = speed;
|
|
257
256
|
AlignPlaybackSpeedIndex(speed);
|
|
258
257
|
UpdatePlaybackSpeedLabel(speed);
|
|
259
258
|
SetSeekingPresentation(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app.hypergames.hypersdk",
|
|
3
|
-
"version": "1.11.0-beta.
|
|
3
|
+
"version": "1.11.0-beta.19",
|
|
4
4
|
"displayName": "HyperSDK",
|
|
5
5
|
"description": "Official Unity SDK for Hyper: multiplayer battles, leaderboards, deterministic RNG, session management, tutorials, and WebGL optimizations for production-ready games.",
|
|
6
6
|
"unity": "6000.0",
|