@xmobitea/gn-server 2.6.1 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +65 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -85708,8 +85708,6 @@ class GNServer {
|
|
|
85708
85708
|
|
|
85709
85709
|
;// external "@xmobitea/gn-typescript-client"
|
|
85710
85710
|
const gn_typescript_client_namespaceObject = require("@xmobitea/gn-typescript-client");
|
|
85711
|
-
;// external "@xmobitea/gn-typescript-client/dist/runtime/config/GNServerSettings"
|
|
85712
|
-
const GNServerSettings_namespaceObject = require("@xmobitea/gn-typescript-client/dist/runtime/config/GNServerSettings");
|
|
85713
85711
|
;// ./src/GN-startup/ServerApplication.ts
|
|
85714
85712
|
|
|
85715
85713
|
|
|
@@ -85733,7 +85731,6 @@ const GNServerSettings_namespaceObject = require("@xmobitea/gn-typescript-client
|
|
|
85733
85731
|
|
|
85734
85732
|
|
|
85735
85733
|
|
|
85736
|
-
|
|
85737
85734
|
|
|
85738
85735
|
|
|
85739
85736
|
class ServerApplication_BuilderBase {
|
|
@@ -85949,7 +85946,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
85949
85946
|
useSsl: false,
|
|
85950
85947
|
useSocket: false,
|
|
85951
85948
|
useHttp: true,
|
|
85952
|
-
messageType:
|
|
85949
|
+
messageType: gn_typescript_client_namespaceObject.MessageType.MsgPack,
|
|
85953
85950
|
sendRate: 2000,
|
|
85954
85951
|
reconnectDelay: 5000,
|
|
85955
85952
|
pingInterval: 20000,
|
|
@@ -86020,7 +86017,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86020
86017
|
}
|
|
86021
86018
|
}
|
|
86022
86019
|
async setupNewGNDatabase() {
|
|
86023
|
-
Debug.log("The GN Server is installing some information
|
|
86020
|
+
Debug.log("The GN Server is installing some new information on Database...");
|
|
86024
86021
|
//let currentMilliseconds = xDatetime.getCurrentMilliseconds();
|
|
86025
86022
|
let masterAdminCollection = this.gnServer.getDatabase().systemCollection("MasterAdmin");
|
|
86026
86023
|
{
|
|
@@ -86031,6 +86028,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86031
86028
|
// create version
|
|
86032
86029
|
await masterAdminCollection.insertOne({ type: "version", gnVersion: GNServer.getServerVersion() });
|
|
86033
86030
|
}
|
|
86031
|
+
Debug.log("create some indexes on System.MasterAdmin success.");
|
|
86034
86032
|
let userId = StringUtility.generateRandomString(10, 0);
|
|
86035
86033
|
{
|
|
86036
86034
|
let currentMilliseconds = xDatetime.getCurrentMilliseconds();
|
|
@@ -86177,6 +86175,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86177
86175
|
.setDisplayName(secretInfoItem.getDisplayName())
|
|
86178
86176
|
.build();
|
|
86179
86177
|
this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
86178
|
+
Debug.log("create SecretInfo Permission for sub admin success.");
|
|
86180
86179
|
}
|
|
86181
86180
|
{
|
|
86182
86181
|
let permission = GrantSecretInfoRequestHandler.generateRecommendPlayerPermission();
|
|
@@ -86205,6 +86204,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86205
86204
|
.setDisplayName(secretInfoItem.getDisplayName())
|
|
86206
86205
|
.build();
|
|
86207
86206
|
this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
86207
|
+
Debug.log("create SecretInfo Permission for player gameId dev success.");
|
|
86208
86208
|
}
|
|
86209
86209
|
{
|
|
86210
86210
|
let result = {
|
|
@@ -86231,6 +86231,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86231
86231
|
.setDisplayName(secretInfoItem.getDisplayName())
|
|
86232
86232
|
.build();
|
|
86233
86233
|
this.gnServer.getApiMiddleware().updateSecretInfo(newSecretInfo);
|
|
86234
|
+
Debug.log("create SecretInfo Permission for player gameId main success.");
|
|
86234
86235
|
}
|
|
86235
86236
|
}
|
|
86236
86237
|
let username = process.env["GEARN_INIT_ROOT_USERNAME"] ?? "gearnadmin";
|
|
@@ -86260,7 +86261,9 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86260
86261
|
secretKey: secretKey,
|
|
86261
86262
|
};
|
|
86262
86263
|
await masterAdminCollection.insertOne(result);
|
|
86264
|
+
Debug.log("create SecretInfo Permission for root admin success.");
|
|
86263
86265
|
}
|
|
86266
|
+
Debug.log("creating some indexes on System.MasterPlayer...");
|
|
86264
86267
|
let masterPlayerCollection = this.gnServer.getDatabase().systemCollection("MasterPlayer");
|
|
86265
86268
|
await masterPlayerCollection.createIndex({ userId: 1 }, { background: true, name: "userId_1" });
|
|
86266
86269
|
await masterPlayerCollection.createIndex({ segments: 1 }, { background: true, name: "segments_1" });
|
|
@@ -86284,7 +86287,8 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86284
86287
|
await masterPlayerCollection.createIndex({ "external.apple.appleId": 1 }, { background: true, sparse: true, name: "external.apple.appleId_1" });
|
|
86285
86288
|
await masterPlayerCollection.createIndex({ "external.google.googleId": 1 }, { background: true, sparse: true, name: "external.google.googleId_1" });
|
|
86286
86289
|
await masterPlayerCollection.createIndex({ "external.facebook.facebookId": 1 }, { background: true, sparse: true, name: "external.facebook.facebookId_1" });
|
|
86287
|
-
Debug.log("
|
|
86290
|
+
Debug.log("create some indexes on System.MasterPlayer success.");
|
|
86291
|
+
Debug.log("[Security] Please login via account with username '" + username + "' and password is '" + password + "' and change new password");
|
|
86288
86292
|
}
|
|
86289
86293
|
{
|
|
86290
86294
|
// create masterGameSettings
|
|
@@ -86338,6 +86342,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86338
86342
|
}
|
|
86339
86343
|
};
|
|
86340
86344
|
await masterAdminCollection.insertOne(masterGameSettingsResult);
|
|
86345
|
+
Debug.log("create default MasterGameSettingsResult success.");
|
|
86341
86346
|
}
|
|
86342
86347
|
{
|
|
86343
86348
|
{
|
|
@@ -86349,6 +86354,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86349
86354
|
let currencyLogCollection = this.gnServer.getDatabase().runtimeCollection("MasterPlayer.CurrencyLog");
|
|
86350
86355
|
await currencyLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86351
86356
|
await currencyLogCollection.createIndex({ userId: 1, key: 1, _id: -1 }, { background: true, name: "userId_1_key_1_id_-1" });
|
|
86357
|
+
Debug.log("create some indexes on Runtime.MasterPlayer.CurrencyLog success.");
|
|
86352
86358
|
}
|
|
86353
86359
|
{
|
|
86354
86360
|
await this.gnServer.getDatabase().createCollection("Runtime.MasterPlayer.StatisticsLog", {
|
|
@@ -86359,18 +86365,22 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86359
86365
|
let statisticsLogCollection = this.gnServer.getDatabase().runtimeCollection("MasterPlayer.StatisticsLog");
|
|
86360
86366
|
await statisticsLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86361
86367
|
await statisticsLogCollection.createIndex({ userId: 1, key: 1, _id: -1 }, { background: true, name: "userId_1_key_1_id_-1" });
|
|
86368
|
+
Debug.log("create some indexes on Runtime.MasterPlayer.StatisticsLog success.");
|
|
86362
86369
|
}
|
|
86363
86370
|
{
|
|
86364
86371
|
let userIPAddressCollection = this.gnServer.getDatabase().systemCollection("MasterPlayer.IPAddress");
|
|
86365
86372
|
await userIPAddressCollection.createIndex({ userId: 1 }, { background: true, name: "userId_1" });
|
|
86373
|
+
Debug.log("create some indexes on System.MasterPlayer.IPAddress success.");
|
|
86366
86374
|
}
|
|
86367
86375
|
{
|
|
86368
86376
|
let countryRegionCollection = this.gnServer.getDatabase().systemCollection("CountryRegion");
|
|
86369
86377
|
await countryRegionCollection.createIndex({ countryCode: 1 }, { background: true, name: "countryCode_1" });
|
|
86378
|
+
Debug.log("create some indexes on System.MasterPlayer.CountryRegion success.");
|
|
86370
86379
|
}
|
|
86371
86380
|
{
|
|
86372
86381
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeCollection("MasterPlayer.StatisticsBackup");
|
|
86373
86382
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86383
|
+
Debug.log("create some indexes on Runtime.MasterPlayer.StatisticsBackup success.");
|
|
86374
86384
|
}
|
|
86375
86385
|
{
|
|
86376
86386
|
await this.gnServer.getDatabase().createCollection("System.Analytics", {
|
|
@@ -86380,6 +86390,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86380
86390
|
});
|
|
86381
86391
|
let analyticsCollection = this.gnServer.getDatabase().systemCollection("Analytics");
|
|
86382
86392
|
await analyticsCollection.createIndex({ tsCreate: -1 }, { background: true, name: "tsCreate_-1" });
|
|
86393
|
+
Debug.log("create some indexes on System.Analytics success.");
|
|
86383
86394
|
}
|
|
86384
86395
|
{
|
|
86385
86396
|
await this.gnServer.getDatabase().createCollection("System.StoreAnalytics", {
|
|
@@ -86389,11 +86400,13 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86389
86400
|
});
|
|
86390
86401
|
let storeAnalytics = this.gnServer.getDatabase().systemCollection("StoreAnalytics");
|
|
86391
86402
|
await storeAnalytics.createIndex({ tsCreate: -1 }, { background: true, name: "tsCreate_-1" });
|
|
86403
|
+
Debug.log("create some indexes on System.StoreAnalytics success.");
|
|
86392
86404
|
}
|
|
86393
86405
|
}
|
|
86394
86406
|
{
|
|
86395
86407
|
// create main game settings
|
|
86396
86408
|
{
|
|
86409
|
+
Debug.log("creating some indexes for gameId main...");
|
|
86397
86410
|
let gameId = "main";
|
|
86398
86411
|
let gameSettingsResult = {
|
|
86399
86412
|
type: "gameSettings",
|
|
@@ -86449,6 +86462,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86449
86462
|
await gamePlayerCollection.createIndex({ segments: 1 }, { background: true, name: "segments_1" });
|
|
86450
86463
|
await gamePlayerCollection.createIndex({ displayNameNormalize: 1 }, { background: true, name: "displayNameNormalize_1" });
|
|
86451
86464
|
await gamePlayerCollection.createIndex({ tsLastLogin: -1 }, { background: true, name: "tsLastLogin_-1" });
|
|
86465
|
+
Debug.log("create some indexes on System." + gameId + ".GamePlayer success.");
|
|
86452
86466
|
}
|
|
86453
86467
|
{
|
|
86454
86468
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".GamePlayer.CurrencyLog", {
|
|
@@ -86459,6 +86473,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86459
86473
|
let currencyLogCollection = this.gnServer.getDatabase().runtimeGameCollection("GamePlayer.CurrencyLog", gameId);
|
|
86460
86474
|
await currencyLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86461
86475
|
await currencyLogCollection.createIndex({ userId: 1, key: 1, _id: -1 }, { background: true, name: "userId_1_key_1_id_-1" });
|
|
86476
|
+
Debug.log("create some indexes on Runtime." + gameId + ".GamePlayer.CurrencyLog success.");
|
|
86462
86477
|
}
|
|
86463
86478
|
{
|
|
86464
86479
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".GamePlayer.StatisticsLog", {
|
|
@@ -86469,10 +86484,12 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86469
86484
|
let statisticsLogCollection = this.gnServer.getDatabase().runtimeGameCollection("GamePlayer.StatisticsLog", gameId);
|
|
86470
86485
|
await statisticsLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86471
86486
|
await statisticsLogCollection.createIndex({ userId: 1, key: 1, _id: -1 }, { background: true, name: "userId_1_key_1_id_-1" });
|
|
86487
|
+
Debug.log("create some indexes on Runtime." + gameId + ".GamePlayer.StatisticsLog success.");
|
|
86472
86488
|
}
|
|
86473
86489
|
{
|
|
86474
86490
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("GamePlayer.StatisticsBackup", gameId);
|
|
86475
86491
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86492
|
+
Debug.log("create some indexes on Runtime." + gameId + ".GamePlayer.StatisticsBackup success.");
|
|
86476
86493
|
}
|
|
86477
86494
|
{
|
|
86478
86495
|
let characterPlayerCollection = this.gnServer.getDatabase().systemGameCollection("CharacterPlayer", gameId);
|
|
@@ -86480,6 +86497,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86480
86497
|
await characterPlayerCollection.createIndex({ segments: 1 }, { background: true, name: "segments_1" });
|
|
86481
86498
|
await characterPlayerCollection.createIndex({ displayNameNormalize: 1 }, { background: true, name: "displayNameNormalize_1" });
|
|
86482
86499
|
await characterPlayerCollection.createIndex({ tsLastLogin: -1 }, { background: true, name: "tsLastLogin_-1" });
|
|
86500
|
+
Debug.log("create some indexes on System." + gameId + ".CharacterPlayer success.");
|
|
86483
86501
|
}
|
|
86484
86502
|
{
|
|
86485
86503
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".CharacterPlayer.CurrencyLog", {
|
|
@@ -86490,6 +86508,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86490
86508
|
let currencyLogCollection = this.gnServer.getDatabase().runtimeGameCollection("CharacterPlayer.CurrencyLog", gameId);
|
|
86491
86509
|
await currencyLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86492
86510
|
await currencyLogCollection.createIndex({ characterId: 1, key: 1, _id: -1 }, { background: true, name: "characterId_1_key_1_id_-1" });
|
|
86511
|
+
Debug.log("create some indexes on Runtime." + gameId + ".CharacterPlayer.CurrencyLog success.");
|
|
86493
86512
|
}
|
|
86494
86513
|
{
|
|
86495
86514
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".CharacterPlayer.StatisticsLog", {
|
|
@@ -86500,16 +86519,19 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86500
86519
|
let statisticsLogCollection = this.gnServer.getDatabase().runtimeGameCollection("CharacterPlayer.StatisticsLog", gameId);
|
|
86501
86520
|
await statisticsLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86502
86521
|
await statisticsLogCollection.createIndex({ characterId: 1, key: 1, _id: -1 }, { background: true, name: "characterId_1_key_1_id_-1" });
|
|
86522
|
+
Debug.log("create some indexes on Runtime." + gameId + ".CharacterPlayer.StatisticsLog success.");
|
|
86503
86523
|
}
|
|
86504
86524
|
{
|
|
86505
86525
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("CharacterPlayer.StatisticsBackup", gameId);
|
|
86506
86526
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86527
|
+
Debug.log("create some indexes on Runtime." + gameId + ".CharacterPlayer.StatisticsBackup success.");
|
|
86507
86528
|
}
|
|
86508
86529
|
{
|
|
86509
86530
|
let groupCollection = this.gnServer.getDatabase().systemGameCollection("Group", gameId);
|
|
86510
86531
|
await groupCollection.createIndex({ groupId: 1 }, { background: true, name: "groupId_1" });
|
|
86511
86532
|
await groupCollection.createIndex({ segments: 1 }, { background: true, name: "segments_1" });
|
|
86512
86533
|
await groupCollection.createIndex({ displayNameNormalize: 1 }, { background: true, name: "displayNameNormalize_1" });
|
|
86534
|
+
Debug.log("create some indexes on System." + gameId + ".Group success.");
|
|
86513
86535
|
}
|
|
86514
86536
|
{
|
|
86515
86537
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".Group.CurrencyLog", {
|
|
@@ -86520,6 +86542,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86520
86542
|
let currencyLogCollection = this.gnServer.getDatabase().runtimeGameCollection("Group.CurrencyLog", gameId);
|
|
86521
86543
|
await currencyLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86522
86544
|
await currencyLogCollection.createIndex({ groupId: 1, key: 1, _id: -1 }, { background: true, name: "groupId_1_key_1_id_-1" });
|
|
86545
|
+
Debug.log("create some indexes on Runtime." + gameId + ".Group.CurrencyLog success.");
|
|
86523
86546
|
}
|
|
86524
86547
|
{
|
|
86525
86548
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".Group.StatisticsLog", {
|
|
@@ -86530,10 +86553,12 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86530
86553
|
let statisticsLogCollection = this.gnServer.getDatabase().runtimeGameCollection("Group.StatisticsLog", gameId);
|
|
86531
86554
|
await statisticsLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86532
86555
|
await statisticsLogCollection.createIndex({ groupId: 1, key: 1, _id: -1 }, { background: true, name: "groupId_1_key_1_id_-1" });
|
|
86556
|
+
Debug.log("create some indexes on Runtime." + gameId + ".Group.StatisticsLog success.");
|
|
86533
86557
|
}
|
|
86534
86558
|
{
|
|
86535
86559
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("Group.StatisticsBackup", gameId);
|
|
86536
86560
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86561
|
+
Debug.log("create some indexes on Runtime." + gameId + ".Group.StatisticsBackup success.");
|
|
86537
86562
|
}
|
|
86538
86563
|
{
|
|
86539
86564
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".Group.Message", {
|
|
@@ -86543,12 +86568,14 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86543
86568
|
});
|
|
86544
86569
|
let groupMessageCollection = this.gnServer.getDatabase().runtimeGameCollection("Group.Message", gameId);
|
|
86545
86570
|
await groupMessageCollection.createIndex({ groupId: 1, _id: -1 }, { background: true, name: "groupId_1_id_-1" });
|
|
86571
|
+
Debug.log("create some indexes on Runtime." + gameId + ".Group.Message success.");
|
|
86546
86572
|
}
|
|
86547
86573
|
{
|
|
86548
86574
|
let inventoryCollection = this.gnServer.getDatabase().systemGameCollection("Inventory", gameId);
|
|
86549
86575
|
await inventoryCollection.createIndex({ itemId: 1 }, { background: true, name: "itemId_1" });
|
|
86550
86576
|
await inventoryCollection.createIndex({ segments: 1 }, { background: true, name: "segments_1" });
|
|
86551
86577
|
await inventoryCollection.createIndex({ displayNameNormalize: 1 }, { background: true, name: "displayNameNormalize_1" });
|
|
86578
|
+
Debug.log("create some indexes on System." + gameId + ".Inventory success.");
|
|
86552
86579
|
}
|
|
86553
86580
|
{
|
|
86554
86581
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".Inventory.StatisticsLog", {
|
|
@@ -86559,16 +86586,19 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86559
86586
|
let statisticsLogCollection = this.gnServer.getDatabase().runtimeGameCollection("Inventory.StatisticsLog", gameId);
|
|
86560
86587
|
await statisticsLogCollection.createIndex({ key: 1, _id: -1 }, { background: true, name: "key_1_id_-1" });
|
|
86561
86588
|
await statisticsLogCollection.createIndex({ itemId: 1, key: 1, _id: -1 }, { background: true, name: "itemId_1_key_1_id_-1" });
|
|
86589
|
+
Debug.log("create some indexes on Runtime." + gameId + ".Inventory.StatisticsLog success.");
|
|
86562
86590
|
}
|
|
86563
86591
|
{
|
|
86564
86592
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("Inventory.StatisticsBackup", gameId);
|
|
86565
86593
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86594
|
+
Debug.log("create some indexes on Runtime." + gameId + ".Inventory.StatisticsBackup success.");
|
|
86566
86595
|
}
|
|
86567
86596
|
{
|
|
86568
86597
|
let storeInventoryCollection = this.gnServer.getDatabase().systemGameCollection("StoreInventory", gameId);
|
|
86569
86598
|
await storeInventoryCollection.createIndex({ storeId: 1 }, { background: true, name: "storeId_1" });
|
|
86570
86599
|
await storeInventoryCollection.createIndex({ displayNameNormalize: 1 }, { background: true, name: "displayNameNormalize_1" });
|
|
86571
86600
|
await storeInventoryCollection.createIndex({ tags: 1 }, { background: true, sparse: true, name: "tags_1" });
|
|
86601
|
+
Debug.log("create some indexes on System." + gameId + ".StoreInventory success.");
|
|
86572
86602
|
}
|
|
86573
86603
|
{
|
|
86574
86604
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".StoreInventory.StoreLog", {
|
|
@@ -86580,15 +86610,18 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86580
86610
|
await storeInventoryLogCollection.createIndex({ storeId: 1, id: 1, storeReceiveType: -1, _id: -1 }, { background: true, name: "storeId_1_id_1_storeReceiveType_-1_id_-1" });
|
|
86581
86611
|
await storeInventoryLogCollection.createIndex({ id: 1, storeReceiveType: -1, _id: -1 }, { background: true, name: "id_1_storeReceiveType_-1_id_-1" });
|
|
86582
86612
|
await storeInventoryLogCollection.createIndex({ storeReceiveType: -1, _id: -1 }, { background: true, name: "storeReceiveType_-1_id_-1" });
|
|
86613
|
+
Debug.log("create some indexes on Runtime." + gameId + ".StoreInventory.StoreLog success.");
|
|
86583
86614
|
}
|
|
86584
86615
|
{
|
|
86585
86616
|
let storeInventoryUsedCollection = this.gnServer.getDatabase().systemGameCollection("StoreInventory.StoreUsed", gameId);
|
|
86586
86617
|
await storeInventoryUsedCollection.createIndex({ storeId: 1 }, { background: true, name: "storeId_1" });
|
|
86618
|
+
Debug.log("create some indexes on System." + gameId + ".StoreInventory.StoreUsed success.");
|
|
86587
86619
|
}
|
|
86588
86620
|
{
|
|
86589
86621
|
let receiptIAPCollection = this.gnServer.getDatabase().systemGameCollection("ReceiptIAP", gameId);
|
|
86590
86622
|
receiptIAPCollection.createIndex({ payloadMd5: 1 }, { background: true, name: "payloadMd5_1" });
|
|
86591
86623
|
receiptIAPCollection.createIndex({ transactionId: 1 }, { background: true, name: "transactionId_1" });
|
|
86624
|
+
Debug.log("create some indexes on System." + gameId + ".ReceiptIAP success.");
|
|
86592
86625
|
}
|
|
86593
86626
|
{
|
|
86594
86627
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".MatchmakingTicket", {
|
|
@@ -86601,6 +86634,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86601
86634
|
await matchmakingTicketCollection.createIndex({ queueName: 1, "status": -1, "tsCreate": -1 }, { background: true, name: "queueName_1_status_-1_tsCreate_-1" });
|
|
86602
86635
|
await matchmakingTicketCollection.createIndex({ ticketId: 1 }, { background: true, name: "ticketId_1" });
|
|
86603
86636
|
await matchmakingTicketCollection.createIndex({ status: -1, _id: -1 }, { background: true, name: "status_-1_id_-1" });
|
|
86637
|
+
Debug.log("create some indexes on Runtime." + gameId + ".MatchmakingTicket success.");
|
|
86604
86638
|
}
|
|
86605
86639
|
{
|
|
86606
86640
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".CloudScript.Log", {
|
|
@@ -86610,24 +86644,30 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86610
86644
|
});
|
|
86611
86645
|
let cloudScriptFunctionLogCollection = this.gnServer.getDatabase().runtimeGameCollection("CloudScript.Log", gameId);
|
|
86612
86646
|
await cloudScriptFunctionLogCollection.createIndex({ tsCreate: -1 }, { background: true, name: "tsCreate-1" });
|
|
86647
|
+
Debug.log("create some indexes on Runtime." + gameId + ".CloudScript.Log success.");
|
|
86613
86648
|
}
|
|
86614
86649
|
{
|
|
86615
86650
|
let matchCollection = this.gnServer.getDatabase().systemGameCollection("Match", gameId);
|
|
86616
86651
|
await matchCollection.createIndex({ matchId: 1 }, { background: true, name: "matchId_1" });
|
|
86617
86652
|
await matchCollection.createIndex({ queueName: 1, tsCreate: -1 }, { background: true, name: "queueName_1_tsCreate_-1" });
|
|
86618
86653
|
await matchCollection.createIndex({ status: -1, tsCreate: -1 }, { background: true, name: "status_-1_tsCreate_-1" });
|
|
86654
|
+
Debug.log("create some indexes on System." + gameId + ".Match success.");
|
|
86619
86655
|
}
|
|
86620
86656
|
{
|
|
86621
86657
|
let configCollection = this.gnServer.getDatabase().systemGameCollection("Config", gameId);
|
|
86622
86658
|
await configCollection.createIndex({ configName: 1, label: 1 }, { background: true, unique: true, name: "configName_1_label_1" });
|
|
86659
|
+
Debug.log("create some indexes on System." + gameId + ".Config success.");
|
|
86623
86660
|
}
|
|
86624
86661
|
{
|
|
86625
86662
|
let cacheCollection = this.gnServer.getDatabase().runtimeGameCollection("Cache", gameId);
|
|
86626
86663
|
await cacheCollection.createIndex({ key: 1 }, { background: true, name: "key_1" });
|
|
86664
|
+
Debug.log("create some indexes on System." + gameId + ".Cache success.");
|
|
86627
86665
|
}
|
|
86666
|
+
Debug.log("create some indexes for gameId main success.");
|
|
86628
86667
|
}
|
|
86629
86668
|
// create dev game settings
|
|
86630
86669
|
{
|
|
86670
|
+
Debug.log("creating some indexes for gameId dev...");
|
|
86631
86671
|
let gameId = "dev";
|
|
86632
86672
|
let gameSettingsResult = {
|
|
86633
86673
|
type: "gameSettings",
|
|
@@ -86708,6 +86748,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86708
86748
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("GamePlayer.StatisticsBackup", gameId);
|
|
86709
86749
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86710
86750
|
}
|
|
86751
|
+
Debug.log("create some indexes on GamePlayer for gameId " + gameId + " success.");
|
|
86711
86752
|
{
|
|
86712
86753
|
let characterPlayerCollection = this.gnServer.getDatabase().systemGameCollection("CharacterPlayer", gameId);
|
|
86713
86754
|
await characterPlayerCollection.createIndex({ characterId: 1 }, { background: true, name: "characterId_1" });
|
|
@@ -86739,6 +86780,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86739
86780
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("CharacterPlayer.StatisticsBackup", gameId);
|
|
86740
86781
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86741
86782
|
}
|
|
86783
|
+
Debug.log("create some indexes on CharacterPlayer for gameId " + gameId + " success.");
|
|
86742
86784
|
{
|
|
86743
86785
|
let groupCollection = this.gnServer.getDatabase().systemGameCollection("Group", gameId);
|
|
86744
86786
|
await groupCollection.createIndex({ groupId: 1 }, { background: true, name: "groupId_1" });
|
|
@@ -86778,6 +86820,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86778
86820
|
let groupMessageCollection = this.gnServer.getDatabase().runtimeGameCollection("Group.Message", gameId);
|
|
86779
86821
|
await groupMessageCollection.createIndex({ groupId: 1, _id: -1 }, { background: true, name: "groupId_1_id_-1" });
|
|
86780
86822
|
}
|
|
86823
|
+
Debug.log("create some indexes on Group for gameId " + gameId + " success.");
|
|
86781
86824
|
{
|
|
86782
86825
|
let inventoryCollection = this.gnServer.getDatabase().systemGameCollection("Inventory", gameId);
|
|
86783
86826
|
await inventoryCollection.createIndex({ itemId: 1 }, { background: true, name: "itemId_1" });
|
|
@@ -86798,6 +86841,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86798
86841
|
let backupStatisticsLeaderboardCollection = this.gnServer.getDatabase().runtimeGameCollection("Inventory.StatisticsBackup", gameId);
|
|
86799
86842
|
await backupStatisticsLeaderboardCollection.createIndex({ key: 1, version: 1 }, { background: true, name: "key_1_version_1" });
|
|
86800
86843
|
}
|
|
86844
|
+
Debug.log("create some indexes on Inventory for gameId " + gameId + " success.");
|
|
86801
86845
|
{
|
|
86802
86846
|
let storeInventoryCollection = this.gnServer.getDatabase().systemGameCollection("StoreInventory", gameId);
|
|
86803
86847
|
await storeInventoryCollection.createIndex({ storeId: 1 }, { background: true, name: "storeId_1" });
|
|
@@ -86819,11 +86863,13 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86819
86863
|
let storeInventoryUsedCollection = this.gnServer.getDatabase().systemGameCollection("StoreInventory.StoreUsed", gameId);
|
|
86820
86864
|
await storeInventoryUsedCollection.createIndex({ storeId: 1 }, { background: true, name: "storeId_1" });
|
|
86821
86865
|
}
|
|
86866
|
+
Debug.log("create some indexes on StoreInventory for gameId " + gameId + " success.");
|
|
86822
86867
|
{
|
|
86823
86868
|
let receiptIAPCollection = this.gnServer.getDatabase().systemGameCollection("ReceiptIAP", gameId);
|
|
86824
86869
|
receiptIAPCollection.createIndex({ payloadMd5: 1 }, { background: true, name: "payloadMd5_1" });
|
|
86825
86870
|
receiptIAPCollection.createIndex({ transactionId: 1 }, { background: true, name: "transactionId_1" });
|
|
86826
86871
|
}
|
|
86872
|
+
Debug.log("create some indexes on ReceiptIAP for gameId " + gameId + " success.");
|
|
86827
86873
|
{
|
|
86828
86874
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".MatchmakingTicket", {
|
|
86829
86875
|
capped: true,
|
|
@@ -86835,6 +86881,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86835
86881
|
await matchmakingTicketCollection.createIndex({ queueName: 1, status: -1, tsCreate: -1 }, { background: true, name: "queueName_1_status_-1_tsCreate_-1" });
|
|
86836
86882
|
await matchmakingTicketCollection.createIndex({ ticketId: 1 }, { background: true, name: "ticketId_1" });
|
|
86837
86883
|
await matchmakingTicketCollection.createIndex({ status: -1, "_id": -1 }, { background: true, name: "status_-1_id_-1" });
|
|
86884
|
+
Debug.log("create some indexes on Runtime." + gameId + ".MatchmakingTicket success.");
|
|
86838
86885
|
}
|
|
86839
86886
|
{
|
|
86840
86887
|
await this.gnServer.getDatabase().createCollection("Runtime." + gameId + ".CloudScript.Log", {
|
|
@@ -86844,21 +86891,26 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86844
86891
|
});
|
|
86845
86892
|
let cloudScriptFunctionLogCollection = this.gnServer.getDatabase().runtimeGameCollection("CloudScript.Log", gameId);
|
|
86846
86893
|
await cloudScriptFunctionLogCollection.createIndex({ tsCreate: -1 }, { background: true, name: "tsCreate-1" });
|
|
86894
|
+
Debug.log("create some indexes on Runtime." + gameId + ".CloudScript.Log success.");
|
|
86847
86895
|
}
|
|
86848
86896
|
{
|
|
86849
86897
|
let matchCollection = this.gnServer.getDatabase().systemGameCollection("Match", gameId);
|
|
86850
86898
|
await matchCollection.createIndex({ matchId: 1 }, { background: true, name: "matchId_1" });
|
|
86851
86899
|
await matchCollection.createIndex({ queueName: 1, tsCreate: -1 }, { background: true, name: "queueName_1_tsCreate_-1" });
|
|
86852
86900
|
await matchCollection.createIndex({ status: -1, tsCreate: -1 }, { background: true, name: "status_-1_tsCreate_-1" });
|
|
86901
|
+
Debug.log("create some indexes on System." + gameId + ".Match success.");
|
|
86853
86902
|
}
|
|
86854
86903
|
{
|
|
86855
86904
|
let configCollection = this.gnServer.getDatabase().systemGameCollection("Config", gameId);
|
|
86856
86905
|
await configCollection.createIndex({ configName: 1, label: 1 }, { background: true, unique: true, name: "configName_1_label_1" });
|
|
86906
|
+
Debug.log("create some indexes on System." + gameId + ".Config success.");
|
|
86857
86907
|
}
|
|
86858
86908
|
{
|
|
86859
86909
|
let cacheCollection = this.gnServer.getDatabase().runtimeGameCollection("Cache", gameId);
|
|
86860
86910
|
await cacheCollection.createIndex({ key: 1 }, { background: true, name: "key_1" });
|
|
86911
|
+
Debug.log("create some indexes on Runtime." + gameId + ".Cache success.");
|
|
86861
86912
|
}
|
|
86913
|
+
Debug.log("create some indexes for gameId dev success.");
|
|
86862
86914
|
}
|
|
86863
86915
|
}
|
|
86864
86916
|
{
|
|
@@ -86869,16 +86921,19 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86869
86921
|
});
|
|
86870
86922
|
let authInfoCollection = this.gnServer.getDatabase().systemCollection("AuthInfo");
|
|
86871
86923
|
await authInfoCollection.createIndex({ gnToken: 1 }, { background: true, name: "gnToken_1" });
|
|
86924
|
+
Debug.log("create some indexes for System.AuthInfo success.");
|
|
86872
86925
|
}
|
|
86873
86926
|
{
|
|
86874
86927
|
let downloadFileSessionCollection = this.gnServer.getDatabase().systemCollection("DownloadFileSession");
|
|
86875
86928
|
await downloadFileSessionCollection.createIndex({ downloadToken: 1 }, { background: true, name: "downloadToken_1" });
|
|
86876
86929
|
await downloadFileSessionCollection.createIndex({ createdAt: 1 }, { background: true, name: "createdAt_1", expireAfterSeconds: 3600 });
|
|
86930
|
+
Debug.log("create some indexes for System.DownloadFileSession success.");
|
|
86877
86931
|
}
|
|
86878
86932
|
{
|
|
86879
86933
|
let uploadFileInfoCollection = this.gnServer.getDatabase().systemCollection("UploadFileInfo");
|
|
86880
86934
|
await uploadFileInfoCollection.createIndex({ fileId: 1 }, { background: true, name: "fileId_1" });
|
|
86881
86935
|
await uploadFileInfoCollection.createIndex({ gameId: 1, _id: -1 }, { background: true, name: "gameId_1_id_-1" });
|
|
86936
|
+
Debug.log("create some indexes for System.UploadFileInfo success.");
|
|
86882
86937
|
}
|
|
86883
86938
|
{
|
|
86884
86939
|
await this.gnServer.getDatabase().createCollection("System.AdapterEvent", {
|
|
@@ -86891,6 +86946,7 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86891
86946
|
// { "createdAt": 1 },
|
|
86892
86947
|
// { expireAfterSeconds: 60, background: true, name: "createdAt_1" }
|
|
86893
86948
|
// );
|
|
86949
|
+
Debug.log("create some indexes for System.AdapterEvent success.");
|
|
86894
86950
|
}
|
|
86895
86951
|
{
|
|
86896
86952
|
// await this.gnServer.getDatabase().systemCollection("SecretInfo").createIndex({ secretKey": 1 }, { background: true, unique: true, name: "secretKey_1" });
|
|
@@ -86903,14 +86959,17 @@ class ServerApplication extends ServerApplication_BuilderBase {
|
|
|
86903
86959
|
});
|
|
86904
86960
|
// let postEventCallbackPostCollection = this.gnServer.getDatabase().systemCollection("EventCallback.Post");
|
|
86905
86961
|
// await postEventCallbackPostCollection.createIndex({ eventName: 1, _id: -1 }, { background: true, name: "eventName_1_id_-1" });
|
|
86962
|
+
Debug.log("create some indexes for System.EventCallback.Post success.");
|
|
86906
86963
|
}
|
|
86907
86964
|
{
|
|
86908
86965
|
let cloudScriptFunctionCollection = this.gnServer.getDatabase().systemCollection("EventCallback.CloudScript");
|
|
86909
86966
|
let path = __dirname + "/./GN-startup/cloudScript/eventCallbackCloudScriptData.json";
|
|
86910
86967
|
await cloudScriptFunctionCollection.insertMany(JSON.parse(external_fs_default().readFileSync(path).toString()));
|
|
86968
|
+
Debug.log("create some indexes for EventCallback.CloudScript success.");
|
|
86911
86969
|
}
|
|
86912
86970
|
}
|
|
86913
86971
|
async reSetupGNDatabase(oldVersion) {
|
|
86972
|
+
Debug.log("re setup Database from version " + oldVersion);
|
|
86914
86973
|
}
|
|
86915
86974
|
async applySettingsGame() {
|
|
86916
86975
|
let answer = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmobitea/gn-server",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "GearN Server by XmobiTea (Pro)",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@msgpack/msgpack": "^2.8.0",
|
|
32
32
|
"@socket.io/mongo-adapter": "^0.3.2",
|
|
33
33
|
"@socket.io/mongo-emitter": "^0.2.0",
|
|
34
|
-
"@xmobitea/gn-typescript-client": "^2.6.
|
|
34
|
+
"@xmobitea/gn-typescript-client": "^2.6.3",
|
|
35
35
|
"axios": "^1.10.0",
|
|
36
36
|
"bcrypt": "^5.1.1",
|
|
37
37
|
"cors": "^2.8.5",
|