app.hypergames.hypersdk 1.8.10 → 1.8.12
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/HyperLoader.unity +3 -3
- package/Runtime/Internal/Managers/BackendManager.cs +35 -18
- package/Runtime/Internal/Managers/DataManager.cs +1 -1
- package/Runtime/Internal/Managers/GameManager.cs +9 -2
- package/Runtime/Internal/Managers/TimeManager.cs +32 -1
- package/Runtime/Internal/Utils/HyperConstants.cs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.8.12](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.11...v1.8.12) (2026-05-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* reduce default session timeout to 29 minutes for v1.8.12 ([5567770](https://github.com/mvmhyper/hyper-sdk/commit/5567770fbbecb7444cd3bfac446f3ea1b0454601))
|
|
7
|
+
|
|
8
|
+
## [1.8.11](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.10...v1.8.11) (2026-04-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* normalize score ordering and prevent duplicate final score delta ([ad47380](https://github.com/mvmhyper/hyper-sdk/commit/ad47380e7af6d3c6323a53732bc56d2c0fd545fa))
|
|
14
|
+
|
|
1
15
|
## [1.8.10](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.9...v1.8.10) (2026-04-22)
|
|
2
16
|
|
|
3
17
|
|
package/HyperLoader.unity
CHANGED
|
@@ -304,7 +304,7 @@ RectTransform:
|
|
|
304
304
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
305
305
|
m_AnchorMin: {x: 0, y: 1}
|
|
306
306
|
m_AnchorMax: {x: 0, y: 1}
|
|
307
|
-
m_AnchoredPosition: {x: 489.
|
|
307
|
+
m_AnchoredPosition: {x: 489.20746, y: -280.1698}
|
|
308
308
|
m_SizeDelta: {x: 1044.9, y: 239.347}
|
|
309
309
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
310
310
|
--- !u!114 &751153944
|
|
@@ -840,7 +840,7 @@ GameObject:
|
|
|
840
840
|
m_Component:
|
|
841
841
|
- component: {fileID: 1064166296}
|
|
842
842
|
m_Layer: 0
|
|
843
|
-
m_Name:
|
|
843
|
+
m_Name: __HyperSDK_BuildMarker_639142756136327602
|
|
844
844
|
m_TagString: Untagged
|
|
845
845
|
m_Icon: {fileID: 0}
|
|
846
846
|
m_NavMeshLayer: 0
|
|
@@ -1092,7 +1092,7 @@ RectTransform:
|
|
|
1092
1092
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
1093
1093
|
m_AnchorMin: {x: 0, y: 1}
|
|
1094
1094
|
m_AnchorMax: {x: 0, y: 1}
|
|
1095
|
-
m_AnchoredPosition: {x: 489.
|
|
1095
|
+
m_AnchoredPosition: {x: 489.20746, y: -133.2274}
|
|
1096
1096
|
m_SizeDelta: {x: 875, y: 54.5378}
|
|
1097
1097
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
1098
1098
|
--- !u!1 &2874543288936963705
|
|
@@ -928,24 +928,6 @@ namespace Hyper.Internal.Managers
|
|
|
928
928
|
yield break;
|
|
929
929
|
}
|
|
930
930
|
|
|
931
|
-
var finalScoreData = _dataManager?.CurrentScoreData;
|
|
932
|
-
finalScoreData.isFinal = true;
|
|
933
|
-
|
|
934
|
-
// For consistency with per-second and backlog submissions, always send
|
|
935
|
-
// the final score as an array of ScoreData.
|
|
936
|
-
var finalScoreList = new List<ScoreData>(1) { finalScoreData };
|
|
937
|
-
string rawScoreJson = JsonConvert.SerializeObject(finalScoreList);
|
|
938
|
-
var compressedScoreData = JsonCompressor.CompressJson(rawScoreJson);
|
|
939
|
-
string scoreJson = compressedScoreData.MinifiedJson;
|
|
940
|
-
string encryptedScoreData = EncryptScore(scoreJson);
|
|
941
|
-
|
|
942
|
-
if (string.IsNullOrEmpty(encryptedScoreData))
|
|
943
|
-
{
|
|
944
|
-
LastSubmissionError = SubmissionErrorType.EncryptionError;
|
|
945
|
-
HyperDebug.LogError("Encryption failed [ENCRYPTION_ERROR]");
|
|
946
|
-
yield break;
|
|
947
|
-
}
|
|
948
|
-
|
|
949
931
|
// Reset gameResumed flag for this attempt
|
|
950
932
|
_gameResumed = false;
|
|
951
933
|
|
|
@@ -1042,6 +1024,39 @@ namespace Hyper.Internal.Managers
|
|
|
1042
1024
|
_finalScoreSubmitted = false;
|
|
1043
1025
|
_isWaitingForFinalScoreResponse = true;
|
|
1044
1026
|
|
|
1027
|
+
float currentScoreDataScoreTime = _dataManager.CurrentScoreData.cumulativeScore + _dataManager.CurrentScoreData.scoreSnapshot.scoreTime;
|
|
1028
|
+
float lastCapturedScoreDataScoreTime = _lastSentBatch.Last().cumulativeScore + _lastSentBatch.Last().scoreSnapshot.scoreTime;
|
|
1029
|
+
ScoreData finalScoreData;
|
|
1030
|
+
|
|
1031
|
+
if (currentScoreDataScoreTime > lastCapturedScoreDataScoreTime)
|
|
1032
|
+
{
|
|
1033
|
+
finalScoreData = _dataManager.CurrentScoreData;
|
|
1034
|
+
finalScoreData.isFinal = true;
|
|
1035
|
+
}
|
|
1036
|
+
else
|
|
1037
|
+
{
|
|
1038
|
+
finalScoreData = _lastSentBatch.Last();
|
|
1039
|
+
finalScoreData.isFinal = true;
|
|
1040
|
+
finalScoreData.timestampUtc = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();
|
|
1041
|
+
finalScoreData.scoreSnapshot.scoreDelta = 0;
|
|
1042
|
+
finalScoreData.scoreSnapshot.gameplayModifiers = new GameplayModifiers();
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
// For consistency with per-second and backlog submissions, always send
|
|
1046
|
+
// the final score as an array of ScoreData.
|
|
1047
|
+
var finalScoreList = new List<ScoreData>(1) { finalScoreData };
|
|
1048
|
+
string rawScoreJson = JsonConvert.SerializeObject(finalScoreList);
|
|
1049
|
+
var compressedScoreData = JsonCompressor.CompressJson(rawScoreJson);
|
|
1050
|
+
string scoreJson = compressedScoreData.MinifiedJson;
|
|
1051
|
+
string encryptedScoreData = EncryptScore(scoreJson);
|
|
1052
|
+
|
|
1053
|
+
if (string.IsNullOrEmpty(encryptedScoreData))
|
|
1054
|
+
{
|
|
1055
|
+
LastSubmissionError = SubmissionErrorType.EncryptionError;
|
|
1056
|
+
HyperDebug.LogError("Encryption failed [ENCRYPTION_ERROR]");
|
|
1057
|
+
yield break;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1045
1060
|
_lastSentBatch.Clear();
|
|
1046
1061
|
if (finalScoreData != null)
|
|
1047
1062
|
{
|
|
@@ -1199,8 +1214,10 @@ namespace Hyper.Internal.Managers
|
|
|
1199
1214
|
// Scores will be flushed when the connection is restored.
|
|
1200
1215
|
if (!isSocketConnected)
|
|
1201
1216
|
{
|
|
1217
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
1202
1218
|
int pendingCount = _dataManager?.PendingScores?.Count ?? 0;
|
|
1203
1219
|
HyperDebug.Log($"[Score] Socket disconnected - accumulating scores for offline batch. PendingCount={pendingCount}");
|
|
1220
|
+
#endif
|
|
1204
1221
|
_isWaitingForTokenLogEmitted = false;
|
|
1205
1222
|
_hasLoggedWaitingForGameStartAck = false;
|
|
1206
1223
|
yield return _scoreSendInterval;
|
|
@@ -66,7 +66,7 @@ namespace Hyper.Internal.Managers
|
|
|
66
66
|
|
|
67
67
|
CurrentScoreData.cumulativeScore = CurrentScore;
|
|
68
68
|
CurrentScoreData.timestampUtc = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();
|
|
69
|
-
CurrentScoreData.isFinal =
|
|
69
|
+
CurrentScoreData.isFinal = false;
|
|
70
70
|
|
|
71
71
|
var snapshot = CurrentScoreData.scoreSnapshot;
|
|
72
72
|
snapshot.scoreTime = currentGameSecond;
|
|
@@ -1304,7 +1304,7 @@ namespace Hyper.Internal.Managers
|
|
|
1304
1304
|
|
|
1305
1305
|
if (IsBattleMode)
|
|
1306
1306
|
{
|
|
1307
|
-
HyperRuntime.Timer.
|
|
1307
|
+
HyperRuntime.Timer.PauseGameplayTimers();
|
|
1308
1308
|
|
|
1309
1309
|
if (isPortrait)
|
|
1310
1310
|
{
|
|
@@ -1319,7 +1319,7 @@ namespace Hyper.Internal.Managers
|
|
|
1319
1319
|
}
|
|
1320
1320
|
else
|
|
1321
1321
|
{
|
|
1322
|
-
HyperRuntime.Timer.
|
|
1322
|
+
HyperRuntime.Timer.PauseGameplayTimers();
|
|
1323
1323
|
|
|
1324
1324
|
if (isPortrait)
|
|
1325
1325
|
{
|
|
@@ -1408,9 +1408,16 @@ namespace Hyper.Internal.Managers
|
|
|
1408
1408
|
private IEnumerator ShowTimeUpSequence()
|
|
1409
1409
|
{
|
|
1410
1410
|
yield return new WaitForSecondsRealtime(0.25f);
|
|
1411
|
+
_isPaused = false;
|
|
1411
1412
|
HidePauseModals();
|
|
1412
1413
|
yield return new WaitForSecondsRealtime(0.25f);
|
|
1413
1414
|
ShowTimeUpModalInternal();
|
|
1415
|
+
if (!_isFrozenBeforePause)
|
|
1416
|
+
{
|
|
1417
|
+
Time.timeScale = _savedTimeScaleBeforePause;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
_isFrozenBeforePause = false;
|
|
1414
1421
|
}
|
|
1415
1422
|
|
|
1416
1423
|
private void EnsureTimeUpModal()
|
|
@@ -130,6 +130,16 @@ namespace Hyper.Internal.Managers
|
|
|
130
130
|
StopPractice();
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
/// <summary>
|
|
134
|
+
/// Pause menu: freeze match/practice clocks without marking the match ended,
|
|
135
|
+
/// so session time can continue and cap the effective battle clock while paused.
|
|
136
|
+
/// </summary>
|
|
137
|
+
public void PauseGameplayTimers()
|
|
138
|
+
{
|
|
139
|
+
StopBattle();
|
|
140
|
+
StopPractice();
|
|
141
|
+
}
|
|
142
|
+
|
|
133
143
|
public void StartPreSessionTimer()
|
|
134
144
|
{
|
|
135
145
|
StartSessionTimer(true);
|
|
@@ -204,6 +214,14 @@ namespace Hyper.Internal.Managers
|
|
|
204
214
|
{
|
|
205
215
|
if (_isBattleRunning)
|
|
206
216
|
{
|
|
217
|
+
if (_gameManager.Config.GameMode == GameMode.Battle &&
|
|
218
|
+
_hasGameStarted &&
|
|
219
|
+
_isPreSessionRunning &&
|
|
220
|
+
_sessionTimer <= _battleTimer)
|
|
221
|
+
{
|
|
222
|
+
_battleTimer = _sessionTimer;
|
|
223
|
+
}
|
|
224
|
+
|
|
207
225
|
_battleTimer -= delta;
|
|
208
226
|
if (_battleTimer <= 0)
|
|
209
227
|
{
|
|
@@ -259,7 +277,20 @@ namespace Hyper.Internal.Managers
|
|
|
259
277
|
_sessionTimer = 0;
|
|
260
278
|
_isSessionRunning = false;
|
|
261
279
|
_isPreSessionRunning = false;
|
|
262
|
-
|
|
280
|
+
|
|
281
|
+
if (_hasGameStarted && _gameManager.Config.GameMode == GameMode.Battle)
|
|
282
|
+
{
|
|
283
|
+
_battleTimer = 0;
|
|
284
|
+
if (!_timeUpTriggered)
|
|
285
|
+
{
|
|
286
|
+
_timeUpTriggered = true;
|
|
287
|
+
_eventManager?.InvokeTimeUpEvent();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else
|
|
291
|
+
{
|
|
292
|
+
_eventManager?.InvokeSessionTimeOutEvent();
|
|
293
|
+
}
|
|
263
294
|
}
|
|
264
295
|
}
|
|
265
296
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app.hypergames.hypersdk",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.12",
|
|
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",
|