@xmobitea/gn-server 2.6.10 → 2.6.11
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/GN-library/xdatabase/lib/entity/pro/Group.d.ts +4 -2
- package/dist/GN-library/xdatabase/lib/entity/pro/Inventory.d.ts +2 -1
- package/dist/GN-library/xdatabase/lib/entity/pro/MongoObject.d.ts +1 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/PlayerBase.d.ts +4 -2
- package/dist/GN-library/xdatabase/lib/entity/pro/TradeInventory.d.ts +2 -1
- package/dist/GN-library/xdatabase/lib/xDatabase.d.ts +4 -4
- package/dist/GN-startup/cloudScript/CloudScriptDatabase.ts +3 -92
- package/dist/index.d.ts +2 -0
- package/dist/index.js +784 -601
- package/package.json +1 -1
|
@@ -39,7 +39,8 @@ export declare class Group extends DataObjectBase {
|
|
|
39
39
|
getAllGroupCurrencies(): Map<string, CurrencyItem>;
|
|
40
40
|
hasGroupCurrency(key: string): boolean;
|
|
41
41
|
getGroupCurrency(key: string): CurrencyItem;
|
|
42
|
-
changeGroupCurrency(key: string,
|
|
42
|
+
changeGroupCurrency(key: string, amount: number): void;
|
|
43
|
+
setGroupCurrency(key: string, value: number): void;
|
|
43
44
|
removeGroupCurrency(key: string): void;
|
|
44
45
|
getAllGroupDatas(): Array<DataItem>;
|
|
45
46
|
hasGroupData(key: string): boolean;
|
|
@@ -49,7 +50,8 @@ export declare class Group extends DataObjectBase {
|
|
|
49
50
|
getAllGroupStatistics(): Map<string, StatisticsItem>;
|
|
50
51
|
hasGroupStatistics(key: string): boolean;
|
|
51
52
|
getGroupStatistics(key: string): StatisticsItem;
|
|
52
|
-
changeGroupStatistics(key: string,
|
|
53
|
+
changeGroupStatistics(key: string, amount: number, tsLastUpdate: number): void;
|
|
54
|
+
setGroupStatistics(key: string, value: number, tsLastUpdate: number): void;
|
|
53
55
|
removeGroupStatistics(key: string): void;
|
|
54
56
|
getAllGroupInventories(): Array<InventoryItem>;
|
|
55
57
|
hasGroupInventory(itemId: string): boolean;
|
|
@@ -42,7 +42,8 @@ export declare class Inventory extends DataObjectBase {
|
|
|
42
42
|
getAllItemStatistics(): Map<string, StatisticsItem>;
|
|
43
43
|
hasItemStatistics(key: string): boolean;
|
|
44
44
|
getItemStatistics(key: string): StatisticsItem;
|
|
45
|
-
changeItemStatistics(key: string,
|
|
45
|
+
changeItemStatistics(key: string, amount: number, tsLastUpdate: number): void;
|
|
46
|
+
setItemStatistics(key: string, value: number, tsLastUpdate: number): void;
|
|
46
47
|
removeItemStatistics(key: string): void;
|
|
47
48
|
getRemoveStatus(): RemoveStatusItem;
|
|
48
49
|
setRemoveStatus(tsRemove: number, reason?: string): void;
|
|
@@ -8,6 +8,7 @@ export declare class MongoObject {
|
|
|
8
8
|
private updateFilter;
|
|
9
9
|
constructor(result: mongoDB.WithId<mongoDB.Document>, collection: mongoDB.Collection<mongoDB.Document>);
|
|
10
10
|
protected inc(field: string, value: number): void;
|
|
11
|
+
protected removeInc(field: string): void;
|
|
11
12
|
protected min(field: string, value: any): void;
|
|
12
13
|
protected max(field: string, value: any): void;
|
|
13
14
|
protected mul(field: string, value: number): void;
|
|
@@ -32,12 +32,14 @@ export declare class PlayerBase extends DataObjectBase {
|
|
|
32
32
|
getAllPlayerCurrencies(): Map<string, CurrencyItem>;
|
|
33
33
|
hasPlayerCurrency(key: string): boolean;
|
|
34
34
|
getPlayerCurrency(key: string): CurrencyItem;
|
|
35
|
-
changePlayerCurrency(key: string,
|
|
35
|
+
changePlayerCurrency(key: string, amount: number): void;
|
|
36
|
+
setPlayerCurrency(key: string, value: number): void;
|
|
36
37
|
removePlayerCurrency(key: string): void;
|
|
37
38
|
getAllPlayerStatistics(): Map<string, StatisticsItem>;
|
|
38
39
|
hasPlayerStatistics(key: string): boolean;
|
|
39
40
|
getPlayerStatistics(key: string): StatisticsItem;
|
|
40
|
-
changePlayerStatistics(key: string,
|
|
41
|
+
changePlayerStatistics(key: string, amount: number, tsLastUpdate: number): void;
|
|
42
|
+
setPlayerStatistics(key: string, value: number, tsLastUpdate: number): void;
|
|
41
43
|
removePlayerStatistics(key: string): void;
|
|
42
44
|
getIpAddressCreate(): string;
|
|
43
45
|
setIpAddressCreate(ipAddressCreate: string): void;
|
|
@@ -47,7 +47,8 @@ export declare class TradeInventory extends DataObjectBase {
|
|
|
47
47
|
getAllItemStatistics(): Map<string, StatisticsItem>;
|
|
48
48
|
hasItemStatistics(key: string): boolean;
|
|
49
49
|
getItemStatistics(key: string): StatisticsItem;
|
|
50
|
-
changeItemStatistics(key: string,
|
|
50
|
+
changeItemStatistics(key: string, amount: number, tsLastUpdate: number): void;
|
|
51
|
+
setItemStatistics(key: string, value: number, tsLastUpdate: number): void;
|
|
51
52
|
removeItemStatistics(key: string): void;
|
|
52
53
|
getRemoveStatus(): RemoveStatusItem;
|
|
53
54
|
setRemoveStatus(tsRemove: number, reason?: string): void;
|
|
@@ -22,10 +22,10 @@ export declare class xDatabase {
|
|
|
22
22
|
private static readonly RUNTIME;
|
|
23
23
|
private static readonly META;
|
|
24
24
|
private static readonly SYSTEM;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
protected client: mongoDB.MongoClient;
|
|
26
|
+
protected db: mongoDB.Db;
|
|
27
|
+
protected logClient: mongoDB.MongoClient;
|
|
28
|
+
protected logDb: mongoDB.Db;
|
|
29
29
|
getDb(): mongoDB.Db;
|
|
30
30
|
getLogDb(): mongoDB.Db;
|
|
31
31
|
init(url: string, dbName: string, logUrl: string, logDbName: string, options?: mongoDB.MongoClientOptions): void;
|
|
@@ -1,93 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { xDatabase } from "./../../index";
|
|
2
2
|
|
|
3
|
-
export class CloudScriptDatabase {
|
|
4
|
-
|
|
5
|
-
private static readonly RUNTIME: string = "Runtime" + CloudScriptDatabase.DOT;
|
|
6
|
-
private static readonly META: string = "Meta" + CloudScriptDatabase.DOT;
|
|
7
|
-
private static readonly SYSTEM: string = "System" + CloudScriptDatabase.DOT;
|
|
8
|
-
|
|
9
|
-
private client: mongodb.MongoClient;
|
|
10
|
-
private db: mongodb.Db;
|
|
11
|
-
|
|
12
|
-
private logClient: mongodb.MongoClient;
|
|
13
|
-
private logDb: mongodb.Db;
|
|
14
|
-
|
|
15
|
-
init(url: string, dbName: string, logUrl: string, logDbName: string, options?: mongodb.MongoClientOptions): void {
|
|
16
|
-
this.client = new mongodb.MongoClient(url, options);
|
|
17
|
-
|
|
18
|
-
this.db = this.client.db(dbName);
|
|
19
|
-
|
|
20
|
-
if (!logUrl || logUrl == "" || logUrl == url) {
|
|
21
|
-
this.logClient = this.client;
|
|
22
|
-
this.logDb = this.db;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
this.logClient = new mongodb.MongoClient(logUrl, options);
|
|
26
|
-
this.logDb = this.logClient.db(logDbName);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public runtimeCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string): mongodb.Collection<TSchema> {
|
|
31
|
-
return this.collection<TSchema>(CloudScriptDatabase.RUNTIME + collectionName);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public metaCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string): mongodb.Collection<TSchema> {
|
|
35
|
-
return this.collection<TSchema>(CloudScriptDatabase.META + collectionName);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public systemCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string): mongodb.Collection<TSchema> {
|
|
39
|
-
return this.collection<TSchema>(CloudScriptDatabase.SYSTEM + collectionName);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public runtimeGameCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string, gameId: string): mongodb.Collection<TSchema> {
|
|
43
|
-
return this.collection<TSchema>(CloudScriptDatabase.RUNTIME + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public metaGameCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string, gameId: string): mongodb.Collection<TSchema> {
|
|
47
|
-
return this.collection<TSchema>(CloudScriptDatabase.META + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public systemGameCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string, gameId: string): mongodb.Collection<TSchema> {
|
|
51
|
-
return this.collection<TSchema>(CloudScriptDatabase.SYSTEM + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public collection<TSchema extends mongodb.Document = mongodb.Document>(fullCollectionName: string): mongodb.Collection<TSchema> {
|
|
55
|
-
return this.db.collection<TSchema>(fullCollectionName);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public createCollection(name: string, options?: mongodb.CreateCollectionOptions): Promise<mongodb.Collection<mongodb.BSON.Document>> {
|
|
59
|
-
return this.db.createCollection(name, options);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public logRuntimeCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string): mongodb.Collection<TSchema> {
|
|
63
|
-
return this.logCollection<TSchema>(CloudScriptDatabase.RUNTIME + collectionName);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public logMetaCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string): mongodb.Collection<TSchema> {
|
|
67
|
-
return this.logCollection<TSchema>(CloudScriptDatabase.META + collectionName);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public logSystemCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string): mongodb.Collection<TSchema> {
|
|
71
|
-
return this.logCollection<TSchema>(CloudScriptDatabase.SYSTEM + collectionName);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
public logRuntimeGameCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string, gameId: string): mongodb.Collection<TSchema> {
|
|
75
|
-
return this.logCollection<TSchema>(CloudScriptDatabase.RUNTIME + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public logMetaGameCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string, gameId: string): mongodb.Collection<TSchema> {
|
|
79
|
-
return this.logCollection<TSchema>(CloudScriptDatabase.META + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
public logSystemGameCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string, gameId: string): mongodb.Collection<TSchema> {
|
|
83
|
-
return this.logCollection<TSchema>(CloudScriptDatabase.SYSTEM + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
public logCollection<TSchema extends mongodb.Document = mongodb.Document>(fullCollectionName: string): mongodb.Collection<TSchema> {
|
|
87
|
-
return this.logDb.collection<TSchema>(fullCollectionName);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public logCreateCollection<TSchema extends mongodb.Document = mongodb.Document>(collectionName: string, options?: mongodb.CreateCollectionOptions) {
|
|
91
|
-
return this.logDb.createCollection<TSchema>(collectionName, options)
|
|
92
|
-
}
|
|
93
|
-
}
|
|
3
|
+
export class CloudScriptDatabase extends xDatabase {
|
|
4
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -218,6 +218,8 @@ import { TradeInventory } from "./GN-library/xdatabase/lib/entity/pro/TradeInven
|
|
|
218
218
|
export { TradeInventory };
|
|
219
219
|
import { UploadFileInfo } from "./GN-library/xdatabase/lib/entity/pro/UploadFileInfo";
|
|
220
220
|
export { UploadFileInfo };
|
|
221
|
+
import { FileUploadInfoFindOptions } from "./GN-library/xdatabase/lib/entity/pro/findOptions/FileUploadInfoFindOptions";
|
|
222
|
+
export { FileUploadInfoFindOptions };
|
|
221
223
|
import { xDatabase } from "./GN-library/xdatabase/lib/xDatabase";
|
|
222
224
|
export { xDatabase };
|
|
223
225
|
import { xDatetime } from "./GN-library/xdatetime/lib/xDatetime";
|