@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
|
@@ -1,26 +1,179 @@
|
|
|
1
1
|
import { LogType } from "./../logger/GNDebug";
|
|
2
|
+
/**
|
|
3
|
+
* Wire-format selector used by the HTTP and socket transports when they
|
|
4
|
+
* encode an outgoing payload or decode an incoming one.
|
|
5
|
+
*
|
|
6
|
+
* The numeric values are persisted onto the wire indirectly through the
|
|
7
|
+
* `Commands.RequestCmd_*` / `Commands.ResponseCmd_*` strings, so changing
|
|
8
|
+
* the underlying ordinal would break every generated request. Treat the
|
|
9
|
+
* numbers as a stable contract.
|
|
10
|
+
*
|
|
11
|
+
* Behavioural notes:
|
|
12
|
+
* - `Json` is the safest default — every host runtime can encode and decode
|
|
13
|
+
* it with no extra dependency. It is also the format used by the
|
|
14
|
+
* reverse-proxy paths in {@link NetworkingPeerAxiosRequest}.
|
|
15
|
+
* - `MsgPack` is preferred on Node.js / Cocos Creator targets where the
|
|
16
|
+
* `MessagePackConverterService` runs the `@msgpack/msgpack` codec
|
|
17
|
+
* directly. On the browser HTTP path the SDK silently downgrades MsgPack
|
|
18
|
+
* responses to JSON because some browsers do not expose the binary
|
|
19
|
+
* primitives needed for streamed MsgPack decoding.
|
|
20
|
+
*/
|
|
2
21
|
export declare enum MessageType {
|
|
22
|
+
/** UTF-8 JSON — universal, slightly larger payloads. */
|
|
3
23
|
Json = 1,
|
|
24
|
+
/** Binary MessagePack — smaller payloads, requires runtime support. */
|
|
4
25
|
MsgPack = 2
|
|
5
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Strongly-typed shape accepted by {@link GNServerSettings.config}.
|
|
29
|
+
*
|
|
30
|
+
* Every field on this interface is **required** because `config()` performs
|
|
31
|
+
* a full snapshot replacement rather than a merge: it copies each property
|
|
32
|
+
* verbatim into the {@link GNServerSettings} instance. To do partial
|
|
33
|
+
* updates use the dedicated `set*` accessors instead.
|
|
34
|
+
*/
|
|
6
35
|
export interface GNServerSettingsOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Public host name or IP address of the GearN Server backend.
|
|
38
|
+
*
|
|
39
|
+
* No scheme prefix (`http://` / `https://`) and no path — only the host
|
|
40
|
+
* portion. The transports compose the full URL by combining this value
|
|
41
|
+
* with `useSsl`, `serverPort` (HTTP) and `serverSocketPort` (socket).
|
|
42
|
+
*
|
|
43
|
+
* Example: `"api.example.com"` or `"10.0.0.5"`.
|
|
44
|
+
*/
|
|
7
45
|
serverAddress: string;
|
|
46
|
+
/**
|
|
47
|
+
* Public TCP port that exposes the GearN HTTP API.
|
|
48
|
+
*
|
|
49
|
+
* Use `-1` when a reverse proxy makes the API available on the default
|
|
50
|
+
* port for the chosen scheme (80 / 443) — the URL builder in
|
|
51
|
+
* {@link GNServerSettings.getHttpUrl} omits the port segment in that
|
|
52
|
+
* case so the browser does not append `:80` / `:443` redundantly.
|
|
53
|
+
*/
|
|
8
54
|
serverPort: number;
|
|
55
|
+
/**
|
|
56
|
+
* Public TCP port that exposes the GearN socket.io endpoint.
|
|
57
|
+
*
|
|
58
|
+
* Use `-1` for proxy setups for the same reason as `serverPort`.
|
|
59
|
+
*/
|
|
9
60
|
serverSocketPort: number;
|
|
61
|
+
/**
|
|
62
|
+
* When `true`, the URL builders emit `https://` and `wss://` schemes,
|
|
63
|
+
* otherwise `http://` and `ws://`. Switching this value at runtime
|
|
64
|
+
* affects the next `getHttpUrl()` / `getSocketUrl()` call but does not
|
|
65
|
+
* upgrade an already-open socket.io connection.
|
|
66
|
+
*/
|
|
10
67
|
useSsl: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Master switch for the realtime socket.io transport.
|
|
70
|
+
*
|
|
71
|
+
* When `false`, {@link SocketPeer.initGNSocketObject} sets `isUse` to
|
|
72
|
+
* `false` and every `enqueue` call routed at the socket peer is dropped
|
|
73
|
+
* with an error logged through `GNDebug.logError`.
|
|
74
|
+
*/
|
|
11
75
|
useSocket: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Master switch for the HTTP transport. When `false` the typed API
|
|
78
|
+
* wrappers in `GNNetwork*Api` will fail to send because their
|
|
79
|
+
* underlying `enqueue` calls are no-ops on a disabled peer.
|
|
80
|
+
*/
|
|
12
81
|
useHttp: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Default request timeout (in **seconds**) applied by both transports
|
|
84
|
+
* whenever an `OperationRequest` is constructed without an explicit
|
|
85
|
+
* timeout override. The shared `OperationRequest.defaultTimeOut`
|
|
86
|
+
* sentinel (also `20`) is what triggers this fallback inside
|
|
87
|
+
* {@link SocketPeer.send}.
|
|
88
|
+
*/
|
|
13
89
|
defaultTimeoutInSeconds: number;
|
|
90
|
+
/**
|
|
91
|
+
* Preferred wire format. See {@link MessageType} for the runtime caveats
|
|
92
|
+
* (the browser HTTP path may downgrade MsgPack responses to JSON).
|
|
93
|
+
*/
|
|
14
94
|
messageType: MessageType;
|
|
95
|
+
/**
|
|
96
|
+
* Maximum number of operation requests the SDK will pop from the local
|
|
97
|
+
* queue per second. The transports convert this value into a
|
|
98
|
+
* per-message tick duration (`perMsgTimer = 1 / sendRate / 1000`)
|
|
99
|
+
* inside {@link PeerBase.setSendRate}, which the `service()` loop uses
|
|
100
|
+
* as a throttle.
|
|
101
|
+
*
|
|
102
|
+
* Practical range is 5..50; values lower than 5 introduce noticeable
|
|
103
|
+
* head-of-line latency on bursts.
|
|
104
|
+
*/
|
|
15
105
|
sendRate: number;
|
|
106
|
+
/**
|
|
107
|
+
* Reconnect backoff delay (in **milliseconds**) handed to the
|
|
108
|
+
* underlying socket.io client after an unexpected disconnection.
|
|
109
|
+
*/
|
|
16
110
|
reconnectDelay: number;
|
|
111
|
+
/**
|
|
112
|
+
* Heartbeat interval (in **milliseconds**) used by the socket.io
|
|
113
|
+
* client to keep the connection alive across NAT timeouts.
|
|
114
|
+
*/
|
|
17
115
|
pingInterval: number;
|
|
116
|
+
/**
|
|
117
|
+
* Maximum waiting time (in **milliseconds**) for a heartbeat response
|
|
118
|
+
* before the socket.io client treats the link as dead and triggers
|
|
119
|
+
* `disconnect`.
|
|
120
|
+
*/
|
|
18
121
|
pingTimeout: number;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Per-game shared secret. The transports forward this value in the
|
|
124
|
+
* `Secret-Key` HTTP header / equivalent socket frame so the backend
|
|
125
|
+
* can authenticate the SDK origin before processing the operation.
|
|
126
|
+
*/
|
|
127
|
+
secretKey: string;
|
|
128
|
+
/**
|
|
129
|
+
* GearN game identifier. Sent in the `Game-Id` HTTP header by every
|
|
130
|
+
* authenticated request so the backend can route to the right game
|
|
131
|
+
* configuration.
|
|
132
|
+
*/
|
|
133
|
+
gameId: string;
|
|
134
|
+
/**
|
|
135
|
+
* Initial verbosity level for {@link GNDebug}. Applied by
|
|
136
|
+
* `GNNetwork.initGNDebug()` shortly after `init()` is called.
|
|
137
|
+
*/
|
|
22
138
|
logType: LogType;
|
|
23
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Mutable configuration container shared between {@link GNNetwork}, the
|
|
142
|
+
* HTTP peer ({@link HttpPeer}) and the socket peer ({@link SocketPeer}).
|
|
143
|
+
*
|
|
144
|
+
* Intended usage:
|
|
145
|
+
* ```ts
|
|
146
|
+
* const settings = new GNServerSettings();
|
|
147
|
+
* settings.config({
|
|
148
|
+
* serverAddress: "api.example.com",
|
|
149
|
+
* serverPort: 443,
|
|
150
|
+
* serverSocketPort: 443,
|
|
151
|
+
* useSsl: true,
|
|
152
|
+
* useSocket: true,
|
|
153
|
+
* useHttp: true,
|
|
154
|
+
* defaultTimeoutInSeconds: 20,
|
|
155
|
+
* messageType: MessageType.MsgPack,
|
|
156
|
+
* sendRate: 20,
|
|
157
|
+
* reconnectDelay: 5000,
|
|
158
|
+
* pingInterval: 20000,
|
|
159
|
+
* pingTimeout: 20000,
|
|
160
|
+
* secretKey: "<game-secret>",
|
|
161
|
+
* gameId: "<game-id>",
|
|
162
|
+
* logType: LogType.All,
|
|
163
|
+
* });
|
|
164
|
+
* GNNetwork.init(settings);
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* Lifecycle notes:
|
|
168
|
+
* - `GNNetwork.init()` stores a reference to the instance you pass in and
|
|
169
|
+
* never copies it, so subsequent `set*` calls remain visible to the
|
|
170
|
+
* transports. URL-affecting changes (`setServerAddress`, `setUseSsl`,
|
|
171
|
+
* port setters) take effect on the very next request, but **do not**
|
|
172
|
+
* reconnect an already-open socket.io session.
|
|
173
|
+
* - The default values defined inline below (host `127.0.0.1`, port
|
|
174
|
+
* `2202` / `2901`, MsgPack, etc.) match the GearN Server local-dev
|
|
175
|
+
* defaults.
|
|
176
|
+
*/
|
|
24
177
|
export declare class GNServerSettings {
|
|
25
178
|
private serverAddress;
|
|
26
179
|
private serverPort;
|
|
@@ -34,46 +187,323 @@ export declare class GNServerSettings {
|
|
|
34
187
|
private reconnectDelay;
|
|
35
188
|
private pingInterval;
|
|
36
189
|
private pingTimeout;
|
|
37
|
-
private
|
|
38
|
-
private
|
|
39
|
-
private clientSecretKey;
|
|
190
|
+
private secretKey;
|
|
191
|
+
private gameId;
|
|
40
192
|
private logType;
|
|
41
193
|
private useReverseProxy;
|
|
194
|
+
/**
|
|
195
|
+
* Replaces every configurable value in the instance with the snapshot
|
|
196
|
+
* provided by `options`.
|
|
197
|
+
*
|
|
198
|
+
* This is **not** a partial merge: every field on
|
|
199
|
+
* {@link GNServerSettingsOptions} is required and is copied verbatim.
|
|
200
|
+
* To change a single value at runtime use the dedicated `set*`
|
|
201
|
+
* accessor instead.
|
|
202
|
+
*
|
|
203
|
+
* `useReverseProxy` is intentionally **not** part of the snapshot
|
|
204
|
+
* because it is configured separately via
|
|
205
|
+
* {@link setUseReverseProxy} during transport-specific tuning.
|
|
206
|
+
*
|
|
207
|
+
* @param options Full configuration snapshot. See the field-level
|
|
208
|
+
* documentation on {@link GNServerSettingsOptions} for
|
|
209
|
+
* units and accepted ranges.
|
|
210
|
+
*/
|
|
42
211
|
config(options: GNServerSettingsOptions): void;
|
|
212
|
+
/**
|
|
213
|
+
* Returns the configured host name or IP address.
|
|
214
|
+
*
|
|
215
|
+
* The value is the bare host (no scheme, no path, no port) used by
|
|
216
|
+
* {@link getHttpUrl} and {@link getSocketUrl} when they compose the
|
|
217
|
+
* absolute URL passed to Axios / socket.io.
|
|
218
|
+
*
|
|
219
|
+
* @returns Current host string. Defaults to `127.0.0.1` until
|
|
220
|
+
* `config()` or `setServerAddress()` overrides it.
|
|
221
|
+
*/
|
|
43
222
|
getServerAddress(): string;
|
|
223
|
+
/**
|
|
224
|
+
* Updates the host name or IP address used by both transports.
|
|
225
|
+
*
|
|
226
|
+
* Takes effect on the next URL build — does not reconnect an already
|
|
227
|
+
* open socket.io session.
|
|
228
|
+
*
|
|
229
|
+
* @param serverAddress Bare host (no scheme, no port).
|
|
230
|
+
*/
|
|
44
231
|
setServerAddress(serverAddress: string): void;
|
|
232
|
+
/**
|
|
233
|
+
* Returns the TCP port used to compose the HTTP base URL.
|
|
234
|
+
*
|
|
235
|
+
* @returns The port number. A value of `-1` is the convention for
|
|
236
|
+
* "default port for the scheme" and causes {@link getHttpUrl}
|
|
237
|
+
* to omit the port segment from the URL.
|
|
238
|
+
*/
|
|
45
239
|
getServerPort(): number;
|
|
240
|
+
/**
|
|
241
|
+
* Updates the HTTP port used to compose the base API URL.
|
|
242
|
+
*
|
|
243
|
+
* @param serverPort TCP port, or `-1` to fall back to the default port
|
|
244
|
+
* of the current scheme (80 for HTTP, 443 for HTTPS).
|
|
245
|
+
*/
|
|
46
246
|
setServerPort(serverPort: number): void;
|
|
247
|
+
/**
|
|
248
|
+
* Returns the TCP port used to compose the socket base URL.
|
|
249
|
+
*
|
|
250
|
+
* @returns The port number, or `-1` when the application wants the URL
|
|
251
|
+
* builder to omit the port segment.
|
|
252
|
+
*/
|
|
47
253
|
getServerSocketPort(): number;
|
|
254
|
+
/**
|
|
255
|
+
* Updates the socket port used to compose the socket URL.
|
|
256
|
+
*
|
|
257
|
+
* @param serverSocketPort TCP port, or `-1` to omit the port segment.
|
|
258
|
+
*/
|
|
48
259
|
setServerSocketPort(serverSocketPort: number): void;
|
|
260
|
+
/**
|
|
261
|
+
* Returns whether the URL builders should emit `https://` / `wss://`.
|
|
262
|
+
*
|
|
263
|
+
* @returns `true` when SSL is enabled, `false` otherwise.
|
|
264
|
+
*/
|
|
49
265
|
isUseSsl(): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Enables or disables HTTPS / WSS URL generation.
|
|
268
|
+
*
|
|
269
|
+
* Does **not** retroactively upgrade an already open socket.io session
|
|
270
|
+
* — call {@link disconnectSocket} then {@link connectSocket} on
|
|
271
|
+
* `GNNetwork` to apply the change to the realtime channel.
|
|
272
|
+
*
|
|
273
|
+
* @param useSsl `true` to use the secure schemes, `false` to use the
|
|
274
|
+
* clear-text schemes.
|
|
275
|
+
*/
|
|
50
276
|
setUseSsl(useSsl: boolean): void;
|
|
277
|
+
/**
|
|
278
|
+
* Returns whether the socket transport is enabled.
|
|
279
|
+
*
|
|
280
|
+
* When `false`, {@link SocketPeer} marks itself as unusable and every
|
|
281
|
+
* realtime feature (event push, low-latency send) is disabled.
|
|
282
|
+
*
|
|
283
|
+
* @returns `true` when the socket transport is enabled.
|
|
284
|
+
*/
|
|
51
285
|
isUseSocket(): boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Enables or disables the realtime socket transport.
|
|
288
|
+
*
|
|
289
|
+
* Read at peer-init time only — toggling this value after
|
|
290
|
+
* `GNNetwork.init()` will **not** start or stop the underlying
|
|
291
|
+
* socket.io client, only freshly initialised peers honour it.
|
|
292
|
+
*
|
|
293
|
+
* @param useSocket Master switch for the realtime channel.
|
|
294
|
+
*/
|
|
52
295
|
setUseSocket(useSocket: boolean): void;
|
|
296
|
+
/**
|
|
297
|
+
* Returns whether the HTTP transport is enabled.
|
|
298
|
+
*
|
|
299
|
+
* @returns `true` when HTTP transport is enabled.
|
|
300
|
+
*/
|
|
53
301
|
isUseHttp(): boolean;
|
|
302
|
+
/**
|
|
303
|
+
* Enables or disables the HTTP transport.
|
|
304
|
+
*
|
|
305
|
+
* Read at peer-init time only — disabling HTTP after
|
|
306
|
+
* `GNNetwork.init()` will not unbind Axios but will cause every
|
|
307
|
+
* subsequent typed API call to fail with an error log because the
|
|
308
|
+
* peer's `isUse` flag is checked at enqueue time.
|
|
309
|
+
*
|
|
310
|
+
* @param useHttp Master switch for the HTTP channel.
|
|
311
|
+
*/
|
|
54
312
|
setUseHttp(useHttp: boolean): void;
|
|
313
|
+
/**
|
|
314
|
+
* Returns the default request timeout in **seconds**.
|
|
315
|
+
*
|
|
316
|
+
* Applied by {@link SocketPeer.send} to any operation request whose
|
|
317
|
+
* timeout still equals the {@link OperationRequest.defaultTimeOut}
|
|
318
|
+
* sentinel.
|
|
319
|
+
*
|
|
320
|
+
* @returns Timeout in seconds. Defaults to `20`.
|
|
321
|
+
*/
|
|
55
322
|
getDefaultTimeoutInSeconds(): number;
|
|
323
|
+
/**
|
|
324
|
+
* Updates the default request timeout in **seconds**.
|
|
325
|
+
*
|
|
326
|
+
* Only affects operations that did not specify their own timeout when
|
|
327
|
+
* they were created.
|
|
328
|
+
*
|
|
329
|
+
* @param defaultTimeoutInSeconds Timeout in seconds. Use values that
|
|
330
|
+
* cover both the network round-trip and
|
|
331
|
+
* server processing time.
|
|
332
|
+
*/
|
|
56
333
|
setDefaultTimeoutInSeconds(defaultTimeoutInSeconds: number): void;
|
|
334
|
+
/**
|
|
335
|
+
* Returns the preferred wire format.
|
|
336
|
+
*
|
|
337
|
+
* @returns The currently selected {@link MessageType}. Note that the
|
|
338
|
+
* browser HTTP path silently downgrades MsgPack responses to
|
|
339
|
+
* JSON for compatibility reasons.
|
|
340
|
+
*/
|
|
57
341
|
getMessageType(): MessageType;
|
|
342
|
+
/**
|
|
343
|
+
* Updates the preferred wire format.
|
|
344
|
+
*
|
|
345
|
+
* The change applies to subsequent requests; in-flight requests
|
|
346
|
+
* already serialised remain in their original format.
|
|
347
|
+
*
|
|
348
|
+
* @param messageType New wire format.
|
|
349
|
+
*/
|
|
58
350
|
setMessageType(messageType: MessageType): void;
|
|
351
|
+
/**
|
|
352
|
+
* Returns the throttle applied by the local request queue.
|
|
353
|
+
*
|
|
354
|
+
* @returns Maximum number of messages dispatched per second.
|
|
355
|
+
* Defaults to `20`.
|
|
356
|
+
*/
|
|
59
357
|
getSendRate(): number;
|
|
358
|
+
/**
|
|
359
|
+
* Updates the local-queue throttle.
|
|
360
|
+
*
|
|
361
|
+
* Only honoured at peer-init time — already-running peers keep using
|
|
362
|
+
* the rate they captured during {@link PeerBase.initSendRate}.
|
|
363
|
+
*
|
|
364
|
+
* @param sendRate Maximum messages per second. Practical range is
|
|
365
|
+
* `5..50`; very low values introduce noticeable
|
|
366
|
+
* head-of-line latency under burst load.
|
|
367
|
+
*/
|
|
60
368
|
setSendRate(sendRate: number): void;
|
|
369
|
+
/**
|
|
370
|
+
* Returns the socket reconnect delay.
|
|
371
|
+
*
|
|
372
|
+
* @returns Delay in **milliseconds** before the socket.io client
|
|
373
|
+
* attempts a reconnect after an unexpected drop.
|
|
374
|
+
*/
|
|
61
375
|
getReconnectDelay(): number;
|
|
376
|
+
/**
|
|
377
|
+
* Updates the socket reconnect delay.
|
|
378
|
+
*
|
|
379
|
+
* Read once when {@link SocketPeer.initGNSocketObject} hands the value
|
|
380
|
+
* to the underlying socket.io client. Setting it later requires a
|
|
381
|
+
* disconnect/reconnect cycle to take effect.
|
|
382
|
+
*
|
|
383
|
+
* @param reconnectDelay Delay in **milliseconds**.
|
|
384
|
+
*/
|
|
62
385
|
setReconnectDelay(reconnectDelay: number): void;
|
|
386
|
+
/**
|
|
387
|
+
* Returns the socket heartbeat interval.
|
|
388
|
+
*
|
|
389
|
+
* @returns Interval in **milliseconds**.
|
|
390
|
+
*/
|
|
63
391
|
getPingInterval(): number;
|
|
392
|
+
/**
|
|
393
|
+
* Updates the socket heartbeat interval.
|
|
394
|
+
*
|
|
395
|
+
* Read once when the socket.io client is configured. Setting it later
|
|
396
|
+
* requires reconnect.
|
|
397
|
+
*
|
|
398
|
+
* @param pingInterval Interval in **milliseconds**.
|
|
399
|
+
*/
|
|
64
400
|
setPingInterval(pingInterval: number): void;
|
|
401
|
+
/**
|
|
402
|
+
* Returns the socket heartbeat timeout.
|
|
403
|
+
*
|
|
404
|
+
* @returns Maximum waiting time in **milliseconds** for a heartbeat
|
|
405
|
+
* response before the link is considered dead.
|
|
406
|
+
*/
|
|
65
407
|
getPingTimeout(): number;
|
|
408
|
+
/**
|
|
409
|
+
* Updates the socket heartbeat timeout.
|
|
410
|
+
*
|
|
411
|
+
* Read once when the socket.io client is configured. Setting it later
|
|
412
|
+
* requires reconnect.
|
|
413
|
+
*
|
|
414
|
+
* @param pingTimeout Timeout in **milliseconds**.
|
|
415
|
+
*/
|
|
66
416
|
setPingTimeout(pingTimeout: number): void;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
417
|
+
/**
|
|
418
|
+
* Returns the secret key sent in the `Secret-Key` HTTP header.
|
|
419
|
+
*
|
|
420
|
+
* @returns Current secret key. Empty / `undefined` when the
|
|
421
|
+
* application has not configured one yet.
|
|
422
|
+
*/
|
|
423
|
+
getSecretKey(): string;
|
|
424
|
+
/**
|
|
425
|
+
* Updates the secret key sent in the `Secret-Key` HTTP header.
|
|
426
|
+
*
|
|
427
|
+
* Take care not to commit production secrets into source control —
|
|
428
|
+
* load this value from a secure environment variable or remote config
|
|
429
|
+
* service before passing it into `config()` or this setter.
|
|
430
|
+
*
|
|
431
|
+
* @param secretKey Game-specific shared secret.
|
|
432
|
+
*/
|
|
433
|
+
setSecretKey(secretKey: string): void;
|
|
434
|
+
/**
|
|
435
|
+
* Returns the game id sent in the `Game-Id` HTTP header.
|
|
436
|
+
*
|
|
437
|
+
* @returns Current game id, or `undefined` when not yet configured.
|
|
438
|
+
*/
|
|
439
|
+
getGameId(): string;
|
|
440
|
+
/**
|
|
441
|
+
* Updates the game id sent in the `Game-Id` HTTP header.
|
|
442
|
+
*
|
|
443
|
+
* @param gameId Identifier configured for this game on the GearN
|
|
444
|
+
* backend.
|
|
445
|
+
*/
|
|
446
|
+
setGameId(gameId: string): void;
|
|
447
|
+
/**
|
|
448
|
+
* Returns the verbosity level forwarded to {@link GNDebug}.
|
|
449
|
+
*
|
|
450
|
+
* @returns The currently configured {@link LogType}.
|
|
451
|
+
*/
|
|
73
452
|
getLogType(): LogType;
|
|
453
|
+
/**
|
|
454
|
+
* Updates the verbosity level forwarded to {@link GNDebug}.
|
|
455
|
+
*
|
|
456
|
+
* Note: this setter only updates the snapshot stored on this instance.
|
|
457
|
+
* `GNDebug.setLogType` is invoked once during `GNNetwork.init()`; to
|
|
458
|
+
* change the live log level afterwards call `GNDebug.setLogType`
|
|
459
|
+
* directly in addition to this setter.
|
|
460
|
+
*
|
|
461
|
+
* @param logType New level. See {@link LogType} for the inclusion table.
|
|
462
|
+
*/
|
|
74
463
|
setLogType(logType: LogType): void;
|
|
464
|
+
/**
|
|
465
|
+
* Builds the absolute base URL for the socket transport.
|
|
466
|
+
*
|
|
467
|
+
* The result is composed of `scheme + "://" + host` and, when
|
|
468
|
+
* `serverSocketPort >= 0`, also `":" + port`. The scheme is `https`
|
|
469
|
+
* when {@link useSsl} is `true`, otherwise `http`. socket.io uses the
|
|
470
|
+
* HTTP scheme — it negotiates the `ws://` / `wss://` upgrade itself.
|
|
471
|
+
*
|
|
472
|
+
* @returns Absolute base URL passed to the socket.io client during
|
|
473
|
+
* {@link SocketPeer.initGNSocketObject}.
|
|
474
|
+
*/
|
|
75
475
|
getSocketUrl(): string;
|
|
476
|
+
/**
|
|
477
|
+
* Builds the absolute base URL for the HTTP transport.
|
|
478
|
+
*
|
|
479
|
+
* Composition mirrors {@link getSocketUrl}: scheme + host + optional
|
|
480
|
+
* `":" + port`. Used by {@link NetworkingPeerAxiosRequest} to prefix
|
|
481
|
+
* the operation-specific sub-URI before the actual Axios call.
|
|
482
|
+
*
|
|
483
|
+
* @returns Absolute HTTP base URL — does **not** include a trailing
|
|
484
|
+
* slash, callers append `"/" + subUri` themselves.
|
|
485
|
+
*/
|
|
76
486
|
getHttpUrl(): string;
|
|
487
|
+
/**
|
|
488
|
+
* Toggles reverse-proxy mode for the HTTP transport.
|
|
489
|
+
*
|
|
490
|
+
* When enabled the Axios layer drops the absolute URL and instead
|
|
491
|
+
* sends the request as a relative path (`"/" + subUri`), forwarding
|
|
492
|
+
* the original base URL through the `X-BaseUrl` header so a
|
|
493
|
+
* same-origin proxy can rewrite it. This is mainly useful for browser
|
|
494
|
+
* applications that want to avoid CORS preflight.
|
|
495
|
+
*
|
|
496
|
+
* @param useReverseProxy `true` to route HTTP traffic through a
|
|
497
|
+
* same-origin proxy, `false` to use the
|
|
498
|
+
* absolute URL built from the configured host
|
|
499
|
+
* and port.
|
|
500
|
+
*/
|
|
77
501
|
setUseReverseProxy(useReverseProxy: boolean): void;
|
|
502
|
+
/**
|
|
503
|
+
* Returns whether HTTP requests should be routed through a same-origin
|
|
504
|
+
* reverse proxy.
|
|
505
|
+
*
|
|
506
|
+
* @returns `true` when reverse-proxy mode is active.
|
|
507
|
+
*/
|
|
78
508
|
getUseReverseProxy(): boolean;
|
|
79
509
|
}
|
|
@@ -1,20 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire-format string constants used by both transports.
|
|
3
|
+
*
|
|
4
|
+
* Centralises HTTP header names, content-type values, socket
|
|
5
|
+
* command identifiers and multipart field names. The values are
|
|
6
|
+
* the literal strings the GearN backend recognises on the wire,
|
|
7
|
+
* so they cannot be renamed without a coordinated backend change.
|
|
8
|
+
*
|
|
9
|
+
* Categories:
|
|
10
|
+
* - `USER_AGENT`, `CONTENT_TYPE`, `ACCEPT`, `CONTENT_LENGTH` —
|
|
11
|
+
* generic HTTP headers consumed by
|
|
12
|
+
* {@link NetworkingPeerAxiosRequest}.
|
|
13
|
+
* - `APPLICATION_JSON`, `APPLICATION_MSGPACK` — MIME values for
|
|
14
|
+
* the matching wire format.
|
|
15
|
+
* - `RequestAuthTokenCmd`, `RequestSecretCmd`, `RequestGameIdCmd` —
|
|
16
|
+
* GearN-specific HTTP headers (also used as the auth-frame name
|
|
17
|
+
* on the socket transport).
|
|
18
|
+
* - `RequestCmd_*`, `ResponseCmd_*`, `EventCmd_*` — socket.io
|
|
19
|
+
* event names for outbound requests, inbound responses and
|
|
20
|
+
* inbound server-pushed events. Two flavours each (MsgPack
|
|
21
|
+
* binary vs JSON text).
|
|
22
|
+
* - `Data`, `File` — multipart form-data field names for the
|
|
23
|
+
* upload endpoint.
|
|
24
|
+
* - `BaseUrl` — reverse-proxy header that forwards the original
|
|
25
|
+
* base URL when relative-path mode is enabled.
|
|
26
|
+
*/
|
|
1
27
|
export declare class Commands {
|
|
28
|
+
/**
|
|
29
|
+
* HTTP header used to identify the SDK client variant and version.
|
|
30
|
+
*/
|
|
2
31
|
static readonly USER_AGENT: string;
|
|
32
|
+
/**
|
|
33
|
+
* HTTP header that declares the request body content type.
|
|
34
|
+
*/
|
|
3
35
|
static readonly CONTENT_TYPE: string;
|
|
36
|
+
/**
|
|
37
|
+
* HTTP header that declares which response content types the client accepts.
|
|
38
|
+
*/
|
|
4
39
|
static readonly ACCEPT: string;
|
|
40
|
+
/**
|
|
41
|
+
* HTTP header that carries the serialized request body size in bytes when required.
|
|
42
|
+
*/
|
|
5
43
|
static readonly CONTENT_LENGTH: string;
|
|
44
|
+
/**
|
|
45
|
+
* MIME type used for JSON request and response payloads.
|
|
46
|
+
*/
|
|
6
47
|
static readonly APPLICATION_JSON: string;
|
|
48
|
+
/**
|
|
49
|
+
* MIME type used for MessagePack request and response payloads.
|
|
50
|
+
*/
|
|
7
51
|
static readonly APPLICATION_MSGPACK: string;
|
|
52
|
+
/**
|
|
53
|
+
* Transport header used to send the current auth token with HTTP requests.
|
|
54
|
+
*/
|
|
8
55
|
static readonly RequestAuthTokenCmd: string;
|
|
56
|
+
/**
|
|
57
|
+
* Transport header used to send the selected route secret key with HTTP requests.
|
|
58
|
+
*/
|
|
9
59
|
static readonly RequestSecretCmd: string;
|
|
60
|
+
/**
|
|
61
|
+
* Transport header used to send the current game id when the backend requires it.
|
|
62
|
+
*/
|
|
10
63
|
static readonly RequestGameIdCmd: string;
|
|
64
|
+
/**
|
|
65
|
+
* Socket command name for MessagePack operation requests.
|
|
66
|
+
*/
|
|
11
67
|
static readonly RequestCmd_MsgPack: string;
|
|
68
|
+
/**
|
|
69
|
+
* Socket command name for MessagePack operation responses.
|
|
70
|
+
*/
|
|
12
71
|
static readonly ResponseCmd_MsgPack: string;
|
|
72
|
+
/**
|
|
73
|
+
* Socket command name for MessagePack pushed events.
|
|
74
|
+
*/
|
|
13
75
|
static readonly EventCmd_MsgPack: string;
|
|
76
|
+
/**
|
|
77
|
+
* Socket command name for JSON operation requests.
|
|
78
|
+
*/
|
|
14
79
|
static readonly RequestCmd_Json: string;
|
|
80
|
+
/**
|
|
81
|
+
* Socket command name for JSON operation responses.
|
|
82
|
+
*/
|
|
15
83
|
static readonly ResponseCmd_Json: string;
|
|
84
|
+
/**
|
|
85
|
+
* Socket command name for JSON pushed events.
|
|
86
|
+
*/
|
|
16
87
|
static readonly EventCmd_Json: string;
|
|
88
|
+
/**
|
|
89
|
+
* Multipart field name used for non-file payload data.
|
|
90
|
+
*/
|
|
17
91
|
static readonly Data: string;
|
|
92
|
+
/**
|
|
93
|
+
* Multipart field name used for uploaded file content.
|
|
94
|
+
*/
|
|
18
95
|
static readonly File: string;
|
|
96
|
+
/**
|
|
97
|
+
* Reverse-proxy helper header that carries the original base URL when needed.
|
|
98
|
+
*/
|
|
19
99
|
static readonly BaseUrl: string;
|
|
20
100
|
}
|
|
@@ -1,8 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String identifiers for every realtime event the GearN backend
|
|
3
|
+
* pushes to authenticated socket clients.
|
|
4
|
+
*
|
|
5
|
+
* The values are the camelCase names embedded in the wire frame's
|
|
6
|
+
* `eventCode` parameter. The SDK uses them as the dictionary key
|
|
7
|
+
* inside {@link SocketPeer.serverEventHandlersDict} when it
|
|
8
|
+
* dispatches an inbound event to the registered
|
|
9
|
+
* {@link IServerEventHandler} implementations.
|
|
10
|
+
*
|
|
11
|
+
* Application code typically does not read these values directly
|
|
12
|
+
* — register a typed handler from
|
|
13
|
+
* `runtime/networking/handler/On*EventHandler.ts` instead, which
|
|
14
|
+
* already wires the matching event code through
|
|
15
|
+
* `getEventCode()`.
|
|
16
|
+
*
|
|
17
|
+
* Adding a new event: declare a new `public static readonly`
|
|
18
|
+
* entry here, write a typed handler that returns it from
|
|
19
|
+
* `getEventCode()`, and decorate the handler with
|
|
20
|
+
* `@IServerEventHandler.registerEvent`.
|
|
21
|
+
*/
|
|
1
22
|
export declare class EventCode {
|
|
23
|
+
/**
|
|
24
|
+
* Account-level (master-player) friend roster changed —
|
|
25
|
+
* decoded by
|
|
26
|
+
* {@link OnGamePlayerFriendUpdateEventHandler}.
|
|
27
|
+
*/
|
|
2
28
|
static readonly OnGamePlayerFriendUpdate: string;
|
|
29
|
+
/**
|
|
30
|
+
* Character-scoped friend roster changed — decoded by
|
|
31
|
+
* {@link OnCharacterPlayerFriendUpdateEventHandler}.
|
|
32
|
+
*/
|
|
3
33
|
static readonly OnCharacterPlayerFriendUpdate: string;
|
|
34
|
+
/**
|
|
35
|
+
* Account-level group membership changed — decoded by
|
|
36
|
+
* {@link OnGamePlayerGroupUpdateEventHandler}.
|
|
37
|
+
*/
|
|
4
38
|
static readonly OnGamePlayerGroupUpdate: string;
|
|
39
|
+
/**
|
|
40
|
+
* Group member roster changed — decoded by
|
|
41
|
+
* {@link OnGroupMemberUpdateEventHandler}. Pushed to every
|
|
42
|
+
* client currently subscribed to the group.
|
|
43
|
+
*/
|
|
5
44
|
static readonly OnGroupMemberUpdate: string;
|
|
45
|
+
/**
|
|
46
|
+
* Group message stream received new entries — decoded by
|
|
47
|
+
* {@link OnGroupMessageUpdateEventHandler}. Payload is a
|
|
48
|
+
* delta (only the new messages), not the full history.
|
|
49
|
+
*/
|
|
6
50
|
static readonly OnGroupMessageUpdate: string;
|
|
51
|
+
/**
|
|
52
|
+
* Character-scoped group membership changed — decoded by
|
|
53
|
+
* {@link OnCharacterPlayerGroupUpdateEventHandler}.
|
|
54
|
+
*/
|
|
7
55
|
static readonly OnCharacterPlayerGroupUpdate: string;
|
|
8
56
|
}
|