app.hypergames.hypersdk 1.5.8 → 1.5.10

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
@@ -1,3 +1,17 @@
1
+ ## [1.5.10](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.9...v1.5.10) (2026-03-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * send SDK lifecycle events (game start/resume/pause) to FE ([1562942](https://github.com/mvmhyper/hyper-sdk/commit/1562942344a40938af71e4ff928425918204fc32))
7
+
8
+ ## [1.5.9](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.8...v1.5.9) (2026-03-18)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * resume timers for current game mode only ([a4bef5a](https://github.com/mvmhyper/hyper-sdk/commit/a4bef5acc0c7c8b49998e2486ea4345b53caeefe))
14
+
1
15
  ## [1.5.8](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.7...v1.5.8) (2026-03-18)
2
16
 
3
17
 
@@ -1244,6 +1244,9 @@ namespace Hyper.Internal.Managers
1244
1244
 
1245
1245
  string eventName = eventType switch
1246
1246
  {
1247
+ ConsoleEventType.GameStart => "GameStart",
1248
+ ConsoleEventType.GameResumed => "GameResumed",
1249
+ ConsoleEventType.GamePaused => "GamePaused",
1247
1250
  ConsoleEventType.GameEnd => "GameEnd",
1248
1251
  ConsoleEventType.PracticeGameEnd => "PracticeGameEnd",
1249
1252
  ConsoleEventType.sdk_ConnectionFailed => "sdk_ConnectionFailed",
@@ -52,14 +52,29 @@ namespace Hyper.Internal.Managers
52
52
  #endregion
53
53
 
54
54
  #region Event Invocation Methods
55
- internal void InvokeGamePausedEvent() => OnGamePaused?.Invoke();
56
- internal void InvokeGameResumedEvent() => OnGameResumed?.Invoke();
55
+ internal void InvokeGamePausedEvent()
56
+ {
57
+ OnGamePaused?.Invoke();
58
+ HyperRuntime.BackendManager.LogEvent(ConsoleEventType.GamePaused);
59
+ }
60
+
61
+ internal void InvokeGameResumedEvent()
62
+ {
63
+ OnGameResumed?.Invoke();
64
+ HyperRuntime.BackendManager.LogEvent(ConsoleEventType.GameResumed);
65
+ }
66
+
67
+ internal void InvokeGameStartEvent()
68
+ {
69
+ OnGameStart?.Invoke();
70
+ HyperRuntime.BackendManager.LogEvent(ConsoleEventType.GameStart);
71
+ }
72
+
57
73
  internal void InvokeSoundChangedEvent(bool sound) => OnSoundChanged?.Invoke(sound);
58
74
  internal void InvokeTimeUpEvent() => OnTimeUp?.Invoke();
59
75
  internal void InvokeSessionTimeOutEvent() => OnSessionTimeOut?.Invoke();
60
76
  internal void InvokeSessionAboutToExpireEvent() => OnSessionAboutToExpire?.Invoke();
61
77
  internal void InvokeStartDeadlineReachedEvent() => OnStartDeadlineReached?.Invoke();
62
- internal void InvokeGameStartEvent() => OnGameStart?.Invoke();
63
78
  internal void InvokeGameEndedEvent() => OnGameEnded?.Invoke();
64
79
  internal void InvokeLivesExhaustedEvent() => OnLivesExhausted?.Invoke();
65
80
  internal void InvokeHealthExhaustedEvent() => OnHealthExhausted?.Invoke();
@@ -91,8 +91,14 @@ namespace Hyper.Internal.Managers
91
91
 
92
92
  public void ResumeGameTimersAfterPause()
93
93
  {
94
- StartBattle();
95
- StartPractice();
94
+ if (_gameManager.Config.GameMode == GameMode.Battle)
95
+ {
96
+ StartBattle();
97
+ }
98
+ else
99
+ {
100
+ StartPractice();
101
+ }
96
102
  }
97
103
 
98
104
  public void StartActiveGameTimer()
@@ -102,17 +102,12 @@ mergeInto(LibraryManager.library, {
102
102
 
103
103
  console.log(eventDataStr);
104
104
 
105
- // Dispatch custom event locally
106
105
  const event = new CustomEvent(eventNameStr);
107
106
  document.dispatchEvent(event);
108
107
 
109
- // Send stringified data to parent window
110
108
  try {
111
109
  if (window.parent && window.parent !== window) {
112
110
  window.parent.postMessage(eventDataStr, "*");
113
- // console.log("Stringified message sent to parent");
114
- } else {
115
- // console.log("No parent window found or same window");
116
111
  }
117
112
  } catch (error) {
118
113
  console.error("Failed to send message to parent:", error);
@@ -48,7 +48,22 @@ namespace Hyper.Shared
48
48
  /// <summary>
49
49
  /// Fired when the game ends due to no internet connection.
50
50
  /// </summary>
51
- sdk_GameEndNoInternet
51
+ sdk_GameEndNoInternet,
52
+
53
+ /// <summary>
54
+ /// Fired when the game starts.
55
+ /// </summary>
56
+ GameStart,
57
+
58
+ /// <summary>
59
+ /// Fired when the game is resumed.
60
+ /// </summary>
61
+ GameResumed,
62
+
63
+ /// <summary>
64
+ /// Fired when the game is paused.
65
+ /// </summary>
66
+ GamePaused
52
67
  }
53
68
 
54
69
  /// <summary>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app.hypergames.hypersdk",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
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",