@xmobitea/gn-server 2.4.4 → 2.4.6
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.
|
@@ -562,6 +562,6 @@ const pushNotification = new CloudScriptPushNotification();
|
|
|
562
562
|
database.init(dbConnection.url, dbConnection.dbName, dbConnection.options);
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
-
const handlers: Record<string, (args
|
|
565
|
+
const handlers: Record<string, (args: any, context: { userId: string; customTags: { [k: string]: any } }, log: (log: any) => void) => any> = {};
|
|
566
566
|
|
|
567
567
|
//$replaceScript
|
|
@@ -466,7 +466,7 @@ interface CloudScriptRequest {
|
|
|
466
466
|
parameters: {};
|
|
467
467
|
encrypted: boolean;
|
|
468
468
|
};
|
|
469
|
-
log
|
|
469
|
+
log: (log: any) => void;
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
interface CloudScriptResponse {
|
|
@@ -787,12 +787,12 @@ const pushNotification = new CloudScriptPushNotification();
|
|
|
787
787
|
database.init(dbConnection.url, dbConnection.dbName, dbConnection.options);
|
|
788
788
|
}
|
|
789
789
|
|
|
790
|
-
const preHandlers: Record<string, (request: any, secretInfo: SecretInfo, operationRequest: OperationRequest, log
|
|
790
|
+
const preHandlers: Record<string, (request: any, secretInfo: SecretInfo, operationRequest: OperationRequest, log: (log: any) => void) => Promise<OperationResponse | null>> = {};
|
|
791
791
|
|
|
792
|
-
const postHandlers: Record<string, (request: any, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log
|
|
792
|
+
const postHandlers: Record<string, (request: any, secretInfo: SecretInfo, operationRequest: OperationRequest, operationResponse: OperationResponse, log: (log: any) => void) => Promise<OperationResponse>> = {};
|
|
793
793
|
|
|
794
|
-
const systemHandlers: Record<string, (log
|
|
794
|
+
const systemHandlers: Record<string, (log: (log: any) => void) => Promise<void>> = {};
|
|
795
795
|
|
|
796
|
-
const systemMatchmakingHandlers: Record<string, (gameId: string, matchmakingTicketCanMatch: MatchmakingTicketCanMatch, log
|
|
796
|
+
const systemMatchmakingHandlers: Record<string, (gameId: string, matchmakingTicketCanMatch: MatchmakingTicketCanMatch, log: (log: any) => void) => Promise<{ success: boolean }>> = {};
|
|
797
797
|
|
|
798
798
|
//$replaceScript
|
package/dist/index.js
CHANGED
|
@@ -13622,6 +13622,7 @@ const GNParameterCode_1 = __webpack_require__(38343);
|
|
|
13622
13622
|
const GNErrorCode_1 = __webpack_require__(94559);
|
|
13623
13623
|
const RequestHandler_1 = __webpack_require__(47239);
|
|
13624
13624
|
const ICloudScriptService_1 = __webpack_require__(64469);
|
|
13625
|
+
const GNData_1 = __webpack_require__(67549);
|
|
13625
13626
|
class ExecuteFunctionOperationRequest extends OperationRequest_1.OperationRequest {
|
|
13626
13627
|
isValidRequest() {
|
|
13627
13628
|
if (!super.isValidRequest())
|
|
@@ -13749,7 +13750,13 @@ class ExecuteFunctionRequestHandler extends RequestHandler_1.RequestHandler {
|
|
|
13749
13750
|
operationResponse.setParameter(ParameterCode_1.ParameterCode.ErrorCode, GNErrorCode_1.GNErrorCode.GameNotFound);
|
|
13750
13751
|
return operationResponse;
|
|
13751
13752
|
}
|
|
13752
|
-
let
|
|
13753
|
+
let functionParameters = request.functionParameters;
|
|
13754
|
+
if (functionParameters != null) {
|
|
13755
|
+
if (functionParameters instanceof GNData_1.GNData) {
|
|
13756
|
+
functionParameters = functionParameters.toData();
|
|
13757
|
+
}
|
|
13758
|
+
}
|
|
13759
|
+
let response = yield cloudScriptService.executeCloudScriptFunction(request.userId, request.functionName, functionParameters, request.version, customTagsData);
|
|
13753
13760
|
operationResponse.setParameter(GNParameterCode_1.GNParameterCode.FunctionLogs, response.logs);
|
|
13754
13761
|
if (response.response.status == ICloudScriptService_1.ExecuteResponseStatus.Ok) {
|
|
13755
13762
|
operationResponse.setParameter(ParameterCode_1.ParameterCode.ErrorCode, GNErrorCode_1.GNErrorCode.Ok);
|
|
@@ -75630,7 +75637,7 @@ class CloudScriptService {
|
|
|
75630
75637
|
let fullScriptTs = fs_1.default.readFileSync(templateFullScriptPathTs).toString().replace("//$replaceScript", script);
|
|
75631
75638
|
fs_1.default.writeFileSync(filePathTempTs, fullScriptTs);
|
|
75632
75639
|
let filePathTemp = __dirname + "/./GN-startup/cloudScript";
|
|
75633
|
-
yield (0, child_process_1.execSync)("npx tsc " + filePathTempTs + " --noImplicitAny --allowJs --outDir " + filePathTemp);
|
|
75640
|
+
yield (0, child_process_1.execSync)("npx tsc " + filePathTempTs + " --noImplicitAny --allowJs --skipLibCheck --outDir " + filePathTemp);
|
|
75634
75641
|
let filePathTempJs = __dirname + "/./GN-startup/cloudScript/temp.js";
|
|
75635
75642
|
fullScriptJs = fs_1.default.readFileSync(filePathTempJs).toString();
|
|
75636
75643
|
if (canExecute) {
|
|
@@ -76419,7 +76426,7 @@ class EventCallbackCloudScriptService {
|
|
|
76419
76426
|
let fullScriptTs = fs_1.default.readFileSync(templateFullScriptPathTs).toString().replace("//$replaceScript", finalScript);
|
|
76420
76427
|
fs_1.default.writeFileSync(filePathTempTs, fullScriptTs);
|
|
76421
76428
|
let filePathTemp = __dirname + "/./GN-startup/cloudScript";
|
|
76422
|
-
yield (0, child_process_1.execSync)("npx tsc " + filePathTempTs + " --noImplicitAny --allowJs --esModuleInterop --outDir " + filePathTemp);
|
|
76429
|
+
yield (0, child_process_1.execSync)("npx tsc " + filePathTempTs + " --noImplicitAny --allowJs --skipLibCheck --esModuleInterop --outDir " + filePathTemp);
|
|
76423
76430
|
let filePathTempJs = __dirname + "/./GN-startup/cloudScript/temp2.js";
|
|
76424
76431
|
fullScriptJs = fs_1.default.readFileSync(filePathTempJs).toString();
|
|
76425
76432
|
let finalVersion = cloudFunction.type + "_" + cloudFunction.version;
|