@xmobitea/gn-server 2.4.11 → 2.4.13

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.
@@ -0,0 +1,28 @@
1
+ import { OperationRequest } from "../../../../../GN-common/entity/operationRequest/OperationRequest";
2
+ import { OperationResponse } from "../../../../../GN-common/entity/operationResponse/OperationResponse";
3
+ import { AuthInfo } from "../../../../../GN-common/entity/AuthInfo";
4
+ import { SecretInfo } from "../../../../../GN-common/entity/SecretInfo";
5
+ import { RequestHandler } from "../base/RequestHandler";
6
+ declare class DeleteInDatabaseOperationRequest extends OperationRequest {
7
+ type: number;
8
+ id: string;
9
+ gameId: string;
10
+ log?: string;
11
+ isValidRequest(): boolean;
12
+ }
13
+ export declare class DeleteInDatabaseRequestHandler extends RequestHandler {
14
+ getCode(): number;
15
+ getCommonOperationRequest(): typeof DeleteInDatabaseOperationRequest;
16
+ handle(authInfo: AuthInfo, secretInfo: SecretInfo, operationRequest: OperationRequest): Promise<OperationResponse>;
17
+ private execute;
18
+ private deleteMasterPlayer;
19
+ private deleteGamePlayer;
20
+ private deleteCharacterPlayer;
21
+ private deleteInventory;
22
+ private deleteGroup;
23
+ private deleteFriendPlayerInGamePlayer;
24
+ private deleteFriendPlayerInCharacterPlayer;
25
+ private deleteGroupInGamePlayer;
26
+ private deleteGroupInCharacterPlayer;
27
+ }
28
+ export {};
@@ -49,6 +49,7 @@ export declare class GamePlayerPermissionRulesParam {
49
49
  getFriendStatisticsLeaderboard?: PermissionRulesParam;
50
50
  getCurrencyLeaderboard?: PermissionRulesParam;
51
51
  getCreateLeaderboard?: PermissionRulesParam;
52
+ getLastLoginLeaderboard?: PermissionRulesParam;
52
53
  getStatisticsLog?: PermissionRulesParam;
53
54
  getCurrencyLog?: PermissionRulesParam;
54
55
  }
@@ -23,4 +23,5 @@ export declare class MasterAdminPermissionRulesParam {
23
23
  setEventCallbackCloudScript?: PermissionRulesParam;
24
24
  resetStatisticsLeaderboard?: PermissionRulesParam;
25
25
  getBackupStatisticsLeaderboardVersion?: PermissionRulesParam;
26
+ deleteInDatabase?: PermissionRulesParam;
26
27
  }
@@ -0,0 +1,22 @@
1
+ import { OperationRequest } from "../../../../../GN-common/entity/operationRequest/OperationRequest";
2
+ import { OperationResponse } from "../../../../../GN-common/entity/operationResponse/OperationResponse";
3
+ import { AuthInfo } from "../../../../../GN-common/entity/AuthInfo";
4
+ import { SecretInfo } from "../../../../../GN-common/entity/SecretInfo";
5
+ import { GamePlayerBaseRequestHandler } from "./GamePlayerBaseRequestHandler";
6
+ import { InfoRequestParam } from "./model/InfoRequestParam";
7
+ declare class GetLastLoginLeaderboardOperationRequest extends OperationRequest {
8
+ infoRequestParam: InfoRequestParam;
9
+ skip?: number;
10
+ limit?: number;
11
+ loadFromCache?: boolean;
12
+ isValidRequest(): boolean;
13
+ }
14
+ export declare class GetLastLoginLeaderboardRequestHandler extends GamePlayerBaseRequestHandler {
15
+ getCode(): number;
16
+ getCommonOperationRequest(): typeof GetLastLoginLeaderboardOperationRequest;
17
+ handle(authInfo: AuthInfo, secretInfo: SecretInfo, operationRequest: OperationRequest): Promise<OperationResponse>;
18
+ serverHandle(secretInfo: SecretInfo, operationRequest: OperationRequest): Promise<OperationResponse>;
19
+ adminHandle(secretInfo: SecretInfo, operationRequest: OperationRequest): Promise<OperationResponse>;
20
+ private execute;
21
+ }
22
+ export {};
@@ -16,6 +16,7 @@ export declare class AppleService implements IAppleService {
16
16
  keyId: string;
17
17
  p8Content: string;
18
18
  }): void;
19
+ private getSigningKey;
19
20
  private verifyToken;
20
21
  verifyAppleToken(token: string): Promise<{
21
22
  [k: string]: any;
@@ -24,6 +24,7 @@ export declare class OperationCode {
24
24
  static readonly ResetStatisticsLeaderboard: number;
25
25
  static readonly GetBackupStatisticsLeaderboardVersion: number;
26
26
  static readonly GetServerGameData: number;
27
+ static readonly DeleteInDatabase: number;
27
28
  static readonly LoginByAccount: number;
28
29
  static readonly LoginByAndroidDeviceId: number;
29
30
  static readonly LoginByApple: number;
@@ -520,6 +520,7 @@ export declare class GNParameterCode {
520
520
  static readonly ResetStatisticsLeaderboard: string;
521
521
  static readonly GetBackupStatisticsLeaderboardVersion: string;
522
522
  static readonly GetServerGameData: string;
523
+ static readonly DeleteInDatabase: string;
523
524
  static readonly MasterPlayerCount: string;
524
525
  static readonly GamePlayerCount: string;
525
526
  static readonly CharacterPlayerCount: string;
@@ -235,6 +235,7 @@ export interface SecretPermissionItem {
235
235
  getFriendStatisticsLeaderboard: GamePlayerPermissionRules;
236
236
  getCurrencyLeaderboard: GamePlayerPermissionRules;
237
237
  getCreateLeaderboard: GamePlayerPermissionRules;
238
+ getLastLoginLeaderboard: MasterPlayerPermissionRules;
238
239
  getStatisticsLog: GamePlayerPermissionRules;
239
240
  getCurrencyLog: GamePlayerPermissionRules;
240
241
  };
@@ -418,6 +419,7 @@ export interface SecretPermissionItem {
418
419
  resetStatisticsLeaderboard: MasterAdminPermissionRules;
419
420
  getBackupStatisticsLeaderboardVersion: MasterAdminPermissionRules;
420
421
  getServerGameData: MasterAdminPermissionRules;
422
+ deleteInDatabase: MasterAdminPermissionRules;
421
423
  };
422
424
  multiplayer: {
423
425
  cancelAllMatchmakingTicket: MultiplayerPermissionRules;
@@ -4,6 +4,7 @@ export declare class MongoObject {
4
4
  private static readonly EMPTY_STR;
5
5
  private readonly collection;
6
6
  protected readonly _id: mongoDB.ObjectId;
7
+ protected readonly originResult: mongoDB.WithId<mongoDB.Document>;
7
8
  private updateFilter;
8
9
  constructor(result: mongoDB.WithId<mongoDB.Document>, collection: mongoDB.Collection<mongoDB.Document>);
9
10
  protected inc(field: string, value: number): void;
@@ -16,5 +17,6 @@ export declare class MongoObject {
16
17
  protected setOnInsert(field: string, value: any): void;
17
18
  protected unset(field: string): void;
18
19
  getObjectId(): mongoDB.ObjectId;
20
+ getOriginResult(): mongoDB.WithId<mongoDB.Document>;
19
21
  saveAsync(): Promise<mongoDB.UpdateResult>;
20
22
  }
@@ -83,6 +83,7 @@ export declare class xDatabase {
83
83
  loadGamePlayersLeaderboardWithStatisticsAsync(key: string, skip: number, limit: number, gameId: string, direction: -1 | 1, gamePlayerFindOptions?: GamePlayerFindOptions): Promise<Array<GamePlayer>>;
84
84
  loadGamePlayersLeaderboardWithStatisticsAllAsync(key: string, gameId: string, direction: -1 | 1, gamePlayerFindOptions?: GamePlayerFindOptions): Promise<Array<GamePlayer>>;
85
85
  loadGamePlayersLeaderboardWithCreateAsync(skip: number, limit: number, gameId: string, gamePlayerFindOptions?: GamePlayerFindOptions): Promise<Array<GamePlayer>>;
86
+ loadGamePlayersLeaderboardWithLastLoginAsync(skip: number, limit: number, gameId: string, gamePlayerFindOptions?: GamePlayerFindOptions): Promise<Array<GamePlayer>>;
86
87
  loadFriendGamePlayersLeaderboardWithStatisticsAsync(friendIds: string[], gameId: string, gamePlayerFindOptions?: GamePlayerFindOptions): Promise<Array<GamePlayer>>;
87
88
  loadGamePlayersLeaderboardWithCurrenciesAsync(key: string, skip: number, limit: number, gameId: string, gamePlayerFindOptions?: GamePlayerFindOptions): Promise<Array<GamePlayer>>;
88
89
  loadPositionGamePlayerLeaderboardWithStatisticsAsync(key: string, userId: string, gameId: string, initialValue: number, direction: -1 | 1): Promise<number>;
@@ -480,6 +480,11 @@
480
480
  "script": "\npreHandlers.dashboard_ChangePasswordAdminAccount = async (request: { userId: string, currentPassword: string, password: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => {\n\n\treturn null;\n}\n\npostHandlers.dashboard_ChangePasswordAdminAccount = async (request: { userId: string, currentPassword: string, password: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => {\n\n\treturn operationResponse;\n}\n",
481
481
  "hasEdit": false
482
482
  },
483
+ {
484
+ "eventName": "dashboard_DeleteInDatabase",
485
+ "script": "\npreHandlers.dashboard_DeleteInDatabase = async (request: { id: string, type: number, gameId: string, log: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => {\n\n\treturn null;\n}\n\npostHandlers.dashboard_DeleteInDatabase = async (request: { id: string, type: number, gameId: string, log: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => {\n\n\treturn operationResponse;\n}\n",
486
+ "hasEdit": false
487
+ },
483
488
  {
484
489
  "eventName": "dashboard_GetAdminAccountList",
485
490
  "script": "\npreHandlers.dashboard_GetAdminAccountList = async (request: {}, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => {\n\n\treturn null;\n}\n\npostHandlers.dashboard_GetAdminAccountList = async (request: {}, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => {\n\n\treturn operationResponse;\n}\n",
@@ -668,6 +673,11 @@
668
673
  "script": "\npreHandlers.gamePlayer_GetIpAddressCreate = async (request: { userId: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => {\n\n\treturn null;\n}\n\npostHandlers.gamePlayer_GetIpAddressCreate = async (request: { userId: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => {\n\n\treturn operationResponse;\n}\n",
669
674
  "hasEdit": false
670
675
  },
676
+ {
677
+ "eventName": "gamePlayer_GetLastLoginLeaderboard",
678
+ "script": "\npreHandlers.gamePlayer_GetLastLoginLeaderboard = async (request: { skip: number, limit: number, infoRequestParam: gamePlayer_InfoRequestParam, loadFromCache: boolean, }, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => {\n\n\treturn null;\n}\n\npostHandlers.gamePlayer_GetLastLoginLeaderboard = async (request: { skip: number, limit: number, infoRequestParam: gamePlayer_InfoRequestParam, loadFromCache: boolean, }, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => {\n\n\treturn operationResponse;\n}\n",
679
+ "hasEdit": false
680
+ },
671
681
  {
672
682
  "eventName": "gamePlayer_GetOnlineStatus",
673
683
  "script": "\npreHandlers.gamePlayer_GetOnlineStatus = async (request: { userId: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => {\n\n\treturn null;\n}\n\npostHandlers.gamePlayer_GetOnlineStatus = async (request: { userId: string }, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => {\n\n\treturn operationResponse;\n}\n",
@@ -490,7 +490,7 @@ if (parentPort) {
490
490
  let endTime = performance.now();
491
491
  let endMemoryUsage = process.memoryUsage();
492
492
 
493
- let memoryUsedInBytes = endMemoryUsage.rss - startMemoryUsage.rss;
493
+ let memoryUsedInBytes = endMemoryUsage.heapUsed - startMemoryUsage.heapUsed;
494
494
  let executeTimeInMs = endTime - startTime;
495
495
 
496
496
  //let cost = (memoryUsedInGb * executeTime) / 1000 * 0.022;
@@ -562,6 +562,9 @@ const pushNotification = new CloudScriptPushNotification();
562
562
  database.init(dbConnection.url, dbConnection.dbName, dbConnection.options);
563
563
  }
564
564
 
565
+ delete workerData.dbConnection;
566
+ delete workerData.gnServerSettingsOptions;
567
+
565
568
  const handlers: Record<string, (args: any, context: { userId: string; customTags: { [k: string]: any } }, log: (log: any) => void) => any> = {};
566
569
 
567
570
  //$replaceScript
@@ -790,6 +790,9 @@ const pushNotification = new CloudScriptPushNotification();
790
790
  database.init(dbConnection.url, dbConnection.dbName, dbConnection.options);
791
791
  }
792
792
 
793
+ delete workerData.dbConnection;
794
+ delete workerData.gnServerSettingsOptions;
795
+
793
796
  const preHandlers: Record<string, (request: any, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => Promise<OperationResponse | null>> = {};
794
797
 
795
798
  const postHandlers: Record<string, (request: any, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => Promise<OperationResponse>> = {};