@xmobitea/gn-typescript-client 2.6.13 → 2.6.14
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/AGENTS.md +37 -0
- package/README.MD +420 -1
- package/dist/gearn.js.client.js +25056 -1056
- package/dist/gearn.js.client.min.js +1 -1
- package/dist/index.d.ts +30 -0
- package/dist/index.js +24236 -212
- package/dist/runtime/GNNetwork.d.ts +687 -3
- package/dist/runtime/GNNetworkAuthenticateApi.d.ts +327 -0
- package/dist/runtime/GNNetworkCharacterPlayerApi.d.ts +1026 -0
- package/dist/runtime/GNNetworkCloudScriptApi.d.ts +141 -0
- package/dist/runtime/GNNetworkContentApi.d.ts +243 -0
- package/dist/runtime/GNNetworkDashboardApi.d.ts +221 -0
- package/dist/runtime/GNNetworkGamePlayerApi.d.ts +1033 -0
- package/dist/runtime/GNNetworkGroupApi.d.ts +783 -0
- package/dist/runtime/GNNetworkInventoryApi.d.ts +673 -0
- package/dist/runtime/GNNetworkMasterPlayerApi.d.ts +1614 -6
- package/dist/runtime/GNNetworkMultiplayerApi.d.ts +234 -0
- package/dist/runtime/GNNetworkStoreInventoryApi.d.ts +309 -0
- package/dist/runtime/common/Action0.d.ts +30 -0
- package/dist/runtime/common/Action1.d.ts +32 -0
- package/dist/runtime/common/Action2.d.ts +21 -0
- package/dist/runtime/common/Action3.d.ts +16 -0
- package/dist/runtime/common/Action4.d.ts +17 -0
- package/dist/runtime/common/GNData.d.ts +368 -0
- package/dist/runtime/config/GNServerSettings.d.ts +442 -12
- package/dist/runtime/constant/Commands.d.ts +80 -0
- package/dist/runtime/constant/EventCode.d.ts +48 -0
- package/dist/runtime/constant/OperationCode.d.ts +74 -1
- package/dist/runtime/constant/ReturnCode.d.ts +72 -0
- package/dist/runtime/constant/enumType/ExecuteResponseStatus.d.ts +31 -0
- package/dist/runtime/constant/enumType/FriendStatus.d.ts +39 -0
- package/dist/runtime/constant/enumType/GoogleLoginType.d.ts +23 -0
- package/dist/runtime/constant/enumType/GroupStatus.d.ts +32 -0
- package/dist/runtime/constant/enumType/InvalidMemberType.d.ts +75 -0
- package/dist/runtime/constant/enumType/ItemType.d.ts +23 -0
- package/dist/runtime/constant/enumType/MatchStatus.d.ts +30 -0
- package/dist/runtime/constant/enumType/MatchmakingMemberStatus.d.ts +24 -0
- package/dist/runtime/constant/enumType/MatchmakingTicketStatus.d.ts +34 -0
- package/dist/runtime/constant/enumType/OwnerType.d.ts +40 -0
- package/dist/runtime/constant/enumType/PermissionDataItem.d.ts +22 -0
- package/dist/runtime/constant/enumType/PushPlatformType.d.ts +18 -0
- package/dist/runtime/constant/enumType/RequestRole.d.ts +32 -0
- package/dist/runtime/constant/enumType/RequestType.d.ts +70 -0
- package/dist/runtime/constant/enumType/StoreItemType.d.ts +21 -0
- package/dist/runtime/constant/enumType/StoreReceiveType.d.ts +30 -0
- package/dist/runtime/constant/errorCode/ErrorCode.d.ts +190 -8
- package/dist/runtime/constant/parameterCode/ParameterCode.d.ts +35 -5
- package/dist/runtime/entity/DataMember.d.ts +338 -0
- package/dist/runtime/entity/GNMetadata.d.ts +101 -0
- package/dist/runtime/entity/InvalidMember.d.ts +28 -0
- package/dist/runtime/entity/OperationEvent.d.ts +49 -0
- package/dist/runtime/entity/OperationRequest.d.ts +108 -0
- package/dist/runtime/entity/OperationResponse.d.ts +110 -0
- package/dist/runtime/entity/models/AuthenticateModels.d.ts +115 -0
- package/dist/runtime/entity/models/AuthenticateRequestModels.d.ts +131 -0
- package/dist/runtime/entity/models/AuthenticateResponseModels.d.ts +131 -0
- package/dist/runtime/entity/models/CharacterPlayerModels.d.ts +625 -1
- package/dist/runtime/entity/models/CharacterPlayerRequestModels.d.ts +972 -0
- package/dist/runtime/entity/models/CharacterPlayerResponseModels.d.ts +332 -0
- package/dist/runtime/entity/models/CloudScriptModels.d.ts +109 -0
- package/dist/runtime/entity/models/CloudScriptRequestModels.d.ts +107 -0
- package/dist/runtime/entity/models/CloudScriptResponseModels.d.ts +46 -0
- package/dist/runtime/entity/models/ContentModels.d.ts +124 -0
- package/dist/runtime/entity/models/ContentRequestModels.d.ts +152 -0
- package/dist/runtime/entity/models/ContentResponseModels.d.ts +58 -0
- package/dist/runtime/entity/models/DashboardModels.d.ts +371 -8
- package/dist/runtime/entity/models/DashboardRequestModels.d.ts +172 -0
- package/dist/runtime/entity/models/DashboardResponseModels.d.ts +170 -0
- package/dist/runtime/entity/models/GamePlayerModels.d.ts +644 -1
- package/dist/runtime/entity/models/GamePlayerRequestModels.d.ts +959 -0
- package/dist/runtime/entity/models/GamePlayerResponseModels.d.ts +333 -1
- package/dist/runtime/entity/models/GenericModels.d.ts +94 -0
- package/dist/runtime/entity/models/GroupModels.d.ts +484 -2
- package/dist/runtime/entity/models/GroupRequestModels.d.ts +737 -0
- package/dist/runtime/entity/models/GroupResponseModels.d.ts +254 -0
- package/dist/runtime/entity/models/InventoryModels.d.ts +415 -0
- package/dist/runtime/entity/models/InventoryRequestModels.d.ts +629 -0
- package/dist/runtime/entity/models/InventoryResponseModels.d.ts +218 -0
- package/dist/runtime/entity/models/MasterPlayerModels.d.ts +1065 -3
- package/dist/runtime/entity/models/MasterPlayerRequestModels.d.ts +1560 -6
- package/dist/runtime/entity/models/MasterPlayerResponseModels.d.ts +532 -1
- package/dist/runtime/entity/models/MultiplayerModels.d.ts +199 -0
- package/dist/runtime/entity/models/MultiplayerRequestModels.d.ts +196 -0
- package/dist/runtime/entity/models/MultiplayerResponseModels.d.ts +74 -0
- package/dist/runtime/entity/models/StoreInventoryModels.d.ts +262 -0
- package/dist/runtime/entity/models/StoreInventoryRequestModels.d.ts +268 -0
- package/dist/runtime/entity/models/StoreInventoryResponseModels.d.ts +98 -0
- package/dist/runtime/entity/request/CustomOperationRequest.d.ts +99 -0
- package/dist/runtime/entity/response/CustomOperationResponse.d.ts +118 -0
- package/dist/runtime/entity/response/GetAuthInfoResponse.d.ts +53 -0
- package/dist/runtime/entity/response/HealthCheckResponse.d.ts +56 -0
- package/dist/runtime/entity/response/UploadFileResponse.d.ts +19 -0
- package/dist/runtime/helper/CodeHelper.d.ts +122 -0
- package/dist/runtime/helper/ConverterService.d.ts +74 -0
- package/dist/runtime/helper/EnumUtility.d.ts +63 -0
- package/dist/runtime/helper/GNSupport.d.ts +64 -4
- package/dist/runtime/helper/GNUtils.d.ts +54 -0
- package/dist/runtime/helper/MessagePackConverterService.d.ts +48 -0
- package/dist/runtime/helper/OperationHelper.d.ts +51 -0
- package/dist/runtime/helper/StorageService.d.ts +48 -8
- package/dist/runtime/logger/GNDebug.d.ts +117 -0
- package/dist/runtime/networking/AuthenticateStatus.d.ts +64 -0
- package/dist/runtime/networking/IPeer.d.ts +83 -0
- package/dist/runtime/networking/NetworkingPeer.d.ts +256 -1
- package/dist/runtime/networking/OperationPending.d.ts +112 -0
- package/dist/runtime/networking/PeerBase.d.ts +231 -0
- package/dist/runtime/networking/handler/IServerEventHandler.d.ts +84 -0
- package/dist/runtime/networking/handler/OnCharacterPlayerFriendUpdateEventHandler.d.ts +69 -0
- package/dist/runtime/networking/handler/OnCharacterPlayerGroupUpdateEventHandler.d.ts +49 -0
- package/dist/runtime/networking/handler/OnGamePlayerFriendUpdateEventHandler.d.ts +50 -0
- package/dist/runtime/networking/handler/OnGamePlayerGroupUpdateEventHandler.d.ts +41 -0
- package/dist/runtime/networking/handler/OnGroupMemberUpdateEventHandler.d.ts +47 -0
- package/dist/runtime/networking/handler/OnGroupMessageUpdateEventHandler.d.ts +46 -0
- package/dist/runtime/networking/http/HttpPeer.d.ts +173 -0
- package/dist/runtime/networking/http/NetworkingHttpPeerBase.d.ts +87 -0
- package/dist/runtime/networking/http/NetworkingPeerAxiosRequest.d.ts +113 -0
- package/dist/runtime/networking/socket/NetworkingPeerSocketIOClient.d.ts +145 -0
- package/dist/runtime/networking/socket/NetworkingSocketPeerBase.d.ts +198 -0
- package/dist/runtime/networking/socket/SocketPeer.d.ts +155 -0
- package/dist/runtime/typescript/ServiceUpdate.d.ts +46 -0
- package/docs/AI_CHEATSHEET.md +211 -0
- package/docs/COOKBOOK.md +912 -0
- package/docs/RULES.md +307 -0
- package/docs/ai-manifest.json +725 -0
- package/docs/guides/AUTHENTICATE.md +246 -0
- package/docs/guides/CHARACTER_PLAYER.md +439 -0
- package/docs/guides/CLOUDSCRIPT.md +335 -0
- package/docs/guides/COCOS_CREATOR_INTEGRATION.md +150 -0
- package/docs/guides/CONTENT.md +291 -0
- package/docs/guides/DASHBOARD.md +262 -0
- package/docs/guides/GAME_PLAYER.md +473 -0
- package/docs/guides/GROUP.md +412 -0
- package/docs/guides/INVENTORY.md +375 -0
- package/docs/guides/MASTER_PLAYER.md +458 -0
- package/docs/guides/MULTIPLAYER.md +303 -0
- package/docs/guides/STORE_INVENTORY.md +313 -0
- package/docs/llms-full.txt +43 -0
- package/docs/reference/API_AUTHENTICATE.md +75 -0
- package/docs/reference/API_CHARACTER_PLAYER.md +226 -0
- package/docs/reference/API_CLOUDSCRIPT.md +82 -0
- package/docs/reference/API_CONTENT.md +88 -0
- package/docs/reference/API_DASHBOARD.md +82 -0
- package/docs/reference/API_GAME_PLAYER.md +223 -0
- package/docs/reference/API_GROUP.md +187 -0
- package/docs/reference/API_INDEX.md +57 -0
- package/docs/reference/API_INVENTORY.md +169 -0
- package/docs/reference/API_MASTER_PLAYER.md +323 -0
- package/docs/reference/API_MULTIPLAYER.md +97 -0
- package/docs/reference/API_STORE_INVENTORY.md +109 -0
- package/docs/reference/CONFIG.md +107 -0
- package/docs/reference/DTO_INDEX.md +2543 -0
- package/docs/reference/ENUMS.md +433 -0
- package/docs/reference/ERROR_HANDLING.md +159 -0
- package/docs/reference/EVENTS.md +188 -0
- package/docs/reference/PERMISSION_RULES.md +55 -0
- package/docs/reference/dto/AUTHENTICATE.md +619 -0
- package/docs/reference/dto/CHARACTER_PLAYER.md +3686 -0
- package/docs/reference/dto/CLOUDSCRIPT.md +400 -0
- package/docs/reference/dto/CONTENT.md +548 -0
- package/docs/reference/dto/DASHBOARD.md +1980 -0
- package/docs/reference/dto/GAME_PLAYER.md +3631 -0
- package/docs/reference/dto/GENERIC.md +151 -0
- package/docs/reference/dto/GROUP.md +2842 -0
- package/docs/reference/dto/INVENTORY.md +2385 -0
- package/docs/reference/dto/MASTER_PLAYER.md +6024 -0
- package/docs/reference/dto/MULTIPLAYER.md +850 -0
- package/docs/reference/dto/STORE_INVENTORY.md +1262 -0
- package/llms.txt +47 -0
- package/package.json +12 -3
- package/GNServerSettings.debug.json +0 -21
- package/docs/COCOS_CREATOR_INTEGRATION.md +0 -116
- package/examples/cocos-creator/GearNExample.ts.txt +0 -176
- package/srcSwift/Package.swift +0 -32
- package/srcSwift/Sources/GearN/runtime/GNNetwork.swift +0 -530
- package/srcSwift/Sources/GearN/runtime/GNNetworkAuthenticateApi.swift +0 -178
- package/srcSwift/Sources/GearN/runtime/GNNetworkCharacterPlayerApi.swift +0 -1162
- package/srcSwift/Sources/GearN/runtime/GNNetworkCloudScriptApi.swift +0 -154
- package/srcSwift/Sources/GearN/runtime/GNNetworkContentApi.swift +0 -208
- package/srcSwift/Sources/GearN/runtime/GNNetworkDashboardApi.swift +0 -240
- package/srcSwift/Sources/GearN/runtime/GNNetworkGamePlayerApi.swift +0 -1369
- package/srcSwift/Sources/GearN/runtime/GNNetworkGroupApi.swift +0 -1100
- package/srcSwift/Sources/GearN/runtime/GNNetworkInventoryApi.swift +0 -937
- package/srcSwift/Sources/GearN/runtime/GNNetworkMasterPlayerApi.swift +0 -2323
- package/srcSwift/Sources/GearN/runtime/GNNetworkMultiplayerApi.swift +0 -298
- package/srcSwift/Sources/GearN/runtime/GNNetworkStoreInventoryApi.swift +0 -397
- package/srcSwift/Sources/GearN/runtime/common/Action0.swift +0 -3
- package/srcSwift/Sources/GearN/runtime/common/Action1.swift +0 -3
- package/srcSwift/Sources/GearN/runtime/common/Action2.swift +0 -3
- package/srcSwift/Sources/GearN/runtime/common/Action3.swift +0 -3
- package/srcSwift/Sources/GearN/runtime/common/Action4.swift +0 -3
- package/srcSwift/Sources/GearN/runtime/common/GNArray.swift +0 -204
- package/srcSwift/Sources/GearN/runtime/common/GNData.swift +0 -108
- package/srcSwift/Sources/GearN/runtime/common/GNHashtable.swift +0 -200
- package/srcSwift/Sources/GearN/runtime/config/GNServerSettings.swift +0 -95
- package/srcSwift/Sources/GearN/runtime/constant/Commands.swift +0 -28
- package/srcSwift/Sources/GearN/runtime/constant/EventCode.swift +0 -10
- package/srcSwift/Sources/GearN/runtime/constant/OperationCode.swift +0 -252
- package/srcSwift/Sources/GearN/runtime/constant/ReturnCode.swift +0 -19
- package/srcSwift/Sources/GearN/runtime/constant/enumType/ExecuteResponseStatus.swift +0 -9
- package/srcSwift/Sources/GearN/runtime/constant/enumType/FriendStatus.swift +0 -8
- package/srcSwift/Sources/GearN/runtime/constant/enumType/GoogleLoginType.swift +0 -6
- package/srcSwift/Sources/GearN/runtime/constant/enumType/GroupStatus.swift +0 -8
- package/srcSwift/Sources/GearN/runtime/constant/enumType/InvalidMemberType.swift +0 -19
- package/srcSwift/Sources/GearN/runtime/constant/enumType/ItemType.swift +0 -6
- package/srcSwift/Sources/GearN/runtime/constant/enumType/MatchmakingMemberStatus.swift +0 -7
- package/srcSwift/Sources/GearN/runtime/constant/enumType/MatchmakingTicketStatus.swift +0 -9
- package/srcSwift/Sources/GearN/runtime/constant/enumType/OwnerType.swift +0 -10
- package/srcSwift/Sources/GearN/runtime/constant/enumType/PermissionDataItem.swift +0 -6
- package/srcSwift/Sources/GearN/runtime/constant/enumType/PushPlatformType.swift +0 -6
- package/srcSwift/Sources/GearN/runtime/constant/enumType/RequestRole.swift +0 -7
- package/srcSwift/Sources/GearN/runtime/constant/enumType/RequestType.swift +0 -16
- package/srcSwift/Sources/GearN/runtime/constant/enumType/StoreItemType.swift +0 -6
- package/srcSwift/Sources/GearN/runtime/constant/enumType/StoreReceiveType.swift +0 -9
- package/srcSwift/Sources/GearN/runtime/constant/errorCode/ErrorCode.swift +0 -58
- package/srcSwift/Sources/GearN/runtime/constant/parameterCode/ParameterCode.swift +0 -672
- package/srcSwift/Sources/GearN/runtime/entity/DataMember.swift +0 -196
- package/srcSwift/Sources/GearN/runtime/entity/GNMetadata.swift +0 -9
- package/srcSwift/Sources/GearN/runtime/entity/InvalidMember.swift +0 -11
- package/srcSwift/Sources/GearN/runtime/entity/OperationEvent.swift +0 -38
- package/srcSwift/Sources/GearN/runtime/entity/OperationHelper.swift +0 -28
- package/srcSwift/Sources/GearN/runtime/entity/OperationRequest.swift +0 -62
- package/srcSwift/Sources/GearN/runtime/entity/OperationResponse.swift +0 -98
- package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateModels.swift +0 -351
- package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateRequestModels.swift +0 -81
- package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateResponseModels.swift +0 -108
- package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerModels.swift +0 -1045
- package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerRequestModels.swift +0 -821
- package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerResponseModels.swift +0 -588
- package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptModels.swift +0 -187
- package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptRequestModels.swift +0 -84
- package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptResponseModels.swift +0 -59
- package/srcSwift/Sources/GearN/runtime/entity/models/ContentModels.swift +0 -195
- package/srcSwift/Sources/GearN/runtime/entity/models/ContentRequestModels.swift +0 -116
- package/srcSwift/Sources/GearN/runtime/entity/models/ContentResponseModels.swift +0 -81
- package/srcSwift/Sources/GearN/runtime/entity/models/DashboardModels.swift +0 -426
- package/srcSwift/Sources/GearN/runtime/entity/models/DashboardRequestModels.swift +0 -160
- package/srcSwift/Sources/GearN/runtime/entity/models/DashboardResponseModels.swift +0 -82
- package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerModels.swift +0 -1334
- package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerRequestModels.swift +0 -643
- package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerResponseModels.swift +0 -213
- package/srcSwift/Sources/GearN/runtime/entity/models/GenericModels.swift +0 -171
- package/srcSwift/Sources/GearN/runtime/entity/models/GroupModels.swift +0 -850
- package/srcSwift/Sources/GearN/runtime/entity/models/GroupRequestModels.swift +0 -485
- package/srcSwift/Sources/GearN/runtime/entity/models/GroupResponseModels.swift +0 -165
- package/srcSwift/Sources/GearN/runtime/entity/models/InventoryModels.swift +0 -679
- package/srcSwift/Sources/GearN/runtime/entity/models/InventoryRequestModels.swift +0 -413
- package/srcSwift/Sources/GearN/runtime/entity/models/InventoryResponseModels.swift +0 -141
- package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerModels.swift +0 -378
- package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerRequestModels.swift +0 -147
- package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerResponseModels.swift +0 -318
- package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerModels.swift +0 -319
- package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerRequestModels.swift +0 -125
- package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerResponseModels.swift +0 -45
- package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryModels.swift +0 -633
- package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryRequestModels.swift +0 -173
- package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryResponseModels.swift +0 -61
- package/srcSwift/Sources/GearN/runtime/entity/request/CustomOperationRequest.swift +0 -42
- package/srcSwift/Sources/GearN/runtime/entity/response/CustomOperationResponse.swift +0 -49
- package/srcSwift/Sources/GearN/runtime/entity/response/GetAuthInfoResponse.swift +0 -43
- package/srcSwift/Sources/GearN/runtime/entity/response/HealthCheckResponse.swift +0 -86
- package/srcSwift/Sources/GearN/runtime/entity/response/UploadFileResponse.swift +0 -15
- package/srcSwift/Sources/GearN/runtime/helper/CodeHelper.swift +0 -107
- package/srcSwift/Sources/GearN/runtime/helper/ConverterService.swift +0 -98
- package/srcSwift/Sources/GearN/runtime/helper/EnumUtility.swift +0 -34
- package/srcSwift/Sources/GearN/runtime/helper/GNSupport.swift +0 -41
- package/srcSwift/Sources/GearN/runtime/helper/GNUtils.swift +0 -66
- package/srcSwift/Sources/GearN/runtime/helper/MessagePackConverterService.swift +0 -21
- package/srcSwift/Sources/GearN/runtime/helper/StorageService.swift +0 -29
- package/srcSwift/Sources/GearN/runtime/logger/GNDebug.swift +0 -33
- package/srcSwift/Sources/GearN/runtime/networking/AuthenticateStatus.swift +0 -24
- package/srcSwift/Sources/GearN/runtime/networking/IPeer.swift +0 -8
- package/srcSwift/Sources/GearN/runtime/networking/NetworkingPeer.swift +0 -368
- package/srcSwift/Sources/GearN/runtime/networking/OperationPending.swift +0 -81
- package/srcSwift/Sources/GearN/runtime/networking/PeerBase.swift +0 -228
- package/srcSwift/Sources/GearN/runtime/networking/handler/IServerEventHandler.swift +0 -20
- package/srcSwift/Sources/GearN/runtime/networking/http/HttpPeer.swift +0 -226
- package/srcSwift/Sources/GearN/runtime/networking/http/HttpTypes.swift +0 -24
- package/srcSwift/Sources/GearN/runtime/networking/http/NetworkingHttpPeerBase.swift +0 -13
- package/srcSwift/Sources/GearN/runtime/networking/http/NetworkingPeerUrlSession.swift +0 -125
- package/srcSwift/Sources/GearN/runtime/networking/request/NetRequest.swift +0 -19
- package/srcSwift/Sources/GearN/runtime/networking/response/NetResponse.swift +0 -13
- package/srcSwift/Sources/GearN/runtime/networking/socket/NetworkingPeerSocketIOClient.swift +0 -244
- package/srcSwift/Sources/GearN/runtime/networking/socket/NetworkingSocketPeerBase.swift +0 -59
- package/srcSwift/Sources/GearN/runtime/networking/socket/SocketPeer.swift +0 -136
- package/tsconfig-build.cocos.json +0 -31
- package/webpack.config.cocos.mjs +0 -78
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# API Reference: MultiplayerApi
|
|
2
|
+
|
|
3
|
+
Matchmaking ticket lifecycle, queue statistics, match query.
|
|
4
|
+
|
|
5
|
+
Domain guide: [guides/MULTIPLAYER.md](../guides/MULTIPLAYER.md). DTO shapes: [dto/MULTIPLAYER.md](dto/MULTIPLAYER.md) hoặc grep [DTO_INDEX.md](DTO_INDEX.md).
|
|
6
|
+
|
|
7
|
+
## Namespaces
|
|
8
|
+
|
|
9
|
+
- `GNNetwork.multiplayer` — `RequestRole.Client`
|
|
10
|
+
- `GNNetwork.multiplayer.server` — `RequestRole.Server`
|
|
11
|
+
- `GNNetwork.multiplayer.admin` — `RequestRole.Admin`
|
|
12
|
+
|
|
13
|
+
## Convention
|
|
14
|
+
|
|
15
|
+
Mỗi method dưới đây có 2 form — callback và `*Async()` Promise. Ưu tiên `*Async()`.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// Callback
|
|
19
|
+
GNNetwork.multiplayer.<method>(requestData, onResponse?, overrideAuthToken?, overrideSecretKey?, customTags?, timeout?);
|
|
20
|
+
|
|
21
|
+
// Async
|
|
22
|
+
const res = await GNNetwork.multiplayer.<method>Async(requestData, overrideAuthToken?, overrideSecretKey?, customTags?, timeout?);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Param chung:
|
|
26
|
+
|
|
27
|
+
| Param | Type | Optional | Notes |
|
|
28
|
+
|-------|------|----------|-------|
|
|
29
|
+
| `requestData` | domain-specific (xem bảng dưới) | no | Payload chính |
|
|
30
|
+
| `onResponse` | `Action1<TResponse>` | yes | Chỉ có ở callback form |
|
|
31
|
+
| `overrideAuthToken` | `string` | yes | Override `authToken` cache cho request này |
|
|
32
|
+
| `overrideSecretKey` | `string` | yes | Override secret key mặc định của route |
|
|
33
|
+
| `customTags` | `GNHashtable` | yes | Tags gắn vào request, backend có thể log/route |
|
|
34
|
+
| `timeout` | `number` | yes | Timeout giây; default = `OperationRequest.defaultTimeOut` |
|
|
35
|
+
|
|
36
|
+
Response class expose field: `returnCode`, `errorCode`, `invalidMembers`, `debugMessage`, `responseData`. Xem [ERROR_HANDLING.md](ERROR_HANDLING.md).
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Client methods (`GNNetwork.multiplayer.*`)
|
|
40
|
+
|
|
41
|
+
| Method | Request DTO | Async form | Response class | Default Permission Rules |
|
|
42
|
+
|--------|-------------|------------|----------------|--------------------------|
|
|
43
|
+
| `cancelAllMatchmakingTicket` | `MultiplayerModels.CancelAllMatchmakingTicketRequestData` | `cancelAllMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CancelAllMatchmakingTicketOperationResponse` | `multiplayer.cancelAllMatchmakingTicket.selfEnable` |
|
|
44
|
+
| `cancelMatchmakingTicket` | `MultiplayerModels.CancelMatchmakingTicketRequestData` | `cancelMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CancelMatchmakingTicketOperationResponse` | `multiplayer.cancelMatchmakingTicket.selfEnable` |
|
|
45
|
+
| `createMatchmakingTicket` | `MultiplayerModels.CreateMatchmakingTicketRequestData` | `createMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CreateMatchmakingTicketOperationResponse` | `multiplayer.createMatchmakingTicket.selfEnable` |
|
|
46
|
+
| `getMatchmakingTicket` | `MultiplayerModels.GetMatchmakingTicketRequestData` | `getMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.GetMatchmakingTicketOperationResponse` | `multiplayer.getMatchmakingTicket.selfEnable` |
|
|
47
|
+
| `getMatch` | `MultiplayerModels.GetMatchRequestData` | `getMatchAsync(...)` | `MultiplayerResponseModels.GetMatchOperationResponse` | `multiplayer.getMatch.selfEnable` |
|
|
48
|
+
| `getQueueStatistics` | `MultiplayerModels.GetQueueStatisticsRequestData` | `getQueueStatisticsAsync(...)` | `MultiplayerResponseModels.GetQueueStatisticsOperationResponse` | `multiplayer.getQueueStatistics.selfEnable` |
|
|
49
|
+
| `joinMatchmakingTicket` | `MultiplayerModels.JoinMatchmakingTicketRequestData` | `joinMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.JoinMatchmakingTicketOperationResponse` | `multiplayer.joinMatchmakingTicket.selfEnable` |
|
|
50
|
+
| `listMatchmakingTicketsForPlayer` | `MultiplayerModels.ListMatchmakingTicketsForPlayerRequestData` | `listMatchmakingTicketsForPlayerAsync(...)` | `MultiplayerResponseModels.ListMatchmakingTicketsForPlayerOperationResponse` | `multiplayer.listMatchmakingTicketsForPlayer.selfEnable` |
|
|
51
|
+
| `getAllMatch` | `MultiplayerModels.GetAllMatchRequestData` | `getAllMatchAsync(...)` | `MultiplayerResponseModels.GetAllMatchOperationResponse` | `multiplayer.getAllMatch.selfEnable` |
|
|
52
|
+
| `getAllMatchmakingTicket` | `MultiplayerModels.GetAllMatchmakingTicketRequestData` | `getAllMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.GetAllMatchmakingTicketOperationResponse` | `multiplayer.getAllMatchmakingTicket.selfEnable` |
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Server methods (`GNNetwork.multiplayer.server.*`)
|
|
56
|
+
|
|
57
|
+
| Method | Request DTO | Async form | Response class | Default Permission Rules |
|
|
58
|
+
|--------|-------------|------------|----------------|--------------------------|
|
|
59
|
+
| `cancelAllMatchmakingTicket` | `MultiplayerModels.ServerCancelAllMatchmakingTicketRequestData` | `cancelAllMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CancelAllMatchmakingTicketOperationResponse` | `multiplayer.cancelAllMatchmakingTicket.serverSelfEnable` |
|
|
60
|
+
| `cancelMatchmakingTicket` | `MultiplayerModels.ServerCancelMatchmakingTicketRequestData` | `cancelMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CancelMatchmakingTicketOperationResponse` | `multiplayer.cancelMatchmakingTicket.serverSelfEnable` |
|
|
61
|
+
| `createMatchmakingTicket` | `MultiplayerModels.ServerCreateMatchmakingTicketRequestData` | `createMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CreateMatchmakingTicketOperationResponse` | `multiplayer.createMatchmakingTicket.serverSelfEnable` |
|
|
62
|
+
| `getMatchmakingTicket` | `MultiplayerModels.ServerGetMatchmakingTicketRequestData` | `getMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.GetMatchmakingTicketOperationResponse` | `multiplayer.getMatchmakingTicket.serverSelfEnable` |
|
|
63
|
+
| `getMatch` | `MultiplayerModels.ServerGetMatchRequestData` | `getMatchAsync(...)` | `MultiplayerResponseModels.GetMatchOperationResponse` | `multiplayer.getMatch.serverSelfEnable` |
|
|
64
|
+
| `getQueueStatistics` | `MultiplayerModels.ServerGetQueueStatisticsRequestData` | `getQueueStatisticsAsync(...)` | `MultiplayerResponseModels.GetQueueStatisticsOperationResponse` | `multiplayer.getQueueStatistics.serverSelfEnable` |
|
|
65
|
+
| `joinMatchmakingTicket` | `MultiplayerModels.ServerJoinMatchmakingTicketRequestData` | `joinMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.JoinMatchmakingTicketOperationResponse` | `multiplayer.joinMatchmakingTicket.serverSelfEnable` |
|
|
66
|
+
| `listMatchmakingTicketsForPlayer` | `MultiplayerModels.ServerListMatchmakingTicketsForPlayerRequestData` | `listMatchmakingTicketsForPlayerAsync(...)` | `MultiplayerResponseModels.ListMatchmakingTicketsForPlayerOperationResponse` | `multiplayer.listMatchmakingTicketsForPlayer.serverSelfEnable` |
|
|
67
|
+
| `getAllMatch` | `MultiplayerModels.ServerGetAllMatchRequestData` | `getAllMatchAsync(...)` | `MultiplayerResponseModels.GetAllMatchOperationResponse` | `multiplayer.getAllMatch.serverSelfEnable` |
|
|
68
|
+
| `getAllMatchmakingTicket` | `MultiplayerModels.ServerGetAllMatchmakingTicketRequestData` | `getAllMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.GetAllMatchmakingTicketOperationResponse` | `multiplayer.getAllMatchmakingTicket.serverSelfEnable` |
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## Admin methods (`GNNetwork.multiplayer.admin.*`)
|
|
72
|
+
|
|
73
|
+
| Method | Request DTO | Async form | Response class | Default Permission Rules |
|
|
74
|
+
|--------|-------------|------------|----------------|--------------------------|
|
|
75
|
+
| `cancelAllMatchmakingTicket` | `MultiplayerModels.AdminCancelAllMatchmakingTicketRequestData` | `cancelAllMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CancelAllMatchmakingTicketOperationResponse` | `multiplayer.cancelAllMatchmakingTicket.adminSelfEnable` |
|
|
76
|
+
| `cancelMatchmakingTicket` | `MultiplayerModels.AdminCancelMatchmakingTicketRequestData` | `cancelMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CancelMatchmakingTicketOperationResponse` | `multiplayer.cancelMatchmakingTicket.adminSelfEnable` |
|
|
77
|
+
| `createMatchmakingTicket` | `MultiplayerModels.AdminCreateMatchmakingTicketRequestData` | `createMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.CreateMatchmakingTicketOperationResponse` | `multiplayer.createMatchmakingTicket.adminSelfEnable` |
|
|
78
|
+
| `getMatchmakingTicket` | `MultiplayerModels.AdminGetMatchmakingTicketRequestData` | `getMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.GetMatchmakingTicketOperationResponse` | `multiplayer.getMatchmakingTicket.adminSelfEnable` |
|
|
79
|
+
| `getMatch` | `MultiplayerModels.AdminGetMatchRequestData` | `getMatchAsync(...)` | `MultiplayerResponseModels.GetMatchOperationResponse` | `multiplayer.getMatch.adminSelfEnable` |
|
|
80
|
+
| `getQueueStatistics` | `MultiplayerModels.AdminGetQueueStatisticsRequestData` | `getQueueStatisticsAsync(...)` | `MultiplayerResponseModels.GetQueueStatisticsOperationResponse` | `multiplayer.getQueueStatistics.adminSelfEnable` |
|
|
81
|
+
| `joinMatchmakingTicket` | `MultiplayerModels.AdminJoinMatchmakingTicketRequestData` | `joinMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.JoinMatchmakingTicketOperationResponse` | `multiplayer.joinMatchmakingTicket.adminSelfEnable` |
|
|
82
|
+
| `listMatchmakingTicketsForPlayer` | `MultiplayerModels.AdminListMatchmakingTicketsForPlayerRequestData` | `listMatchmakingTicketsForPlayerAsync(...)` | `MultiplayerResponseModels.ListMatchmakingTicketsForPlayerOperationResponse` | `multiplayer.listMatchmakingTicketsForPlayer.adminSelfEnable` |
|
|
83
|
+
| `getAllMatch` | `MultiplayerModels.AdminGetAllMatchRequestData` | `getAllMatchAsync(...)` | `MultiplayerResponseModels.GetAllMatchOperationResponse` | `multiplayer.getAllMatch.adminSelfEnable` |
|
|
84
|
+
| `getAllMatchmakingTicket` | `MultiplayerModels.AdminGetAllMatchmakingTicketRequestData` | `getAllMatchmakingTicketAsync(...)` | `MultiplayerResponseModels.GetAllMatchmakingTicketOperationResponse` | `multiplayer.getAllMatchmakingTicket.adminSelfEnable` |
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Ví dụ tối thiểu
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { GNNetwork, ReturnCode, ErrorCode } from "@xmobitea/gn-typescript-client";
|
|
91
|
+
|
|
92
|
+
// requestData: MultiplayerModels.CancelAllMatchmakingTicketRequestData đã build theo dto/MULTIPLAYER.md
|
|
93
|
+
const res = await GNNetwork.multiplayer.cancelAllMatchmakingTicketAsync(requestData);
|
|
94
|
+
if (res.returnCode !== ReturnCode.Ok) return;
|
|
95
|
+
if (res.errorCode !== ErrorCode.Ok) return;
|
|
96
|
+
// res.responseData có typed payload
|
|
97
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# API Reference: StoreInventoryApi
|
|
2
|
+
|
|
3
|
+
Store catalog, buy/present, receipt validation, store log.
|
|
4
|
+
|
|
5
|
+
Domain guide: [guides/STORE_INVENTORY.md](../guides/STORE_INVENTORY.md). DTO shapes: [dto/STORE_INVENTORY.md](dto/STORE_INVENTORY.md) hoặc grep [DTO_INDEX.md](DTO_INDEX.md).
|
|
6
|
+
|
|
7
|
+
## Namespaces
|
|
8
|
+
|
|
9
|
+
- `GNNetwork.storeInventory` — `RequestRole.Client`
|
|
10
|
+
- `GNNetwork.storeInventory.server` — `RequestRole.Server`
|
|
11
|
+
- `GNNetwork.storeInventory.admin` — `RequestRole.Admin`
|
|
12
|
+
|
|
13
|
+
## Convention
|
|
14
|
+
|
|
15
|
+
Mỗi method dưới đây có 2 form — callback và `*Async()` Promise. Ưu tiên `*Async()`.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// Callback
|
|
19
|
+
GNNetwork.storeInventory.<method>(requestData, onResponse?, overrideAuthToken?, overrideSecretKey?, customTags?, timeout?);
|
|
20
|
+
|
|
21
|
+
// Async
|
|
22
|
+
const res = await GNNetwork.storeInventory.<method>Async(requestData, overrideAuthToken?, overrideSecretKey?, customTags?, timeout?);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Param chung:
|
|
26
|
+
|
|
27
|
+
| Param | Type | Optional | Notes |
|
|
28
|
+
|-------|------|----------|-------|
|
|
29
|
+
| `requestData` | domain-specific (xem bảng dưới) | no | Payload chính |
|
|
30
|
+
| `onResponse` | `Action1<TResponse>` | yes | Chỉ có ở callback form |
|
|
31
|
+
| `overrideAuthToken` | `string` | yes | Override `authToken` cache cho request này |
|
|
32
|
+
| `overrideSecretKey` | `string` | yes | Override secret key mặc định của route |
|
|
33
|
+
| `customTags` | `GNHashtable` | yes | Tags gắn vào request, backend có thể log/route |
|
|
34
|
+
| `timeout` | `number` | yes | Timeout giây; default = `OperationRequest.defaultTimeOut` |
|
|
35
|
+
|
|
36
|
+
Response class expose field: `returnCode`, `errorCode`, `invalidMembers`, `debugMessage`, `responseData`. Xem [ERROR_HANDLING.md](ERROR_HANDLING.md).
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Client methods (`GNNetwork.storeInventory.*`)
|
|
40
|
+
|
|
41
|
+
| Method | Request DTO | Async form | Response class | Default Permission Rules | Permission Rules khi truyền `id` khác với những `entity` liên quan mà `gamePlayer` đang được authenticated không phải owner nếu `type` là `OwnerType.CharacterPlayer` hoặc không phải member nếu là `type` `OwnerType.Group` |
|
|
42
|
+
|--------|-------------|------------|----------------|--------------------------|---------------------------------------------------------------------------------------------------------|
|
|
43
|
+
| `buyStoreItem` | `StoreInventoryModels.BuyStoreItemRequestData` | `buyStoreItemAsync(...)` | `StoreInventoryResponseModels.BuyStoreItemOperationResponse` | `storeInventory.buyStoreItem.selfEnable` | `storeInventory.buyStoreItem.otherSelfEnable` |
|
|
44
|
+
| `getStoreItemInformation` | `StoreInventoryModels.GetStoreItemInformationRequestData` | `getStoreItemInformationAsync(...)` | `StoreInventoryResponseModels.GetStoreItemInformationOperationResponse` | `storeInventory.getStoreItemInformation.otherSelfEnable` | |
|
|
45
|
+
| `getStoreItemsWithTag` | `StoreInventoryModels.GetStoreItemsWithTagRequestData` | `getStoreItemsWithTagAsync(...)` | `StoreInventoryResponseModels.GetStoreItemsWithTagOperationResponse` | `storeInventory.getStoreItemsWithTag.otherSelfEnable` | |
|
|
46
|
+
| `createStoreItem` | `StoreInventoryModels.CreateStoreItemRequestData` | `createStoreItemAsync(...)` | `StoreInventoryResponseModels.CreateStoreItemOperationResponse` | `storeInventory.createStoreItem.otherSelfEnable` | |
|
|
47
|
+
| `setRemoveStatus` | `StoreInventoryModels.SetRemoveStatusRequestData` | `setRemoveStatusAsync(...)` | `StoreInventoryResponseModels.SetRemoveStatusOperationResponse` | `storeInventory.setRemoveStatus.otherSelfEnable` | |
|
|
48
|
+
| `setStoreItemInformation` | `StoreInventoryModels.SetStoreItemInformationRequestData` | `setStoreItemInformationAsync(...)` | `StoreInventoryResponseModels.SetStoreItemInformationOperationResponse` | `storeInventory.setStoreItemInformation.otherSelfEnable` | |
|
|
49
|
+
| `validateAppleAppStoreReceipt` | `StoreInventoryModels.ValidateAppleAppStoreReceiptRequestData` | `validateAppleAppStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateAppleAppStoreReceiptOperationResponse` | `storeInventory.validateAppleAppStoreReceipt.selfEnable` | `storeInventory.validateAppleAppStoreReceipt.otherSelfEnable` |
|
|
50
|
+
| `validateFacebookStoreReceipt` | `StoreInventoryModels.ValidateFacebookStoreReceiptRequestData` | `validateFacebookStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateFacebookStoreReceiptOperationResponse` | `storeInventory.validateFacebookStoreReceipt.selfEnable` | `storeInventory.validateFacebookStoreReceipt.otherSelfEnable` |
|
|
51
|
+
| `validateGooglePlayStoreReceipt` | `StoreInventoryModels.ValidateGooglePlayStoreReceiptRequestData` | `validateGooglePlayStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateGooglePlayStoreReceiptOperationResponse` | `storeInventory.validateGooglePlayStoreReceipt.selfEnable` | `storeInventory.validateGooglePlayStoreReceipt.otherSelfEnable` |
|
|
52
|
+
| `getCreateLeaderboard` | `StoreInventoryModels.GetCreateLeaderboardRequestData` | `getCreateLeaderboardAsync(...)` | `StoreInventoryResponseModels.GetCreateLeaderboardOperationResponse` | `storeInventory.getCreateLeaderboard.otherSelfEnable` | |
|
|
53
|
+
| `presentStoreItem` | `StoreInventoryModels.PresentStoreItemRequestData` | `presentStoreItemAsync(...)` | `StoreInventoryResponseModels.PresentStoreItemOperationResponse` | `storeInventory.presentStoreItem.selfEnable` | `storeInventory.presentStoreItem.otherSelfEnable` |
|
|
54
|
+
| `getStoreLog` | `StoreInventoryModels.GetStoreLogRequestData` | `getStoreLogAsync(...)` | `StoreInventoryResponseModels.GetStoreLogOperationResponse` | `storeInventory.getStoreLog.otherSelfEnable` | |
|
|
55
|
+
| `getStoreUsed` | `StoreInventoryModels.GetStoreUsedRequestData` | `getStoreUsedAsync(...)` | `StoreInventoryResponseModels.GetStoreUsedOperationResponse` | `storeInventory.getStoreUsed.otherSelfEnable` | |
|
|
56
|
+
| `removeStoreUsed` | `StoreInventoryModels.RemoveStoreUsedRequestData` | `removeStoreUsedAsync(...)` | `StoreInventoryResponseModels.RemoveStoreUsedOperationResponse` | `storeInventory.removeStoreUsed.otherSelfEnable` | |
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Server methods (`GNNetwork.storeInventory.server.*`)
|
|
60
|
+
|
|
61
|
+
| Method | Request DTO | Async form | Response class | Default Permission Rules |
|
|
62
|
+
|--------|-------------|------------|----------------|--------------------------|
|
|
63
|
+
| `buyStoreItem` | `StoreInventoryModels.ServerBuyStoreItemRequestData` | `buyStoreItemAsync(...)` | `StoreInventoryResponseModels.BuyStoreItemOperationResponse` | `storeInventory.buyStoreItem.serverSelfEnable` |
|
|
64
|
+
| `getStoreItemInformation` | `StoreInventoryModels.ServerGetStoreItemInformationRequestData` | `getStoreItemInformationAsync(...)` | `StoreInventoryResponseModels.GetStoreItemInformationOperationResponse` | `storeInventory.getStoreItemInformation.serverSelfEnable` |
|
|
65
|
+
| `getStoreItemsWithTag` | `StoreInventoryModels.ServerGetStoreItemsWithTagRequestData` | `getStoreItemsWithTagAsync(...)` | `StoreInventoryResponseModels.GetStoreItemsWithTagOperationResponse` | `storeInventory.getStoreItemsWithTag.serverSelfEnable` |
|
|
66
|
+
| `createStoreItem` | `StoreInventoryModels.ServerCreateStoreItemRequestData` | `createStoreItemAsync(...)` | `StoreInventoryResponseModels.CreateStoreItemOperationResponse` | `storeInventory.createStoreItem.serverSelfEnable` |
|
|
67
|
+
| `setRemoveStatus` | `StoreInventoryModels.ServerSetRemoveStatusRequestData` | `setRemoveStatusAsync(...)` | `StoreInventoryResponseModels.SetRemoveStatusOperationResponse` | `storeInventory.setRemoveStatus.serverSelfEnable` |
|
|
68
|
+
| `setStoreItemInformation` | `StoreInventoryModels.ServerSetStoreItemInformationRequestData` | `setStoreItemInformationAsync(...)` | `StoreInventoryResponseModels.SetStoreItemInformationOperationResponse` | `storeInventory.setStoreItemInformation.serverSelfEnable` |
|
|
69
|
+
| `validateAppleAppStoreReceipt` | `StoreInventoryModels.ServerValidateAppleAppStoreReceiptRequestData` | `validateAppleAppStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateAppleAppStoreReceiptOperationResponse` | `storeInventory.validateAppleAppStoreReceipt.serverSelfEnable` |
|
|
70
|
+
| `validateFacebookStoreReceipt` | `StoreInventoryModels.ServerValidateFacebookStoreReceiptRequestData` | `validateFacebookStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateFacebookStoreReceiptOperationResponse` | `storeInventory.validateFacebookStoreReceipt.serverSelfEnable` |
|
|
71
|
+
| `validateGooglePlayStoreReceipt` | `StoreInventoryModels.ServerValidateGooglePlayStoreReceiptRequestData` | `validateGooglePlayStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateGooglePlayStoreReceiptOperationResponse` | `storeInventory.validateGooglePlayStoreReceipt.serverSelfEnable` |
|
|
72
|
+
| `getCreateLeaderboard` | `StoreInventoryModels.ServerGetCreateLeaderboardRequestData` | `getCreateLeaderboardAsync(...)` | `StoreInventoryResponseModels.GetCreateLeaderboardOperationResponse` | `storeInventory.getCreateLeaderboard.serverSelfEnable` |
|
|
73
|
+
| `presentStoreItem` | `StoreInventoryModels.ServerPresentStoreItemRequestData` | `presentStoreItemAsync(...)` | `StoreInventoryResponseModels.PresentStoreItemOperationResponse` | `storeInventory.presentStoreItem.serverSelfEnable` |
|
|
74
|
+
| `getStoreLog` | `StoreInventoryModels.ServerGetStoreLogRequestData` | `getStoreLogAsync(...)` | `StoreInventoryResponseModels.GetStoreLogOperationResponse` | `storeInventory.getStoreLog.serverSelfEnable` |
|
|
75
|
+
| `getStoreUsed` | `StoreInventoryModels.ServerGetStoreUsedRequestData` | `getStoreUsedAsync(...)` | `StoreInventoryResponseModels.GetStoreUsedOperationResponse` | `storeInventory.getStoreUsed.serverSelfEnable` |
|
|
76
|
+
| `removeStoreUsed` | `StoreInventoryModels.ServerRemoveStoreUsedRequestData` | `removeStoreUsedAsync(...)` | `StoreInventoryResponseModels.RemoveStoreUsedOperationResponse` | `storeInventory.removeStoreUsed.serverSelfEnable` |
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## Admin methods (`GNNetwork.storeInventory.admin.*`)
|
|
80
|
+
|
|
81
|
+
| Method | Request DTO | Async form | Response class | Default Permission Rules |
|
|
82
|
+
|--------|-------------|------------|----------------|--------------------------|
|
|
83
|
+
| `buyStoreItem` | `StoreInventoryModels.AdminBuyStoreItemRequestData` | `buyStoreItemAsync(...)` | `StoreInventoryResponseModels.BuyStoreItemOperationResponse` | `storeInventory.buyStoreItem.adminSelfEnable` |
|
|
84
|
+
| `getStoreItemInformation` | `StoreInventoryModels.AdminGetStoreItemInformationRequestData` | `getStoreItemInformationAsync(...)` | `StoreInventoryResponseModels.GetStoreItemInformationOperationResponse` | `storeInventory.getStoreItemInformation.adminSelfEnable` |
|
|
85
|
+
| `getStoreItemsWithTag` | `StoreInventoryModels.AdminGetStoreItemsWithTagRequestData` | `getStoreItemsWithTagAsync(...)` | `StoreInventoryResponseModels.GetStoreItemsWithTagOperationResponse` | `storeInventory.getStoreItemsWithTag.adminSelfEnable` |
|
|
86
|
+
| `createStoreItem` | `StoreInventoryModels.AdminCreateStoreItemRequestData` | `createStoreItemAsync(...)` | `StoreInventoryResponseModels.CreateStoreItemOperationResponse` | `storeInventory.createStoreItem.adminSelfEnable` |
|
|
87
|
+
| `setRemoveStatus` | `StoreInventoryModels.AdminSetRemoveStatusRequestData` | `setRemoveStatusAsync(...)` | `StoreInventoryResponseModels.SetRemoveStatusOperationResponse` | `storeInventory.setRemoveStatus.adminSelfEnable` |
|
|
88
|
+
| `setStoreItemInformation` | `StoreInventoryModels.AdminSetStoreItemInformationRequestData` | `setStoreItemInformationAsync(...)` | `StoreInventoryResponseModels.SetStoreItemInformationOperationResponse` | `storeInventory.setStoreItemInformation.adminSelfEnable` |
|
|
89
|
+
| `validateAppleAppStoreReceipt` | `StoreInventoryModels.AdminValidateAppleAppStoreReceiptRequestData` | `validateAppleAppStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateAppleAppStoreReceiptOperationResponse` | `storeInventory.validateAppleAppStoreReceipt.adminSelfEnable` |
|
|
90
|
+
| `validateFacebookStoreReceipt` | `StoreInventoryModels.AdminValidateFacebookStoreReceiptRequestData` | `validateFacebookStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateFacebookStoreReceiptOperationResponse` | `storeInventory.validateFacebookStoreReceipt.adminSelfEnable` |
|
|
91
|
+
| `validateGooglePlayStoreReceipt` | `StoreInventoryModels.AdminValidateGooglePlayStoreReceiptRequestData` | `validateGooglePlayStoreReceiptAsync(...)` | `StoreInventoryResponseModels.ValidateGooglePlayStoreReceiptOperationResponse` | `storeInventory.validateGooglePlayStoreReceipt.adminSelfEnable` |
|
|
92
|
+
| `getCreateLeaderboard` | `StoreInventoryModels.AdminGetCreateLeaderboardRequestData` | `getCreateLeaderboardAsync(...)` | `StoreInventoryResponseModels.GetCreateLeaderboardOperationResponse` | `storeInventory.getCreateLeaderboard.adminSelfEnable` |
|
|
93
|
+
| `presentStoreItem` | `StoreInventoryModels.AdminPresentStoreItemRequestData` | `presentStoreItemAsync(...)` | `StoreInventoryResponseModels.PresentStoreItemOperationResponse` | `storeInventory.presentStoreItem.adminSelfEnable` |
|
|
94
|
+
| `getStoreLog` | `StoreInventoryModels.AdminGetStoreLogRequestData` | `getStoreLogAsync(...)` | `StoreInventoryResponseModels.GetStoreLogOperationResponse` | `storeInventory.getStoreLog.adminSelfEnable` |
|
|
95
|
+
| `getStoreUsed` | `StoreInventoryModels.AdminGetStoreUsedRequestData` | `getStoreUsedAsync(...)` | `StoreInventoryResponseModels.GetStoreUsedOperationResponse` | `storeInventory.getStoreUsed.adminSelfEnable` |
|
|
96
|
+
| `removeStoreUsed` | `StoreInventoryModels.AdminRemoveStoreUsedRequestData` | `removeStoreUsedAsync(...)` | `StoreInventoryResponseModels.RemoveStoreUsedOperationResponse` | `storeInventory.removeStoreUsed.adminSelfEnable` |
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## Ví dụ tối thiểu
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
import { GNNetwork, ReturnCode, ErrorCode } from "@xmobitea/gn-typescript-client";
|
|
103
|
+
|
|
104
|
+
// requestData: StoreInventoryModels.BuyStoreItemRequestData đã build theo dto/STORE_INVENTORY.md
|
|
105
|
+
const res = await GNNetwork.storeInventory.buyStoreItemAsync(requestData);
|
|
106
|
+
if (res.returnCode !== ReturnCode.Ok) return;
|
|
107
|
+
if (res.errorCode !== ErrorCode.Ok) return;
|
|
108
|
+
// res.responseData có typed payload
|
|
109
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Reference: Config (`GNServerSettingsOptions`)
|
|
2
|
+
|
|
3
|
+
Schema đầy đủ của object truyền vào `GNNetwork.init(settings)`.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { GNNetwork, GNServerSettings, GNServerSettingsOptions, MessageType, LogType } from "@xmobitea/gn-typescript-client";
|
|
7
|
+
|
|
8
|
+
const settings = new GNServerSettings();
|
|
9
|
+
settings.config({
|
|
10
|
+
serverAddress: "api.example.com",
|
|
11
|
+
serverPort: -1,
|
|
12
|
+
serverSocketPort: -1,
|
|
13
|
+
useSsl: true,
|
|
14
|
+
useSocket: true,
|
|
15
|
+
useHttp: true,
|
|
16
|
+
|
|
17
|
+
defaultTimeoutInSeconds: 20,
|
|
18
|
+
messageType: MessageType.MsgPack,
|
|
19
|
+
sendRate: 20,
|
|
20
|
+
reconnectDelay: 5000,
|
|
21
|
+
pingInterval: 20000,
|
|
22
|
+
pingTimeout: 20000,
|
|
23
|
+
|
|
24
|
+
secretKey: "<secret-key>",
|
|
25
|
+
gameId: "<game-id>",
|
|
26
|
+
|
|
27
|
+
logType: LogType.All,
|
|
28
|
+
} satisfies GNServerSettingsOptions);
|
|
29
|
+
|
|
30
|
+
GNNetwork.init(settings);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Rule cứng
|
|
34
|
+
|
|
35
|
+
- `GNNetwork.init(settings)` là **idempotent**: gọi 1 lần ở bootstrap, các lần sau bị bỏ qua (không reset config).
|
|
36
|
+
- `GNServerSettings.config(options)` thay thế toàn bộ snapshot — không merge partial. Nếu muốn đổi từng field, dùng setter như `setServerAddress`.
|
|
37
|
+
- Không commit `secretKey` chứa `permission rules` có permission `admin` hoặc `server` vào production.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Bảng field
|
|
42
|
+
|
|
43
|
+
| Field | Type | Required | Default | Unit | Notes |
|
|
44
|
+
|-------|------|----------|---------|------|-------|
|
|
45
|
+
| `serverAddress` | `string` | yes | `"127.0.0.1"` | host | Host name hoặc IP public của GearN Server |
|
|
46
|
+
| `serverPort` | `number` | yes | `2202` | port | HTTP port. Set `-1` khi proxy đã expose default port trực tiếp |
|
|
47
|
+
| `serverSocketPort` | `number` | yes | `2901` | port | Socket port. Set `-1` khi proxy đã expose default port trực tiếp |
|
|
48
|
+
| `useSsl` | `boolean` | yes | `false` | — | `true` để build HTTPS/WSS URL |
|
|
49
|
+
| `useSocket` | `boolean` | yes | `true` | — | Bật socket transport và realtime feature |
|
|
50
|
+
| `useHttp` | `boolean` | yes | `true` | — | Bật HTTP transport (mọi public API wrapper đều dựa vào) |
|
|
51
|
+
| `defaultTimeoutInSeconds` | `number` | yes | `20` | giây | Timeout mặc định cho request không override `timeout` |
|
|
52
|
+
| `messageType` | `MessageType` | yes | `MessageType.MsgPack` | enum | Payload format. Browser HTTP với MsgPack tự fallback JSON |
|
|
53
|
+
| `sendRate` | `number` | yes | `20` | msg/giây | Max send rate request bởi transport loop |
|
|
54
|
+
| `reconnectDelay` | `number` | yes | `5000` | ms | Reconnect delay của socket client |
|
|
55
|
+
| `pingInterval` | `number` | yes | `20000` | ms | Ping interval socket client |
|
|
56
|
+
| `pingTimeout` | `number` | yes | `20000` | ms | Timeout phát hiện socket stale |
|
|
57
|
+
| `secretKey` | `string` | yes | — | — | Auto gắn cho mọi route nếu không dùng overrideSecretKey |
|
|
58
|
+
| `gameId` | `string` | yes | — | — | Game/application id khớp với `secretKey`; dùng để chọn đúng game context trên GearN Server |
|
|
59
|
+
| `logType` | `LogType` | yes | `LogType.All` | enum | Verbosity `GNDebug` |
|
|
60
|
+
|
|
61
|
+
Default column phản ánh giá trị khởi tạo trong class `GNServerSettings` trước khi gọi `config()`. `config()` yêu cầu cung cấp đầy đủ mọi field (strict replace).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## URL building behavior
|
|
66
|
+
|
|
67
|
+
SDK tự build base URL từ `serverAddress` + port + `useSsl`:
|
|
68
|
+
|
|
69
|
+
- `getHttpUrl()`:
|
|
70
|
+
- `serverPort >= 0` → `{http|https}://{serverAddress}:{serverPort}`
|
|
71
|
+
- `serverPort < 0` → `{http|https}://{serverAddress}` (reverse proxy mode)
|
|
72
|
+
- `getSocketUrl()`: same pattern dùng `serverSocketPort`.
|
|
73
|
+
|
|
74
|
+
Set `serverPort: -1` hoặc `serverSocketPort: -1` khi proxy (nginx, ALB, Cloudflare) đã terminate port 80/443.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Setter runtime (khi cần đổi sau init)
|
|
79
|
+
|
|
80
|
+
`GNServerSettings` expose setter cho mọi field. Sau `init`, SDK vẫn giữ reference tới cùng `settings` object, nên một số request mới có thể thấy giá trị setter mới. Đây không phải cách đổi toàn bộ app config an toàn; route/socket đang mở không tự reset.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
settings.setServerAddress("prod-api.example.com");
|
|
84
|
+
settings.setLogType(LogType.Error);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Lưu ý: gọi lại `GNNetwork.init()` để đổi config sẽ bị ignore. Đổi host/port sau khi socket đã connect **không** tự reconnect; phải `disconnectSocket()` rồi `connectSocket()` lại.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Reverse proxy flag
|
|
92
|
+
|
|
93
|
+
`GNServerSettings` có property nội bộ `useReverseProxy` (default `false`):
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
settings.setUseReverseProxy(true);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Khi bật, low-level HTTP helper có thể bỏ qua việc tự thêm request path prefix vì proxy đã route. Chỉ bật khi infra yêu cầu — default giữ nguyên `false`.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Liên kết
|
|
104
|
+
|
|
105
|
+
- Secret key và route permission: xem [RULES.md § 3](../RULES.md#3-route--trust-boundary-của-caller)
|
|
106
|
+
- Socket auth flow: xem [RULES.md § 7](../RULES.md#7-auth--socket-flow) và [EVENTS.md](EVENTS.md)
|
|
107
|
+
- `MessageType` / `LogType` enum: [ENUMS.md](ENUMS.md#messagetype)
|