app.hypergames.hypersdk 1.5.9 → 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,10 @@
|
|
|
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
|
+
|
|
1
8
|
## [1.5.9](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.8...v1.5.9) (2026-03-18)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -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()
|
|
56
|
-
|
|
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();
|
|
@@ -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.
|
|
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",
|