@xmobitea/gn-typescript-client 2.6.1 → 2.6.2
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/GNServerSettingsConfig.debug.json +1 -0
- package/dist/gn.js.client.js +45 -11
- package/dist/gn.js.client.min.js +1 -1
- package/dist/index.js +45 -11
- package/dist/runtime/config/GNServerSettings.d.ts +8 -0
- package/dist/runtime/constant/parameterCode/GNParameterCode.d.ts +3 -0
- package/dist/runtime/entity/models/DashboardModels.d.ts +5 -1
- package/package.json +1 -1
package/dist/gn.js.client.js
CHANGED
|
@@ -3243,6 +3243,11 @@ class GNDebug {
|
|
|
3243
3243
|
|
|
3244
3244
|
;// ./src/runtime/config/GNServerSettings.ts
|
|
3245
3245
|
|
|
3246
|
+
var MessageType;
|
|
3247
|
+
(function (MessageType) {
|
|
3248
|
+
MessageType[MessageType["Json"] = 1] = "Json";
|
|
3249
|
+
MessageType[MessageType["MsgPack"] = 2] = "MsgPack";
|
|
3250
|
+
})(MessageType || (MessageType = {}));
|
|
3246
3251
|
class GNServerSettings {
|
|
3247
3252
|
constructor() {
|
|
3248
3253
|
this.serverAddress = "127.0.0.1";
|
|
@@ -3251,6 +3256,7 @@ class GNServerSettings {
|
|
|
3251
3256
|
this.useSsl = false;
|
|
3252
3257
|
this.useSocket = true;
|
|
3253
3258
|
this.useHttp = true;
|
|
3259
|
+
this.messageType = MessageType.MsgPack;
|
|
3254
3260
|
this.sendRate = 20;
|
|
3255
3261
|
this.reconnectDelay = 5000;
|
|
3256
3262
|
this.pingInterval = 20000;
|
|
@@ -3264,6 +3270,7 @@ class GNServerSettings {
|
|
|
3264
3270
|
this.useSsl = options.useSsl;
|
|
3265
3271
|
this.useSocket = options.useSocket;
|
|
3266
3272
|
this.useHttp = options.useHttp;
|
|
3273
|
+
this.messageType = options.messageType;
|
|
3267
3274
|
this.sendRate = options.sendRate;
|
|
3268
3275
|
this.reconnectDelay = options.reconnectDelay;
|
|
3269
3276
|
this.pingInterval = options.pingInterval;
|
|
@@ -3309,6 +3316,12 @@ class GNServerSettings {
|
|
|
3309
3316
|
setUseHttp(useHttp) {
|
|
3310
3317
|
this.useHttp = useHttp;
|
|
3311
3318
|
}
|
|
3319
|
+
getMessageType() {
|
|
3320
|
+
return this.messageType;
|
|
3321
|
+
}
|
|
3322
|
+
setMessageType(messageType) {
|
|
3323
|
+
this.messageType = messageType;
|
|
3324
|
+
}
|
|
3312
3325
|
getSendRate() {
|
|
3313
3326
|
return this.sendRate;
|
|
3314
3327
|
}
|
|
@@ -4140,6 +4153,9 @@ GNParameterCode.GetPushNotification = "getPushNotification";
|
|
|
4140
4153
|
GNParameterCode.EmailSettings = "emailSettings";
|
|
4141
4154
|
GNParameterCode.PushNotificationSettings = "pushNotificationSettings";
|
|
4142
4155
|
GNParameterCode.SendFrom = "sendFrom";
|
|
4156
|
+
GNParameterCode.Host = "host";
|
|
4157
|
+
GNParameterCode.Port = "port";
|
|
4158
|
+
GNParameterCode.Secure = "secure";
|
|
4143
4159
|
GNParameterCode.SendGridApiKey = "sendGridApiKey";
|
|
4144
4160
|
GNParameterCode.Subject = "subject";
|
|
4145
4161
|
GNParameterCode.ContentHtml = "contentHtml";
|
|
@@ -12938,9 +12954,25 @@ var DashboardModels;
|
|
|
12938
12954
|
DashboardModels_metadata("design:type", String)
|
|
12939
12955
|
], EmailSettingsParam.prototype, "sendFrom", void 0);
|
|
12940
12956
|
DashboardModels_decorate([
|
|
12941
|
-
|
|
12957
|
+
BooleanDataMember({ code: GNParameterCode.Secure }),
|
|
12958
|
+
DashboardModels_metadata("design:type", Boolean)
|
|
12959
|
+
], EmailSettingsParam.prototype, "secure", void 0);
|
|
12960
|
+
DashboardModels_decorate([
|
|
12961
|
+
StringDataMember({ code: GNParameterCode.Host }),
|
|
12962
|
+
DashboardModels_metadata("design:type", String)
|
|
12963
|
+
], EmailSettingsParam.prototype, "host", void 0);
|
|
12964
|
+
DashboardModels_decorate([
|
|
12965
|
+
NumberDataMember({ code: GNParameterCode.Port }),
|
|
12966
|
+
DashboardModels_metadata("design:type", Number)
|
|
12967
|
+
], EmailSettingsParam.prototype, "port", void 0);
|
|
12968
|
+
DashboardModels_decorate([
|
|
12969
|
+
StringDataMember({ code: GNParameterCode.Username }),
|
|
12970
|
+
DashboardModels_metadata("design:type", String)
|
|
12971
|
+
], EmailSettingsParam.prototype, "username", void 0);
|
|
12972
|
+
DashboardModels_decorate([
|
|
12973
|
+
StringDataMember({ code: GNParameterCode.Password }),
|
|
12942
12974
|
DashboardModels_metadata("design:type", String)
|
|
12943
|
-
], EmailSettingsParam.prototype, "
|
|
12975
|
+
], EmailSettingsParam.prototype, "password", void 0);
|
|
12944
12976
|
DashboardModels.EmailSettingsParam = EmailSettingsParam;
|
|
12945
12977
|
class PushNotificationSettingsParam {
|
|
12946
12978
|
}
|
|
@@ -35469,6 +35501,7 @@ Object.assign(esm_lookup, {
|
|
|
35469
35501
|
|
|
35470
35502
|
|
|
35471
35503
|
|
|
35504
|
+
|
|
35472
35505
|
class NetworkingPeerSocketIOClient extends NetworkingSocketPeerBase {
|
|
35473
35506
|
sendRequestAuthSocket() {
|
|
35474
35507
|
super.sendRequestAuthSocket();
|
|
@@ -35494,7 +35527,7 @@ class NetworkingPeerSocketIOClient extends NetworkingSocketPeerBase {
|
|
|
35494
35527
|
socket.on("disconnect", () => {
|
|
35495
35528
|
this.onDisconnect();
|
|
35496
35529
|
});
|
|
35497
|
-
socket.
|
|
35530
|
+
socket.on("error", (error) => {
|
|
35498
35531
|
this.onError(error);
|
|
35499
35532
|
});
|
|
35500
35533
|
socket.on(Commands.ResponseCmd_MsgPack, (args) => {
|
|
@@ -35554,10 +35587,11 @@ class NetworkingPeerSocketIOClient extends NetworkingSocketPeerBase {
|
|
|
35554
35587
|
if (customTags != null)
|
|
35555
35588
|
operationRequest.setParameter(GNParameterCode.CustomTags, customTags);
|
|
35556
35589
|
let dataSend = OperationHelper.toSocketData(requestType, requestRole, operationRequest);
|
|
35557
|
-
|
|
35558
|
-
|
|
35559
|
-
else
|
|
35590
|
+
let gnServerSettings = GNNetwork.getGNServerSettings();
|
|
35591
|
+
if (gnServerSettings.getMessageType() == MessageType.Json)
|
|
35560
35592
|
socket.emit(Commands.RequestCmd_Json, dataSend);
|
|
35593
|
+
else
|
|
35594
|
+
socket.emit(Commands.RequestCmd_MsgPack, MessagePackConverterService.serialize(dataSend));
|
|
35561
35595
|
}
|
|
35562
35596
|
close(_onSocketDisconnect) {
|
|
35563
35597
|
super.close(_onSocketDisconnect);
|
|
@@ -46413,6 +46447,7 @@ class NetworkingPeerAxiosRequest extends NetworkingHttpPeerBase {
|
|
|
46413
46447
|
|
|
46414
46448
|
|
|
46415
46449
|
|
|
46450
|
+
|
|
46416
46451
|
class HttpAppResponse {
|
|
46417
46452
|
hasError() {
|
|
46418
46453
|
return this.error != null;
|
|
@@ -46449,13 +46484,12 @@ class HttpPeer extends PeerBase {
|
|
|
46449
46484
|
let secretKey = operationPending.getSecretKey();
|
|
46450
46485
|
let gameId = operationPending.getGameId();
|
|
46451
46486
|
let customTags = operationPending.getCustomTags();
|
|
46487
|
+
let gnServerSettings = GNNetwork.getGNServerSettings();
|
|
46488
|
+
let postType = gnServerSettings.getMessageType() == MessageType.Json ? PostType.Json : PostType.MsgPack;
|
|
46452
46489
|
if (GNSupport.isBrowser()) {
|
|
46453
|
-
|
|
46454
|
-
|
|
46455
|
-
operationRequest.setEncrypted(false);
|
|
46456
|
-
}
|
|
46490
|
+
GNDebug.logWarning("GN JS client sdk does not support send encrypted request via HTTP, so we will send this request via HTTP non encrypted");
|
|
46491
|
+
postType = PostType.MsgPack;
|
|
46457
46492
|
}
|
|
46458
|
-
let postType = !operationRequest.isEncrypted() ? PostType.Json : PostType.MsgPack;
|
|
46459
46493
|
let subUri = (postType == PostType.Json ? NetworkingPeer.API_JSON : NetworkingPeer.API_MSG_PACK) + "/" + operationRequest.getOperationCode() + "/" + operationPending.getRequestType() + "/" + operationPending.getRequestRole();
|
|
46460
46494
|
let thiz = this;
|
|
46461
46495
|
this.networkingHttpPeerBase.postRequest(subUri, operationRequest.getParameters(), postType, (httpAppResponse) => {
|