@xmobitea/gn-server 2.1.0 → 2.3.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/GNconfig.debug.json +30 -27
- package/dist/GN-app-api/handler/controller/handler/authenticate/LoginBaseRequestHandler.d.ts +1 -1
- package/dist/GN-app-api/handler/controller/handler/authenticate/LoginByGameCenterRequestHandler.d.ts +24 -0
- package/dist/GN-app-api/handler/controller/handler/authenticate/LoginByGooglePlayGameServiceRequestHandler.d.ts +19 -0
- package/dist/GN-app-api/handler/controller/handler/authenticate/RegisterAccountRequestHandler.d.ts +1 -6
- package/dist/GN-app-api/handler/controller/handler/authenticate/model/InfoRequestParam.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/base/RequestHandler.d.ts +1 -1
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/GetCreateLeaderboardRequestHandler.d.ts +23 -0
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/GetCurrencyLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/GetFriendStatisticsLeaderboardRequestHandler.d.ts +2 -1
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/GetStatisticsLeaderboardRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/GetStatisticsLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/SetPlayerCurrencyRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/SetPlayerStatisticsRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/characterPlayer/model/PlayerDataParam.d.ts +0 -1
- package/dist/GN-app-api/handler/controller/handler/cloudScript/ExecuteFunctionRequestHandler.d.ts +1 -1
- package/dist/GN-app-api/handler/controller/handler/content/GetContentDataRequestHandler.d.ts +1 -1
- package/dist/GN-app-api/handler/controller/handler/content/GetFileUploadInfoListRequestHandler.d.ts +0 -1
- package/dist/GN-app-api/handler/controller/handler/dashboard/GetAnalyticsRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/GetBackupStatisticsLeaderboardVersionRequestHandler.d.ts +18 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/GetEventCallbackCloudScriptRequestHandler.d.ts +15 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/GetServerGameDataRequestHandler.d.ts +34 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/GetServerLogRequestHandler.d.ts +2 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/GetUsernameAdminAccountRequestHandler.d.ts +16 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/GrantSecretInfoRequestHandler.d.ts +4 -1
- package/dist/GN-app-api/handler/controller/handler/dashboard/ResetStatisticsLeaderboardRequestHandler.d.ts +20 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/SetEventCallbackCloudScriptRequestHandler.d.ts +17 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/SetMasterGameSettingsRequestHandler.d.ts +4 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/AuthenticatePermissionRulesParam.d.ts +2 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/CharacterPlayerPermissionRulesParam.d.ts +3 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/ContentPermissionRulesParam.d.ts +2 -2
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/CurrencySettingsParam.d.ts +2 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/EmailSettingsParam.d.ts +4 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/GamePlayerPermissionRulesParam.d.ts +3 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/GroupPermissionRulesParam.d.ts +3 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/InventoryPermissionRulesParam.d.ts +2 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/MasterAdminPermissionRulesParam.d.ts +6 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/MasterPlayerPermissionRulesParam.d.ts +16 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/MatchmakingQueueSettingsParam.d.ts +4 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/MultiplayerPermissionRulesParam.d.ts +2 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/PushNotificationSettingsParam.d.ts +5 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/StatisticsSettingsParam.d.ts +3 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/StoreInventoryPermissionRulesParam.d.ts +3 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/TagSettingsParam.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/ThirtPartyAppleSettingsParam.d.ts +3 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/ThirtPartyGameCenterSettingsParam.d.ts +3 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/ThirtPartyGooglePlayGameSettingsParam.d.ts +6 -0
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/ThirtPartyGoogleSettingsParam.d.ts +3 -3
- package/dist/GN-app-api/handler/controller/handler/dashboard/model/ThirtPartyParam.d.ts +4 -0
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/GetCreateLeaderboardRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/GetCurrencyLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/GetFriendStatisticsLeaderboardRequestHandler.d.ts +2 -1
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/GetStatisticsLeaderboardRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/GetStatisticsLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/SetPlayerCurrencyRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/SetPlayerStatisticsRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/gamePlayer/model/PlayerDataParam.d.ts +0 -1
- package/dist/GN-app-api/handler/controller/handler/group/GetCreateLeaderboardRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/group/GetCurrencyLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/group/GetStatisticsLeaderboardRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/group/GetStatisticsLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/group/GroupBaseRequestHandler.d.ts +1 -1
- package/dist/GN-app-api/handler/controller/handler/group/SetGroupCurrencyRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/group/SetGroupStatisticsRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/group/model/GroupDataParam.d.ts +0 -1
- package/dist/GN-app-api/handler/controller/handler/inventory/GetCreateLeaderboardRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/inventory/GetStatisticsLeaderboardRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/inventory/GetStatisticsLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/inventory/SetItemStatisticsRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/inventory/model/ItemDataParam.d.ts +0 -1
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/AddPushNotificationRequestHandler.d.ts +20 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetCreateLeaderboardRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetCurrencyLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetLastLoginLeaderboardRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetPlayersWithGameCenterRequestHandler.d.ts +20 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetPlayersWithGooglePlayGameServiceRequestHandler.d.ts +20 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetPushNotificationRequestHandler.d.ts +18 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetStatisticsLeaderboardRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/GetStatisticsLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/LinkGameCenterRequestHandler.d.ts +25 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/LinkGooglePlayGameServiceRequestHandler.d.ts +20 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/MasterPlayerBaseRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/RemovePushNotificationRequestHandler.d.ts +19 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/SendEmailRequestHandler.d.ts +20 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/SendPushNotificationRequestHandler.d.ts +25 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/SendSocketOperationEventRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/SetPlayerCurrencyRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/SetPlayerStatisticsRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/UnlinkGameCenterRequestHandler.d.ts +19 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/UnlinkGooglePlayGameServiceRequestHandler.d.ts +19 -0
- package/dist/GN-app-api/handler/controller/handler/masterPlayer/model/InfoRequestParam.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/multiplayer/GetAllMatchRequestHandler.d.ts +20 -0
- package/dist/GN-app-api/handler/controller/handler/multiplayer/GetAllMatchmakingTicketRequestHandler.d.ts +21 -0
- package/dist/GN-app-api/handler/controller/handler/multiplayer/MatchmakingHandler.d.ts +2 -2
- package/dist/GN-app-api/handler/controller/handler/storeInventory/BuyStoreItemRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/GetCreateLeaderboardRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/GetStoreLogRequestHandler.d.ts +22 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/GrantStoreItemRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/PresentStoreItemRequestHandler.d.ts +21 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/SetStoreItemInformationRequestHandler.d.ts +8 -8
- package/dist/GN-app-api/handler/controller/handler/storeInventory/ValidateAppleAppStoreReceiptRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/ValidateFacebookStoreReceiptRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/ValidateGooglePlayStoreReceiptRequestHandler.d.ts +1 -0
- package/dist/GN-app-api/handler/controller/handler/storeInventory/model/InAppPurchaseParam.d.ts +4 -3
- package/dist/GN-app-api/service/AnalyticsService.d.ts +4 -2
- package/dist/GN-app-api/service/AppleService.d.ts +16 -4
- package/dist/GN-app-api/service/CloudScriptService.d.ts +14 -2
- package/dist/GN-app-api/service/CountryIPDetailService.d.ts +11 -0
- package/dist/GN-app-api/service/EventCallbackService.d.ts +103 -0
- package/dist/GN-app-api/service/GameCenterService.d.ts +19 -0
- package/dist/GN-app-api/service/GenericService.d.ts +3 -2
- package/dist/GN-app-api/service/GooglePlayGameService.d.ts +21 -0
- package/dist/GN-app-api/service/IAnalyticsService.d.ts +13 -2
- package/dist/GN-app-api/service/ICloudScriptService.d.ts +3 -1
- package/dist/GN-app-api/service/ICountryIPDetailService.d.ts +20 -0
- package/dist/GN-app-api/service/IGameCenterService.d.ts +13 -0
- package/dist/GN-app-api/service/IGenericService.d.ts +6 -3
- package/dist/GN-app-api/service/IGooglePlayGameService.d.ts +5 -0
- package/dist/GN-common/constant/Commands.d.ts +1 -0
- package/dist/GN-common/constant/OperationCode.d.ts +29 -0
- package/dist/GN-common/constant/enumType/OwnerType.d.ts +2 -1
- package/dist/GN-common/constant/enumType/PushPlatformType.d.ts +4 -0
- package/dist/GN-common/constant/enumType/StoreReceiveType.d.ts +7 -0
- package/dist/GN-common/constant/errorCode/GNErrorCode.d.ts +2 -0
- package/dist/GN-common/constant/parameterCode/GNParameterCode.d.ts +120 -1
- package/dist/GN-common/entity/SecretInfo.d.ts +48 -1
- package/dist/GN-common/helper/StringUtility.d.ts +1 -1
- package/dist/GN-library/xcachedata/lib/xCacheData.d.ts +1 -0
- package/dist/GN-library/xconfig/lib/xConfig.d.ts +2 -1
- package/dist/GN-library/xdatabase/lib/entity/pro/ExternalItem.d.ts +10 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/IPDetailItem.d.ts +5 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/MasterPlayer.d.ts +13 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/MongoObject.d.ts +2 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/PushNotificationItem.d.ts +5 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/StoreInventory.d.ts +1 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/findOptions/MasterPlayerFindOptions.d.ts +2 -0
- package/dist/GN-library/xdatabase/lib/entity/pro/masterAdmin/MasterGameSettings.d.ts +10 -0
- package/dist/GN-library/xdatabase/lib/xDatabase.d.ts +113 -10
- package/dist/GN-library/xdebug/lib/xDebug.d.ts +1 -0
- package/dist/GN-library/xmail/lib/xMail.d.ts +3 -1
- package/dist/GN-library/xnotification/lib/xPushNotification.d.ts +27 -0
- package/dist/GN-library/xsettings/lib/entity/xCurrencySettings.d.ts +2 -0
- package/dist/GN-library/xsettings/lib/entity/xEmailSettings.d.ts +4 -0
- package/dist/GN-library/xsettings/lib/entity/xPushNotificationSettings.d.ts +5 -0
- package/dist/GN-library/xsettings/lib/entity/xStatisticsSettings.d.ts +3 -0
- package/dist/GN-library/xsettings/lib/entity/xTagSettings.d.ts +1 -0
- package/dist/GN-library/xsettings/lib/entity/xThirtPartySettings.d.ts +12 -0
- package/dist/GN-startup/DefaultApplicationStartup.d.ts +1 -2
- package/dist/GN-startup/HttpApp.d.ts +0 -3
- package/dist/GN-startup/ServerApplication.d.ts +0 -4
- package/dist/GN-startup/cloudScript/eventCallbackCloudScriptData.json +1818 -0
- package/dist/GN-startup/cloudScript/templateCloudScript.ts +567 -0
- package/dist/GN-startup/cloudScript/templateEventCallback.ts +798 -0
- package/dist/GN-startup/middleware/AntiDdosMiddleware.d.ts +4 -1
- package/dist/GN-startup/middleware/ApiMiddleware.d.ts +1 -0
- package/dist/GN-startup/routes/AdminAppHandler.d.ts +0 -31
- package/dist/GN-startup/settings/DDosSettings.d.ts +3 -0
- package/dist/GN-startup/settings/OtherSettings.d.ts +6 -0
- package/dist/GNServer.d.ts +30 -4
- package/dist/index.d.ts +144 -6
- package/dist/index.js +21329 -6740
- package/gn.sh +7 -10
- package/package.json +24 -27
- package/syncCode.js +341 -341
- package/syncCodeVer2.js +176 -0
- package/dist/GN-startup/cloudScript/template.ts +0 -118
- package/dist/GN-startup/routes/www/public/admin/debug-common.js +0 -1233
- package/dist/GN-startup/routes/www/public/admin/index-common.js +0 -217
- package/dist/GN-startup/routes/www/public/admin/log-common.js +0 -52
- package/dist/GN-startup/routes/www/public/admin/signin-common.js +0 -35
- package/dist/GN-startup/routes/www/public/assets/demo/chart-area-demo.js +0 -54
- package/dist/GN-startup/routes/www/public/assets/demo/chart-bar-demo.js +0 -46
- package/dist/GN-startup/routes/www/public/assets/demo/chart-pie-demo.js +0 -16
- package/dist/GN-startup/routes/www/public/assets/demo/datatables-demo.js +0 -4
- package/dist/GN-startup/routes/www/public/assets/img/error-404-monochrome.svg +0 -1
- package/dist/GN-startup/routes/www/public/css/styles.css +0 -11701
- package/dist/GN-startup/routes/www/public/favicon.ico +0 -0
- package/dist/GN-startup/routes/www/public/favicon.png +0 -0
- package/dist/GN-startup/routes/www/public/js/scripts.js +0 -26
- package/dist/GN-startup/routes/www/views/101.ejs +0 -21
- package/dist/GN-startup/routes/www/views/401.ejs +0 -25
- package/dist/GN-startup/routes/www/views/403.ejs +0 -21
- package/dist/GN-startup/routes/www/views/404.ejs +0 -25
- package/dist/GN-startup/routes/www/views/500.ejs +0 -25
- package/dist/GN-startup/routes/www/views/admin/change-password.ejs +0 -46
- package/dist/GN-startup/routes/www/views/admin/debug.ejs +0 -14
- package/dist/GN-startup/routes/www/views/admin/index.ejs +0 -28
- package/dist/GN-startup/routes/www/views/admin/log.ejs +0 -16
- package/dist/GN-startup/routes/www/views/admin/signin.ejs +0 -56
- package/dist/GN-startup/routes/www/views/layout.ejs +0 -8
- package/dist/GN-startup/routes/www/views/partials/areachart.ejs +0 -9
- package/dist/GN-startup/routes/www/views/partials/areachartccu.ejs +0 -9
- package/dist/GN-startup/routes/www/views/partials/barchart.ejs +0 -9
- package/dist/GN-startup/routes/www/views/partials/barcharttotal.ejs +0 -9
- package/dist/GN-startup/routes/www/views/partials/common/footer.ejs +0 -14
- package/dist/GN-startup/routes/www/views/partials/common/head.ejs +0 -11
- package/dist/GN-startup/routes/www/views/partials/dau.ejs +0 -41
- package/dist/GN-startup/routes/www/views/partials/debugboard.ejs +0 -90
- package/dist/GN-startup/routes/www/views/partials/description.ejs +0 -20
- package/dist/GN-startup/routes/www/views/partials/logtable.ejs +0 -50
- package/dist/GN-startup/routes/www/views/partials/piechart.ejs +0 -7
- package/dist/GN-startup/routes/www/views/partials/sidenav.ejs +0 -83
- package/dist/GN-startup/routes/www/views/partials/topnav.ejs +0 -53
- package/dist/GN-startup/settings/MailSettings.d.ts +0 -22
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
import { parentPort, workerData } from "worker_threads";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
GNNetwork,
|
|
5
|
+
Action0,
|
|
6
|
+
Action1,
|
|
7
|
+
Action2,
|
|
8
|
+
Action3,
|
|
9
|
+
Action4,
|
|
10
|
+
ConverterService,
|
|
11
|
+
OwnerType,
|
|
12
|
+
GNErrorCode,
|
|
13
|
+
GNParameterCode,
|
|
14
|
+
ParameterCode,
|
|
15
|
+
Commands,
|
|
16
|
+
EventCode,
|
|
17
|
+
OperationCode,
|
|
18
|
+
ReturnCode,
|
|
19
|
+
CodeHelper,
|
|
20
|
+
DataMember,
|
|
21
|
+
StringDataMember,
|
|
22
|
+
BooleanDataMember,
|
|
23
|
+
GNHashtableDataMember,
|
|
24
|
+
GNArrayDataMember,
|
|
25
|
+
NumberDataMember,
|
|
26
|
+
GNHashtableBuilder,
|
|
27
|
+
GNHashtable,
|
|
28
|
+
GNArrayBuilder,
|
|
29
|
+
GNArray,
|
|
30
|
+
InvalidMemberType,
|
|
31
|
+
InvalidMember,
|
|
32
|
+
RequestType,
|
|
33
|
+
RequestRole,
|
|
34
|
+
CustomOperationRequest,
|
|
35
|
+
CustomOperationRequestAbstract,
|
|
36
|
+
CustomOperationResponse,
|
|
37
|
+
Constructor,
|
|
38
|
+
AbstractConstructor,
|
|
39
|
+
FieldDataType,
|
|
40
|
+
GNObjectFieldMetadata,
|
|
41
|
+
GNObjectMetadata,
|
|
42
|
+
CustomOperationResponseAbstract,
|
|
43
|
+
IServerEventHandler,
|
|
44
|
+
OperationEvent,
|
|
45
|
+
OperationRequest,
|
|
46
|
+
OperationResponse,
|
|
47
|
+
GenericModels,
|
|
48
|
+
CharacterPlayerModels,
|
|
49
|
+
ContentModels,
|
|
50
|
+
GamePlayerModels,
|
|
51
|
+
GroupModels,
|
|
52
|
+
InventoryModels,
|
|
53
|
+
MasterPlayerModels,
|
|
54
|
+
StoreInventoryModels,
|
|
55
|
+
MultiplayerModels,
|
|
56
|
+
CloudScriptModels,
|
|
57
|
+
GNServerSettingsOptions,
|
|
58
|
+
GNServerSettings,
|
|
59
|
+
PermissionDataItem,
|
|
60
|
+
FriendStatus,
|
|
61
|
+
GoogleLoginType,
|
|
62
|
+
GroupStatus,
|
|
63
|
+
GNDebug,
|
|
64
|
+
ItemType,
|
|
65
|
+
LogType,
|
|
66
|
+
GNSupport,
|
|
67
|
+
PostType,
|
|
68
|
+
} from "@xmobitea/gn-typescript-client";
|
|
69
|
+
|
|
70
|
+
import * as mongodb from "mongodb";
|
|
71
|
+
import * as axios from "axios";
|
|
72
|
+
|
|
73
|
+
enum CloudScriptEventType {
|
|
74
|
+
SendToUser = 0,
|
|
75
|
+
SendToMore = 1,
|
|
76
|
+
SendToAll = 2,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface CloudScriptEvent {
|
|
80
|
+
eventType: CloudScriptEventType;
|
|
81
|
+
operationEvent: {
|
|
82
|
+
eventCode: number;
|
|
83
|
+
parameters: {} | null;
|
|
84
|
+
encrypted: boolean;
|
|
85
|
+
};
|
|
86
|
+
receiver: string[] | string | null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
class CloudScriptAdmin {
|
|
90
|
+
public readonly characterPlayer = GNNetwork.characterPlayer.admin;
|
|
91
|
+
public readonly content = GNNetwork.content.admin;
|
|
92
|
+
public readonly gamePlayer = GNNetwork.gamePlayer.admin;
|
|
93
|
+
public readonly group = GNNetwork.group.admin;
|
|
94
|
+
public readonly inventory = GNNetwork.inventory.admin;
|
|
95
|
+
public readonly masterPlayer = GNNetwork.masterPlayer.admin;
|
|
96
|
+
public readonly storeInventory = GNNetwork.storeInventory.admin;
|
|
97
|
+
public readonly multiplayer = GNNetwork.multiplayer.admin;
|
|
98
|
+
public readonly cloudScript = GNNetwork.cloudScript.admin;
|
|
99
|
+
public readonly dashboard = GNNetwork.dashboard;
|
|
100
|
+
public send(
|
|
101
|
+
requestType: RequestType,
|
|
102
|
+
requestRole: RequestRole,
|
|
103
|
+
request: OperationRequest,
|
|
104
|
+
onResponse: Action1<OperationResponse>,
|
|
105
|
+
overrideAuthToken: string,
|
|
106
|
+
overrideSecretKey: string,
|
|
107
|
+
customTags: GNHashtable
|
|
108
|
+
): void {
|
|
109
|
+
GNNetwork.sendViaHttp(requestType, requestRole, request, onResponse, overrideAuthToken, overrideSecretKey, customTags);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
public sendAsync(
|
|
113
|
+
requestType: RequestType,
|
|
114
|
+
requestRole: RequestRole,
|
|
115
|
+
request: OperationRequest,
|
|
116
|
+
overrideAuthToken: string,
|
|
117
|
+
overrideSecretKey: string,
|
|
118
|
+
customTags: GNHashtable
|
|
119
|
+
): Promise<OperationResponse> {
|
|
120
|
+
return GNNetwork.sendViaHttpAsync(requestType, requestRole, request, overrideAuthToken, overrideSecretKey, customTags);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
class CloudScriptDatabase {
|
|
125
|
+
private static readonly DOT: string = ".";
|
|
126
|
+
private static readonly RUNTIME: string = "Runtime" + CloudScriptDatabase.DOT;
|
|
127
|
+
private static readonly META: string = "Meta" + CloudScriptDatabase.DOT;
|
|
128
|
+
private static readonly SYSTEM: string = "System" + CloudScriptDatabase.DOT;
|
|
129
|
+
|
|
130
|
+
private client: mongodb.MongoClient;
|
|
131
|
+
private db: mongodb.Db;
|
|
132
|
+
|
|
133
|
+
init(url: string, dbName: string, options?: mongodb.MongoClientOptions): void {
|
|
134
|
+
this.client = new mongodb.MongoClient(url, options);
|
|
135
|
+
|
|
136
|
+
this.db = this.client.db(dbName);
|
|
137
|
+
|
|
138
|
+
this.client.connect();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public runtimeCollection(collectionName: string): mongodb.Collection<mongodb.Document> {
|
|
142
|
+
return this.collection(CloudScriptDatabase.RUNTIME + collectionName);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
public metaCollection(collectionName: string): mongodb.Collection<mongodb.Document> {
|
|
146
|
+
return this.collection(CloudScriptDatabase.META + collectionName);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public systemCollection(collectionName: string): mongodb.Collection<mongodb.Document> {
|
|
150
|
+
return this.collection(CloudScriptDatabase.SYSTEM + collectionName);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public runtimeGameCollection(collectionName: string, gameId: string): mongodb.Collection<mongodb.Document> {
|
|
154
|
+
return this.collection(CloudScriptDatabase.RUNTIME + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public metaGameCollection(collectionName: string, gameId: string): mongodb.Collection<mongodb.Document> {
|
|
158
|
+
return this.collection(CloudScriptDatabase.META + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public systemGameCollection(collectionName: string, gameId: string): mongodb.Collection<mongodb.Document> {
|
|
162
|
+
return this.collection(CloudScriptDatabase.SYSTEM + gameId + CloudScriptDatabase.DOT + collectionName);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
public collection(fullCollectionName: string): mongodb.Collection<mongodb.Document> {
|
|
166
|
+
return this.db.collection(fullCollectionName);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
public createCollection(name: string, options?: mongodb.CreateCollectionOptions): Promise<mongodb.Collection<mongodb.BSON.Document>> {
|
|
170
|
+
return this.db.createCollection(name, options);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
class CloudScriptHttp {
|
|
175
|
+
public async get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R> {
|
|
176
|
+
return await axios.default.get<T, R, D>(url, config);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public async delete<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R> {
|
|
180
|
+
return await axios.default.delete<T, R, D>(url, config);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public async head<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R> {
|
|
184
|
+
return await axios.default.head<T, R, D>(url, config);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
public async options<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R> {
|
|
188
|
+
return await axios.default.options<T, R, D>(url, config);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
public async post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: any, config?: axios.AxiosRequestConfig<D>): Promise<R> {
|
|
192
|
+
return await axios.default.post<T, R, D>(url, data, config);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
public async put<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: any, config?: axios.AxiosRequestConfig<D>): Promise<R> {
|
|
196
|
+
return await axios.default.put<T, R, D>(url, data, config);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
public async patch<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: any, config?: axios.AxiosRequestConfig<D>): Promise<R> {
|
|
200
|
+
return await axios.default.patch<T, R, D>(url, data, config);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
class CloudScriptSocket {
|
|
205
|
+
public async sendEventTo(userId: string, operationEvent: OperationEvent): Promise<void> {
|
|
206
|
+
return await this.sendEvent({
|
|
207
|
+
eventType: CloudScriptEventType.SendToUser,
|
|
208
|
+
receiver: userId,
|
|
209
|
+
operationEvent: {
|
|
210
|
+
eventCode: operationEvent.getEventCode(),
|
|
211
|
+
encrypted: operationEvent.isEncrypted(),
|
|
212
|
+
parameters: operationEvent.getParameters()?.toData() ?? null,
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public async sendEventToMoreUser(userIds: string[], operationEvent: OperationEvent): Promise<void> {
|
|
218
|
+
return await this.sendEvent({
|
|
219
|
+
eventType: CloudScriptEventType.SendToMore,
|
|
220
|
+
receiver: userIds,
|
|
221
|
+
operationEvent: {
|
|
222
|
+
eventCode: operationEvent.getEventCode(),
|
|
223
|
+
encrypted: operationEvent.isEncrypted(),
|
|
224
|
+
parameters: operationEvent.getParameters()?.toData() ?? null,
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
public async sendEventToAllPlayer(operationEvent: OperationEvent): Promise<void> {
|
|
230
|
+
return await this.sendEvent({
|
|
231
|
+
eventType: CloudScriptEventType.SendToAll,
|
|
232
|
+
receiver: null,
|
|
233
|
+
operationEvent: {
|
|
234
|
+
eventCode: operationEvent.getEventCode(),
|
|
235
|
+
encrypted: operationEvent.isEncrypted(),
|
|
236
|
+
parameters: operationEvent.getParameters()?.toData() ?? null,
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
private async sendEvent(event: CloudScriptEvent) {
|
|
242
|
+
parentPort?.postMessage(event);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
class CloudScriptMail {
|
|
247
|
+
public async send(email: string, subject: string, contentHtml: string) {
|
|
248
|
+
parentPort?.postMessage({
|
|
249
|
+
eventType: 20,
|
|
250
|
+
receiver: null,
|
|
251
|
+
operationEvent: {
|
|
252
|
+
eventCode: 0,
|
|
253
|
+
encrypted: false,
|
|
254
|
+
parameters: {
|
|
255
|
+
email: email,
|
|
256
|
+
subject: subject,
|
|
257
|
+
contentHtml: contentHtml,
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
public async sendToMore(emails: string[], subject: string, contentHtml: string) {
|
|
264
|
+
parentPort?.postMessage({
|
|
265
|
+
eventType: 21,
|
|
266
|
+
receiver: null,
|
|
267
|
+
operationEvent: {
|
|
268
|
+
eventCode: 0,
|
|
269
|
+
encrypted: false,
|
|
270
|
+
parameters: {
|
|
271
|
+
emails: emails,
|
|
272
|
+
subject: subject,
|
|
273
|
+
contentHtml: contentHtml,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
class CloudScriptPushNotification {
|
|
281
|
+
public async send(token: string, title: string, body: string, badge?: number, sound?: string, icon?: string, data?: { [k: string]: any }) {
|
|
282
|
+
parentPort?.postMessage({
|
|
283
|
+
eventType: 30,
|
|
284
|
+
receiver: null,
|
|
285
|
+
operationEvent: {
|
|
286
|
+
eventCode: 0,
|
|
287
|
+
encrypted: false,
|
|
288
|
+
parameters: {
|
|
289
|
+
token: token,
|
|
290
|
+
title: title,
|
|
291
|
+
body: body,
|
|
292
|
+
badge: badge,
|
|
293
|
+
sound: sound,
|
|
294
|
+
icon: icon,
|
|
295
|
+
data: data,
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
public async sendToMore(tokens: string[], title: string, body: string, badge?: number, sound?: string, icon?: string, data?: { [k: string]: any }) {
|
|
302
|
+
parentPort?.postMessage({
|
|
303
|
+
eventType: 31,
|
|
304
|
+
receiver: null,
|
|
305
|
+
operationEvent: {
|
|
306
|
+
eventCode: 0,
|
|
307
|
+
encrypted: false,
|
|
308
|
+
parameters: {
|
|
309
|
+
tokens: tokens,
|
|
310
|
+
title: title,
|
|
311
|
+
body: body,
|
|
312
|
+
badge: badge,
|
|
313
|
+
sound: sound,
|
|
314
|
+
icon: icon,
|
|
315
|
+
data: data,
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
public async sendToTopic(topic: string, title: string, body: string, badge?: number, sound?: string, icon?: string, data?: { [k: string]: any }) {
|
|
322
|
+
parentPort?.postMessage({
|
|
323
|
+
eventType: 32,
|
|
324
|
+
receiver: null,
|
|
325
|
+
operationEvent: {
|
|
326
|
+
eventCode: 0,
|
|
327
|
+
encrypted: false,
|
|
328
|
+
parameters: {
|
|
329
|
+
topic: topic,
|
|
330
|
+
title: title,
|
|
331
|
+
body: body,
|
|
332
|
+
badge: badge,
|
|
333
|
+
sound: sound,
|
|
334
|
+
icon: icon,
|
|
335
|
+
data: data,
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface CloudScriptRequest {
|
|
343
|
+
requestId: string;
|
|
344
|
+
userId: string;
|
|
345
|
+
name: string;
|
|
346
|
+
parameters: object;
|
|
347
|
+
customTags: { [k: string]: any };
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
interface CloudScriptResponse {
|
|
351
|
+
stats: {
|
|
352
|
+
memoryUsedInBytes: number;
|
|
353
|
+
executeTimeInMs: number;
|
|
354
|
+
};
|
|
355
|
+
response: FunctionResponse;
|
|
356
|
+
responseId: string;
|
|
357
|
+
logs: string[];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
interface FunctionRequest {
|
|
361
|
+
userId: string;
|
|
362
|
+
name: string;
|
|
363
|
+
parameters: any;
|
|
364
|
+
customTags: { [k: string]: any };
|
|
365
|
+
context: {};
|
|
366
|
+
log: (log: any) => void;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
enum ExecuteResponseStatus {
|
|
370
|
+
Ok = 1,
|
|
371
|
+
Exception = 2,
|
|
372
|
+
FunctionNameNotFound = 3,
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
interface FunctionResponse {
|
|
376
|
+
status: ExecuteResponseStatus;
|
|
377
|
+
result: any;
|
|
378
|
+
errorMessage: any;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const ConvertObject = (result: any) => {
|
|
382
|
+
if (result) {
|
|
383
|
+
if (result instanceof GNHashtable) {
|
|
384
|
+
result = (<GNHashtable>result).toData();
|
|
385
|
+
}
|
|
386
|
+
else if (result instanceof GNArray) {
|
|
387
|
+
result = (<GNArray>result).toData();
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
let typeofObject = typeof (result);
|
|
391
|
+
if (typeofObject == "object") {
|
|
392
|
+
if (Array.isArray(result)) {
|
|
393
|
+
result = ConvertArray(result as any[]);
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
let answer = {} as any;
|
|
397
|
+
|
|
398
|
+
let keys = Object.keys(result);
|
|
399
|
+
|
|
400
|
+
for (let i = 0; i < keys.length; i++) {
|
|
401
|
+
let key = keys[i];
|
|
402
|
+
let value = ConvertObject(result[key]);
|
|
403
|
+
|
|
404
|
+
if (value) {
|
|
405
|
+
answer[key] = value;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
result = answer;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
else if (typeofObject == "function") {
|
|
413
|
+
result = null;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return result;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const ConvertArray = (results: any[]) => {
|
|
422
|
+
let answer: any[] = [];
|
|
423
|
+
|
|
424
|
+
for (let i = 0; i < results.length; i++) {
|
|
425
|
+
let result = ConvertObject(results[i]);
|
|
426
|
+
|
|
427
|
+
answer.push(result);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return answer;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
if (parentPort) {
|
|
434
|
+
parentPort.on("message", async (request: CloudScriptRequest) => {
|
|
435
|
+
let startTime = performance.now();
|
|
436
|
+
let startMemoryUsage = process.memoryUsage();
|
|
437
|
+
|
|
438
|
+
let logs: string[] = [];
|
|
439
|
+
let functionRequest: FunctionRequest = {
|
|
440
|
+
userId: request.userId,
|
|
441
|
+
name: request.name,
|
|
442
|
+
parameters: request.parameters,
|
|
443
|
+
context: {},
|
|
444
|
+
customTags: request.customTags,
|
|
445
|
+
log(log: any) {
|
|
446
|
+
logs.push(log);
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
let handleResponse = await ___handleFunction(functionRequest);
|
|
451
|
+
|
|
452
|
+
if (handleResponse.result) {
|
|
453
|
+
if (handleResponse.result instanceof GNHashtable) {
|
|
454
|
+
handleResponse.result = (<GNHashtable>handleResponse.result).toData();
|
|
455
|
+
}
|
|
456
|
+
else if (handleResponse.result instanceof GNArray) {
|
|
457
|
+
handleResponse.result = (<GNArray>handleResponse.result).toData();
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
let typeofResult = typeof (handleResponse.result);
|
|
461
|
+
|
|
462
|
+
if (typeofResult == "boolean") {
|
|
463
|
+
|
|
464
|
+
}
|
|
465
|
+
else if (typeofResult == "number") {
|
|
466
|
+
|
|
467
|
+
}
|
|
468
|
+
else if (typeofResult == "object") {
|
|
469
|
+
if (Array.isArray(handleResponse.result)) {
|
|
470
|
+
|
|
471
|
+
handleResponse.result = ConvertArray(handleResponse.result as any[]);
|
|
472
|
+
//answer.push(this.deserializeArray(gnArray.getGNArray(i), cls));
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
handleResponse.result = ConvertObject(handleResponse.result);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
else if (typeofResult == "string") {
|
|
479
|
+
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
handleResponse.result = null;
|
|
483
|
+
|
|
484
|
+
handleResponse.errorMessage = "CloudScript must return void, number, string, boolean, null, json dictionary, json array, GNHashtable or GNArray";
|
|
485
|
+
handleResponse.status = ExecuteResponseStatus.Exception;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
let endTime = performance.now();
|
|
491
|
+
let endMemoryUsage = process.memoryUsage();
|
|
492
|
+
|
|
493
|
+
let memoryUsedInBytes = endMemoryUsage.rss - startMemoryUsage.rss;
|
|
494
|
+
let executeTimeInMs = endTime - startTime;
|
|
495
|
+
|
|
496
|
+
//let cost = (memoryUsedInGb * executeTime) / 1000 * 0.022;
|
|
497
|
+
|
|
498
|
+
let response: CloudScriptResponse = {
|
|
499
|
+
responseId: request.requestId,
|
|
500
|
+
response: handleResponse,
|
|
501
|
+
stats: {
|
|
502
|
+
executeTimeInMs: executeTimeInMs,
|
|
503
|
+
memoryUsedInBytes: memoryUsedInBytes,
|
|
504
|
+
},
|
|
505
|
+
logs: logs,
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
parentPort?.postMessage(response);
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
async function ___handleFunction(request: FunctionRequest): Promise<FunctionResponse> {
|
|
513
|
+
let handler = handlers[request.name];
|
|
514
|
+
|
|
515
|
+
if (handler == null) {
|
|
516
|
+
return {
|
|
517
|
+
status: ExecuteResponseStatus.FunctionNameNotFound,
|
|
518
|
+
result: null,
|
|
519
|
+
errorMessage: null,
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
let answer: FunctionResponse = {
|
|
524
|
+
status: ExecuteResponseStatus.Ok,
|
|
525
|
+
errorMessage: null,
|
|
526
|
+
result: null,
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
try {
|
|
530
|
+
answer.result = await handler(request.parameters, { userId: request.userId, customTags: request.customTags }, request.log);
|
|
531
|
+
} catch (err: any) {
|
|
532
|
+
answer.status = ExecuteResponseStatus.Exception;
|
|
533
|
+
answer.errorMessage = err.message;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
return answer;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
{
|
|
540
|
+
let gnServerSettingsOptions: GNServerSettingsOptions = workerData.gnServerSettingsOptions;
|
|
541
|
+
|
|
542
|
+
let gnServerSettings = new GNServerSettings();
|
|
543
|
+
gnServerSettings.config(gnServerSettingsOptions);
|
|
544
|
+
|
|
545
|
+
GNNetwork.init(gnServerSettings);
|
|
546
|
+
|
|
547
|
+
let gameId = workerData.gameId;
|
|
548
|
+
GNNetwork.setGameId(gameId);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
const gameId: string = workerData.gameId;
|
|
552
|
+
|
|
553
|
+
const admin = new CloudScriptAdmin();
|
|
554
|
+
const database = new CloudScriptDatabase();
|
|
555
|
+
const http = new CloudScriptHttp();
|
|
556
|
+
const socket = new CloudScriptSocket();
|
|
557
|
+
const mail = new CloudScriptMail();
|
|
558
|
+
const pushNotification = new CloudScriptPushNotification();
|
|
559
|
+
|
|
560
|
+
{
|
|
561
|
+
let dbConnection = workerData.dbConnection;
|
|
562
|
+
database.init(dbConnection.url, dbConnection.dbName, dbConnection.options);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const handlers: Record<string, (args?: any, context?: { userId: string; customTags: { [k: string]: any } }, log?: (log: any) => void) => any> = {};
|
|
566
|
+
|
|
567
|
+
//$replaceScript
|