@xmobitea/gn-server 2.5.1 → 2.6.0
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/LICENSE +202 -0
- package/README.md +3 -0
- package/THIRD_PARTY_LICENSES +97 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/SetSecretInfoInformationRequestHandler.d.ts +1 -0
- package/dist/GN-common/constant/parameterCode/GNParameterCode.d.ts +3 -0
- package/dist/GN-common/entity/SecretInfo.d.ts +4 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/masterAdmin/SecretInfoItem.d.ts +4 -0
- package/dist/GN-library/xdatabase/lib/xDatabase.d.ts +15 -8
- package/dist/GN-startup/cloudScript/eventCallbackCloudScriptData.json +1 -1
- package/dist/GN-startup/middleware/AntiDdosMiddleware.d.ts +1 -0
- package/dist/GN-startup/routes/utils/wrap.d.ts +2 -0
- package/dist/GNServer.d.ts +0 -3
- package/dist/index.d.ts +0 -4
- package/dist/index.js +635 -369
- package/gn.sh +1 -1
- package/package.json +7 -20
- package/dist/GN-app-api/service/ILockService.d.ts +0 -4
- package/dist/GN-app-api/service/LockService.d.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -138,7 +138,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
138
138
|
ItemDataParam: () => (/* reexport */ ItemDataParam),
|
|
139
139
|
ItemStatisticsParam: () => (/* reexport */ ItemStatisticsParam),
|
|
140
140
|
ItemType: () => (/* reexport */ ItemType),
|
|
141
|
-
LockService: () => (/* reexport */ LockService),
|
|
142
141
|
LogSettings: () => (/* reexport */ LogSettings),
|
|
143
142
|
MasterAdminMongoObject: () => (/* reexport */ MasterAdminMongoObject),
|
|
144
143
|
MasterAdminPermissionRulesParam: () => (/* reexport */ MasterAdminPermissionRulesParam),
|
|
@@ -1774,7 +1773,7 @@ class AppleService {
|
|
|
1774
1773
|
signedTransactionInfoPayload = external_jsonwebtoken_default().decode(transactionInfoResponse.data.signedTransactionInfo);
|
|
1775
1774
|
}
|
|
1776
1775
|
catch (err) {
|
|
1777
|
-
Debug.log("[
|
|
1776
|
+
Debug.log("[GearN] error while validate apple receipt " + err.toString());
|
|
1778
1777
|
}
|
|
1779
1778
|
return {
|
|
1780
1779
|
success: true,
|
|
@@ -1826,7 +1825,7 @@ class AppleService {
|
|
|
1826
1825
|
// try {
|
|
1827
1826
|
// let result = await axios.post(AppleService.MAIN_verifyAppleAppStoreAPIUrl, { "receipt-data": payload }, {
|
|
1828
1827
|
// headers: {
|
|
1829
|
-
//
|
|
1828
|
+
// "Content-Type": "application/x-www-form-urlencoded"
|
|
1830
1829
|
// },
|
|
1831
1830
|
// });
|
|
1832
1831
|
// answer = result.data;
|
|
@@ -1840,7 +1839,7 @@ class AppleService {
|
|
|
1840
1839
|
// try {
|
|
1841
1840
|
// let result = await axios.post(AppleService.MAIN_verifySandboxAppleAppStoreAPIUrl, { "receipt-data": payload }, {
|
|
1842
1841
|
// headers: {
|
|
1843
|
-
//
|
|
1842
|
+
// "Content-Type": "application/x-www-form-urlencoded"
|
|
1844
1843
|
// },
|
|
1845
1844
|
// });
|
|
1846
1845
|
// answer = result.data;
|
|
@@ -1856,8 +1855,8 @@ class AppleService {
|
|
|
1856
1855
|
try {
|
|
1857
1856
|
let result = await external_axios_default().get(url, {
|
|
1858
1857
|
headers: {
|
|
1859
|
-
|
|
1860
|
-
|
|
1858
|
+
"Content-Type": "application/json",
|
|
1859
|
+
"Authorization": "Bearer " + token
|
|
1861
1860
|
},
|
|
1862
1861
|
});
|
|
1863
1862
|
return {
|
|
@@ -1879,18 +1878,18 @@ class AppleService {
|
|
|
1879
1878
|
iss: this.issuerId,
|
|
1880
1879
|
iat: now,
|
|
1881
1880
|
exp: now + 30 * 60,
|
|
1882
|
-
aud:
|
|
1881
|
+
aud: "appstoreconnect-v1",
|
|
1883
1882
|
bid: this.appleClientId,
|
|
1884
1883
|
};
|
|
1885
1884
|
// Create the header
|
|
1886
1885
|
let header = {
|
|
1887
|
-
alg:
|
|
1886
|
+
alg: "ES256",
|
|
1888
1887
|
kid: this.keyId,
|
|
1889
|
-
typ:
|
|
1888
|
+
typ: "JWT",
|
|
1890
1889
|
};
|
|
1891
1890
|
// Generate the token
|
|
1892
1891
|
const token = external_jsonwebtoken_default().sign(payload, this.p8Content, {
|
|
1893
|
-
algorithm:
|
|
1892
|
+
algorithm: "ES256",
|
|
1894
1893
|
header: header,
|
|
1895
1894
|
});
|
|
1896
1895
|
return token;
|
|
@@ -2574,6 +2573,9 @@ class GNParameterCode {
|
|
|
2574
2573
|
static OwnerIds = "ownerIds";
|
|
2575
2574
|
static GetStoreUsed = "getStoreUsed";
|
|
2576
2575
|
static RemoveStoreUsed = "removeStoreUsed";
|
|
2576
|
+
static AdminSecretKeys = "adminSecretKeys";
|
|
2577
|
+
static ServerSecretKeys = "serverSecretKeys";
|
|
2578
|
+
static PlayerSecretKeys = "playerSecretKeys";
|
|
2577
2579
|
}
|
|
2578
2580
|
|
|
2579
2581
|
;// ./src/GN-app-api/service/EventCallbackService.ts
|
|
@@ -2680,15 +2682,15 @@ class EventCallbackCloudScriptService {
|
|
|
2680
2682
|
async executeSystem(eventName) {
|
|
2681
2683
|
let cloudFunction = this.cloudScriptFunctionDict.get("system");
|
|
2682
2684
|
if (cloudFunction == null) {
|
|
2683
|
-
Debug.logError("[
|
|
2685
|
+
Debug.logError("[GearN] [SystemEventCallback] system not found");
|
|
2684
2686
|
return;
|
|
2685
2687
|
}
|
|
2686
2688
|
let cloudScriptWorker = this.loadCloudScriptFunctionWorkerFromCache(cloudFunction.type, eventName);
|
|
2687
2689
|
if (cloudScriptWorker == null) {
|
|
2688
|
-
Debug.logError("[
|
|
2690
|
+
Debug.logError("[GearN] [SystemEventCallback] worker not found at " + cloudFunction.type);
|
|
2689
2691
|
return;
|
|
2690
2692
|
}
|
|
2691
|
-
Debug.log("[
|
|
2693
|
+
Debug.log("[GearN] [SystemEventCallback] auto call " + eventName);
|
|
2692
2694
|
let requestId = StringUtility.generateRandomString(10, 0);
|
|
2693
2695
|
let cloudScriptRequest = {
|
|
2694
2696
|
requestId: requestId,
|
|
@@ -2730,22 +2732,22 @@ class EventCallbackCloudScriptService {
|
|
|
2730
2732
|
if (cloudScriptResponse.logs.length != 0)
|
|
2731
2733
|
Debug.log(JSON.stringify(cloudScriptResponse.logs));
|
|
2732
2734
|
if (cloudScriptResponse.response.status == ExecuteResponseStatus.Ok) {
|
|
2733
|
-
Debug.log("[
|
|
2735
|
+
Debug.log("[GearN] [SystemEventCallback] auto call success " + eventName);
|
|
2734
2736
|
}
|
|
2735
2737
|
else {
|
|
2736
|
-
Debug.log("[
|
|
2738
|
+
Debug.log("[GearN] [SystemEventCallback] auto call failed " + eventName + " " + cloudScriptResponse.response.errorMessage);
|
|
2737
2739
|
}
|
|
2738
2740
|
}
|
|
2739
2741
|
async executeRequestServerDetailSystem(gameId, matchmakingTicketCanMatch) {
|
|
2740
2742
|
let cloudFunction = this.cloudScriptFunctionDict.get("system");
|
|
2741
2743
|
if (cloudFunction == null) {
|
|
2742
|
-
Debug.logError("[
|
|
2744
|
+
Debug.logError("[GearN] [SystemEventCallback] system not found");
|
|
2743
2745
|
return { success: false };
|
|
2744
2746
|
}
|
|
2745
2747
|
let eventName = "system_RequestServerDetail";
|
|
2746
2748
|
let cloudScriptWorker = this.loadCloudScriptFunctionWorkerFromCache(cloudFunction.type, eventName);
|
|
2747
2749
|
if (cloudScriptWorker == null) {
|
|
2748
|
-
Debug.logError("[
|
|
2750
|
+
Debug.logError("[GearN] [SystemEventCallback] worker not found at " + cloudFunction.type);
|
|
2749
2751
|
return { success: false };
|
|
2750
2752
|
}
|
|
2751
2753
|
let requestId = StringUtility.generateRandomString(10, 0);
|
|
@@ -2803,12 +2805,12 @@ class EventCallbackCloudScriptService {
|
|
|
2803
2805
|
async executeEvent(eventName, request, operationEvent) {
|
|
2804
2806
|
let cloudFunction = this.cloudScriptFunctionDict.get("system");
|
|
2805
2807
|
if (cloudFunction == null) {
|
|
2806
|
-
Debug.logError("[
|
|
2808
|
+
Debug.logError("[GearN] [SystemEventCallback] system not found");
|
|
2807
2809
|
return;
|
|
2808
2810
|
}
|
|
2809
2811
|
let cloudScriptWorker = this.loadCloudScriptFunctionWorkerFromCache(cloudFunction.type, eventName);
|
|
2810
2812
|
if (cloudScriptWorker == null) {
|
|
2811
|
-
Debug.logError("[
|
|
2813
|
+
Debug.logError("[GearN] [SystemEventCallback] worker not found at " + cloudFunction.type);
|
|
2812
2814
|
return;
|
|
2813
2815
|
}
|
|
2814
2816
|
let requestId = StringUtility.generateRandomString(10, 0);
|
|
@@ -3180,7 +3182,7 @@ class EventCallbackCloudScriptService {
|
|
|
3180
3182
|
loadCloudScriptWorker(type, version) {
|
|
3181
3183
|
let finalVersion = type + "_" + version;
|
|
3182
3184
|
let filePath = __dirname + "/./GN-startup/cloudScript/" + finalVersion + ".js";
|
|
3183
|
-
Debug.log("[
|
|
3185
|
+
Debug.log("[GearN] [EventCallback] run cloudScript " + finalVersion);
|
|
3184
3186
|
let cloudScriptWorker = (0,external_child_process_namespaceObject.fork)(filePath, {
|
|
3185
3187
|
env: {
|
|
3186
3188
|
gnServerSettingsOptions: JSON.stringify(this.gnServerSettingsOptions),
|
|
@@ -3245,7 +3247,7 @@ class EventCallbackCloudScriptService {
|
|
|
3245
3247
|
}
|
|
3246
3248
|
});
|
|
3247
3249
|
cloudScriptWorker.on("exit", (code) => {
|
|
3248
|
-
Debug.log("[
|
|
3250
|
+
Debug.log("[GearN] [EventCallback] terminal cloudScript " + finalVersion + " with code " + code);
|
|
3249
3251
|
thiz.cloudScriptWorkerDict.delete(finalVersion);
|
|
3250
3252
|
});
|
|
3251
3253
|
this.cloudScriptWorkerDict.set(finalVersion, cloudScriptWorker);
|
|
@@ -3345,8 +3347,9 @@ class PreEventCallbackService {
|
|
|
3345
3347
|
}
|
|
3346
3348
|
}
|
|
3347
3349
|
|
|
3348
|
-
;// external "crypto
|
|
3349
|
-
const
|
|
3350
|
+
;// external "crypto"
|
|
3351
|
+
const external_crypto_namespaceObject = require("crypto");
|
|
3352
|
+
var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_namespaceObject);
|
|
3350
3353
|
;// ./src/GN-app-api/service/FacebookService.ts
|
|
3351
3354
|
|
|
3352
3355
|
|
|
@@ -3412,10 +3415,23 @@ class FacebookService {
|
|
|
3412
3415
|
let signedRequest = payloadJson["json"]["signedRequest"];
|
|
3413
3416
|
let appId = payloadJson["json"]["appId"];
|
|
3414
3417
|
if (this.facebookValidationReceipt(signedRequest)) {
|
|
3415
|
-
let json =
|
|
3416
|
-
let gsJson = JSON.parse(json);
|
|
3417
|
-
if (appId == this.facebookAppId) {
|
|
3418
|
-
|
|
3418
|
+
// let json = CryptoJS.enc.Base64.parse(signedRequest.split(".")[1]).toString(CryptoJS.enc.Utf8);
|
|
3419
|
+
// let gsJson = JSON.parse(json);
|
|
3420
|
+
// if (appId == this.facebookAppId) {
|
|
3421
|
+
// let product_id = gsJson["product_id"];
|
|
3422
|
+
// return {
|
|
3423
|
+
// success: true,
|
|
3424
|
+
// productId: product_id,
|
|
3425
|
+
// };
|
|
3426
|
+
// }
|
|
3427
|
+
const base64Payload = signedRequest.split(".")[1]
|
|
3428
|
+
.replace(/-/g, "+")
|
|
3429
|
+
.replace(/_/g, "/");
|
|
3430
|
+
const payloadBuffer = Buffer.from(base64Payload, "base64");
|
|
3431
|
+
const jsonStr = payloadBuffer.toString("utf8");
|
|
3432
|
+
const gsJson = JSON.parse(jsonStr);
|
|
3433
|
+
if (appId === this.facebookAppId) {
|
|
3434
|
+
const product_id = gsJson["product_id"];
|
|
3419
3435
|
return {
|
|
3420
3436
|
success: true,
|
|
3421
3437
|
productId: product_id,
|
|
@@ -3427,11 +3443,21 @@ class FacebookService {
|
|
|
3427
3443
|
};
|
|
3428
3444
|
}
|
|
3429
3445
|
facebookValidationReceipt(signedRequest) {
|
|
3430
|
-
let
|
|
3431
|
-
|
|
3432
|
-
let signature =
|
|
3433
|
-
let dataHash =
|
|
3434
|
-
let isValid = signature === dataHash;
|
|
3446
|
+
// let [encodedSig, encodedPayload] = signedRequest.split(".");
|
|
3447
|
+
// let base64Sig = encodedSig.replace(/-/g, "+").replace(/_/g, "/");
|
|
3448
|
+
// let signature = CryptoJS.enc.Base64.parse(base64Sig).toString();
|
|
3449
|
+
// let dataHash = CryptoJS.HmacSHA256(encodedPayload, this.facebookInappSecret).toString();
|
|
3450
|
+
// let isValid = signature === dataHash;
|
|
3451
|
+
// return isValid;
|
|
3452
|
+
const [encodedSig, encodedPayload] = signedRequest.split(".");
|
|
3453
|
+
const base64Sig = encodedSig
|
|
3454
|
+
.replace(/-/g, "+")
|
|
3455
|
+
.replace(/_/g, "/");
|
|
3456
|
+
const signatureBuffer = Buffer.from(base64Sig, "base64");
|
|
3457
|
+
const hmac = (0,external_crypto_namespaceObject.createHmac)("sha256", this.facebookInappSecret);
|
|
3458
|
+
hmac.update(encodedPayload);
|
|
3459
|
+
const dataHashBuffer = hmac.digest();
|
|
3460
|
+
const isValid = signatureBuffer.equals(dataHashBuffer);
|
|
3435
3461
|
return isValid;
|
|
3436
3462
|
}
|
|
3437
3463
|
;
|
|
@@ -3468,9 +3494,6 @@ class GenericService {
|
|
|
3468
3494
|
}
|
|
3469
3495
|
}
|
|
3470
3496
|
|
|
3471
|
-
;// external "crypto"
|
|
3472
|
-
const external_crypto_namespaceObject = require("crypto");
|
|
3473
|
-
var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_namespaceObject);
|
|
3474
3497
|
;// ./src/GN-app-api/service/GoogleService.ts
|
|
3475
3498
|
|
|
3476
3499
|
|
|
@@ -3558,16 +3581,16 @@ class GoogleService {
|
|
|
3558
3581
|
androidValidationReceipt(signature, signedData) {
|
|
3559
3582
|
if (!this.publicKeyString)
|
|
3560
3583
|
return false;
|
|
3561
|
-
let verifier = external_crypto_default().createVerify(
|
|
3584
|
+
let verifier = external_crypto_default().createVerify("RSA-SHA1");
|
|
3562
3585
|
verifier.update(signedData);
|
|
3563
|
-
return verifier.verify(this.publicKeyString, signature,
|
|
3586
|
+
return verifier.verify(this.publicKeyString, signature, "base64");
|
|
3564
3587
|
}
|
|
3565
3588
|
;
|
|
3566
3589
|
// gotta give credit to nothing2lose for this function
|
|
3567
3590
|
generateFormattedPublickey(publicKeyStr) {
|
|
3568
3591
|
var KEY_PREFIX, KEY_SUFFIX, chunkSize, chunks, str;
|
|
3569
3592
|
KEY_PREFIX = "-----BEGIN PUBLIC KEY-----\n";
|
|
3570
|
-
KEY_SUFFIX =
|
|
3593
|
+
KEY_SUFFIX = "\n-----END PUBLIC KEY-----";
|
|
3571
3594
|
str = publicKeyStr;
|
|
3572
3595
|
chunks = [];
|
|
3573
3596
|
chunkSize = 64;
|
|
@@ -3625,7 +3648,7 @@ class PushNotificationService {
|
|
|
3625
3648
|
credential: external_firebase_admin_default().credential.cert({
|
|
3626
3649
|
projectId: this.projectId,
|
|
3627
3650
|
clientEmail: this.clientEmail,
|
|
3628
|
-
privateKey: this.privateKey.replace(/\\n/g,
|
|
3651
|
+
privateKey: this.privateKey.replace(/\\n/g, "\n"),
|
|
3629
3652
|
}),
|
|
3630
3653
|
});
|
|
3631
3654
|
this.messaging = external_firebase_admin_default().messaging();
|
|
@@ -5957,21 +5980,6 @@ class ConfigService {
|
|
|
5957
5980
|
}
|
|
5958
5981
|
}
|
|
5959
5982
|
|
|
5960
|
-
;// external "async-lock"
|
|
5961
|
-
const external_async_lock_namespaceObject = require("async-lock");
|
|
5962
|
-
var external_async_lock_default = /*#__PURE__*/__webpack_require__.n(external_async_lock_namespaceObject);
|
|
5963
|
-
;// ./src/GN-app-api/service/LockService.ts
|
|
5964
|
-
|
|
5965
|
-
const asyncLock = new (external_async_lock_default())();
|
|
5966
|
-
class LockService {
|
|
5967
|
-
async handle(key, fn) {
|
|
5968
|
-
return await asyncLock.acquire(key, fn);
|
|
5969
|
-
}
|
|
5970
|
-
isBusy(key) {
|
|
5971
|
-
return asyncLock.isBusy(key);
|
|
5972
|
-
}
|
|
5973
|
-
}
|
|
5974
|
-
|
|
5975
5983
|
;// ./src/GN-app-api/service/TimerService.ts
|
|
5976
5984
|
|
|
5977
5985
|
|
|
@@ -6473,6 +6481,7 @@ class SecretInfo_BuilderBase {
|
|
|
6473
6481
|
role;
|
|
6474
6482
|
remove;
|
|
6475
6483
|
tsExpire;
|
|
6484
|
+
displayName;
|
|
6476
6485
|
permission;
|
|
6477
6486
|
gameId;
|
|
6478
6487
|
isDefault;
|
|
@@ -6492,6 +6501,9 @@ class SecretInfo_BuilderBase {
|
|
|
6492
6501
|
getTsExpire() {
|
|
6493
6502
|
return this.tsExpire;
|
|
6494
6503
|
}
|
|
6504
|
+
getDisplayName() {
|
|
6505
|
+
return this.displayName;
|
|
6506
|
+
}
|
|
6495
6507
|
getGameId() {
|
|
6496
6508
|
return this.gameId;
|
|
6497
6509
|
}
|
|
@@ -6529,6 +6541,9 @@ class SecretInfo_BuilderBase {
|
|
|
6529
6541
|
//this.tsExpire = tsExpire;
|
|
6530
6542
|
return this;
|
|
6531
6543
|
}
|
|
6544
|
+
setDisplayName(displayName) {
|
|
6545
|
+
return this;
|
|
6546
|
+
}
|
|
6532
6547
|
build() {
|
|
6533
6548
|
return null;
|
|
6534
6549
|
}
|
|
@@ -6548,6 +6563,10 @@ class SecretInfo_Builder extends SecretInfo_BuilderBase {
|
|
|
6548
6563
|
this.tsExpire = tsExpire;
|
|
6549
6564
|
return this;
|
|
6550
6565
|
}
|
|
6566
|
+
setDisplayName(displayName) {
|
|
6567
|
+
this.displayName = displayName;
|
|
6568
|
+
return this;
|
|
6569
|
+
}
|
|
6551
6570
|
setPermission(permission) {
|
|
6552
6571
|
this.permission = permission;
|
|
6553
6572
|
return this;
|
|
@@ -6570,6 +6589,7 @@ class SecretInfo extends SecretInfo_BuilderBase {
|
|
|
6570
6589
|
this.role = builder.getRole();
|
|
6571
6590
|
this.remove = builder.isRemove();
|
|
6572
6591
|
this.tsExpire = builder.getTsExpire();
|
|
6592
|
+
this.displayName = builder.getDisplayName();
|
|
6573
6593
|
this.permission = builder.getPermission();
|
|
6574
6594
|
this.gameId = builder.getGameId();
|
|
6575
6595
|
this.isDefault = builder.getIsDefault();
|
|
@@ -6585,6 +6605,7 @@ class SecretInfo extends SecretInfo_BuilderBase {
|
|
|
6585
6605
|
"role": this.role,
|
|
6586
6606
|
"isRemove": this.remove,
|
|
6587
6607
|
"tsExpire": this.tsExpire,
|
|
6608
|
+
"displayName": this.displayName,
|
|
6588
6609
|
"permission": this.permission,
|
|
6589
6610
|
"gameId": this.gameId,
|
|
6590
6611
|
};
|
|
@@ -6710,19 +6731,27 @@ class DisplayNameUtility {
|
|
|
6710
6731
|
inputReturn += "y";
|
|
6711
6732
|
else if (char == "z")
|
|
6712
6733
|
inputReturn += "z";
|
|
6734
|
+
else if (char == "0" ||
|
|
6735
|
+
char == "1" ||
|
|
6736
|
+
char == "2" ||
|
|
6737
|
+
char == "3" ||
|
|
6738
|
+
char == "4" ||
|
|
6739
|
+
char == "5" ||
|
|
6740
|
+
char == "6" ||
|
|
6741
|
+
char == "7" ||
|
|
6742
|
+
char == "8" ||
|
|
6743
|
+
char == "9")
|
|
6744
|
+
inputReturn += char;
|
|
6713
6745
|
}
|
|
6714
6746
|
return inputReturn;
|
|
6715
6747
|
}
|
|
6716
6748
|
}
|
|
6717
6749
|
|
|
6718
|
-
;// external "md5"
|
|
6719
|
-
const external_md5_namespaceObject = require("md5");
|
|
6720
|
-
var external_md5_default = /*#__PURE__*/__webpack_require__.n(external_md5_namespaceObject);
|
|
6721
6750
|
;// ./src/GN-common/helper/Md5Generate.ts
|
|
6722
6751
|
|
|
6723
6752
|
class Md5Generate {
|
|
6724
6753
|
static getMd5(input) {
|
|
6725
|
-
return
|
|
6754
|
+
return (0,external_crypto_namespaceObject.createHash)("md5").update(input).digest("hex");
|
|
6726
6755
|
}
|
|
6727
6756
|
}
|
|
6728
6757
|
|
|
@@ -7042,6 +7071,7 @@ class SecretInfoItem extends MasterAdminMongoObject {
|
|
|
7042
7071
|
static _tsExpire = "tsExpire";
|
|
7043
7072
|
static _permission = "permission";
|
|
7044
7073
|
static _tsCreate = "tsCreate";
|
|
7074
|
+
static _displayName = "displayName";
|
|
7045
7075
|
static _creatorId = "creatorId";
|
|
7046
7076
|
gameId;
|
|
7047
7077
|
secretKey;
|
|
@@ -7050,6 +7080,7 @@ class SecretInfoItem extends MasterAdminMongoObject {
|
|
|
7050
7080
|
creatorId;
|
|
7051
7081
|
remove;
|
|
7052
7082
|
tsExpire;
|
|
7083
|
+
displayName;
|
|
7053
7084
|
permission;
|
|
7054
7085
|
constructor(result, collection) {
|
|
7055
7086
|
super(result, collection);
|
|
@@ -7063,6 +7094,7 @@ class SecretInfoItem extends MasterAdminMongoObject {
|
|
|
7063
7094
|
setDocumentMasterSecretInfoItem(result) {
|
|
7064
7095
|
this.remove = result[SecretInfoItem._remove];
|
|
7065
7096
|
this.tsExpire = result[SecretInfoItem._tsExpire];
|
|
7097
|
+
this.displayName = result[SecretInfoItem._displayName];
|
|
7066
7098
|
this.permission = result[SecretInfoItem._permission];
|
|
7067
7099
|
}
|
|
7068
7100
|
getGameId() {
|
|
@@ -7094,6 +7126,13 @@ class SecretInfoItem extends MasterAdminMongoObject {
|
|
|
7094
7126
|
this.tsExpire = tsExpire;
|
|
7095
7127
|
this.set(SecretInfoItem._tsExpire, this.tsExpire);
|
|
7096
7128
|
}
|
|
7129
|
+
getDisplayName() {
|
|
7130
|
+
return this.displayName;
|
|
7131
|
+
}
|
|
7132
|
+
setDisplayName(displayName) {
|
|
7133
|
+
this.displayName = displayName;
|
|
7134
|
+
this.set(SecretInfoItem._displayName, this.displayName);
|
|
7135
|
+
}
|
|
7097
7136
|
getPermission() {
|
|
7098
7137
|
return this.permission;
|
|
7099
7138
|
}
|
|
@@ -8907,14 +8946,16 @@ class xDatabase {
|
|
|
8907
8946
|
}).skip(skip).limit(limit);
|
|
8908
8947
|
return this.convertToMasterPlayers(results, collection);
|
|
8909
8948
|
}
|
|
8910
|
-
async
|
|
8949
|
+
async loadMasterPlayerWithDisplayNameAsync(displayName, masterPlayerFindOptions) {
|
|
8911
8950
|
let collection = this.systemCollection("MasterPlayer");
|
|
8912
|
-
let
|
|
8951
|
+
let result = await collection.findOne({ displayName: displayName }, {
|
|
8913
8952
|
projection: this.getFindOptions(masterPlayerFindOptions)
|
|
8914
|
-
})
|
|
8915
|
-
|
|
8953
|
+
});
|
|
8954
|
+
if (!result)
|
|
8955
|
+
return null;
|
|
8956
|
+
return new MasterPlayer(result, collection);
|
|
8916
8957
|
}
|
|
8917
|
-
async
|
|
8958
|
+
async loadMasterPlayerWithDisplayNameNormalizeAsync(displayNameNormalize, masterPlayerFindOptions) {
|
|
8918
8959
|
let collection = this.systemCollection("MasterPlayer");
|
|
8919
8960
|
let result = await collection.findOne({ displayNameNormalize: displayNameNormalize }, {
|
|
8920
8961
|
projection: this.getFindOptions(masterPlayerFindOptions)
|
|
@@ -8923,6 +8964,13 @@ class xDatabase {
|
|
|
8923
8964
|
return null;
|
|
8924
8965
|
return new MasterPlayer(result, collection);
|
|
8925
8966
|
}
|
|
8967
|
+
async loadMasterPlayersWithDisplayNameNormalizeRegexAsync(keyword, skip, limit, masterPlayerFindOptions) {
|
|
8968
|
+
let collection = this.systemCollection("MasterPlayer");
|
|
8969
|
+
let results = await collection.find({ displayNameNormalize: { $regex: keyword } }, {
|
|
8970
|
+
projection: this.getFindOptions(masterPlayerFindOptions)
|
|
8971
|
+
}).skip(skip).limit(limit);
|
|
8972
|
+
return this.convertToMasterPlayers(results, collection);
|
|
8973
|
+
}
|
|
8926
8974
|
async loadMasterPlayersLeaderboardWithStatisticsAsync(key, skip, limit, direction, masterPlayerFindOptions) {
|
|
8927
8975
|
let collection = this.systemCollection("MasterPlayer");
|
|
8928
8976
|
let $sort = {};
|
|
@@ -9228,14 +9276,16 @@ class xDatabase {
|
|
|
9228
9276
|
}).skip(skip).limit(limit);
|
|
9229
9277
|
return this.convertToGamePlayers(results, collection);
|
|
9230
9278
|
}
|
|
9231
|
-
async
|
|
9232
|
-
let collection = this.
|
|
9233
|
-
let
|
|
9279
|
+
async loadGamePlayerWithDisplayNameAsync(displayName, gamePlayerFindOptions) {
|
|
9280
|
+
let collection = this.systemCollection("GamePlayer");
|
|
9281
|
+
let result = await collection.findOne({ displayName: displayName }, {
|
|
9234
9282
|
projection: this.getFindOptions(gamePlayerFindOptions)
|
|
9235
|
-
})
|
|
9236
|
-
|
|
9283
|
+
});
|
|
9284
|
+
if (!result)
|
|
9285
|
+
return null;
|
|
9286
|
+
return new GamePlayer(result, collection);
|
|
9237
9287
|
}
|
|
9238
|
-
async
|
|
9288
|
+
async loadGamePlayerWithDisplayNameNormalizeAsync(displayNameNormalize, gamePlayerFindOptions) {
|
|
9239
9289
|
let collection = this.systemCollection("GamePlayer");
|
|
9240
9290
|
let result = await collection.findOne({ displayNameNormalize: displayNameNormalize }, {
|
|
9241
9291
|
projection: this.getFindOptions(gamePlayerFindOptions)
|
|
@@ -9244,6 +9294,13 @@ class xDatabase {
|
|
|
9244
9294
|
return null;
|
|
9245
9295
|
return new GamePlayer(result, collection);
|
|
9246
9296
|
}
|
|
9297
|
+
async loadGamePlayersWithDisplayNameNormalizeRegexAsync(keyword, skip, limit, gameId, gamePlayerFindOptions) {
|
|
9298
|
+
let collection = this.systemGameCollection("GamePlayer", gameId);
|
|
9299
|
+
let results = await collection.find({ displayNameNormalize: { $regex: keyword } }, {
|
|
9300
|
+
projection: this.getFindOptions(gamePlayerFindOptions)
|
|
9301
|
+
}).skip(skip).limit(limit);
|
|
9302
|
+
return this.convertToGamePlayers(results, collection);
|
|
9303
|
+
}
|
|
9247
9304
|
async loadGamePlayersLeaderboardWithStatisticsAsync(key, skip, limit, gameId, direction, gamePlayerFindOptions) {
|
|
9248
9305
|
let collection = this.systemGameCollection("GamePlayer", gameId);
|
|
9249
9306
|
let $sort = {};
|
|
@@ -9470,20 +9527,31 @@ class xDatabase {
|
|
|
9470
9527
|
}).skip(skip).limit(limit);
|
|
9471
9528
|
return this.convertToCharacterPlayers(results, collection);
|
|
9472
9529
|
}
|
|
9473
|
-
async
|
|
9530
|
+
async loadCharacterPlayerWithDisplayNameAsync(displayName, gameId, characterPlayerFindOptions) {
|
|
9474
9531
|
let collection = this.systemGameCollection("CharacterPlayer", gameId);
|
|
9475
|
-
let
|
|
9532
|
+
let result = await collection.findOne({ displayName: displayName }, {
|
|
9476
9533
|
projection: this.getFindOptions(characterPlayerFindOptions)
|
|
9477
|
-
})
|
|
9478
|
-
|
|
9534
|
+
});
|
|
9535
|
+
if (!result)
|
|
9536
|
+
return null;
|
|
9537
|
+
return new CharacterPlayer(result, collection);
|
|
9479
9538
|
}
|
|
9480
|
-
async
|
|
9539
|
+
async loadCharacterPlayerWithDisplayNameNormalizeAsync(displayNameNormalize, gameId, characterPlayerFindOptions) {
|
|
9481
9540
|
let collection = this.systemGameCollection("CharacterPlayer", gameId);
|
|
9482
9541
|
let result = await collection.findOne({ displayNameNormalize: displayNameNormalize }, {
|
|
9483
9542
|
projection: this.getFindOptions(characterPlayerFindOptions)
|
|
9484
9543
|
});
|
|
9544
|
+
if (!result)
|
|
9545
|
+
return null;
|
|
9485
9546
|
return new CharacterPlayer(result, collection);
|
|
9486
9547
|
}
|
|
9548
|
+
async loadCharacterPlayersWithDisplayNameNormalizeRegexAsync(keyword, skip, limit, gameId, characterPlayerFindOptions) {
|
|
9549
|
+
let collection = this.systemGameCollection("CharacterPlayer", gameId);
|
|
9550
|
+
let results = await collection.find({ displayNameNormalize: { $regex: keyword } }, {
|
|
9551
|
+
projection: this.getFindOptions(characterPlayerFindOptions)
|
|
9552
|
+
}).skip(skip).limit(limit);
|
|
9553
|
+
return this.convertToCharacterPlayers(results, collection);
|
|
9554
|
+
}
|
|
9487
9555
|
async loadCharacterPlayersLeaderboardWithStatisticsAsync(key, skip, limit, catalogId, gameId, direction, characterPlayerFindOptions) {
|
|
9488
9556
|
let collection = this.systemGameCollection("CharacterPlayer", gameId);
|
|
9489
9557
|
let $sort = {};
|
|
@@ -9716,7 +9784,25 @@ class xDatabase {
|
|
|
9716
9784
|
}).skip(skip).limit(limit);
|
|
9717
9785
|
return this.convertToGroups(results, collection);
|
|
9718
9786
|
}
|
|
9719
|
-
async
|
|
9787
|
+
async loadGroupWithDisplayNameAsync(displayName, gameId, groupFindOptions) {
|
|
9788
|
+
let collection = this.systemGameCollection("Group", gameId);
|
|
9789
|
+
let result = await collection.findOne({ displayName: displayName }, {
|
|
9790
|
+
projection: this.getFindOptions(groupFindOptions)
|
|
9791
|
+
});
|
|
9792
|
+
if (!result)
|
|
9793
|
+
return null;
|
|
9794
|
+
return new Group(result, collection);
|
|
9795
|
+
}
|
|
9796
|
+
async loadGroupWithDisplayNameNormalizeAsync(displayNameNormalize, gameId, groupFindOptions) {
|
|
9797
|
+
let collection = this.systemGameCollection("Group", gameId);
|
|
9798
|
+
let result = await collection.findOne({ displayNameNormalize: displayNameNormalize }, {
|
|
9799
|
+
projection: this.getFindOptions(groupFindOptions)
|
|
9800
|
+
});
|
|
9801
|
+
if (!result)
|
|
9802
|
+
return null;
|
|
9803
|
+
return new Group(result, collection);
|
|
9804
|
+
}
|
|
9805
|
+
async loadGroupsWithDisplayNameNormalizeRegexAsync(keyword, skip, limit, gameId, groupFindOptions) {
|
|
9720
9806
|
let collection = this.systemGameCollection("Group", gameId);
|
|
9721
9807
|
let results = await collection.find({ displayNameNormalize: { $regex: keyword } }, {
|
|
9722
9808
|
projection: this.getFindOptions(groupFindOptions)
|
|
@@ -9869,7 +9955,25 @@ class xDatabase {
|
|
|
9869
9955
|
}).skip(skip).limit(limit);
|
|
9870
9956
|
return this.convertToInventories(results, collection);
|
|
9871
9957
|
}
|
|
9872
|
-
async
|
|
9958
|
+
async loadInventoryWithDisplayNameAsync(displayName, gameId, inventoryFindOptions) {
|
|
9959
|
+
let collection = this.systemGameCollection("Inventory", gameId);
|
|
9960
|
+
let result = await collection.findOne({ displayName: displayName }, {
|
|
9961
|
+
projection: this.getFindOptions(inventoryFindOptions)
|
|
9962
|
+
});
|
|
9963
|
+
if (!result)
|
|
9964
|
+
null;
|
|
9965
|
+
return new Inventory(result, collection);
|
|
9966
|
+
}
|
|
9967
|
+
async loadInventoryWithDisplayNameNormalizeAsync(displayNameNormalize, gameId, inventoryFindOptions) {
|
|
9968
|
+
let collection = this.systemGameCollection("Inventory", gameId);
|
|
9969
|
+
let result = await collection.findOne({ displayNameNormalize: displayNameNormalize }, {
|
|
9970
|
+
projection: this.getFindOptions(inventoryFindOptions)
|
|
9971
|
+
});
|
|
9972
|
+
if (!result)
|
|
9973
|
+
null;
|
|
9974
|
+
return new Inventory(result, collection);
|
|
9975
|
+
}
|
|
9976
|
+
async loadInventoriesWithDisplayNameNormalizeRegexAsync(keyword, skip, limit, gameId, inventoryFindOptions) {
|
|
9873
9977
|
let collection = this.systemGameCollection("Inventory", gameId);
|
|
9874
9978
|
let results = await collection.find({ displayNameNormalize: { $regex: keyword } }, {
|
|
9875
9979
|
projection: this.getFindOptions(inventoryFindOptions)
|
|
@@ -10285,6 +10389,7 @@ const msgpack_namespaceObject = require("@msgpack/msgpack");
|
|
|
10285
10389
|
|
|
10286
10390
|
|
|
10287
10391
|
|
|
10392
|
+
|
|
10288
10393
|
var AntiDdosMiddleware_RequestType;
|
|
10289
10394
|
(function (RequestType) {
|
|
10290
10395
|
RequestType[RequestType["HTTP"] = 0] = "HTTP";
|
|
@@ -10297,6 +10402,7 @@ var BanType;
|
|
|
10297
10402
|
})(BanType || (BanType = {}));
|
|
10298
10403
|
class AntiDdosMiddleware {
|
|
10299
10404
|
static FIVE_MINUTE_TS = 5 * 60 * 1000;
|
|
10405
|
+
static K_MULTIPLE_ADMIN = 500;
|
|
10300
10406
|
static K_MULTIPLE_WHITE_LIST = 100;
|
|
10301
10407
|
static K_MULTIPLE_BLACK_LIST = 5;
|
|
10302
10408
|
socketRequestPerIPDic;
|
|
@@ -10397,12 +10503,19 @@ class AntiDdosMiddleware {
|
|
|
10397
10503
|
|| url == "/167/11/1") {
|
|
10398
10504
|
return ReturnCode.Ok;
|
|
10399
10505
|
}
|
|
10400
|
-
let contentLengthStr = req.
|
|
10506
|
+
let contentLengthStr = req.header("content-length");
|
|
10401
10507
|
if (contentLengthStr) {
|
|
10402
10508
|
let ip = req.xip;
|
|
10403
10509
|
let httpMaxRequestSize = this.httpMaxRequestSize;
|
|
10404
10510
|
if (this.ipWhiteLst.includes(ip))
|
|
10405
10511
|
httpMaxRequestSize = httpMaxRequestSize * AntiDdosMiddleware.K_MULTIPLE_WHITE_LIST;
|
|
10512
|
+
else {
|
|
10513
|
+
let role = Number.parseInt(req.params.role);
|
|
10514
|
+
if (!Number.isNaN(role)) {
|
|
10515
|
+
if (role == RequestRole.Admin || role == RequestRole.Server)
|
|
10516
|
+
httpMaxRequestSize = httpMaxRequestSize * AntiDdosMiddleware.K_MULTIPLE_ADMIN;
|
|
10517
|
+
}
|
|
10518
|
+
}
|
|
10406
10519
|
let contentLength = parseInt(contentLengthStr);
|
|
10407
10520
|
if (contentLength > httpMaxRequestSize) {
|
|
10408
10521
|
this.reportDdosCollection.insertOne({
|
|
@@ -10572,6 +10685,13 @@ class AntiDdosMiddleware {
|
|
|
10572
10685
|
httpMaxRequestPerSecondPerIp = httpMaxRequestPerSecondPerIp / AntiDdosMiddleware.K_MULTIPLE_BLACK_LIST;
|
|
10573
10686
|
else if (this.ipWhiteLst.includes(ip))
|
|
10574
10687
|
httpMaxRequestPerSecondPerIp = httpMaxRequestPerSecondPerIp * AntiDdosMiddleware.K_MULTIPLE_WHITE_LIST;
|
|
10688
|
+
else {
|
|
10689
|
+
let role = Number.parseInt(req.params.role);
|
|
10690
|
+
if (!Number.isNaN(role)) {
|
|
10691
|
+
if (role == RequestRole.Admin || role == RequestRole.Server)
|
|
10692
|
+
httpMaxRequestPerSecondPerIp = httpMaxRequestPerSecondPerIp * AntiDdosMiddleware.K_MULTIPLE_ADMIN;
|
|
10693
|
+
}
|
|
10694
|
+
}
|
|
10575
10695
|
if (httpRequestPerIPItem.count > httpMaxRequestPerSecondPerIp) {
|
|
10576
10696
|
this.reportDdosCollection.insertOne({
|
|
10577
10697
|
returnCode: ReturnCode.MaxRequestReject,
|
|
@@ -10634,6 +10754,13 @@ class AntiDdosMiddleware {
|
|
|
10634
10754
|
httpMaxRequestPerSecondPerPeer = httpMaxRequestPerSecondPerPeer / AntiDdosMiddleware.K_MULTIPLE_BLACK_LIST;
|
|
10635
10755
|
else if (this.ipWhiteLst.includes(ip))
|
|
10636
10756
|
httpMaxRequestPerSecondPerPeer = httpMaxRequestPerSecondPerPeer * AntiDdosMiddleware.K_MULTIPLE_WHITE_LIST;
|
|
10757
|
+
else {
|
|
10758
|
+
let role = Number.parseInt(req.params.role);
|
|
10759
|
+
if (!Number.isNaN(role)) {
|
|
10760
|
+
if (role == RequestRole.Admin || role == RequestRole.Server)
|
|
10761
|
+
httpMaxRequestPerSecondPerPeer = httpMaxRequestPerSecondPerPeer * AntiDdosMiddleware.K_MULTIPLE_ADMIN;
|
|
10762
|
+
}
|
|
10763
|
+
}
|
|
10637
10764
|
httpRequestPerPeerItem.count++;
|
|
10638
10765
|
if (httpRequestPerPeerItem.count > httpMaxRequestPerSecondPerPeer) {
|
|
10639
10766
|
this.reportDdosCollection.insertOne({
|
|
@@ -10673,6 +10800,13 @@ class AntiDdosMiddleware {
|
|
|
10673
10800
|
httpMaxPendingRequest = httpMaxPendingRequest / AntiDdosMiddleware.K_MULTIPLE_BLACK_LIST;
|
|
10674
10801
|
else if (this.ipWhiteLst.includes(ip))
|
|
10675
10802
|
httpMaxPendingRequest = httpMaxPendingRequest * AntiDdosMiddleware.K_MULTIPLE_WHITE_LIST;
|
|
10803
|
+
else {
|
|
10804
|
+
let role = Number.parseInt(req.params.role);
|
|
10805
|
+
if (!Number.isNaN(role)) {
|
|
10806
|
+
if (role == RequestRole.Admin || role == RequestRole.Server)
|
|
10807
|
+
httpMaxPendingRequest = httpMaxPendingRequest * AntiDdosMiddleware.K_MULTIPLE_ADMIN;
|
|
10808
|
+
}
|
|
10809
|
+
}
|
|
10676
10810
|
if (this.currentHttpRequestCount > httpMaxPendingRequest) {
|
|
10677
10811
|
this.reportDdosCollection.insertOne({
|
|
10678
10812
|
returnCode: ReturnCode.MaxRequestReject,
|
|
@@ -14597,7 +14731,7 @@ class ApiMiddleware {
|
|
|
14597
14731
|
for (let key of keysNeedRemove) {
|
|
14598
14732
|
this.authInfoDict.delete(key);
|
|
14599
14733
|
}
|
|
14600
|
-
Debug.log("[
|
|
14734
|
+
Debug.log("[GearN] ApiMiddleware remove " + removeCount + "/" + startSize);
|
|
14601
14735
|
}
|
|
14602
14736
|
catch (err) {
|
|
14603
14737
|
Debug.logException(err);
|
|
@@ -14767,8 +14901,7 @@ class ApiMiddleware {
|
|
|
14767
14901
|
return next();
|
|
14768
14902
|
}
|
|
14769
14903
|
async getReturnCodeAuthenticate(req) {
|
|
14770
|
-
let
|
|
14771
|
-
let authToken = headers[Commands.RequestAuthTokenCmd];
|
|
14904
|
+
let authToken = req.header(Commands.RequestAuthTokenCmd);
|
|
14772
14905
|
let currentMilliseconds = xDatetime.getCurrentMilliseconds();
|
|
14773
14906
|
if (!authToken) {
|
|
14774
14907
|
req.isAuthenticated = false;
|
|
@@ -14811,7 +14944,7 @@ class ApiMiddleware {
|
|
|
14811
14944
|
}
|
|
14812
14945
|
}
|
|
14813
14946
|
}
|
|
14814
|
-
let secretKey =
|
|
14947
|
+
let secretKey = req.header(Commands.RequestSecretCmd);
|
|
14815
14948
|
if (!secretKey) {
|
|
14816
14949
|
if (!req.isAuthenticated) {
|
|
14817
14950
|
if (req.url != "/-1/9/3") {
|
|
@@ -14836,7 +14969,7 @@ class ApiMiddleware {
|
|
|
14836
14969
|
return ReturnCode.SecretInvalid;
|
|
14837
14970
|
}
|
|
14838
14971
|
if (!secretInfo.getGameId()) {
|
|
14839
|
-
let gameId =
|
|
14972
|
+
let gameId = req.header(Commands.RequestGameIdCmd);
|
|
14840
14973
|
if (!gameId)
|
|
14841
14974
|
gameId = ApiMiddleware.DEFAULT_GAME_ID;
|
|
14842
14975
|
let secretInfoAny = structuredClone(secretInfo);
|
|
@@ -15040,14 +15173,16 @@ class UploadFileMiddleware {
|
|
|
15040
15173
|
}
|
|
15041
15174
|
}
|
|
15042
15175
|
|
|
15043
|
-
;//
|
|
15044
|
-
|
|
15176
|
+
;// ./src/GN-startup/routes/utils/wrap.ts
|
|
15177
|
+
function wrap(fn) {
|
|
15178
|
+
return (req, res, next) => {
|
|
15179
|
+
Promise.resolve(fn(req, res, next)).catch(next);
|
|
15180
|
+
};
|
|
15181
|
+
}
|
|
15182
|
+
|
|
15045
15183
|
;// external "express"
|
|
15046
15184
|
const external_express_namespaceObject = require("express");
|
|
15047
15185
|
var external_express_default = /*#__PURE__*/__webpack_require__.n(external_express_namespaceObject);
|
|
15048
|
-
;// external "express-msgpack"
|
|
15049
|
-
const external_express_msgpack_namespaceObject = require("express-msgpack");
|
|
15050
|
-
var external_express_msgpack_default = /*#__PURE__*/__webpack_require__.n(external_express_msgpack_namespaceObject);
|
|
15051
15186
|
;// ./src/GN-startup/routes/HttpAppHandler.ts
|
|
15052
15187
|
|
|
15053
15188
|
|
|
@@ -15059,7 +15194,6 @@ var external_express_msgpack_default = /*#__PURE__*/__webpack_require__.n(extern
|
|
|
15059
15194
|
|
|
15060
15195
|
|
|
15061
15196
|
|
|
15062
|
-
|
|
15063
15197
|
class HttpAppHandler {
|
|
15064
15198
|
_onRequestCb;
|
|
15065
15199
|
apiMiddleware;
|
|
@@ -15180,17 +15314,17 @@ class HttpAppHandler {
|
|
|
15180
15314
|
this.router.use("/api", apiRouter);
|
|
15181
15315
|
if (this.enablePostViaJson) {
|
|
15182
15316
|
this.apiJsonRouter = external_express_default().Router();
|
|
15183
|
-
apiRouter.use("/" + Commands.RequestCmd_Json,
|
|
15317
|
+
apiRouter.use("/" + Commands.RequestCmd_Json, wrap((req, res, next) => {
|
|
15184
15318
|
return this.apiMiddleware.getIP(req, res, next);
|
|
15185
|
-
}),
|
|
15319
|
+
}), wrap((req, res, next) => {
|
|
15186
15320
|
return this.antiDdosMiddleware.checkMaxRequestPerSecondPerIpViaJson(req, res, next);
|
|
15187
|
-
}),
|
|
15321
|
+
}), wrap((req, res, next) => {
|
|
15188
15322
|
return this.antiDdosMiddleware.checkRequestSizeBodyViaJson(req, res, next);
|
|
15189
|
-
}),
|
|
15323
|
+
}), wrap((req, res, next) => {
|
|
15190
15324
|
return this.apiMiddleware.authenticateTokenViaJson(req, res, next);
|
|
15191
|
-
}),
|
|
15325
|
+
}), wrap((req, res, next) => {
|
|
15192
15326
|
return this.antiDdosMiddleware.checkMaxRequestPerSecondPerPeerViaJson(req, res, next);
|
|
15193
|
-
}), (
|
|
15327
|
+
}), external_express_default().json({ limit: "10mb" }), wrap((req, res, next) => {
|
|
15194
15328
|
return this.antiDdosMiddleware.addPendingRequestViaJson(req, res, next);
|
|
15195
15329
|
}), this.apiJsonRouter);
|
|
15196
15330
|
this.apiJsonRouter.post("/:code/:type/:role", async (req, res) => {
|
|
@@ -15218,17 +15352,33 @@ class HttpAppHandler {
|
|
|
15218
15352
|
}
|
|
15219
15353
|
if (this.enablePostViaMsgPack) {
|
|
15220
15354
|
this.apiMsgPackRouter = external_express_default().Router();
|
|
15221
|
-
apiRouter.use("/" + Commands.RequestCmd_MsgPack,
|
|
15355
|
+
apiRouter.use("/" + Commands.RequestCmd_MsgPack, wrap((req, res, next) => {
|
|
15222
15356
|
return this.apiMiddleware.getIP(req, res, next);
|
|
15223
|
-
}),
|
|
15357
|
+
}), wrap((req, res, next) => {
|
|
15224
15358
|
return this.antiDdosMiddleware.checkMaxRequestPerSecondPerIpViaMsgPack(req, res, next);
|
|
15225
|
-
}),
|
|
15359
|
+
}), wrap((req, res, next) => {
|
|
15226
15360
|
return this.antiDdosMiddleware.checkRequestSizeBodyViaMsgPack(req, res, next);
|
|
15227
|
-
}),
|
|
15361
|
+
}), wrap((req, res, next) => {
|
|
15228
15362
|
return this.apiMiddleware.authenticateTokenViaMsgPack(req, res, next);
|
|
15229
|
-
}),
|
|
15363
|
+
}), wrap((req, res, next) => {
|
|
15230
15364
|
return this.antiDdosMiddleware.checkMaxRequestPerSecondPerPeerViaMsgPack(req, res, next);
|
|
15231
|
-
}), (
|
|
15365
|
+
}), (req, res, next) => {
|
|
15366
|
+
if (req.header(Commands.CONTENT_TYPE) === Commands.APPLICATION_MSGPACK) {
|
|
15367
|
+
let buffer = [];
|
|
15368
|
+
req.on("data", chunk => buffer.push(chunk));
|
|
15369
|
+
req.on("end", () => {
|
|
15370
|
+
try {
|
|
15371
|
+
const raw = Buffer.concat(buffer);
|
|
15372
|
+
req.body = (0,msgpack_namespaceObject.decode)(raw);
|
|
15373
|
+
return next();
|
|
15374
|
+
}
|
|
15375
|
+
catch (err) {
|
|
15376
|
+
return next(err);
|
|
15377
|
+
}
|
|
15378
|
+
});
|
|
15379
|
+
}
|
|
15380
|
+
return next();
|
|
15381
|
+
}, wrap((req, res, next) => {
|
|
15232
15382
|
return this.antiDdosMiddleware.addPendingRequestViaMsgPack(req, res, next);
|
|
15233
15383
|
}), this.apiMsgPackRouter);
|
|
15234
15384
|
this.apiMsgPackRouter.post("/:code/:type/:role", async (req, res) => {
|
|
@@ -15749,21 +15899,21 @@ class UploadFileHandler {
|
|
|
15749
15899
|
}
|
|
15750
15900
|
init() {
|
|
15751
15901
|
this.uploadRouter = external_express_default().Router();
|
|
15752
|
-
this.router.use("/upload",
|
|
15902
|
+
this.router.use("/upload", wrap((req, res, next) => {
|
|
15753
15903
|
return this.apiMiddleware.getIP(req, res, next);
|
|
15754
|
-
}),
|
|
15904
|
+
}), wrap((req, res, next) => {
|
|
15755
15905
|
return this.antiDdosMiddleware.checkMaxUploadRequestPerSecondPerIp(req, res, next);
|
|
15756
|
-
}),
|
|
15906
|
+
}), wrap((req, res, next) => {
|
|
15757
15907
|
return this.apiMiddleware.authenticateUploadToken(req, res, next);
|
|
15758
|
-
}),
|
|
15908
|
+
}), wrap((req, res, next) => {
|
|
15759
15909
|
return this.antiDdosMiddleware.checkMaxUploadRequestPerSecondPerPeer(req, res, next);
|
|
15760
15910
|
}), this.uploadRouter);
|
|
15761
15911
|
let downloadRouter = external_express_default().Router();
|
|
15762
|
-
this.router.use("/download",
|
|
15912
|
+
this.router.use("/download", wrap((req, res, next) => {
|
|
15763
15913
|
return this.apiMiddleware.getIP(req, res, next);
|
|
15764
|
-
}),
|
|
15914
|
+
}), wrap((req, res, next) => {
|
|
15765
15915
|
return this.antiDdosMiddleware.checkMaxUploadRequestPerSecondPerIp(req, res, next);
|
|
15766
|
-
}),
|
|
15916
|
+
}), wrap((req, res, next) => {
|
|
15767
15917
|
return this.antiDdosMiddleware.checkMaxUploadRequestPerSecondPerPeer(req, res, next);
|
|
15768
15918
|
}), downloadRouter);
|
|
15769
15919
|
downloadRouter.get("/:downloadToken",
|
|
@@ -15819,11 +15969,11 @@ class UploadFileHandler {
|
|
|
15819
15969
|
if (!external_fs_default().existsSync(uploadPath)) {
|
|
15820
15970
|
external_fs_default().mkdirSync(uploadPath, { mode: "0775" });
|
|
15821
15971
|
}
|
|
15822
|
-
this.uploadRouter.post("/:fileId",
|
|
15972
|
+
this.uploadRouter.post("/:fileId", wrap((req, res, next) => {
|
|
15823
15973
|
return this.antiDdosMiddleware.addPendingUploadRequest(req, res, next);
|
|
15824
|
-
}),
|
|
15974
|
+
}), wrap((req, res, next) => {
|
|
15825
15975
|
return this.uploadFileMiddleware.checkFileUploadInvalid(req, res, next);
|
|
15826
|
-
}),
|
|
15976
|
+
}), wrap((req, res, next) => {
|
|
15827
15977
|
return this.uploadFileMiddleware.handleUpload().single(Commands.File)(req, res, next);
|
|
15828
15978
|
}), async (req, res) => {
|
|
15829
15979
|
this.antiDdosMiddleware.removePendingUploadRequest(req, res);
|
|
@@ -15849,7 +15999,7 @@ class UploadFileHandler {
|
|
|
15849
15999
|
}
|
|
15850
16000
|
removeFile(fullPath) {
|
|
15851
16001
|
external_fs_default().rm(fullPath, err => {
|
|
15852
|
-
Debug.logError("[
|
|
16002
|
+
Debug.logError("[GearN] remove file at path " + fullPath + ", error " + err);
|
|
15853
16003
|
});
|
|
15854
16004
|
}
|
|
15855
16005
|
}
|
|
@@ -16657,11 +16807,11 @@ class ClusterHandler {
|
|
|
16657
16807
|
}
|
|
16658
16808
|
init() {
|
|
16659
16809
|
this.clusterRouter = external_express_default().Router();
|
|
16660
|
-
this.router.use("/cluster",
|
|
16661
|
-
|
|
16662
|
-
|
|
16663
|
-
|
|
16664
|
-
|
|
16810
|
+
this.router.use("/cluster", wrap((req, res, next) => {
|
|
16811
|
+
let pkt = req.header("privateKeyToken");
|
|
16812
|
+
if (!pkt || pkt != this.privateKeyToken) {
|
|
16813
|
+
return res.sendStatus(401);
|
|
16814
|
+
}
|
|
16665
16815
|
return next();
|
|
16666
16816
|
}), this.clusterRouter);
|
|
16667
16817
|
}
|
|
@@ -16712,7 +16862,7 @@ class ClusterHandler {
|
|
|
16712
16862
|
callback(data);
|
|
16713
16863
|
}
|
|
16714
16864
|
catch (err) {
|
|
16715
|
-
Debug.logError("[
|
|
16865
|
+
Debug.logError("[GearN] ClusterHandler receive event failed " + err.message);
|
|
16716
16866
|
}
|
|
16717
16867
|
}
|
|
16718
16868
|
async update() {
|
|
@@ -16840,10 +16990,10 @@ class ClusterHandler {
|
|
|
16840
16990
|
if (nodeInfo.instanceId != this.instanceId)
|
|
16841
16991
|
external_axios_default().post(nodeInfo.fullUrl + "/cluster/sendEvent/" + name, data, { headers: { "pkt": this.privateKeyToken, "Content-Type": "application/json" } }).then(response => {
|
|
16842
16992
|
if (response.status != 200) {
|
|
16843
|
-
Debug.logError("[
|
|
16993
|
+
Debug.logError("[GearN] ClusterHandler sendEvent failed with status " + response.status + ", instanceId: " + nodeInfo.instanceId);
|
|
16844
16994
|
}
|
|
16845
16995
|
}).catch(err => {
|
|
16846
|
-
Debug.logError("[
|
|
16996
|
+
Debug.logError("[GearN] ClusterHandler sendEvent failed " + err.message + ", instanceId: " + nodeInfo.instanceId);
|
|
16847
16997
|
});
|
|
16848
16998
|
}
|
|
16849
16999
|
if (includeMe) {
|
|
@@ -26551,7 +26701,6 @@ var SetDisplayNameRequestHandler_metadata = (undefined && undefined.__metadata)
|
|
|
26551
26701
|
|
|
26552
26702
|
|
|
26553
26703
|
|
|
26554
|
-
|
|
26555
26704
|
class SetDisplayNameOperationRequest extends OperationRequest {
|
|
26556
26705
|
userId;
|
|
26557
26706
|
displayName;
|
|
@@ -26665,7 +26814,7 @@ class SetDisplayNameRequestHandler extends MasterPlayerBaseRequestHandler {
|
|
|
26665
26814
|
displayName: true,
|
|
26666
26815
|
};
|
|
26667
26816
|
if (request.uniqueDisplayName) {
|
|
26668
|
-
let masterPlayerWithThisDisplayName = await this.gnServer.getDatabase().loadMasterPlayerWithDisplayNameAsync(
|
|
26817
|
+
let masterPlayerWithThisDisplayName = await this.gnServer.getDatabase().loadMasterPlayerWithDisplayNameAsync(request.displayName, masterPlayerFindOptions);
|
|
26669
26818
|
if (masterPlayerWithThisDisplayName != null) {
|
|
26670
26819
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.DisplayNameHasUse);
|
|
26671
26820
|
return operationResponse;
|
|
@@ -31761,7 +31910,7 @@ class GetPlayersWithDisplayNameRequestHandler extends MasterPlayerBaseRequestHan
|
|
|
31761
31910
|
operationResponse.setReturnCode(ReturnCode.Ok);
|
|
31762
31911
|
let masterPlayerFindOptions = this.convertToMasterPlayerFindOptions(request.infoRequestParam);
|
|
31763
31912
|
let gnResults = new GNArray();
|
|
31764
|
-
let masterPlayers = await this.gnServer.getDatabase().
|
|
31913
|
+
let masterPlayers = await this.gnServer.getDatabase().loadMasterPlayersWithDisplayNameNormalizeRegexAsync(DisplayNameUtility.normalizeString(request.keyword), request.skip, request.limit, masterPlayerFindOptions);
|
|
31765
31914
|
for (let i = 0; i < masterPlayers.length; i++) {
|
|
31766
31915
|
let masterPlayer = masterPlayers[i];
|
|
31767
31916
|
let gnResult = new GNHashtable();
|
|
@@ -35298,7 +35447,6 @@ var characterPlayer_SetDisplayNameRequestHandler_metadata = (undefined && undefi
|
|
|
35298
35447
|
|
|
35299
35448
|
|
|
35300
35449
|
|
|
35301
|
-
|
|
35302
35450
|
class SetDisplayNameRequestHandler_SetDisplayNameOperationRequest extends OperationRequest {
|
|
35303
35451
|
characterId;
|
|
35304
35452
|
displayName;
|
|
@@ -35396,7 +35544,7 @@ class SetDisplayNameRequestHandler_SetDisplayNameRequestHandler extends Characte
|
|
|
35396
35544
|
displayName: true,
|
|
35397
35545
|
};
|
|
35398
35546
|
if (request.uniqueDisplayName) {
|
|
35399
|
-
let characterPlayerWithThisDisplayName = await this.gnServer.getDatabase().loadCharacterPlayerWithDisplayNameAsync(
|
|
35547
|
+
let characterPlayerWithThisDisplayName = await this.gnServer.getDatabase().loadCharacterPlayerWithDisplayNameAsync(request.displayName, secretInfo.getGameId(), characterPlayerFindOptions);
|
|
35400
35548
|
if (characterPlayerWithThisDisplayName != null) {
|
|
35401
35549
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.DisplayNameHasUse);
|
|
35402
35550
|
return operationResponse;
|
|
@@ -41288,7 +41436,7 @@ class GetPlayersWithDisplayNameRequestHandler_GetPlayersWithDisplayNameRequestHa
|
|
|
41288
41436
|
operationResponse.setReturnCode(ReturnCode.Ok);
|
|
41289
41437
|
let characterPlayerFindOptions = this.convertToCharacterPlayerFindOptions(request.infoRequestParam);
|
|
41290
41438
|
let gnResults = new GNArray();
|
|
41291
|
-
let characterPlayers = await this.gnServer.getDatabase().
|
|
41439
|
+
let characterPlayers = await this.gnServer.getDatabase().loadCharacterPlayersWithDisplayNameNormalizeRegexAsync(DisplayNameUtility.normalizeString(request.keyword), request.skip, request.limit, secretInfo.getGameId(), characterPlayerFindOptions);
|
|
41292
41440
|
for (let i = 0; i < characterPlayers.length; i++) {
|
|
41293
41441
|
let characterPlayer = characterPlayers[i];
|
|
41294
41442
|
let gnResult = new GNHashtable();
|
|
@@ -44332,7 +44480,6 @@ var gamePlayer_SetDisplayNameRequestHandler_metadata = (undefined && undefined._
|
|
|
44332
44480
|
|
|
44333
44481
|
|
|
44334
44482
|
|
|
44335
|
-
|
|
44336
44483
|
class gamePlayer_SetDisplayNameRequestHandler_SetDisplayNameOperationRequest extends OperationRequest {
|
|
44337
44484
|
userId;
|
|
44338
44485
|
displayName;
|
|
@@ -44446,7 +44593,7 @@ class gamePlayer_SetDisplayNameRequestHandler_SetDisplayNameRequestHandler exten
|
|
|
44446
44593
|
displayName: true,
|
|
44447
44594
|
};
|
|
44448
44595
|
if (request.uniqueDisplayName) {
|
|
44449
|
-
let gamePlayerWithThisDisplayName = await this.gnServer.getDatabase().loadGamePlayerWithDisplayNameAsync(
|
|
44596
|
+
let gamePlayerWithThisDisplayName = await this.gnServer.getDatabase().loadGamePlayerWithDisplayNameAsync(request.displayName, gamePlayerFindOptions);
|
|
44450
44597
|
if (gamePlayerWithThisDisplayName != null) {
|
|
44451
44598
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.DisplayNameHasUse);
|
|
44452
44599
|
return operationResponse;
|
|
@@ -49640,7 +49787,7 @@ class GrantPlayerCharacterRequestHandler extends GamePlayerBaseRequestHandler {
|
|
|
49640
49787
|
return operationResponse;
|
|
49641
49788
|
}
|
|
49642
49789
|
if (request.uniqueDisplayName && request.displayName) {
|
|
49643
|
-
let characterPlayerWithThisDisplayName = await this.gnServer.getDatabase().loadCharacterPlayerWithDisplayNameAsync(
|
|
49790
|
+
let characterPlayerWithThisDisplayName = await this.gnServer.getDatabase().loadCharacterPlayerWithDisplayNameAsync(request.displayName, secretInfo.getGameId(), { displayName: true });
|
|
49644
49791
|
if (characterPlayerWithThisDisplayName != null) {
|
|
49645
49792
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.DisplayNameHasUse);
|
|
49646
49793
|
return operationResponse;
|
|
@@ -50926,7 +51073,7 @@ class gamePlayer_GetPlayersWithDisplayNameRequestHandler_GetPlayersWithDisplayNa
|
|
|
50926
51073
|
operationResponse.setReturnCode(ReturnCode.Ok);
|
|
50927
51074
|
let gamePlayerFindOptions = this.convertToGamePlayerFindOptions(request.infoRequestParam);
|
|
50928
51075
|
let gnResults = new GNArray();
|
|
50929
|
-
let gamePlayers = await this.gnServer.getDatabase().
|
|
51076
|
+
let gamePlayers = await this.gnServer.getDatabase().loadGamePlayersWithDisplayNameNormalizeRegexAsync(DisplayNameUtility.normalizeString(request.keyword), request.skip, request.limit, secretInfo.getGameId(), gamePlayerFindOptions);
|
|
50930
51077
|
for (let i = 0; i < gamePlayers.length; i++) {
|
|
50931
51078
|
let gamePlayer = gamePlayers[i];
|
|
50932
51079
|
let gnResult = new GNHashtable();
|
|
@@ -53381,6 +53528,39 @@ class GroupBaseRequestHandler extends RequestHandler {
|
|
|
53381
53528
|
answer = true;
|
|
53382
53529
|
}
|
|
53383
53530
|
if (!answer && permissionRules.selfEnable) {
|
|
53531
|
+
let group = await this.gnServer.getDatabase().loadGroupAsync(groupId, gameId, {
|
|
53532
|
+
members: true,
|
|
53533
|
+
groupType: true,
|
|
53534
|
+
});
|
|
53535
|
+
if (group != null) {
|
|
53536
|
+
let groupType = group.getGroupType();
|
|
53537
|
+
if (groupType == OwnerType.GamePlayer) {
|
|
53538
|
+
let memberItem = group.getMember(userId);
|
|
53539
|
+
if (memberItem != null) {
|
|
53540
|
+
if (memberItem.status == GroupStatus.Member) {
|
|
53541
|
+
answer = true;
|
|
53542
|
+
}
|
|
53543
|
+
}
|
|
53544
|
+
}
|
|
53545
|
+
else if (groupType == OwnerType.CharacterPlayer) {
|
|
53546
|
+
let gamePlayer = await this.gnServer.getDatabase().loadGamePlayerAsync(userId, gameId, { playerCharacters: true });
|
|
53547
|
+
if (gamePlayer != null) {
|
|
53548
|
+
let characterPlayers = gamePlayer.getAllPlayerCharacters();
|
|
53549
|
+
if (characterPlayers != null) {
|
|
53550
|
+
for (let i = 0; i < characterPlayers.length; i++) {
|
|
53551
|
+
let characterPlayer = characterPlayers[i];
|
|
53552
|
+
let memberItem = group.getMember(characterPlayer.characterId);
|
|
53553
|
+
if (memberItem != null) {
|
|
53554
|
+
if (memberItem.status == GroupStatus.Member) {
|
|
53555
|
+
answer = true;
|
|
53556
|
+
break;
|
|
53557
|
+
}
|
|
53558
|
+
}
|
|
53559
|
+
}
|
|
53560
|
+
}
|
|
53561
|
+
}
|
|
53562
|
+
}
|
|
53563
|
+
}
|
|
53384
53564
|
let gamePlayer = await this.gnServer.getDatabase().loadGamePlayerAsync(userId, gameId, { playerGroups: true });
|
|
53385
53565
|
if (gamePlayer != null) {
|
|
53386
53566
|
let playerGroup = gamePlayer.getPlayerGroup(groupId);
|
|
@@ -57073,6 +57253,7 @@ var GetGroupInformationRequestHandler_metadata = (undefined && undefined.__metad
|
|
|
57073
57253
|
|
|
57074
57254
|
|
|
57075
57255
|
|
|
57256
|
+
|
|
57076
57257
|
class GetGroupInformationOperationRequest extends OperationRequest {
|
|
57077
57258
|
groupId;
|
|
57078
57259
|
infoRequestParam;
|
|
@@ -57125,12 +57306,39 @@ class GetGroupInformationRequestHandler extends GroupBaseRequestHandler {
|
|
|
57125
57306
|
allowMethod = true;
|
|
57126
57307
|
}
|
|
57127
57308
|
if (secretInfo.getPermission().group.getGroupInformation.selfEnable) {
|
|
57128
|
-
let
|
|
57129
|
-
|
|
57130
|
-
|
|
57131
|
-
|
|
57132
|
-
|
|
57133
|
-
|
|
57309
|
+
let group = await this.gnServer.getDatabase().loadGroupAsync(request.groupId, secretInfo.getGameId(), {
|
|
57310
|
+
members: true,
|
|
57311
|
+
groupType: true,
|
|
57312
|
+
});
|
|
57313
|
+
if (group != null) {
|
|
57314
|
+
let groupType = group.getGroupType();
|
|
57315
|
+
if (groupType == OwnerType.GamePlayer) {
|
|
57316
|
+
let memberItem = group.getMember(authInfo.getUserId());
|
|
57317
|
+
if (memberItem != null) {
|
|
57318
|
+
if (memberItem.status == GroupStatus.Member) {
|
|
57319
|
+
allowMethod = true;
|
|
57320
|
+
owned = true;
|
|
57321
|
+
}
|
|
57322
|
+
}
|
|
57323
|
+
}
|
|
57324
|
+
else if (groupType == OwnerType.CharacterPlayer) {
|
|
57325
|
+
let gamePlayer = await this.gnServer.getDatabase().loadGamePlayerAsync(authInfo.getUserId(), secretInfo.getGameId(), { playerCharacters: true });
|
|
57326
|
+
if (gamePlayer != null) {
|
|
57327
|
+
let characterPlayers = gamePlayer.getAllPlayerCharacters();
|
|
57328
|
+
if (characterPlayers != null) {
|
|
57329
|
+
for (let i = 0; i < characterPlayers.length; i++) {
|
|
57330
|
+
let characterPlayer = characterPlayers[i];
|
|
57331
|
+
let memberItem = group.getMember(characterPlayer.characterId);
|
|
57332
|
+
if (memberItem != null) {
|
|
57333
|
+
if (memberItem.status == GroupStatus.Member) {
|
|
57334
|
+
allowMethod = true;
|
|
57335
|
+
owned = true;
|
|
57336
|
+
break;
|
|
57337
|
+
}
|
|
57338
|
+
}
|
|
57339
|
+
}
|
|
57340
|
+
}
|
|
57341
|
+
}
|
|
57134
57342
|
}
|
|
57135
57343
|
}
|
|
57136
57344
|
}
|
|
@@ -59502,7 +59710,7 @@ class GetGroupsWithDisplayNameRequestHandler extends GroupBaseRequestHandler {
|
|
|
59502
59710
|
operationResponse.setReturnCode(ReturnCode.Ok);
|
|
59503
59711
|
let groupFindOptions = this.convertToGroupFindOptions(request.infoRequestParam);
|
|
59504
59712
|
let gnResults = new GNArray();
|
|
59505
|
-
let groups = await this.gnServer.getDatabase().
|
|
59713
|
+
let groups = await this.gnServer.getDatabase().loadGroupsWithDisplayNameNormalizeRegexAsync(DisplayNameUtility.normalizeString(request.keyword), request.skip, request.limit, secretInfo.getGameId(), groupFindOptions);
|
|
59506
59714
|
for (let i = 0; i < groups.length; i++) {
|
|
59507
59715
|
let group = groups[i];
|
|
59508
59716
|
let gnResult = new GNHashtable();
|
|
@@ -60048,6 +60256,7 @@ class group_GetCurrencyLogRequestHandler_GetCurrencyLogRequestHandler extends Re
|
|
|
60048
60256
|
|
|
60049
60257
|
|
|
60050
60258
|
|
|
60259
|
+
|
|
60051
60260
|
class ItemBaseRequestHandler extends RequestHandler {
|
|
60052
60261
|
isGetAll(infoRequestParam) {
|
|
60053
60262
|
return infoRequestParam.catalogId
|
|
@@ -60107,10 +60316,33 @@ class ItemBaseRequestHandler extends RequestHandler {
|
|
|
60107
60316
|
answer = true;
|
|
60108
60317
|
}
|
|
60109
60318
|
if (!answer && permissionRules.selfEnable) {
|
|
60110
|
-
let
|
|
60111
|
-
if (
|
|
60112
|
-
|
|
60113
|
-
|
|
60319
|
+
let inventory = await this.gnServer.getDatabase().loadInventoryAsync(itemId, gameId, { owner: true });
|
|
60320
|
+
if (inventory != null) {
|
|
60321
|
+
let owner = inventory.getOwner();
|
|
60322
|
+
if (owner != null) {
|
|
60323
|
+
if (owner.type == OwnerType.GamePlayer) {
|
|
60324
|
+
if (owner.id == userId) {
|
|
60325
|
+
answer = true;
|
|
60326
|
+
}
|
|
60327
|
+
}
|
|
60328
|
+
else if (owner.type == OwnerType.CharacterPlayer) {
|
|
60329
|
+
let gamePlayer = await this.gnServer.getDatabase().loadGamePlayerAsync(userId, gameId, { playerCharacters: true });
|
|
60330
|
+
if (gamePlayer != null) {
|
|
60331
|
+
if (gamePlayer.hasPlayerCharacter(owner.id)) {
|
|
60332
|
+
answer = true;
|
|
60333
|
+
}
|
|
60334
|
+
}
|
|
60335
|
+
}
|
|
60336
|
+
else if (owner.type == OwnerType.Group) {
|
|
60337
|
+
let gamePlayer = await this.gnServer.getDatabase().loadGamePlayerAsync(userId, gameId, { playerGroups: true });
|
|
60338
|
+
if (gamePlayer != null) {
|
|
60339
|
+
let playerGroup = gamePlayer.getPlayerGroup(owner.id);
|
|
60340
|
+
if (playerGroup != null && playerGroup.status == GroupStatus.Member) {
|
|
60341
|
+
answer = true;
|
|
60342
|
+
}
|
|
60343
|
+
}
|
|
60344
|
+
}
|
|
60345
|
+
}
|
|
60114
60346
|
}
|
|
60115
60347
|
}
|
|
60116
60348
|
return answer;
|
|
@@ -63390,6 +63622,8 @@ var GetItemInformationRequestHandler_metadata = (undefined && undefined.__metada
|
|
|
63390
63622
|
|
|
63391
63623
|
|
|
63392
63624
|
|
|
63625
|
+
|
|
63626
|
+
|
|
63393
63627
|
class GetItemInformationOperationRequest extends OperationRequest {
|
|
63394
63628
|
itemId;
|
|
63395
63629
|
infoRequestParam;
|
|
@@ -63442,11 +63676,35 @@ class GetItemInformationRequestHandler extends ItemBaseRequestHandler {
|
|
|
63442
63676
|
allowMethod = true;
|
|
63443
63677
|
}
|
|
63444
63678
|
if (secretInfo.getPermission().inventory.getItemInformation.selfEnable) {
|
|
63445
|
-
let
|
|
63446
|
-
if (
|
|
63447
|
-
|
|
63448
|
-
|
|
63449
|
-
|
|
63679
|
+
let inventory = await this.gnServer.getDatabase().loadInventoryAsync(request.itemId, secretInfo.getGameId(), { owner: true });
|
|
63680
|
+
if (inventory != null) {
|
|
63681
|
+
let owner = inventory.getOwner();
|
|
63682
|
+
if (owner != null) {
|
|
63683
|
+
if (owner.type == OwnerType.GamePlayer) {
|
|
63684
|
+
if (owner.id == authInfo.getUserId()) {
|
|
63685
|
+
allowMethod = true;
|
|
63686
|
+
owned = true;
|
|
63687
|
+
}
|
|
63688
|
+
}
|
|
63689
|
+
else if (owner.type == OwnerType.CharacterPlayer) {
|
|
63690
|
+
let gamePlayer = await this.gnServer.getDatabase().loadGamePlayerAsync(authInfo.getUserId(), secretInfo.getGameId(), { playerCharacters: true });
|
|
63691
|
+
if (gamePlayer != null) {
|
|
63692
|
+
if (gamePlayer.hasPlayerCharacter(owner.id)) {
|
|
63693
|
+
allowMethod = true;
|
|
63694
|
+
owned = true;
|
|
63695
|
+
}
|
|
63696
|
+
}
|
|
63697
|
+
}
|
|
63698
|
+
else if (owner.type == OwnerType.Group) {
|
|
63699
|
+
let gamePlayer = await this.gnServer.getDatabase().loadGamePlayerAsync(authInfo.getUserId(), secretInfo.getGameId(), { playerGroups: true });
|
|
63700
|
+
if (gamePlayer != null) {
|
|
63701
|
+
let playerGroup = gamePlayer.getPlayerGroup(owner.id);
|
|
63702
|
+
if (playerGroup != null && playerGroup.status == GroupStatus.Member) {
|
|
63703
|
+
allowMethod = true;
|
|
63704
|
+
owned = true;
|
|
63705
|
+
}
|
|
63706
|
+
}
|
|
63707
|
+
}
|
|
63450
63708
|
}
|
|
63451
63709
|
}
|
|
63452
63710
|
}
|
|
@@ -65161,7 +65419,7 @@ class GetItemsWithDisplayNameRequestHandler extends ItemBaseRequestHandler {
|
|
|
65161
65419
|
operationResponse.setReturnCode(ReturnCode.Ok);
|
|
65162
65420
|
let inventoryFindOptions = this.convertToInventoryFindOptions(request.infoRequestParam);
|
|
65163
65421
|
let gnResults = new GNArray();
|
|
65164
|
-
let inventorys = await this.gnServer.getDatabase().
|
|
65422
|
+
let inventorys = await this.gnServer.getDatabase().loadInventoriesWithDisplayNameNormalizeRegexAsync(DisplayNameUtility.normalizeString(request.keyword), request.skip, request.limit, secretInfo.getGameId(), inventoryFindOptions);
|
|
65165
65423
|
for (let i = 0; i < inventorys.length; i++) {
|
|
65166
65424
|
let inventory = inventorys[i];
|
|
65167
65425
|
let gnResult = new GNHashtable();
|
|
@@ -70616,7 +70874,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70616
70874
|
let key = removeKeyLst[i];
|
|
70617
70875
|
let indexName = "playerCurrencies." + key + ".value_-1";
|
|
70618
70876
|
masterPlayerCollection.dropIndex(indexName);
|
|
70619
|
-
Debug.log("[
|
|
70877
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70620
70878
|
}
|
|
70621
70879
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
70622
70880
|
let key = addKeyLst[i];
|
|
@@ -70624,7 +70882,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70624
70882
|
indexDoc["playerCurrencies." + key + ".value"] = -1;
|
|
70625
70883
|
let indexName = "playerCurrencies." + key + ".value_-1";
|
|
70626
70884
|
masterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
70627
|
-
Debug.log("[
|
|
70885
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70628
70886
|
}
|
|
70629
70887
|
}
|
|
70630
70888
|
masterPlayerSettings.playerCurrencySettings = playerCurrencySettings;
|
|
@@ -70678,7 +70936,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70678
70936
|
let key = removeKeyLst[i];
|
|
70679
70937
|
let indexName = "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
70680
70938
|
masterPlayerCollection.dropIndex(indexName);
|
|
70681
|
-
Debug.log("[
|
|
70939
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70682
70940
|
}
|
|
70683
70941
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
70684
70942
|
let key = addKeyLst[i];
|
|
@@ -70687,7 +70945,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70687
70945
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
70688
70946
|
let indexName = "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
70689
70947
|
masterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
70690
|
-
Debug.log("[
|
|
70948
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70691
70949
|
}
|
|
70692
70950
|
}
|
|
70693
70951
|
}
|
|
@@ -70706,7 +70964,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70706
70964
|
let key = removeKeyAscLst[i];
|
|
70707
70965
|
let indexName = "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
70708
70966
|
masterPlayerCollection.dropIndex(indexName);
|
|
70709
|
-
Debug.log("[
|
|
70967
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70710
70968
|
}
|
|
70711
70969
|
for (let i = 0; i < addKeyAscLst.length; i++) {
|
|
70712
70970
|
let key = addKeyAscLst[i];
|
|
@@ -70715,7 +70973,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70715
70973
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
70716
70974
|
let indexName = "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
70717
70975
|
masterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
70718
|
-
Debug.log("[
|
|
70976
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70719
70977
|
}
|
|
70720
70978
|
}
|
|
70721
70979
|
}
|
|
@@ -70781,7 +71039,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70781
71039
|
let key = removeKeyLst[i];
|
|
70782
71040
|
let indexName = "tags." + key + "_1";
|
|
70783
71041
|
masterPlayerCollection.dropIndex(indexName);
|
|
70784
|
-
Debug.log("[
|
|
71042
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70785
71043
|
}
|
|
70786
71044
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
70787
71045
|
let key = addKeyLst[i];
|
|
@@ -70789,7 +71047,7 @@ class SetMasterGameSettingsRequestHandler extends RequestHandler {
|
|
|
70789
71047
|
indexDoc["tags." + key] = 1;
|
|
70790
71048
|
let indexName = "tags." + key + "_1";
|
|
70791
71049
|
masterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
70792
|
-
Debug.log("[
|
|
71050
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + masterPlayerCollection.collectionName);
|
|
70793
71051
|
}
|
|
70794
71052
|
}
|
|
70795
71053
|
masterPlayerSettings.tagsSettings = tagsSettings;
|
|
@@ -72201,12 +72459,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72201
72459
|
{
|
|
72202
72460
|
let indexName = "playerCurrencies." + key + ".value_-1";
|
|
72203
72461
|
characterPlayerCollection.dropIndex(indexName);
|
|
72204
|
-
Debug.log("[
|
|
72462
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72205
72463
|
}
|
|
72206
72464
|
{
|
|
72207
72465
|
let indexName = "catalogId_1_" + "playerCurrencies." + key + ".value_-1";
|
|
72208
72466
|
characterPlayerCollection.dropIndex(indexName);
|
|
72209
|
-
Debug.log("[
|
|
72467
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72210
72468
|
}
|
|
72211
72469
|
}
|
|
72212
72470
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
@@ -72216,7 +72474,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72216
72474
|
indexDoc["playerCurrencies." + key + ".value"] = -1;
|
|
72217
72475
|
let indexName = "playerCurrencies." + key + ".value_-1";
|
|
72218
72476
|
characterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72219
|
-
Debug.log("[
|
|
72477
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72220
72478
|
}
|
|
72221
72479
|
{
|
|
72222
72480
|
let indexDoc = {};
|
|
@@ -72224,7 +72482,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72224
72482
|
indexDoc["playerCurrencies." + key + ".value"] = -1;
|
|
72225
72483
|
let indexName = "catalogId_1_" + "playerCurrencies." + key + ".value_-1";
|
|
72226
72484
|
characterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72227
|
-
Debug.log("[
|
|
72485
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72228
72486
|
}
|
|
72229
72487
|
}
|
|
72230
72488
|
}
|
|
@@ -72278,12 +72536,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72278
72536
|
{
|
|
72279
72537
|
let indexName = "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72280
72538
|
characterPlayerCollection.dropIndex(indexName);
|
|
72281
|
-
Debug.log("[
|
|
72539
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72282
72540
|
}
|
|
72283
72541
|
{
|
|
72284
72542
|
let indexName = "catalogId_1_" + "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72285
72543
|
characterPlayerCollection.dropIndex(indexName);
|
|
72286
|
-
Debug.log("[
|
|
72544
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72287
72545
|
}
|
|
72288
72546
|
}
|
|
72289
72547
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
@@ -72294,7 +72552,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72294
72552
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72295
72553
|
let indexName = "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72296
72554
|
characterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72297
|
-
Debug.log("[
|
|
72555
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72298
72556
|
}
|
|
72299
72557
|
{
|
|
72300
72558
|
let indexDoc = {};
|
|
@@ -72303,7 +72561,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72303
72561
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72304
72562
|
let indexName = "catalogId_1_" + "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72305
72563
|
characterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72306
|
-
Debug.log("[
|
|
72564
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72307
72565
|
}
|
|
72308
72566
|
}
|
|
72309
72567
|
}
|
|
@@ -72322,12 +72580,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72322
72580
|
{
|
|
72323
72581
|
let indexName = "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72324
72582
|
characterPlayerCollection.dropIndex(indexName);
|
|
72325
|
-
Debug.log("[
|
|
72583
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72326
72584
|
}
|
|
72327
72585
|
{
|
|
72328
72586
|
let indexName = "catalogId_1_" + "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72329
72587
|
characterPlayerCollection.dropIndex(indexName);
|
|
72330
|
-
Debug.log("[
|
|
72588
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72331
72589
|
}
|
|
72332
72590
|
}
|
|
72333
72591
|
for (let i = 0; i < addKeyAscLst.length; i++) {
|
|
@@ -72338,7 +72596,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72338
72596
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72339
72597
|
let indexName = "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72340
72598
|
characterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72341
|
-
Debug.log("[
|
|
72599
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72342
72600
|
}
|
|
72343
72601
|
{
|
|
72344
72602
|
let indexDoc = {};
|
|
@@ -72347,7 +72605,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72347
72605
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72348
72606
|
let indexName = "catalogId_1_" + "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72349
72607
|
characterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72350
|
-
Debug.log("[
|
|
72608
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72351
72609
|
}
|
|
72352
72610
|
}
|
|
72353
72611
|
}
|
|
@@ -72411,7 +72669,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72411
72669
|
let key = removeKeyLst[i];
|
|
72412
72670
|
let indexName = "tags." + key + "_1";
|
|
72413
72671
|
characterPlayerCollection.dropIndex(indexName);
|
|
72414
|
-
Debug.log("[
|
|
72672
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72415
72673
|
}
|
|
72416
72674
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
72417
72675
|
let key = addKeyLst[i];
|
|
@@ -72419,7 +72677,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72419
72677
|
indexDoc["tags." + key] = 1;
|
|
72420
72678
|
let indexName = "tags." + key + "_1";
|
|
72421
72679
|
characterPlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72422
|
-
Debug.log("[
|
|
72680
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + characterPlayerCollection.collectionName);
|
|
72423
72681
|
}
|
|
72424
72682
|
}
|
|
72425
72683
|
if (request.gameSettings.characterPlayerSettings.playerGroupCatalogSettings != null) {
|
|
@@ -72499,7 +72757,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72499
72757
|
let key = removeKeyLst[i];
|
|
72500
72758
|
let indexName = "playerCurrencies." + key + ".value_-1";
|
|
72501
72759
|
gamePlayerCollection.dropIndex(indexName);
|
|
72502
|
-
Debug.log("[
|
|
72760
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72503
72761
|
}
|
|
72504
72762
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
72505
72763
|
let key = addKeyLst[i];
|
|
@@ -72507,7 +72765,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72507
72765
|
indexDoc["playerCurrencies." + key + ".value"] = -1;
|
|
72508
72766
|
let indexName = "playerCurrencies." + key + ".value_-1";
|
|
72509
72767
|
gamePlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72510
|
-
Debug.log("[
|
|
72768
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72511
72769
|
}
|
|
72512
72770
|
}
|
|
72513
72771
|
if (request.gameSettings.gamePlayerSettings.playerStatisticsSettings != null) {
|
|
@@ -72559,7 +72817,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72559
72817
|
let key = removeKeyLst[i];
|
|
72560
72818
|
let indexName = "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72561
72819
|
gamePlayerCollection.dropIndex(indexName);
|
|
72562
|
-
Debug.log("[
|
|
72820
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72563
72821
|
}
|
|
72564
72822
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
72565
72823
|
let key = addKeyLst[i];
|
|
@@ -72568,7 +72826,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72568
72826
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72569
72827
|
let indexName = "playerStatistics." + key + ".value_-1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72570
72828
|
gamePlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72571
|
-
Debug.log("[
|
|
72829
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72572
72830
|
}
|
|
72573
72831
|
}
|
|
72574
72832
|
{
|
|
@@ -72585,7 +72843,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72585
72843
|
let key = removeKeyAscLst[i];
|
|
72586
72844
|
let indexName = "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72587
72845
|
gamePlayerCollection.dropIndex(indexName);
|
|
72588
|
-
Debug.log("[
|
|
72846
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72589
72847
|
}
|
|
72590
72848
|
for (let i = 0; i < addKeyAscLst.length; i++) {
|
|
72591
72849
|
let key = addKeyAscLst[i];
|
|
@@ -72594,7 +72852,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72594
72852
|
indexDoc["playerStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72595
72853
|
let indexName = "playerStatistics." + key + ".value_1_playerStatistics." + key + ".tsLastUpdate_1";
|
|
72596
72854
|
gamePlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72597
|
-
Debug.log("[
|
|
72855
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72598
72856
|
}
|
|
72599
72857
|
}
|
|
72600
72858
|
}
|
|
@@ -72657,7 +72915,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72657
72915
|
let key = removeKeyLst[i];
|
|
72658
72916
|
let indexName = "tags." + key + "_1";
|
|
72659
72917
|
gamePlayerCollection.dropIndex(indexName);
|
|
72660
|
-
Debug.log("[
|
|
72918
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72661
72919
|
}
|
|
72662
72920
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
72663
72921
|
let key = addKeyLst[i];
|
|
@@ -72665,7 +72923,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72665
72923
|
indexDoc["tags." + key] = 1;
|
|
72666
72924
|
let indexName = "tags." + key + "_1";
|
|
72667
72925
|
gamePlayerCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72668
|
-
Debug.log("[
|
|
72926
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + gamePlayerCollection.collectionName);
|
|
72669
72927
|
}
|
|
72670
72928
|
}
|
|
72671
72929
|
if (request.gameSettings.gamePlayerSettings.playerCharacterCatalogSettings != null) {
|
|
@@ -72758,12 +73016,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72758
73016
|
{
|
|
72759
73017
|
let indexName = "groupCurrencies." + key + ".value_-1";
|
|
72760
73018
|
groupCollection.dropIndex(indexName);
|
|
72761
|
-
Debug.log("[
|
|
73019
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + groupCollection.collectionName);
|
|
72762
73020
|
}
|
|
72763
73021
|
{
|
|
72764
73022
|
let indexName = "catalogId_1_" + "groupCurrencies." + key + ".value_-1";
|
|
72765
73023
|
groupCollection.dropIndex(indexName);
|
|
72766
|
-
Debug.log("[
|
|
73024
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + groupCollection.collectionName);
|
|
72767
73025
|
}
|
|
72768
73026
|
}
|
|
72769
73027
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
@@ -72773,7 +73031,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72773
73031
|
indexDoc["groupCurrencies." + key + ".value"] = -1;
|
|
72774
73032
|
let indexName = "groupCurrencies." + key + ".value_-1";
|
|
72775
73033
|
groupCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72776
|
-
Debug.log("[
|
|
73034
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + groupCollection.collectionName);
|
|
72777
73035
|
}
|
|
72778
73036
|
{
|
|
72779
73037
|
let indexDoc = {};
|
|
@@ -72781,7 +73039,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72781
73039
|
indexDoc["groupCurrencies." + key + ".value"] = -1;
|
|
72782
73040
|
let indexName = "catalogId_1_" + "groupCurrencies." + key + ".value_-1";
|
|
72783
73041
|
groupCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72784
|
-
Debug.log("[
|
|
73042
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + groupCollection.collectionName);
|
|
72785
73043
|
}
|
|
72786
73044
|
}
|
|
72787
73045
|
}
|
|
@@ -72835,12 +73093,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72835
73093
|
{
|
|
72836
73094
|
let indexName = "groupStatistics." + key + ".value_-1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72837
73095
|
groupCollection.dropIndex(indexName);
|
|
72838
|
-
Debug.log("[
|
|
73096
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + groupCollection.collectionName);
|
|
72839
73097
|
}
|
|
72840
73098
|
{
|
|
72841
73099
|
let indexName = "catalogId_1_" + "groupStatistics." + key + ".value_-1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72842
73100
|
groupCollection.dropIndex(indexName);
|
|
72843
|
-
Debug.log("[
|
|
73101
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + groupCollection.collectionName);
|
|
72844
73102
|
}
|
|
72845
73103
|
}
|
|
72846
73104
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
@@ -72851,7 +73109,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72851
73109
|
indexDoc["groupStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72852
73110
|
let indexName = "groupStatistics." + key + ".value_-1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72853
73111
|
groupCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72854
|
-
Debug.log("[
|
|
73112
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + groupCollection.collectionName);
|
|
72855
73113
|
}
|
|
72856
73114
|
{
|
|
72857
73115
|
let indexDoc = {};
|
|
@@ -72860,7 +73118,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72860
73118
|
indexDoc["groupStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72861
73119
|
let indexName = "catalogId_1_" + "groupStatistics." + key + ".value_-1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72862
73120
|
groupCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72863
|
-
Debug.log("[
|
|
73121
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + groupCollection.collectionName);
|
|
72864
73122
|
}
|
|
72865
73123
|
}
|
|
72866
73124
|
}
|
|
@@ -72879,12 +73137,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72879
73137
|
{
|
|
72880
73138
|
let indexName = "groupStatistics." + key + ".value_1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72881
73139
|
groupCollection.dropIndex(indexName);
|
|
72882
|
-
Debug.log("[
|
|
73140
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + groupCollection.collectionName);
|
|
72883
73141
|
}
|
|
72884
73142
|
{
|
|
72885
73143
|
let indexName = "catalogId_1_" + "groupStatistics." + key + ".value_1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72886
73144
|
groupCollection.dropIndex(indexName);
|
|
72887
|
-
Debug.log("[
|
|
73145
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + groupCollection.collectionName);
|
|
72888
73146
|
}
|
|
72889
73147
|
}
|
|
72890
73148
|
for (let i = 0; i < addKeyAscLst.length; i++) {
|
|
@@ -72895,7 +73153,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72895
73153
|
indexDoc["groupStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72896
73154
|
let indexName = "groupStatistics." + key + ".value_1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72897
73155
|
groupCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72898
|
-
Debug.log("[
|
|
73156
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + groupCollection.collectionName);
|
|
72899
73157
|
}
|
|
72900
73158
|
{
|
|
72901
73159
|
let indexDoc = {};
|
|
@@ -72904,7 +73162,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72904
73162
|
indexDoc["groupStatistics." + key + ".tsLastUpdate"] = 1;
|
|
72905
73163
|
let indexName = "catalogId_1_" + "groupStatistics." + key + ".value_1_groupStatistics." + key + ".tsLastUpdate_1";
|
|
72906
73164
|
groupCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72907
|
-
Debug.log("[
|
|
73165
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + groupCollection.collectionName);
|
|
72908
73166
|
}
|
|
72909
73167
|
}
|
|
72910
73168
|
}
|
|
@@ -72969,7 +73227,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72969
73227
|
groupCollection.dropIndex("tags." + key + "_1");
|
|
72970
73228
|
let indexName = "tags." + key + "_1";
|
|
72971
73229
|
groupCollection.dropIndex(indexName);
|
|
72972
|
-
Debug.log("[
|
|
73230
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + groupCollection.collectionName);
|
|
72973
73231
|
}
|
|
72974
73232
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
72975
73233
|
let key = addKeyLst[i];
|
|
@@ -72977,7 +73235,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
72977
73235
|
indexDoc["tags." + key] = 1;
|
|
72978
73236
|
let indexName = "tags." + key + "_1";
|
|
72979
73237
|
groupCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
72980
|
-
Debug.log("[
|
|
73238
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + groupCollection.collectionName);
|
|
72981
73239
|
}
|
|
72982
73240
|
}
|
|
72983
73241
|
if (request.gameSettings.groupSettings.groupItemCatalogSettings != null) {
|
|
@@ -73048,12 +73306,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73048
73306
|
{
|
|
73049
73307
|
let indexName = "itemStatistics." + key + ".value_-1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73050
73308
|
inventoryCollection.dropIndex(indexName);
|
|
73051
|
-
Debug.log("[
|
|
73309
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73052
73310
|
}
|
|
73053
73311
|
{
|
|
73054
73312
|
let indexName = "catalogId_1_" + "itemStatistics." + key + ".value_-1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73055
73313
|
inventoryCollection.dropIndex(indexName);
|
|
73056
|
-
Debug.log("[
|
|
73314
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73057
73315
|
}
|
|
73058
73316
|
}
|
|
73059
73317
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
@@ -73064,7 +73322,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73064
73322
|
indexDoc["itemStatistics." + key + ".tsLastUpdate"] = 1;
|
|
73065
73323
|
let indexName = "itemStatistics." + key + ".value_-1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73066
73324
|
inventoryCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
73067
|
-
Debug.log("[
|
|
73325
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73068
73326
|
}
|
|
73069
73327
|
{
|
|
73070
73328
|
let indexDoc = {};
|
|
@@ -73073,7 +73331,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73073
73331
|
indexDoc["itemStatistics." + key + ".tsLastUpdate"] = 1;
|
|
73074
73332
|
let indexName = "catalogId_1_" + "itemStatistics." + key + ".value_-1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73075
73333
|
inventoryCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
73076
|
-
Debug.log("[
|
|
73334
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73077
73335
|
}
|
|
73078
73336
|
}
|
|
73079
73337
|
}
|
|
@@ -73092,12 +73350,12 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73092
73350
|
{
|
|
73093
73351
|
let indexName = "itemStatistics." + key + ".value_1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73094
73352
|
inventoryCollection.dropIndex(indexName);
|
|
73095
|
-
Debug.log("[
|
|
73353
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73096
73354
|
}
|
|
73097
73355
|
{
|
|
73098
73356
|
let indexName = "catalogId_1_" + "itemStatistics." + key + ".value_1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73099
73357
|
inventoryCollection.dropIndex(indexName);
|
|
73100
|
-
Debug.log("[
|
|
73358
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73101
73359
|
}
|
|
73102
73360
|
}
|
|
73103
73361
|
for (let i = 0; i < addKeyAscLst.length; i++) {
|
|
@@ -73108,7 +73366,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73108
73366
|
indexDoc["itemStatistics." + key + ".tsLastUpdate"] = 1;
|
|
73109
73367
|
let indexName = "itemStatistics." + key + ".value_1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73110
73368
|
inventoryCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
73111
|
-
Debug.log("[
|
|
73369
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73112
73370
|
}
|
|
73113
73371
|
{
|
|
73114
73372
|
let indexDoc = {};
|
|
@@ -73117,7 +73375,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73117
73375
|
indexDoc["itemStatistics." + key + ".tsLastUpdate"] = 1;
|
|
73118
73376
|
let indexName = "catalogId_1_" + "itemStatistics." + key + ".value_1_itemStatistics." + key + ".tsLastUpdate_1";
|
|
73119
73377
|
inventoryCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
73120
|
-
Debug.log("[
|
|
73378
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73121
73379
|
}
|
|
73122
73380
|
}
|
|
73123
73381
|
}
|
|
@@ -73181,7 +73439,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73181
73439
|
let key = removeKeyLst[i];
|
|
73182
73440
|
let indexName = "tags." + key + "_1";
|
|
73183
73441
|
inventoryCollection.dropIndex(indexName);
|
|
73184
|
-
Debug.log("[
|
|
73442
|
+
Debug.log("[GearN] [Database] drop index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73185
73443
|
}
|
|
73186
73444
|
for (let i = 0; i < addKeyLst.length; i++) {
|
|
73187
73445
|
let key = addKeyLst[i];
|
|
@@ -73189,7 +73447,7 @@ class SetGameInformationRequestHandler extends RequestHandler {
|
|
|
73189
73447
|
indexDoc["tags." + key] = 1;
|
|
73190
73448
|
let indexName = "tags." + key + "_1";
|
|
73191
73449
|
inventoryCollection.createIndex(indexDoc, { background: true, sparse: true, name: indexName });
|
|
73192
|
-
Debug.log("[
|
|
73450
|
+
Debug.log("[GearN] [Database] create new index " + indexName + " at " + inventoryCollection.collectionName);
|
|
73193
73451
|
}
|
|
73194
73452
|
}
|
|
73195
73453
|
}
|
|
@@ -73809,7 +74067,7 @@ class CloudScriptService {
|
|
|
73809
74067
|
}
|
|
73810
74068
|
loadCloudScriptWorker(version) {
|
|
73811
74069
|
let filePath = __dirname + "/./GN-startup/cloudScript/" + version + ".js";
|
|
73812
|
-
Debug.log("[
|
|
74070
|
+
Debug.log("[GearN] [CloudScript] run cloudScript " + version);
|
|
73813
74071
|
let cloudScriptWorker = (0,external_child_process_namespaceObject.fork)(filePath, {
|
|
73814
74072
|
env: {
|
|
73815
74073
|
gameId: this.gameId,
|
|
@@ -73875,7 +74133,7 @@ class CloudScriptService {
|
|
|
73875
74133
|
}
|
|
73876
74134
|
});
|
|
73877
74135
|
cloudScriptWorker.on("exit", (code) => {
|
|
73878
|
-
Debug.log("[
|
|
74136
|
+
Debug.log("[GearN] [CloudScript] terminal cloudScript " + version + " with code " + code);
|
|
73879
74137
|
thiz.cloudScriptWorkerDict.delete(version);
|
|
73880
74138
|
});
|
|
73881
74139
|
this.cloudScriptWorkerDict.set(version, cloudScriptWorker);
|
|
@@ -75515,6 +75773,7 @@ class GetSecretInfoInformationRequestHandler extends RequestHandler {
|
|
|
75515
75773
|
operationResponse.setParameter(GNParameterCode.CreatorId, secretInfoItem.getCreatorId());
|
|
75516
75774
|
operationResponse.setParameter(GNParameterCode.Remove, secretInfoItem.getRemove());
|
|
75517
75775
|
operationResponse.setParameter(GNParameterCode.TsExpire, secretInfoItem.getTsExpire());
|
|
75776
|
+
operationResponse.setParameter(GNParameterCode.DisplayName, secretInfoItem.getDisplayName());
|
|
75518
75777
|
let gnPermission = GetSecretInfoInformationRequestHandler.getPermissionHashtable(secretInfoItem.getPermission());
|
|
75519
75778
|
operationResponse.setParameter(GNParameterCode.Permission, gnPermission);
|
|
75520
75779
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.Ok);
|
|
@@ -78541,7 +78800,7 @@ class GetSecretInfoInformationRequestHandler extends RequestHandler {
|
|
|
78541
78800
|
gnPermissionRules.add(GNParameterCode.OtherSelfEnable, permissionRules.otherSelfEnable);
|
|
78542
78801
|
gnPermissionRules.add(GNParameterCode.ServerSelfEnable, permissionRules.serverSelfEnable);
|
|
78543
78802
|
gnPermissionRules.add(GNParameterCode.AdminSelfEnable, permissionRules.adminSelfEnable);
|
|
78544
|
-
gnMasterAdmin.add(GNParameterCode.
|
|
78803
|
+
gnMasterAdmin.add(GNParameterCode.DeleteInDatabase, gnPermissionRules);
|
|
78545
78804
|
}
|
|
78546
78805
|
gnPermission.add(GNParameterCode.MasterAdmin, gnMasterAdmin);
|
|
78547
78806
|
}
|
|
@@ -78705,6 +78964,7 @@ class GetSecretInfoInformationRequestHandler extends RequestHandler {
|
|
|
78705
78964
|
|
|
78706
78965
|
|
|
78707
78966
|
|
|
78967
|
+
|
|
78708
78968
|
class GetSecretInfoListOperationRequest extends OperationRequest {
|
|
78709
78969
|
isValidRequest() {
|
|
78710
78970
|
if (!super.isValidRequest())
|
|
@@ -78737,15 +78997,25 @@ class GetSecretInfoListRequestHandler extends RequestHandler {
|
|
|
78737
78997
|
operationResponse = new OperationResponse(operationRequest.getOperationCode(), operationRequest.getRequestId(), operationRequest.isEncrypted());
|
|
78738
78998
|
operationResponse.setReturnCode(ReturnCode.Ok);
|
|
78739
78999
|
let collection = this.gnServer.getDatabase().systemCollection("MasterAdmin");
|
|
78740
|
-
let results = await collection.find({ type: "secretInfo" }, { secretKey: true });
|
|
78741
|
-
let
|
|
79000
|
+
let results = await collection.find({ type: "secretInfo" }, { secretKey: true, role: true });
|
|
79001
|
+
let gnAdminSecretKeys = new GNArray();
|
|
79002
|
+
let gnServerSecretKeys = new GNArray();
|
|
79003
|
+
let gnPlayerSecretKeys = new GNArray();
|
|
78742
79004
|
while (await results.hasNext()) {
|
|
78743
79005
|
let secretInfoItem = new SecretInfoItem(await results.next(), collection);
|
|
78744
79006
|
let gnSecretInfoItem = new GNHashtable();
|
|
78745
79007
|
gnSecretInfoItem.add(GNParameterCode.SecretKey, secretInfoItem.getSecretKey());
|
|
78746
|
-
|
|
79008
|
+
let role = secretInfoItem.getRole();
|
|
79009
|
+
if (role == SecretRole.Admin)
|
|
79010
|
+
gnAdminSecretKeys.add(gnSecretInfoItem);
|
|
79011
|
+
else if (role == SecretRole.Server)
|
|
79012
|
+
gnServerSecretKeys.add(gnSecretInfoItem);
|
|
79013
|
+
else
|
|
79014
|
+
gnPlayerSecretKeys.add(gnSecretInfoItem);
|
|
78747
79015
|
}
|
|
78748
|
-
operationResponse.setParameter(GNParameterCode.
|
|
79016
|
+
operationResponse.setParameter(GNParameterCode.AdminSecretKeys, gnAdminSecretKeys);
|
|
79017
|
+
operationResponse.setParameter(GNParameterCode.ServerSecretKeys, gnServerSecretKeys);
|
|
79018
|
+
operationResponse.setParameter(GNParameterCode.PlayerSecretKeys, gnPlayerSecretKeys);
|
|
78749
79019
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.Ok);
|
|
78750
79020
|
await this.gnServer.getPostEventCallbackService().onEvent("dashboard_GetSecretInfoList", request, secretInfo, operationRequest, operationResponse);
|
|
78751
79021
|
return operationResponse;
|
|
@@ -78779,6 +79049,7 @@ class SetSecretInfoInformationOperationRequest extends OperationRequest {
|
|
|
78779
79049
|
remove;
|
|
78780
79050
|
tsExpire;
|
|
78781
79051
|
permissionParam;
|
|
79052
|
+
displayName;
|
|
78782
79053
|
isValidRequest() {
|
|
78783
79054
|
if (!super.isValidRequest())
|
|
78784
79055
|
return false;
|
|
@@ -78801,6 +79072,10 @@ SetSecretInfoInformationRequestHandler_decorate([
|
|
|
78801
79072
|
GNHashtableDataMember({ code: GNParameterCode.Permission, isOptional: true }),
|
|
78802
79073
|
SetSecretInfoInformationRequestHandler_metadata("design:type", PermissionParam)
|
|
78803
79074
|
], SetSecretInfoInformationOperationRequest.prototype, "permissionParam", void 0);
|
|
79075
|
+
SetSecretInfoInformationRequestHandler_decorate([
|
|
79076
|
+
StringDataMember({ code: GNParameterCode.DisplayName, isOptional: true }),
|
|
79077
|
+
SetSecretInfoInformationRequestHandler_metadata("design:type", String)
|
|
79078
|
+
], SetSecretInfoInformationOperationRequest.prototype, "displayName", void 0);
|
|
78804
79079
|
class SetSecretInfoInformationRequestHandler extends RequestHandler {
|
|
78805
79080
|
getCode() {
|
|
78806
79081
|
return OperationCode.SetSecretInfoInformation;
|
|
@@ -78821,6 +79096,7 @@ class SetSecretInfoInformationRequestHandler extends RequestHandler {
|
|
|
78821
79096
|
remove: request.remove,
|
|
78822
79097
|
tsExpire: request.tsExpire,
|
|
78823
79098
|
permissionParam: request.permissionParam,
|
|
79099
|
+
displayName: request.displayName,
|
|
78824
79100
|
}, secretInfo, operationRequest);
|
|
78825
79101
|
}
|
|
78826
79102
|
async execute(request, secretInfo, operationRequest) {
|
|
@@ -78843,6 +79119,9 @@ class SetSecretInfoInformationRequestHandler extends RequestHandler {
|
|
|
78843
79119
|
if (request.tsExpire != null) {
|
|
78844
79120
|
secretInfoItem.setTsExpire(request.tsExpire);
|
|
78845
79121
|
}
|
|
79122
|
+
if (request.displayName != null) {
|
|
79123
|
+
secretInfoItem.setDisplayName(request.displayName);
|
|
79124
|
+
}
|
|
78846
79125
|
// let secretRole = <SecretRole>secretInfoItem.getRole();
|
|
78847
79126
|
if (request.permissionParam) {
|
|
78848
79127
|
let permissionAny = secretInfoItem.getPermission();
|
|
@@ -78908,6 +79187,7 @@ class SetSecretInfoInformationRequestHandler extends RequestHandler {
|
|
|
78908
79187
|
.setRole(secretInfoItem.getRole())
|
|
78909
79188
|
.setSecretKey(secretInfoItem.getSecretKey())
|
|
78910
79189
|
.setTsExpire(secretInfoItem.getTsExpire())
|
|
79190
|
+
.setDisplayName(secretInfoItem.getDisplayName())
|
|
78911
79191
|
.build();
|
|
78912
79192
|
this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
78913
79193
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.Ok);
|
|
@@ -79493,7 +79773,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79493
79773
|
let statisticsAggregationMethod = playerStatisticsSettingsItem.statisticsAggregationMethod;
|
|
79494
79774
|
let direction = statisticsAggregationMethod == xStatisticsAggregationMethod.Minimum ? 1 : -1;
|
|
79495
79775
|
let masterPlayerCollection = await this.gnServer.getDatabase().systemCollection("MasterPlayer");
|
|
79496
|
-
Debug.log("[
|
|
79776
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + masterPlayerCollection.collectionName + " starting");
|
|
79497
79777
|
let masterPlayers = await this.gnServer.getDatabase().loadMasterPlayersLeaderboardWithStatisticsAllAsync(key, direction, masterPlayerFindOptions);
|
|
79498
79778
|
let backupData = {
|
|
79499
79779
|
key: key,
|
|
@@ -79539,7 +79819,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79539
79819
|
});
|
|
79540
79820
|
await backupStatisticsLeaderboardCollection.insertOne(backupData);
|
|
79541
79821
|
this.gnServer.getDatabase().insertMasterPlayerStatisticsLogsAsync(logRequests);
|
|
79542
|
-
Debug.log("[
|
|
79822
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + masterPlayerCollection.collectionName + " success");
|
|
79543
79823
|
}
|
|
79544
79824
|
else {
|
|
79545
79825
|
let gameId = request.gameId;
|
|
@@ -79563,7 +79843,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79563
79843
|
let statisticsAggregationMethod = playerStatisticsSettingsItem.statisticsAggregationMethod;
|
|
79564
79844
|
let direction = statisticsAggregationMethod == xStatisticsAggregationMethod.Minimum ? 1 : -1;
|
|
79565
79845
|
let gamePlayerCollection = await this.gnServer.getDatabase().systemGameCollection("GamePlayer", gameId);
|
|
79566
|
-
Debug.log("[
|
|
79846
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + gamePlayerCollection.collectionName + " starting");
|
|
79567
79847
|
let gamePlayers = await this.gnServer.getDatabase().loadGamePlayersLeaderboardWithStatisticsAllAsync(key, gameId, direction, gamePlayerFindOptions);
|
|
79568
79848
|
let backupData = {
|
|
79569
79849
|
key: key,
|
|
@@ -79609,7 +79889,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79609
79889
|
});
|
|
79610
79890
|
await backupStatisticsLeaderboardCollection.insertOne(backupData);
|
|
79611
79891
|
this.gnServer.getDatabase().insertGamePlayerStatisticsLogsAsync(logRequests, gameId);
|
|
79612
|
-
Debug.log("[
|
|
79892
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + gamePlayerCollection.collectionName + " success");
|
|
79613
79893
|
}
|
|
79614
79894
|
else if (type == OwnerType.CharacterPlayer) {
|
|
79615
79895
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("CharacterPlayer.StatisticsBackup", gameId);
|
|
@@ -79631,7 +79911,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79631
79911
|
let statisticsAggregationMethod = playerStatisticsSettingsItem.statisticsAggregationMethod;
|
|
79632
79912
|
let direction = statisticsAggregationMethod == xStatisticsAggregationMethod.Minimum ? 1 : -1;
|
|
79633
79913
|
let characterPlayerCollection = await this.gnServer.getDatabase().systemGameCollection("CharacterPlayer", gameId);
|
|
79634
|
-
Debug.log("[
|
|
79914
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + characterPlayerCollection.collectionName + " starting");
|
|
79635
79915
|
let characterPlayers = await this.gnServer.getDatabase().loadCharacterPlayersLeaderboardWithStatisticsAllAsync(key, request.catalogId, gameId, direction, characterPlayerFindOptions);
|
|
79636
79916
|
let backupData = {
|
|
79637
79917
|
key: key,
|
|
@@ -79677,7 +79957,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79677
79957
|
});
|
|
79678
79958
|
await backupStatisticsLeaderboardCollection.insertOne(backupData);
|
|
79679
79959
|
this.gnServer.getDatabase().insertCharacterPlayerStatisticsLogsAsync(logRequests, gameId);
|
|
79680
|
-
Debug.log("[
|
|
79960
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + characterPlayerCollection.collectionName + " success");
|
|
79681
79961
|
}
|
|
79682
79962
|
else if (type == OwnerType.Group) {
|
|
79683
79963
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("Group.StatisticsBackup", gameId);
|
|
@@ -79699,7 +79979,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79699
79979
|
let statisticsAggregationMethod = groupStatisticsSettingsItem.statisticsAggregationMethod;
|
|
79700
79980
|
let direction = statisticsAggregationMethod == xStatisticsAggregationMethod.Minimum ? 1 : -1;
|
|
79701
79981
|
let groupCollection = await this.gnServer.getDatabase().systemGameCollection("Group", gameId);
|
|
79702
|
-
Debug.log("[
|
|
79982
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + groupCollection.collectionName + " starting");
|
|
79703
79983
|
let groups = await this.gnServer.getDatabase().loadGroupsLeaderboardWithStatisticsAllAsync(key, request.catalogId, gameId, direction, groupFindOptions);
|
|
79704
79984
|
let backupData = {
|
|
79705
79985
|
key: key,
|
|
@@ -79745,7 +80025,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79745
80025
|
});
|
|
79746
80026
|
await backupStatisticsLeaderboardCollection.insertOne(backupData);
|
|
79747
80027
|
this.gnServer.getDatabase().insertGroupStatisticsLogsAsync(logRequests, gameId);
|
|
79748
|
-
Debug.log("[
|
|
80028
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + groupCollection.collectionName + " success");
|
|
79749
80029
|
}
|
|
79750
80030
|
else if (type == OwnerType.Inventory) {
|
|
79751
80031
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("Inventory.StatisticsBackup", gameId);
|
|
@@ -79762,7 +80042,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79762
80042
|
let statisticsAggregationMethod = inventoryStatisticsSettingsItem.statisticsAggregationMethod;
|
|
79763
80043
|
let direction = statisticsAggregationMethod == xStatisticsAggregationMethod.Minimum ? 1 : -1;
|
|
79764
80044
|
let inventoryCollection = await this.gnServer.getDatabase().systemGameCollection("Inventory", gameId);
|
|
79765
|
-
Debug.log("[
|
|
80045
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + inventoryCollection.collectionName + " starting");
|
|
79766
80046
|
let inventories = await this.gnServer.getDatabase().loadInventoriesLeaderboardWithStatisticsAllAsync(key, request.catalogId, gameId, direction, inventoryFindOptions);
|
|
79767
80047
|
let backupData = {
|
|
79768
80048
|
key: key,
|
|
@@ -79808,7 +80088,7 @@ class ResetStatisticsLeaderboardRequestHandler extends RequestHandler {
|
|
|
79808
80088
|
});
|
|
79809
80089
|
await backupStatisticsLeaderboardCollection.insertOne(backupData);
|
|
79810
80090
|
this.gnServer.getDatabase().insertInventoryStatisticsLogsAsync(logRequests, gameId);
|
|
79811
|
-
Debug.log("[
|
|
80091
|
+
Debug.log("[GearN] ResetStatisticsLeaderboard for key " + key + " at " + inventoryCollection.collectionName + " success");
|
|
79812
80092
|
}
|
|
79813
80093
|
else {
|
|
79814
80094
|
operationResponse.setParameter(ParameterCode.ErrorCode, GNErrorCode.OwnerTypeNotSupport);
|
|
@@ -80073,7 +80353,7 @@ class GetServerGameDataRequestHandler extends RequestHandler {
|
|
|
80073
80353
|
}
|
|
80074
80354
|
if (requestParams.groupCount) {
|
|
80075
80355
|
let groupCollection = this.gnServer.getDatabase().systemGameCollection("Group", gameId);
|
|
80076
|
-
operationResponse.setParameter(GNParameterCode.
|
|
80356
|
+
operationResponse.setParameter(GNParameterCode.GroupCount, await groupCollection.countDocuments());
|
|
80077
80357
|
}
|
|
80078
80358
|
if (requestParams.country) {
|
|
80079
80359
|
// [ { countryCode: "", regions: [{regionCode: "", "lat": 0, "lon": 0, ccu: 0}]} ]
|
|
@@ -84200,8 +84480,7 @@ class CountryIPDetailService {
|
|
|
84200
84480
|
}
|
|
84201
84481
|
|
|
84202
84482
|
;// ./src/GNServer.ts
|
|
84203
|
-
const GN_VERSION = "2.
|
|
84204
|
-
|
|
84483
|
+
const GN_VERSION = "2.6";
|
|
84205
84484
|
|
|
84206
84485
|
|
|
84207
84486
|
|
|
@@ -84586,7 +84865,6 @@ class GNServer {
|
|
|
84586
84865
|
googlePlayGameService;
|
|
84587
84866
|
gameCenterService;
|
|
84588
84867
|
timerService;
|
|
84589
|
-
lockService;
|
|
84590
84868
|
requestConverterService;
|
|
84591
84869
|
analyticsService;
|
|
84592
84870
|
postEventCallbackService;
|
|
@@ -84612,7 +84890,6 @@ class GNServer {
|
|
|
84612
84890
|
this.googlePlayGameService = new GooglePlayGameService();
|
|
84613
84891
|
this.gameCenterService = new GameCenterService();
|
|
84614
84892
|
this.timerService = new TimerService();
|
|
84615
|
-
this.lockService = new LockService();
|
|
84616
84893
|
this.requestConverterService = new RequestConverterService();
|
|
84617
84894
|
this.pushNotificationService = new PushNotificationService();
|
|
84618
84895
|
this.emailService = new EmailService();
|
|
@@ -85132,9 +85409,6 @@ class GNServer {
|
|
|
85132
85409
|
getTimerService() {
|
|
85133
85410
|
return this.timerService;
|
|
85134
85411
|
}
|
|
85135
|
-
getLockService() {
|
|
85136
|
-
return this.lockService;
|
|
85137
|
-
}
|
|
85138
85412
|
getAnalyticsService() {
|
|
85139
85413
|
return this.analyticsService;
|
|
85140
85414
|
}
|
|
@@ -85279,7 +85553,7 @@ class GNServer {
|
|
|
85279
85553
|
}
|
|
85280
85554
|
async requestMatchServerDetail(gameId, matchmakingTicketCanMatch) {
|
|
85281
85555
|
let matchId = matchmakingTicketCanMatch.matchId;
|
|
85282
|
-
Debug.logInfo("[
|
|
85556
|
+
Debug.logInfo("[GearN] [Matchmaking] request match server detail for " + matchId + " to set serverDetail on gameId " + gameId);
|
|
85283
85557
|
let thiz = this;
|
|
85284
85558
|
let timeout = setTimeout(async () => {
|
|
85285
85559
|
thiz.setMatchServerDetailFailed(gameId, matchId, matchmakingTicketCanMatch.ticketIds, "Timeout");
|
|
@@ -85307,7 +85581,7 @@ class GNServer {
|
|
|
85307
85581
|
clearTimeout(timeout);
|
|
85308
85582
|
this.waitingServerDetailDict.delete(matchId);
|
|
85309
85583
|
}
|
|
85310
|
-
Debug.logInfo("[
|
|
85584
|
+
Debug.logInfo("[GearN] [Matchmaking] request match server detail for " + matchId + " failed on " + gameId + ", with reason " + reason);
|
|
85311
85585
|
let matchCollection = this.getDatabase().systemGameCollection("Match", gameId);
|
|
85312
85586
|
matchCollection.updateOne({ matchId: matchId }, { $set: {} });
|
|
85313
85587
|
let matchmakingTicketCollection = this.getDatabase().runtimeGameCollection("MatchmakingTicket", gameId);
|
|
@@ -85453,18 +85727,18 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85453
85727
|
fullLogPath = process.cwd() + "/" + configFullLogPath;
|
|
85454
85728
|
}
|
|
85455
85729
|
}
|
|
85456
|
-
console.log("[
|
|
85730
|
+
console.log("[GearN] FullLogPath at: " + fullLogPath);
|
|
85457
85731
|
Debug.init({
|
|
85458
85732
|
isLogToConsoleEnable: this.getLogSettings().getLogToConsoleEnable(),
|
|
85459
85733
|
isLogToFileEnable: this.getLogSettings().getLogToFileEnable(),
|
|
85460
85734
|
logPath: fullLogPath,
|
|
85461
85735
|
});
|
|
85462
85736
|
Debug.run();
|
|
85463
|
-
Debug.log("[
|
|
85464
|
-
const port = this.
|
|
85465
|
-
Debug.log("[
|
|
85466
|
-
const socketPort = this.
|
|
85467
|
-
Debug.log("[
|
|
85737
|
+
Debug.log("[GearN XmobiTea] -->>==>>>--<<<==<<-- [GN XmobiTea]");
|
|
85738
|
+
const port = this.getApplicationSettings().getPort();
|
|
85739
|
+
Debug.log("[GearN] Try run server on the port " + port);
|
|
85740
|
+
const socketPort = this.getApplicationSettings().getSocketPort();
|
|
85741
|
+
Debug.log("[GearN] Try run socket server on the port " + socketPort);
|
|
85468
85742
|
const app = external_express_default()();
|
|
85469
85743
|
const server = this.getServer(app, this.getApplicationSettings());
|
|
85470
85744
|
const useOtherSocketServer = this.getApplicationSettings().getPort() != this.getApplicationSettings().getSocketPort() && this.getSocketAppSettings().getEnable();
|
|
@@ -85515,9 +85789,9 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85515
85789
|
this.gnServer.setHttpApp(this.httpApp);
|
|
85516
85790
|
this.gnServer.setSocketApp(this.socketApp);
|
|
85517
85791
|
this.gnServer.getDatabase().run(() => {
|
|
85518
|
-
Debug.log("[
|
|
85792
|
+
Debug.log("[GearN] Database run success");
|
|
85519
85793
|
}, (err) => {
|
|
85520
|
-
Debug.logError("[
|
|
85794
|
+
Debug.logError("[GearN] Database connect error " + err);
|
|
85521
85795
|
});
|
|
85522
85796
|
let authInfoCollection = this.gnServer.getDatabase().systemCollection("AuthInfo");
|
|
85523
85797
|
this.apiMiddleware.setAuthInfoCollection(authInfoCollection);
|
|
@@ -85539,7 +85813,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85539
85813
|
this.socketApp.setEmitter(adapterEventCollection);
|
|
85540
85814
|
// if (this.mailSettings.getEnable()) {
|
|
85541
85815
|
// this.gnServer.getMail().run(() => {
|
|
85542
|
-
// Debug.log("[
|
|
85816
|
+
// Debug.log("[GearN] Send Grid Mail run success");
|
|
85543
85817
|
// });
|
|
85544
85818
|
// }
|
|
85545
85819
|
let uploadFileInfoCollection = this.gnServer.getDatabase().systemCollection("UploadFileInfo");
|
|
@@ -85549,7 +85823,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85549
85823
|
this.uploadFileMiddleware.setUploadFileInfoCollection(uploadFileInfoCollection);
|
|
85550
85824
|
this.gnServer.init();
|
|
85551
85825
|
this.gnServer.run(() => {
|
|
85552
|
-
Debug.log("[
|
|
85826
|
+
Debug.log("[GearN] Game Application run success");
|
|
85553
85827
|
});
|
|
85554
85828
|
let secretInfoResults = await secretInfoCollection.find({ isDefault: true }).toArray();
|
|
85555
85829
|
let secretInfo = secretInfoResults.at(0);
|
|
@@ -85565,7 +85839,6 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85565
85839
|
reconnectDelay: 5000,
|
|
85566
85840
|
pingInterval: 20000,
|
|
85567
85841
|
pingTimeout: 20000,
|
|
85568
|
-
gnServerSourcePath: "",
|
|
85569
85842
|
logType: gn_typescript_client_namespaceObject.LogType.Off,
|
|
85570
85843
|
adminSecretKey: secretKey,
|
|
85571
85844
|
serverSecretKey: secretKey,
|
|
@@ -85589,12 +85862,12 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85589
85862
|
this.gnServer.getPostEventCallbackService().setEventCallbackCollection(postEventCallbackCollection);
|
|
85590
85863
|
this.gnServer.getPostEventCallbackService().setCloudScriptService(this.gnServer.getEventCallbackCloudScriptService());
|
|
85591
85864
|
this.gnServer.getPreEventCallbackService().setCloudScriptService(this.gnServer.getEventCallbackCloudScriptService());
|
|
85592
|
-
server.listen(port, () => {
|
|
85593
|
-
Debug.log("[
|
|
85594
|
-
Debug.log("[
|
|
85865
|
+
server.listen(port, "0.0.0.0", () => {
|
|
85866
|
+
Debug.log("[GearN XmobiTea] -->>==>>>--<<<==<<-- [GearN XmobiTea]");
|
|
85867
|
+
Debug.log("[GearN] Server Application running on 0.0.0.0 the port " + port + " with sessionId: " + this.sessionId);
|
|
85595
85868
|
if (useOtherSocketServer) {
|
|
85596
|
-
socketServer.listen(socketPort, () => {
|
|
85597
|
-
Debug.log("[
|
|
85869
|
+
socketServer.listen(socketPort, "0.0.0.0", () => {
|
|
85870
|
+
Debug.log("[GearN] Socket Server running on 0.0.0.0 the port " + socketPort);
|
|
85598
85871
|
});
|
|
85599
85872
|
}
|
|
85600
85873
|
if (onRunSuccess != null)
|
|
@@ -85645,132 +85918,120 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85645
85918
|
}
|
|
85646
85919
|
let userId = StringUtility.generateRandomString(10, 0);
|
|
85647
85920
|
{
|
|
85648
|
-
let permission = GrantSecretInfoRequestHandler.generateRecommendAdminPermission();
|
|
85649
|
-
{
|
|
85650
|
-
permission.masterAdmin.setMasterGameSettings = {
|
|
85651
|
-
selfEnable: false,
|
|
85652
|
-
adminSelfEnable: false,
|
|
85653
|
-
otherSelfEnable: false,
|
|
85654
|
-
serverSelfEnable: false,
|
|
85655
|
-
};
|
|
85656
|
-
permission.masterAdmin.grantAdminAccount = {
|
|
85657
|
-
selfEnable: false,
|
|
85658
|
-
adminSelfEnable: false,
|
|
85659
|
-
otherSelfEnable: false,
|
|
85660
|
-
serverSelfEnable: false,
|
|
85661
|
-
};
|
|
85662
|
-
permission.masterAdmin.removeAdminAccount = {
|
|
85663
|
-
selfEnable: false,
|
|
85664
|
-
adminSelfEnable: false,
|
|
85665
|
-
otherSelfEnable: false,
|
|
85666
|
-
serverSelfEnable: false,
|
|
85667
|
-
};
|
|
85668
|
-
permission.masterAdmin.setPasswordAdminAccount = {
|
|
85669
|
-
selfEnable: false,
|
|
85670
|
-
adminSelfEnable: false,
|
|
85671
|
-
otherSelfEnable: false,
|
|
85672
|
-
serverSelfEnable: false,
|
|
85673
|
-
};
|
|
85674
|
-
permission.masterAdmin.setSecretKeyAdminAccount = {
|
|
85675
|
-
selfEnable: false,
|
|
85676
|
-
adminSelfEnable: false,
|
|
85677
|
-
otherSelfEnable: false,
|
|
85678
|
-
serverSelfEnable: false,
|
|
85679
|
-
};
|
|
85680
|
-
permission.masterAdmin.setGameInformation = {
|
|
85681
|
-
selfEnable: false,
|
|
85682
|
-
adminSelfEnable: false,
|
|
85683
|
-
otherSelfEnable: false,
|
|
85684
|
-
serverSelfEnable: false,
|
|
85685
|
-
};
|
|
85686
|
-
permission.masterAdmin.grantGame = {
|
|
85687
|
-
selfEnable: false,
|
|
85688
|
-
adminSelfEnable: false,
|
|
85689
|
-
otherSelfEnable: false,
|
|
85690
|
-
serverSelfEnable: false,
|
|
85691
|
-
};
|
|
85692
|
-
permission.masterAdmin.changePasswordAdminAccount = {
|
|
85693
|
-
selfEnable: false,
|
|
85694
|
-
adminSelfEnable: false,
|
|
85695
|
-
otherSelfEnable: false,
|
|
85696
|
-
serverSelfEnable: false,
|
|
85697
|
-
};
|
|
85698
|
-
permission.masterAdmin.getAdminAccountList = {
|
|
85699
|
-
selfEnable: false,
|
|
85700
|
-
adminSelfEnable: false,
|
|
85701
|
-
otherSelfEnable: false,
|
|
85702
|
-
serverSelfEnable: false,
|
|
85703
|
-
};
|
|
85704
|
-
permission.masterAdmin.getGameInformation = {
|
|
85705
|
-
selfEnable: false,
|
|
85706
|
-
adminSelfEnable: false,
|
|
85707
|
-
otherSelfEnable: false,
|
|
85708
|
-
serverSelfEnable: false,
|
|
85709
|
-
};
|
|
85710
|
-
permission.masterAdmin.getGameList = {
|
|
85711
|
-
selfEnable: false,
|
|
85712
|
-
adminSelfEnable: false,
|
|
85713
|
-
otherSelfEnable: false,
|
|
85714
|
-
serverSelfEnable: false,
|
|
85715
|
-
};
|
|
85716
|
-
permission.masterAdmin.getMasterGameSettings = {
|
|
85717
|
-
selfEnable: false,
|
|
85718
|
-
adminSelfEnable: false,
|
|
85719
|
-
otherSelfEnable: false,
|
|
85720
|
-
serverSelfEnable: false,
|
|
85721
|
-
};
|
|
85722
|
-
permission.masterAdmin.getSecretInfoInformation = {
|
|
85723
|
-
selfEnable: false,
|
|
85724
|
-
adminSelfEnable: false,
|
|
85725
|
-
otherSelfEnable: false,
|
|
85726
|
-
serverSelfEnable: false,
|
|
85727
|
-
};
|
|
85728
|
-
permission.masterAdmin.getSecretInfoList = {
|
|
85729
|
-
selfEnable: false,
|
|
85730
|
-
adminSelfEnable: false,
|
|
85731
|
-
otherSelfEnable: false,
|
|
85732
|
-
serverSelfEnable: false,
|
|
85733
|
-
};
|
|
85734
|
-
permission.masterAdmin.grantSecretInfo = {
|
|
85735
|
-
selfEnable: false,
|
|
85736
|
-
adminSelfEnable: false,
|
|
85737
|
-
otherSelfEnable: false,
|
|
85738
|
-
serverSelfEnable: false,
|
|
85739
|
-
};
|
|
85740
|
-
permission.masterAdmin.setSecretInfoInformation = {
|
|
85741
|
-
selfEnable: false,
|
|
85742
|
-
adminSelfEnable: false,
|
|
85743
|
-
otherSelfEnable: false,
|
|
85744
|
-
serverSelfEnable: false,
|
|
85745
|
-
};
|
|
85746
|
-
permission.masterAdmin.getEventCallbackCloudScript = {
|
|
85747
|
-
selfEnable: false,
|
|
85748
|
-
adminSelfEnable: false,
|
|
85749
|
-
otherSelfEnable: false,
|
|
85750
|
-
serverSelfEnable: false,
|
|
85751
|
-
};
|
|
85752
|
-
permission.masterAdmin.setEventCallbackCloudScript = {
|
|
85753
|
-
selfEnable: false,
|
|
85754
|
-
adminSelfEnable: false,
|
|
85755
|
-
otherSelfEnable: false,
|
|
85756
|
-
serverSelfEnable: false,
|
|
85757
|
-
};
|
|
85758
|
-
}
|
|
85759
|
-
{
|
|
85760
|
-
let newSecretInfo = SecretInfo.Builder()
|
|
85761
|
-
.setGameId("")
|
|
85762
|
-
.setIsRemove(false)
|
|
85763
|
-
.setPermission(permission)
|
|
85764
|
-
.setRole(SecretRole.Admin)
|
|
85765
|
-
.setSecretKey(StringUtility.generateRandomString(20, 0))
|
|
85766
|
-
.setTsExpire(-1)
|
|
85767
|
-
.setIsDefault(true)
|
|
85768
|
-
.build();
|
|
85769
|
-
await this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
85770
|
-
}
|
|
85771
85921
|
let currentMilliseconds = xDatetime.getCurrentMilliseconds();
|
|
85772
85922
|
// create secretInfo for admin account
|
|
85773
85923
|
{
|
|
85924
|
+
let permission = GrantSecretInfoRequestHandler.generateRecommendAdminPermission();
|
|
85925
|
+
{
|
|
85926
|
+
permission.masterAdmin.setMasterGameSettings = {
|
|
85927
|
+
selfEnable: false,
|
|
85928
|
+
adminSelfEnable: false,
|
|
85929
|
+
otherSelfEnable: false,
|
|
85930
|
+
serverSelfEnable: false,
|
|
85931
|
+
};
|
|
85932
|
+
permission.masterAdmin.grantAdminAccount = {
|
|
85933
|
+
selfEnable: false,
|
|
85934
|
+
adminSelfEnable: false,
|
|
85935
|
+
otherSelfEnable: false,
|
|
85936
|
+
serverSelfEnable: false,
|
|
85937
|
+
};
|
|
85938
|
+
permission.masterAdmin.removeAdminAccount = {
|
|
85939
|
+
selfEnable: false,
|
|
85940
|
+
adminSelfEnable: false,
|
|
85941
|
+
otherSelfEnable: false,
|
|
85942
|
+
serverSelfEnable: false,
|
|
85943
|
+
};
|
|
85944
|
+
permission.masterAdmin.setPasswordAdminAccount = {
|
|
85945
|
+
selfEnable: false,
|
|
85946
|
+
adminSelfEnable: false,
|
|
85947
|
+
otherSelfEnable: false,
|
|
85948
|
+
serverSelfEnable: false,
|
|
85949
|
+
};
|
|
85950
|
+
permission.masterAdmin.setSecretKeyAdminAccount = {
|
|
85951
|
+
selfEnable: false,
|
|
85952
|
+
adminSelfEnable: false,
|
|
85953
|
+
otherSelfEnable: false,
|
|
85954
|
+
serverSelfEnable: false,
|
|
85955
|
+
};
|
|
85956
|
+
permission.masterAdmin.setGameInformation = {
|
|
85957
|
+
selfEnable: false,
|
|
85958
|
+
adminSelfEnable: false,
|
|
85959
|
+
otherSelfEnable: false,
|
|
85960
|
+
serverSelfEnable: false,
|
|
85961
|
+
};
|
|
85962
|
+
permission.masterAdmin.grantGame = {
|
|
85963
|
+
selfEnable: false,
|
|
85964
|
+
adminSelfEnable: false,
|
|
85965
|
+
otherSelfEnable: false,
|
|
85966
|
+
serverSelfEnable: false,
|
|
85967
|
+
};
|
|
85968
|
+
permission.masterAdmin.changePasswordAdminAccount = {
|
|
85969
|
+
selfEnable: false,
|
|
85970
|
+
adminSelfEnable: false,
|
|
85971
|
+
otherSelfEnable: false,
|
|
85972
|
+
serverSelfEnable: false,
|
|
85973
|
+
};
|
|
85974
|
+
permission.masterAdmin.getAdminAccountList = {
|
|
85975
|
+
selfEnable: false,
|
|
85976
|
+
adminSelfEnable: false,
|
|
85977
|
+
otherSelfEnable: false,
|
|
85978
|
+
serverSelfEnable: false,
|
|
85979
|
+
};
|
|
85980
|
+
permission.masterAdmin.getGameInformation = {
|
|
85981
|
+
selfEnable: false,
|
|
85982
|
+
adminSelfEnable: false,
|
|
85983
|
+
otherSelfEnable: false,
|
|
85984
|
+
serverSelfEnable: false,
|
|
85985
|
+
};
|
|
85986
|
+
permission.masterAdmin.getGameList = {
|
|
85987
|
+
selfEnable: false,
|
|
85988
|
+
adminSelfEnable: false,
|
|
85989
|
+
otherSelfEnable: false,
|
|
85990
|
+
serverSelfEnable: false,
|
|
85991
|
+
};
|
|
85992
|
+
permission.masterAdmin.getMasterGameSettings = {
|
|
85993
|
+
selfEnable: false,
|
|
85994
|
+
adminSelfEnable: false,
|
|
85995
|
+
otherSelfEnable: false,
|
|
85996
|
+
serverSelfEnable: false,
|
|
85997
|
+
};
|
|
85998
|
+
permission.masterAdmin.getSecretInfoInformation = {
|
|
85999
|
+
selfEnable: false,
|
|
86000
|
+
adminSelfEnable: false,
|
|
86001
|
+
otherSelfEnable: false,
|
|
86002
|
+
serverSelfEnable: false,
|
|
86003
|
+
};
|
|
86004
|
+
permission.masterAdmin.getSecretInfoList = {
|
|
86005
|
+
selfEnable: false,
|
|
86006
|
+
adminSelfEnable: false,
|
|
86007
|
+
otherSelfEnable: false,
|
|
86008
|
+
serverSelfEnable: false,
|
|
86009
|
+
};
|
|
86010
|
+
permission.masterAdmin.grantSecretInfo = {
|
|
86011
|
+
selfEnable: false,
|
|
86012
|
+
adminSelfEnable: false,
|
|
86013
|
+
otherSelfEnable: false,
|
|
86014
|
+
serverSelfEnable: false,
|
|
86015
|
+
};
|
|
86016
|
+
permission.masterAdmin.setSecretInfoInformation = {
|
|
86017
|
+
selfEnable: false,
|
|
86018
|
+
adminSelfEnable: false,
|
|
86019
|
+
otherSelfEnable: false,
|
|
86020
|
+
serverSelfEnable: false,
|
|
86021
|
+
};
|
|
86022
|
+
permission.masterAdmin.getEventCallbackCloudScript = {
|
|
86023
|
+
selfEnable: false,
|
|
86024
|
+
adminSelfEnable: false,
|
|
86025
|
+
otherSelfEnable: false,
|
|
86026
|
+
serverSelfEnable: false,
|
|
86027
|
+
};
|
|
86028
|
+
permission.masterAdmin.setEventCallbackCloudScript = {
|
|
86029
|
+
selfEnable: false,
|
|
86030
|
+
adminSelfEnable: false,
|
|
86031
|
+
otherSelfEnable: false,
|
|
86032
|
+
serverSelfEnable: false,
|
|
86033
|
+
};
|
|
86034
|
+
}
|
|
85774
86035
|
let adminPermission = structuredClone(permission);
|
|
85775
86036
|
// adminPermission.masterAdmin.grantAdminAccount.selfEnable = false;
|
|
85776
86037
|
// adminPermission.masterAdmin.removeAdminAccount.selfEnable = false;
|
|
@@ -85786,6 +86047,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85786
86047
|
creatorId: userId,
|
|
85787
86048
|
remove: false,
|
|
85788
86049
|
tsExpire: -1,
|
|
86050
|
+
displayName: "default recommend sub admin secret info",
|
|
85789
86051
|
tsCreate: currentMilliseconds,
|
|
85790
86052
|
};
|
|
85791
86053
|
await masterAdminCollection.insertOne(result);
|
|
@@ -85797,6 +86059,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85797
86059
|
.setRole(secretInfoItem.getRole())
|
|
85798
86060
|
.setSecretKey(secretInfoItem.getSecretKey())
|
|
85799
86061
|
.setTsExpire(secretInfoItem.getTsExpire())
|
|
86062
|
+
.setDisplayName(secretInfoItem.getDisplayName())
|
|
85800
86063
|
.build();
|
|
85801
86064
|
this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
85802
86065
|
}
|
|
@@ -85812,6 +86075,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85812
86075
|
creatorId: userId,
|
|
85813
86076
|
remove: false,
|
|
85814
86077
|
tsExpire: -1,
|
|
86078
|
+
displayName: "default recommend player secret info for gameId dev",
|
|
85815
86079
|
tsCreate: currentMilliseconds,
|
|
85816
86080
|
};
|
|
85817
86081
|
await masterAdminCollection.insertOne(result);
|
|
@@ -85823,6 +86087,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85823
86087
|
.setRole(secretInfoItem.getRole())
|
|
85824
86088
|
.setSecretKey(secretInfoItem.getSecretKey())
|
|
85825
86089
|
.setTsExpire(secretInfoItem.getTsExpire())
|
|
86090
|
+
.setDisplayName(secretInfoItem.getDisplayName())
|
|
85826
86091
|
.build();
|
|
85827
86092
|
this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
85828
86093
|
}
|
|
@@ -85836,6 +86101,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85836
86101
|
creatorId: userId,
|
|
85837
86102
|
remove: false,
|
|
85838
86103
|
tsExpire: -1,
|
|
86104
|
+
displayName: "default recommend player secret info for gameId main",
|
|
85839
86105
|
tsCreate: currentMilliseconds,
|
|
85840
86106
|
};
|
|
85841
86107
|
await masterAdminCollection.insertOne(result);
|
|
@@ -85847,6 +86113,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85847
86113
|
.setRole(secretInfoItem.getRole())
|
|
85848
86114
|
.setSecretKey(secretInfoItem.getSecretKey())
|
|
85849
86115
|
.setTsExpire(secretInfoItem.getTsExpire())
|
|
86116
|
+
.setDisplayName(secretInfoItem.getDisplayName())
|
|
85850
86117
|
.build();
|
|
85851
86118
|
this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
85852
86119
|
}
|
|
@@ -85856,7 +86123,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85856
86123
|
// create secretInfo for admin account
|
|
85857
86124
|
{
|
|
85858
86125
|
let permission = GrantSecretInfoRequestHandler.generateDefaultPermission(true, true, true, true);
|
|
85859
|
-
let secretKey =
|
|
86126
|
+
let secretKey = StringUtility.generateRandomString(20, 0);
|
|
85860
86127
|
let newSecretInfo = SecretInfo.Builder()
|
|
85861
86128
|
.setGameId("")
|
|
85862
86129
|
.setIsRemove(false)
|
|
@@ -85864,6 +86131,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85864
86131
|
.setRole(SecretRole.Admin)
|
|
85865
86132
|
.setSecretKey(secretKey)
|
|
85866
86133
|
.setTsExpire(-1)
|
|
86134
|
+
.setDisplayName("default root admin secret info")
|
|
85867
86135
|
.setIsDefault(true)
|
|
85868
86136
|
.setIsOnlyMasterAdmin(true)
|
|
85869
86137
|
.build();
|
|
@@ -87285,8 +87553,6 @@ group_model_GroupMemberParam_decorate([
|
|
|
87285
87553
|
|
|
87286
87554
|
|
|
87287
87555
|
|
|
87288
|
-
|
|
87289
|
-
|
|
87290
87556
|
|
|
87291
87557
|
|
|
87292
87558
|
|