app.hypergames.hypersdk 1.11.0 → 1.11.1
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 +7 -0
- package/Runtime/Internal/Managers/GameManager.cs +20 -12
- package/Runtime/Internal/Managers/ReplayManager.cs +3 -1
- package/Runtime/Internal/Managers/TimeManager.cs +9 -6
- package/Runtime/Internal/UI/Modals/StartingInstructionModal.cs +1 -1
- package/Runtime/Internal/UI/Modals/TimeUpModal.cs +2 -2
- package/Runtime/Resources/HyperSDKSettings.asset +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.11.1](https://github.com/mvmhyper/hyper-sdk/compare/v1.11.0...v1.11.1) (2026-09-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* stop battle gameplay on the fixed timeout tick ([d265c6d](https://github.com/mvmhyper/hyper-sdk/commit/d265c6de6d4fb19f6194b73000bfbef93397228d))
|
|
7
|
+
|
|
1
8
|
# [1.11.0](https://github.com/mvmhyper/hyper-sdk/compare/v1.10.0...v1.11.0) (2026-09-23)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -62,14 +62,14 @@ namespace Hyper.Internal.Managers
|
|
|
62
62
|
|
|
63
63
|
private void HandleLivesExhausted()
|
|
64
64
|
{
|
|
65
|
-
if (!IsInGameScene ||
|
|
65
|
+
if (!IsInGameScene || HasGameEnded || !_hasGameStarted) return;
|
|
66
66
|
|
|
67
67
|
EndGame();
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
private void HandleHealthExhausted()
|
|
71
71
|
{
|
|
72
|
-
if (!IsInGameScene ||
|
|
72
|
+
if (!IsInGameScene || HasGameEnded || !_hasGameStarted) return;
|
|
73
73
|
|
|
74
74
|
EndGame();
|
|
75
75
|
}
|
|
@@ -98,7 +98,10 @@ namespace Hyper.Internal.Managers
|
|
|
98
98
|
public bool IsReplayMode => Config.GameMode == GameMode.Replay;
|
|
99
99
|
public bool IsPaused => _isPaused;
|
|
100
100
|
public bool HasGameStarted => _hasGameStarted;
|
|
101
|
-
|
|
101
|
+
// Gameplay stops at the timer boundary; presentation/finalization may follow later.
|
|
102
|
+
public bool HasGameEnded => _hasGameEnded || _gameplayCutoffReached;
|
|
103
|
+
|
|
104
|
+
internal void ReachGameplayCutoff() => _gameplayCutoffReached = true;
|
|
102
105
|
|
|
103
106
|
internal int BattleTimeRemaining =>
|
|
104
107
|
IsBattleMode && HyperRuntime.Timer != null
|
|
@@ -177,7 +180,7 @@ namespace Hyper.Internal.Managers
|
|
|
177
180
|
internal void PauseGame()
|
|
178
181
|
{
|
|
179
182
|
if (IsReplayMode) return;
|
|
180
|
-
if (!_hasGameStarted || _isPaused ||
|
|
183
|
+
if (!_hasGameStarted || _isPaused || HasGameEnded) return;
|
|
181
184
|
|
|
182
185
|
_isPaused = true;
|
|
183
186
|
_isFrozenBeforePause = Time.timeScale == 0;
|
|
@@ -193,7 +196,7 @@ namespace Hyper.Internal.Managers
|
|
|
193
196
|
|
|
194
197
|
internal void PauseReplay()
|
|
195
198
|
{
|
|
196
|
-
if (!IsReplayMode || !_hasGameStarted || _isPaused ||
|
|
199
|
+
if (!IsReplayMode || !_hasGameStarted || _isPaused || HasGameEnded)
|
|
197
200
|
{
|
|
198
201
|
return;
|
|
199
202
|
}
|
|
@@ -214,7 +217,7 @@ namespace Hyper.Internal.Managers
|
|
|
214
217
|
|
|
215
218
|
internal void ResumeReplay()
|
|
216
219
|
{
|
|
217
|
-
if (!IsReplayMode || !_isPaused ||
|
|
220
|
+
if (!IsReplayMode || !_isPaused || HasGameEnded) return;
|
|
218
221
|
|
|
219
222
|
_isPaused = false;
|
|
220
223
|
HidePauseModals();
|
|
@@ -256,7 +259,7 @@ namespace Hyper.Internal.Managers
|
|
|
256
259
|
|
|
257
260
|
private void HandleReplayFocus(bool hasFocus)
|
|
258
261
|
{
|
|
259
|
-
if (!_hasGameStarted ||
|
|
262
|
+
if (!_hasGameStarted || HasGameEnded) return;
|
|
260
263
|
if (!hasFocus) PauseReplay();
|
|
261
264
|
}
|
|
262
265
|
|
|
@@ -292,13 +295,13 @@ namespace Hyper.Internal.Managers
|
|
|
292
295
|
|
|
293
296
|
// Always restart capturing when game resumes, even if offline,
|
|
294
297
|
// so scores accumulate for the offline batch and are flushed on reconnect.
|
|
295
|
-
if (!IsReplayMode && !
|
|
298
|
+
if (!IsReplayMode && !HasGameEnded && _hasGameStarted)
|
|
296
299
|
{
|
|
297
300
|
_dataManager.StartCapturingScores();
|
|
298
301
|
}
|
|
299
302
|
|
|
300
303
|
// Only resume server session if connected
|
|
301
|
-
if (!IsReplayMode && _backendManager.isSocketConnected && !
|
|
304
|
+
if (!IsReplayMode && _backendManager.isSocketConnected && !HasGameEnded && _hasGameStarted)
|
|
302
305
|
{
|
|
303
306
|
_backendManager.SendGameResumed();
|
|
304
307
|
}
|
|
@@ -714,6 +717,7 @@ namespace Hyper.Internal.Managers
|
|
|
714
717
|
private bool _gameStartRequested;
|
|
715
718
|
private bool _isPaused;
|
|
716
719
|
private bool _hasGameEnded;
|
|
720
|
+
private bool _gameplayCutoffReached;
|
|
717
721
|
private bool _replayEndHandled;
|
|
718
722
|
private bool _isFrozenBeforePause;
|
|
719
723
|
private bool _isPortrait;
|
|
@@ -948,6 +952,7 @@ namespace Hyper.Internal.Managers
|
|
|
948
952
|
_hasGameStarted = false;
|
|
949
953
|
_gameStartRequested = false;
|
|
950
954
|
_hasGameEnded = false;
|
|
955
|
+
_gameplayCutoffReached = false;
|
|
951
956
|
_isPaused = false;
|
|
952
957
|
_isFrozenBeforePause = false;
|
|
953
958
|
HideTopBarElements();
|
|
@@ -973,6 +978,7 @@ namespace Hyper.Internal.Managers
|
|
|
973
978
|
_hasGameStarted = false;
|
|
974
979
|
_gameStartRequested = false;
|
|
975
980
|
_hasGameEnded = false;
|
|
981
|
+
_gameplayCutoffReached = false;
|
|
976
982
|
_replayEndHandled = false;
|
|
977
983
|
_isPaused = false;
|
|
978
984
|
_isFrozenBeforePause = false;
|
|
@@ -1012,7 +1018,7 @@ namespace Hyper.Internal.Managers
|
|
|
1012
1018
|
|
|
1013
1019
|
internal void StartGameplay()
|
|
1014
1020
|
{
|
|
1015
|
-
if (_gameStartRequested || _hasGameStarted ||
|
|
1021
|
+
if (_gameStartRequested || _hasGameStarted || HasGameEnded || !IsInGameScene) return;
|
|
1016
1022
|
_gameStartRequested = true;
|
|
1017
1023
|
|
|
1018
1024
|
HyperRuntime.ApplyPendingReplayRandomReset();
|
|
@@ -1045,6 +1051,7 @@ namespace Hyper.Internal.Managers
|
|
|
1045
1051
|
{
|
|
1046
1052
|
_hasGameStarted = true;
|
|
1047
1053
|
_hasGameEnded = false;
|
|
1054
|
+
_gameplayCutoffReached = false;
|
|
1048
1055
|
HyperRuntime.DataManager.UpdateScore(0);
|
|
1049
1056
|
}
|
|
1050
1057
|
|
|
@@ -1066,6 +1073,7 @@ namespace Hyper.Internal.Managers
|
|
|
1066
1073
|
_hasGameStarted = false;
|
|
1067
1074
|
_gameStartRequested = false;
|
|
1068
1075
|
_hasGameEnded = false;
|
|
1076
|
+
_gameplayCutoffReached = false;
|
|
1069
1077
|
_replayEndHandled = false;
|
|
1070
1078
|
_isPaused = false;
|
|
1071
1079
|
_isFrozenBeforePause = false;
|
|
@@ -1096,7 +1104,7 @@ namespace Hyper.Internal.Managers
|
|
|
1096
1104
|
|
|
1097
1105
|
internal void CompleteReplayCustomRestart()
|
|
1098
1106
|
{
|
|
1099
|
-
if (!IsReplayMode || _gameStartRequested || _hasGameStarted ||
|
|
1107
|
+
if (!IsReplayMode || _gameStartRequested || _hasGameStarted || HasGameEnded) return;
|
|
1100
1108
|
|
|
1101
1109
|
if (ReplaySessionState.IsSeeking)
|
|
1102
1110
|
{
|
|
@@ -1143,7 +1151,7 @@ namespace Hyper.Internal.Managers
|
|
|
1143
1151
|
{
|
|
1144
1152
|
if (ReplaySessionState.IsSeekRestartPending) return;
|
|
1145
1153
|
|
|
1146
|
-
// Time Up marks _hasGameEnded before its
|
|
1154
|
+
// Time Up marks _hasGameEnded before its one-second presentation finishes.
|
|
1147
1155
|
// Track replay finalization separately so that delayed end still runs once.
|
|
1148
1156
|
if (_replayEndHandled) return;
|
|
1149
1157
|
|
|
@@ -103,7 +103,9 @@ namespace Hyper.Internal.Managers
|
|
|
103
103
|
ReplaySessionState.MarkEnded();
|
|
104
104
|
|
|
105
105
|
GameManager gameManager = HyperRuntime.GameManager;
|
|
106
|
-
|
|
106
|
+
// Time Up can freeze gameplay before the recorded GE arrives.
|
|
107
|
+
// EndReplayGame has its own once-only finalization guard.
|
|
108
|
+
if (gameManager == null) return;
|
|
107
109
|
|
|
108
110
|
_endingGame = true;
|
|
109
111
|
gameManager.EndGame();
|
|
@@ -339,6 +339,14 @@ namespace Hyper.Internal.Managers
|
|
|
339
339
|
|
|
340
340
|
private void QueueTimeUp()
|
|
341
341
|
{
|
|
342
|
+
if (_timeUpPending || _timeUpTriggered || _hasGameEnded) return;
|
|
343
|
+
|
|
344
|
+
_battleTimer = 0f;
|
|
345
|
+
_isBattleRunning = false;
|
|
346
|
+
ClearPausedGameplayTimerState();
|
|
347
|
+
// The SDK runs before gameplay FixedUpdate. The expiry step is blocked,
|
|
348
|
+
// even when several fixed steps run before the next rendered frame.
|
|
349
|
+
_gameManager.ReachGameplayCutoff();
|
|
342
350
|
_timeUpPending = true;
|
|
343
351
|
}
|
|
344
352
|
|
|
@@ -387,12 +395,7 @@ namespace Hyper.Internal.Managers
|
|
|
387
395
|
|
|
388
396
|
if (_hasGameStarted && _gameManager.IsBattleMode)
|
|
389
397
|
{
|
|
390
|
-
|
|
391
|
-
if (!_timeUpTriggered)
|
|
392
|
-
{
|
|
393
|
-
_timeUpTriggered = true;
|
|
394
|
-
_eventManager?.InvokeTimeUpEvent();
|
|
395
|
-
}
|
|
398
|
+
QueueTimeUp();
|
|
396
399
|
}
|
|
397
400
|
else
|
|
398
401
|
{
|
|
@@ -14,7 +14,7 @@ namespace Hyper.Internal
|
|
|
14
14
|
[SerializeField] private BlinkingText blinkingText;
|
|
15
15
|
[SerializeField] private RectTransform swipeGif;
|
|
16
16
|
[SerializeField] private RectTransform handSpriteInGif;
|
|
17
|
-
[SerializeField] private float replayAutoStartDelay =
|
|
17
|
+
[SerializeField] private float replayAutoStartDelay = 1.02f;
|
|
18
18
|
private GameManager _gameManager;
|
|
19
19
|
private StartCTA _currentCTA;
|
|
20
20
|
private SwipeDirection _swipeDirection;
|
|
@@ -16,13 +16,13 @@ namespace Hyper.Internal
|
|
|
16
16
|
|
|
17
17
|
private void OnEnable()
|
|
18
18
|
{
|
|
19
|
-
//
|
|
19
|
+
// Show Game Over after one real-time second.
|
|
20
20
|
StartCoroutine(GameOver());
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
IEnumerator GameOver()
|
|
24
24
|
{
|
|
25
|
-
yield return new WaitForSecondsRealtime(
|
|
25
|
+
yield return new WaitForSecondsRealtime(1f);
|
|
26
26
|
gameObject.SetActive(false);
|
|
27
27
|
|
|
28
28
|
_gameManager.EndGame("Hyper_Time_Up");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app.hypergames.hypersdk",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.1",
|
|
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",
|