glitch-javascript-sdk 2.9.3 → 2.9.4
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/dist/cjs/index.js +25 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Titles.d.ts +15 -1
- package/dist/esm/index.js +25 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/package.json +1 -1
- package/src/api/Titles.ts +26 -1
- package/src/routes/TitlesRoute.ts +10 -1
package/dist/index.d.ts
CHANGED
|
@@ -4401,7 +4401,21 @@ declare class Titles {
|
|
|
4401
4401
|
* @param title_id The UUID of the game title.
|
|
4402
4402
|
* @returns AxiosPromise containing { signallingServer: string }
|
|
4403
4403
|
*/
|
|
4404
|
-
static getMatchmakerServer<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
4404
|
+
static getMatchmakerServer<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4405
|
+
/**
|
|
4406
|
+
* Send a session heartbeat to keep the dedicated instance claimed.
|
|
4407
|
+
* Called every 30s during active gameplay.
|
|
4408
|
+
*/
|
|
4409
|
+
static matchmakerSessionHeartbeat<T>(title_id: string, data: {
|
|
4410
|
+
sessionId: string;
|
|
4411
|
+
}): AxiosPromise<Response<T>>;
|
|
4412
|
+
/**
|
|
4413
|
+
* Release the session (starts reclaim countdown).
|
|
4414
|
+
* Called on beforeunload or explicit navigation away.
|
|
4415
|
+
*/
|
|
4416
|
+
static matchmakerSessionRelease<T>(title_id: string, data: {
|
|
4417
|
+
sessionId: string;
|
|
4418
|
+
}): AxiosPromise<Response<T>>;
|
|
4405
4419
|
/**
|
|
4406
4420
|
* Initiates a resumable S3 multipart upload for large files.
|
|
4407
4421
|
*/
|
package/package.json
CHANGED
package/src/api/Titles.ts
CHANGED
|
@@ -1100,10 +1100,35 @@ class Titles {
|
|
|
1100
1100
|
* @param title_id The UUID of the game title.
|
|
1101
1101
|
* @returns AxiosPromise containing { signallingServer: string }
|
|
1102
1102
|
*/
|
|
1103
|
-
public static getMatchmakerServer<T>(title_id: string): AxiosPromise<Response<T>> {
|
|
1103
|
+
public static getMatchmakerServer<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
1104
1104
|
return Requests.processRoute(
|
|
1105
1105
|
TitlesRoute.routes.getMatchmakerServer,
|
|
1106
1106
|
{},
|
|
1107
|
+
{ title_id },
|
|
1108
|
+
params // ← passes as ?sessionId=xxx via Requests.get()
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Send a session heartbeat to keep the dedicated instance claimed.
|
|
1114
|
+
* Called every 30s during active gameplay.
|
|
1115
|
+
*/
|
|
1116
|
+
public static matchmakerSessionHeartbeat<T>(title_id: string, data: { sessionId: string }): AxiosPromise<Response<T>> {
|
|
1117
|
+
return Requests.processRoute(
|
|
1118
|
+
TitlesRoute.routes.matchmakerSessionHeartbeat,
|
|
1119
|
+
data,
|
|
1120
|
+
{ title_id }
|
|
1121
|
+
);
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Release the session (starts reclaim countdown).
|
|
1126
|
+
* Called on beforeunload or explicit navigation away.
|
|
1127
|
+
*/
|
|
1128
|
+
public static matchmakerSessionRelease<T>(title_id: string, data: { sessionId: string }): AxiosPromise<Response<T>> {
|
|
1129
|
+
return Requests.processRoute(
|
|
1130
|
+
TitlesRoute.routes.matchmakerSessionRelease,
|
|
1131
|
+
data,
|
|
1107
1132
|
{ title_id }
|
|
1108
1133
|
);
|
|
1109
1134
|
}
|
|
@@ -243,7 +243,16 @@ class TitlesRoute {
|
|
|
243
243
|
method: HTTP_METHODS.GET
|
|
244
244
|
},
|
|
245
245
|
|
|
246
|
-
|
|
246
|
+
matchmakerSessionHeartbeat: {
|
|
247
|
+
url: '/titles/{title_id}/matchmaker/session/heartbeat',
|
|
248
|
+
method: HTTP_METHODS.POST
|
|
249
|
+
},
|
|
250
|
+
matchmakerSessionRelease: {
|
|
251
|
+
url: '/titles/{title_id}/matchmaker/session/release',
|
|
252
|
+
method: HTTP_METHODS.POST
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
|
|
247
256
|
|
|
248
257
|
};
|
|
249
258
|
|