@xmobitea/gn-typescript-client 2.6.13-tsc → 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.
Files changed (400) hide show
  1. package/AGENTS.md +37 -0
  2. package/README.MD +420 -1
  3. package/dist/gearn.js.client.js +71354 -0
  4. package/dist/gearn.js.client.min.js +2 -0
  5. package/dist/gearn.js.client.min.js.LICENSE.txt +14 -0
  6. package/dist/index.d.ts +30 -0
  7. package/dist/index.js +58386 -339
  8. package/dist/runtime/GNNetwork.d.ts +687 -3
  9. package/dist/runtime/GNNetworkAuthenticateApi.d.ts +327 -0
  10. package/dist/runtime/GNNetworkCharacterPlayerApi.d.ts +1026 -0
  11. package/dist/runtime/GNNetworkCloudScriptApi.d.ts +141 -0
  12. package/dist/runtime/GNNetworkContentApi.d.ts +243 -0
  13. package/dist/runtime/GNNetworkDashboardApi.d.ts +221 -0
  14. package/dist/runtime/GNNetworkGamePlayerApi.d.ts +1033 -0
  15. package/dist/runtime/GNNetworkGroupApi.d.ts +783 -0
  16. package/dist/runtime/GNNetworkInventoryApi.d.ts +673 -0
  17. package/dist/runtime/GNNetworkMasterPlayerApi.d.ts +1614 -6
  18. package/dist/runtime/GNNetworkMultiplayerApi.d.ts +234 -0
  19. package/dist/runtime/GNNetworkStoreInventoryApi.d.ts +309 -0
  20. package/dist/runtime/common/Action0.d.ts +30 -0
  21. package/dist/runtime/common/Action1.d.ts +32 -0
  22. package/dist/runtime/common/Action2.d.ts +21 -0
  23. package/dist/runtime/common/Action3.d.ts +16 -0
  24. package/dist/runtime/common/Action4.d.ts +17 -0
  25. package/dist/runtime/common/GNData.d.ts +368 -0
  26. package/dist/runtime/config/GNServerSettings.d.ts +442 -12
  27. package/dist/runtime/constant/Commands.d.ts +80 -0
  28. package/dist/runtime/constant/EventCode.d.ts +48 -0
  29. package/dist/runtime/constant/OperationCode.d.ts +74 -1
  30. package/dist/runtime/constant/ReturnCode.d.ts +72 -0
  31. package/dist/runtime/constant/enumType/ExecuteResponseStatus.d.ts +31 -0
  32. package/dist/runtime/constant/enumType/FriendStatus.d.ts +39 -0
  33. package/dist/runtime/constant/enumType/GoogleLoginType.d.ts +23 -0
  34. package/dist/runtime/constant/enumType/GroupStatus.d.ts +32 -0
  35. package/dist/runtime/constant/enumType/InvalidMemberType.d.ts +75 -0
  36. package/dist/runtime/constant/enumType/ItemType.d.ts +23 -0
  37. package/dist/runtime/constant/enumType/MatchStatus.d.ts +30 -0
  38. package/dist/runtime/constant/enumType/MatchmakingMemberStatus.d.ts +24 -0
  39. package/dist/runtime/constant/enumType/MatchmakingTicketStatus.d.ts +34 -0
  40. package/dist/runtime/constant/enumType/OwnerType.d.ts +40 -0
  41. package/dist/runtime/constant/enumType/PermissionDataItem.d.ts +22 -0
  42. package/dist/runtime/constant/enumType/PushPlatformType.d.ts +18 -0
  43. package/dist/runtime/constant/enumType/RequestRole.d.ts +32 -0
  44. package/dist/runtime/constant/enumType/RequestType.d.ts +70 -0
  45. package/dist/runtime/constant/enumType/StoreItemType.d.ts +21 -0
  46. package/dist/runtime/constant/enumType/StoreReceiveType.d.ts +30 -0
  47. package/dist/runtime/constant/errorCode/ErrorCode.d.ts +190 -8
  48. package/dist/runtime/constant/parameterCode/ParameterCode.d.ts +35 -5
  49. package/dist/runtime/entity/DataMember.d.ts +338 -0
  50. package/dist/runtime/entity/GNMetadata.d.ts +101 -0
  51. package/dist/runtime/entity/InvalidMember.d.ts +28 -0
  52. package/dist/runtime/entity/OperationEvent.d.ts +49 -0
  53. package/dist/runtime/entity/OperationRequest.d.ts +108 -0
  54. package/dist/runtime/entity/OperationResponse.d.ts +110 -0
  55. package/dist/runtime/entity/models/AuthenticateModels.d.ts +115 -0
  56. package/dist/runtime/entity/models/AuthenticateRequestModels.d.ts +131 -0
  57. package/dist/runtime/entity/models/AuthenticateResponseModels.d.ts +131 -0
  58. package/dist/runtime/entity/models/CharacterPlayerModels.d.ts +625 -1
  59. package/dist/runtime/entity/models/CharacterPlayerRequestModels.d.ts +972 -0
  60. package/dist/runtime/entity/models/CharacterPlayerResponseModels.d.ts +332 -0
  61. package/dist/runtime/entity/models/CloudScriptModels.d.ts +109 -0
  62. package/dist/runtime/entity/models/CloudScriptRequestModels.d.ts +107 -0
  63. package/dist/runtime/entity/models/CloudScriptResponseModels.d.ts +46 -0
  64. package/dist/runtime/entity/models/ContentModels.d.ts +124 -0
  65. package/dist/runtime/entity/models/ContentRequestModels.d.ts +152 -0
  66. package/dist/runtime/entity/models/ContentResponseModels.d.ts +58 -0
  67. package/dist/runtime/entity/models/DashboardModels.d.ts +371 -8
  68. package/dist/runtime/entity/models/DashboardRequestModels.d.ts +172 -0
  69. package/dist/runtime/entity/models/DashboardResponseModels.d.ts +170 -0
  70. package/dist/runtime/entity/models/GamePlayerModels.d.ts +644 -1
  71. package/dist/runtime/entity/models/GamePlayerRequestModels.d.ts +959 -0
  72. package/dist/runtime/entity/models/GamePlayerResponseModels.d.ts +333 -1
  73. package/dist/runtime/entity/models/GenericModels.d.ts +94 -0
  74. package/dist/runtime/entity/models/GroupModels.d.ts +484 -2
  75. package/dist/runtime/entity/models/GroupRequestModels.d.ts +737 -0
  76. package/dist/runtime/entity/models/GroupResponseModels.d.ts +254 -0
  77. package/dist/runtime/entity/models/InventoryModels.d.ts +415 -0
  78. package/dist/runtime/entity/models/InventoryRequestModels.d.ts +629 -0
  79. package/dist/runtime/entity/models/InventoryResponseModels.d.ts +218 -0
  80. package/dist/runtime/entity/models/MasterPlayerModels.d.ts +1065 -3
  81. package/dist/runtime/entity/models/MasterPlayerRequestModels.d.ts +1560 -6
  82. package/dist/runtime/entity/models/MasterPlayerResponseModels.d.ts +532 -1
  83. package/dist/runtime/entity/models/MultiplayerModels.d.ts +199 -0
  84. package/dist/runtime/entity/models/MultiplayerRequestModels.d.ts +196 -0
  85. package/dist/runtime/entity/models/MultiplayerResponseModels.d.ts +74 -0
  86. package/dist/runtime/entity/models/StoreInventoryModels.d.ts +262 -0
  87. package/dist/runtime/entity/models/StoreInventoryRequestModels.d.ts +268 -0
  88. package/dist/runtime/entity/models/StoreInventoryResponseModels.d.ts +98 -0
  89. package/dist/runtime/entity/request/CustomOperationRequest.d.ts +99 -0
  90. package/dist/runtime/entity/response/CustomOperationResponse.d.ts +118 -0
  91. package/dist/runtime/entity/response/GetAuthInfoResponse.d.ts +53 -0
  92. package/dist/runtime/entity/response/HealthCheckResponse.d.ts +56 -0
  93. package/dist/runtime/entity/response/UploadFileResponse.d.ts +19 -0
  94. package/dist/runtime/helper/CodeHelper.d.ts +122 -0
  95. package/dist/runtime/helper/ConverterService.d.ts +74 -0
  96. package/dist/runtime/helper/EnumUtility.d.ts +63 -0
  97. package/dist/runtime/helper/GNSupport.d.ts +64 -4
  98. package/dist/runtime/helper/GNUtils.d.ts +54 -0
  99. package/dist/runtime/helper/MessagePackConverterService.d.ts +48 -0
  100. package/dist/runtime/helper/OperationHelper.d.ts +51 -0
  101. package/dist/runtime/helper/StorageService.d.ts +48 -8
  102. package/dist/runtime/logger/GNDebug.d.ts +117 -0
  103. package/dist/runtime/networking/AuthenticateStatus.d.ts +64 -0
  104. package/dist/runtime/networking/IPeer.d.ts +83 -0
  105. package/dist/runtime/networking/NetworkingPeer.d.ts +256 -1
  106. package/dist/runtime/networking/OperationPending.d.ts +112 -0
  107. package/dist/runtime/networking/PeerBase.d.ts +231 -0
  108. package/dist/runtime/networking/handler/IServerEventHandler.d.ts +84 -0
  109. package/dist/runtime/networking/handler/OnCharacterPlayerFriendUpdateEventHandler.d.ts +69 -0
  110. package/dist/runtime/networking/handler/OnCharacterPlayerGroupUpdateEventHandler.d.ts +49 -0
  111. package/dist/runtime/networking/handler/OnGamePlayerFriendUpdateEventHandler.d.ts +50 -0
  112. package/dist/runtime/networking/handler/OnGamePlayerGroupUpdateEventHandler.d.ts +41 -0
  113. package/dist/runtime/networking/handler/OnGroupMemberUpdateEventHandler.d.ts +47 -0
  114. package/dist/runtime/networking/handler/OnGroupMessageUpdateEventHandler.d.ts +46 -0
  115. package/dist/runtime/networking/http/HttpPeer.d.ts +173 -0
  116. package/dist/runtime/networking/http/NetworkingHttpPeerBase.d.ts +87 -0
  117. package/dist/runtime/networking/http/NetworkingPeerAxiosRequest.d.ts +113 -0
  118. package/dist/runtime/networking/socket/NetworkingPeerSocketIOClient.d.ts +145 -0
  119. package/dist/runtime/networking/socket/NetworkingSocketPeerBase.d.ts +198 -0
  120. package/dist/runtime/networking/socket/SocketPeer.d.ts +155 -0
  121. package/dist/runtime/typescript/ServiceUpdate.d.ts +46 -0
  122. package/docs/AI_CHEATSHEET.md +211 -0
  123. package/docs/COOKBOOK.md +912 -0
  124. package/docs/RULES.md +307 -0
  125. package/docs/ai-manifest.json +725 -0
  126. package/docs/guides/AUTHENTICATE.md +246 -0
  127. package/docs/guides/CHARACTER_PLAYER.md +439 -0
  128. package/docs/guides/CLOUDSCRIPT.md +335 -0
  129. package/docs/guides/COCOS_CREATOR_INTEGRATION.md +150 -0
  130. package/docs/guides/CONTENT.md +291 -0
  131. package/docs/guides/DASHBOARD.md +262 -0
  132. package/docs/guides/GAME_PLAYER.md +473 -0
  133. package/docs/guides/GROUP.md +412 -0
  134. package/docs/guides/INVENTORY.md +375 -0
  135. package/docs/guides/MASTER_PLAYER.md +458 -0
  136. package/docs/guides/MULTIPLAYER.md +303 -0
  137. package/docs/guides/STORE_INVENTORY.md +313 -0
  138. package/docs/llms-full.txt +43 -0
  139. package/docs/reference/API_AUTHENTICATE.md +75 -0
  140. package/docs/reference/API_CHARACTER_PLAYER.md +226 -0
  141. package/docs/reference/API_CLOUDSCRIPT.md +82 -0
  142. package/docs/reference/API_CONTENT.md +88 -0
  143. package/docs/reference/API_DASHBOARD.md +82 -0
  144. package/docs/reference/API_GAME_PLAYER.md +223 -0
  145. package/docs/reference/API_GROUP.md +187 -0
  146. package/docs/reference/API_INDEX.md +57 -0
  147. package/docs/reference/API_INVENTORY.md +169 -0
  148. package/docs/reference/API_MASTER_PLAYER.md +323 -0
  149. package/docs/reference/API_MULTIPLAYER.md +97 -0
  150. package/docs/reference/API_STORE_INVENTORY.md +109 -0
  151. package/docs/reference/CONFIG.md +107 -0
  152. package/docs/reference/DTO_INDEX.md +2543 -0
  153. package/docs/reference/ENUMS.md +433 -0
  154. package/docs/reference/ERROR_HANDLING.md +159 -0
  155. package/docs/reference/EVENTS.md +188 -0
  156. package/docs/reference/PERMISSION_RULES.md +55 -0
  157. package/docs/reference/dto/AUTHENTICATE.md +619 -0
  158. package/docs/reference/dto/CHARACTER_PLAYER.md +3686 -0
  159. package/docs/reference/dto/CLOUDSCRIPT.md +400 -0
  160. package/docs/reference/dto/CONTENT.md +548 -0
  161. package/docs/reference/dto/DASHBOARD.md +1980 -0
  162. package/docs/reference/dto/GAME_PLAYER.md +3631 -0
  163. package/docs/reference/dto/GENERIC.md +151 -0
  164. package/docs/reference/dto/GROUP.md +2842 -0
  165. package/docs/reference/dto/INVENTORY.md +2385 -0
  166. package/docs/reference/dto/MASTER_PLAYER.md +6024 -0
  167. package/docs/reference/dto/MULTIPLAYER.md +850 -0
  168. package/docs/reference/dto/STORE_INVENTORY.md +1262 -0
  169. package/llms.txt +47 -0
  170. package/package.json +11 -2
  171. package/GNServerSettings.debug.json +0 -21
  172. package/dist/runtime/GNNetwork.js +0 -273
  173. package/dist/runtime/GNNetworkAuthenticateApi.js +0 -122
  174. package/dist/runtime/GNNetworkCharacterPlayerApi.js +0 -968
  175. package/dist/runtime/GNNetworkCloudScriptApi.js +0 -104
  176. package/dist/runtime/GNNetworkContentApi.js +0 -140
  177. package/dist/runtime/GNNetworkDashboardApi.js +0 -170
  178. package/dist/runtime/GNNetworkGamePlayerApi.js +0 -950
  179. package/dist/runtime/GNNetworkGroupApi.js +0 -734
  180. package/dist/runtime/GNNetworkInventoryApi.js +0 -626
  181. package/dist/runtime/GNNetworkMasterPlayerApi.js +0 -1550
  182. package/dist/runtime/GNNetworkMultiplayerApi.js +0 -194
  183. package/dist/runtime/GNNetworkStoreInventoryApi.js +0 -266
  184. package/dist/runtime/common/Action0.js +0 -1
  185. package/dist/runtime/common/Action1.js +0 -1
  186. package/dist/runtime/common/Action2.js +0 -1
  187. package/dist/runtime/common/Action3.js +0 -1
  188. package/dist/runtime/common/Action4.js +0 -1
  189. package/dist/runtime/common/GNData.js +0 -209
  190. package/dist/runtime/config/GNServerSettings.js +0 -156
  191. package/dist/runtime/constant/Commands.js +0 -20
  192. package/dist/runtime/constant/EventCode.js +0 -8
  193. package/dist/runtime/constant/OperationCode.js +0 -221
  194. package/dist/runtime/constant/ReturnCode.js +0 -14
  195. package/dist/runtime/constant/enumType/ExecuteResponseStatus.js +0 -8
  196. package/dist/runtime/constant/enumType/FriendStatus.js +0 -7
  197. package/dist/runtime/constant/enumType/GoogleLoginType.js +0 -5
  198. package/dist/runtime/constant/enumType/GroupStatus.js +0 -7
  199. package/dist/runtime/constant/enumType/InvalidMemberType.js +0 -18
  200. package/dist/runtime/constant/enumType/ItemType.js +0 -5
  201. package/dist/runtime/constant/enumType/MatchmakingMemberStatus.js +0 -6
  202. package/dist/runtime/constant/enumType/MatchmakingTicketStatus.js +0 -8
  203. package/dist/runtime/constant/enumType/OwnerType.js +0 -9
  204. package/dist/runtime/constant/enumType/PermissionDataItem.js +0 -5
  205. package/dist/runtime/constant/enumType/PushPlatformType.js +0 -5
  206. package/dist/runtime/constant/enumType/RequestRole.js +0 -6
  207. package/dist/runtime/constant/enumType/RequestType.js +0 -15
  208. package/dist/runtime/constant/enumType/StoreItemType.js +0 -5
  209. package/dist/runtime/constant/enumType/StoreReceiveType.js +0 -8
  210. package/dist/runtime/constant/errorCode/ErrorCode.js +0 -52
  211. package/dist/runtime/constant/parameterCode/ParameterCode.js +0 -617
  212. package/dist/runtime/entity/DataMember.js +0 -208
  213. package/dist/runtime/entity/GNMetadata.js +0 -11
  214. package/dist/runtime/entity/InvalidMember.js +0 -1
  215. package/dist/runtime/entity/OperationEvent.js +0 -24
  216. package/dist/runtime/entity/OperationRequest.js +0 -42
  217. package/dist/runtime/entity/OperationResponse.js +0 -73
  218. package/dist/runtime/entity/models/AuthenticateModels.js +0 -426
  219. package/dist/runtime/entity/models/AuthenticateRequestModels.js +0 -188
  220. package/dist/runtime/entity/models/AuthenticateResponseModels.js +0 -131
  221. package/dist/runtime/entity/models/CharacterPlayerModels.js +0 -1433
  222. package/dist/runtime/entity/models/CharacterPlayerRequestModels.js +0 -1386
  223. package/dist/runtime/entity/models/CharacterPlayerResponseModels.js +0 -376
  224. package/dist/runtime/entity/models/CloudScriptModels.js +0 -197
  225. package/dist/runtime/entity/models/CloudScriptRequestModels.js +0 -138
  226. package/dist/runtime/entity/models/CloudScriptResponseModels.js +0 -40
  227. package/dist/runtime/entity/models/ContentModels.js +0 -203
  228. package/dist/runtime/entity/models/ContentRequestModels.js +0 -190
  229. package/dist/runtime/entity/models/ContentResponseModels.js +0 -54
  230. package/dist/runtime/entity/models/DashboardModels.js +0 -3002
  231. package/dist/runtime/entity/models/DashboardRequestModels.js +0 -268
  232. package/dist/runtime/entity/models/DashboardResponseModels.js +0 -187
  233. package/dist/runtime/entity/models/GamePlayerModels.js +0 -1591
  234. package/dist/runtime/entity/models/GamePlayerRequestModels.js +0 -1360
  235. package/dist/runtime/entity/models/GamePlayerResponseModels.js +0 -369
  236. package/dist/runtime/entity/models/GenericModels.js +0 -177
  237. package/dist/runtime/entity/models/GroupModels.js +0 -1135
  238. package/dist/runtime/entity/models/GroupRequestModels.js +0 -1048
  239. package/dist/runtime/entity/models/GroupResponseModels.js +0 -285
  240. package/dist/runtime/entity/models/InventoryModels.js +0 -915
  241. package/dist/runtime/entity/models/InventoryRequestModels.js +0 -892
  242. package/dist/runtime/entity/models/InventoryResponseModels.js +0 -243
  243. package/dist/runtime/entity/models/MasterPlayerModels.js +0 -2573
  244. package/dist/runtime/entity/models/MasterPlayerRequestModels.js +0 -2228
  245. package/dist/runtime/entity/models/MasterPlayerResponseModels.js +0 -607
  246. package/dist/runtime/entity/models/MultiplayerModels.js +0 -404
  247. package/dist/runtime/entity/models/MultiplayerRequestModels.js +0 -268
  248. package/dist/runtime/entity/models/MultiplayerResponseModels.js +0 -75
  249. package/dist/runtime/entity/models/StoreInventoryModels.js +0 -797
  250. package/dist/runtime/entity/models/StoreInventoryRequestModels.js +0 -372
  251. package/dist/runtime/entity/models/StoreInventoryResponseModels.js +0 -103
  252. package/dist/runtime/entity/request/CustomOperationRequest.js +0 -24
  253. package/dist/runtime/entity/response/CustomOperationResponse.js +0 -29
  254. package/dist/runtime/entity/response/GetAuthInfoResponse.js +0 -2
  255. package/dist/runtime/entity/response/HealthCheckResponse.js +0 -2
  256. package/dist/runtime/entity/response/UploadFileResponse.js +0 -2
  257. package/dist/runtime/helper/CodeHelper.js +0 -63
  258. package/dist/runtime/helper/ConverterService.js +0 -275
  259. package/dist/runtime/helper/EnumUtility.js +0 -33
  260. package/dist/runtime/helper/GNSupport.js +0 -47
  261. package/dist/runtime/helper/GNUtils.js +0 -72
  262. package/dist/runtime/helper/MessagePackConverterService.js +0 -9
  263. package/dist/runtime/helper/OperationHelper.js +0 -24
  264. package/dist/runtime/helper/StorageService.js +0 -62
  265. package/dist/runtime/logger/GNDebug.js +0 -29
  266. package/dist/runtime/networking/AuthenticateStatus.js +0 -14
  267. package/dist/runtime/networking/IPeer.js +0 -1
  268. package/dist/runtime/networking/NetworkingPeer.js +0 -210
  269. package/dist/runtime/networking/OperationPending.js +0 -53
  270. package/dist/runtime/networking/PeerBase.js +0 -161
  271. package/dist/runtime/networking/handler/IServerEventHandler.js +0 -13
  272. package/dist/runtime/networking/handler/OnCharacterPlayerFriendUpdateEventHandler.js +0 -39
  273. package/dist/runtime/networking/handler/OnCharacterPlayerGroupUpdateEventHandler.js +0 -39
  274. package/dist/runtime/networking/handler/OnGamePlayerFriendUpdateEventHandler.js +0 -39
  275. package/dist/runtime/networking/handler/OnGamePlayerGroupUpdateEventHandler.js +0 -39
  276. package/dist/runtime/networking/handler/OnGroupMemberUpdateEventHandler.js +0 -35
  277. package/dist/runtime/networking/handler/OnGroupMessageUpdateEventHandler.js +0 -43
  278. package/dist/runtime/networking/http/HttpPeer.js +0 -123
  279. package/dist/runtime/networking/http/NetworkingHttpPeerBase.js +0 -9
  280. package/dist/runtime/networking/http/NetworkingPeerAxiosRequest.js +0 -179
  281. package/dist/runtime/networking/socket/NetworkingPeerSocketIOClient.js +0 -130
  282. package/dist/runtime/networking/socket/NetworkingSocketPeerBase.js +0 -165
  283. package/dist/runtime/networking/socket/SocketPeer.js +0 -115
  284. package/dist/runtime/typescript/ServiceUpdate.js +0 -22
  285. package/docs/COCOS_CREATOR_INTEGRATION.md +0 -116
  286. package/examples/cocos-creator/GearNExample.ts.txt +0 -176
  287. package/srcSwift/Package.swift +0 -32
  288. package/srcSwift/Sources/GearN/runtime/GNNetwork.swift +0 -530
  289. package/srcSwift/Sources/GearN/runtime/GNNetworkAuthenticateApi.swift +0 -178
  290. package/srcSwift/Sources/GearN/runtime/GNNetworkCharacterPlayerApi.swift +0 -1162
  291. package/srcSwift/Sources/GearN/runtime/GNNetworkCloudScriptApi.swift +0 -154
  292. package/srcSwift/Sources/GearN/runtime/GNNetworkContentApi.swift +0 -208
  293. package/srcSwift/Sources/GearN/runtime/GNNetworkDashboardApi.swift +0 -240
  294. package/srcSwift/Sources/GearN/runtime/GNNetworkGamePlayerApi.swift +0 -1369
  295. package/srcSwift/Sources/GearN/runtime/GNNetworkGroupApi.swift +0 -1100
  296. package/srcSwift/Sources/GearN/runtime/GNNetworkInventoryApi.swift +0 -937
  297. package/srcSwift/Sources/GearN/runtime/GNNetworkMasterPlayerApi.swift +0 -2323
  298. package/srcSwift/Sources/GearN/runtime/GNNetworkMultiplayerApi.swift +0 -298
  299. package/srcSwift/Sources/GearN/runtime/GNNetworkStoreInventoryApi.swift +0 -397
  300. package/srcSwift/Sources/GearN/runtime/common/Action0.swift +0 -3
  301. package/srcSwift/Sources/GearN/runtime/common/Action1.swift +0 -3
  302. package/srcSwift/Sources/GearN/runtime/common/Action2.swift +0 -3
  303. package/srcSwift/Sources/GearN/runtime/common/Action3.swift +0 -3
  304. package/srcSwift/Sources/GearN/runtime/common/Action4.swift +0 -3
  305. package/srcSwift/Sources/GearN/runtime/common/GNArray.swift +0 -204
  306. package/srcSwift/Sources/GearN/runtime/common/GNData.swift +0 -108
  307. package/srcSwift/Sources/GearN/runtime/common/GNHashtable.swift +0 -200
  308. package/srcSwift/Sources/GearN/runtime/config/GNServerSettings.swift +0 -95
  309. package/srcSwift/Sources/GearN/runtime/constant/Commands.swift +0 -28
  310. package/srcSwift/Sources/GearN/runtime/constant/EventCode.swift +0 -10
  311. package/srcSwift/Sources/GearN/runtime/constant/OperationCode.swift +0 -252
  312. package/srcSwift/Sources/GearN/runtime/constant/ReturnCode.swift +0 -19
  313. package/srcSwift/Sources/GearN/runtime/constant/enumType/ExecuteResponseStatus.swift +0 -9
  314. package/srcSwift/Sources/GearN/runtime/constant/enumType/FriendStatus.swift +0 -8
  315. package/srcSwift/Sources/GearN/runtime/constant/enumType/GoogleLoginType.swift +0 -6
  316. package/srcSwift/Sources/GearN/runtime/constant/enumType/GroupStatus.swift +0 -8
  317. package/srcSwift/Sources/GearN/runtime/constant/enumType/InvalidMemberType.swift +0 -19
  318. package/srcSwift/Sources/GearN/runtime/constant/enumType/ItemType.swift +0 -6
  319. package/srcSwift/Sources/GearN/runtime/constant/enumType/MatchmakingMemberStatus.swift +0 -7
  320. package/srcSwift/Sources/GearN/runtime/constant/enumType/MatchmakingTicketStatus.swift +0 -9
  321. package/srcSwift/Sources/GearN/runtime/constant/enumType/OwnerType.swift +0 -10
  322. package/srcSwift/Sources/GearN/runtime/constant/enumType/PermissionDataItem.swift +0 -6
  323. package/srcSwift/Sources/GearN/runtime/constant/enumType/PushPlatformType.swift +0 -6
  324. package/srcSwift/Sources/GearN/runtime/constant/enumType/RequestRole.swift +0 -7
  325. package/srcSwift/Sources/GearN/runtime/constant/enumType/RequestType.swift +0 -16
  326. package/srcSwift/Sources/GearN/runtime/constant/enumType/StoreItemType.swift +0 -6
  327. package/srcSwift/Sources/GearN/runtime/constant/enumType/StoreReceiveType.swift +0 -9
  328. package/srcSwift/Sources/GearN/runtime/constant/errorCode/ErrorCode.swift +0 -58
  329. package/srcSwift/Sources/GearN/runtime/constant/parameterCode/ParameterCode.swift +0 -672
  330. package/srcSwift/Sources/GearN/runtime/entity/DataMember.swift +0 -196
  331. package/srcSwift/Sources/GearN/runtime/entity/GNMetadata.swift +0 -9
  332. package/srcSwift/Sources/GearN/runtime/entity/InvalidMember.swift +0 -11
  333. package/srcSwift/Sources/GearN/runtime/entity/OperationEvent.swift +0 -38
  334. package/srcSwift/Sources/GearN/runtime/entity/OperationHelper.swift +0 -28
  335. package/srcSwift/Sources/GearN/runtime/entity/OperationRequest.swift +0 -62
  336. package/srcSwift/Sources/GearN/runtime/entity/OperationResponse.swift +0 -98
  337. package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateModels.swift +0 -351
  338. package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateRequestModels.swift +0 -81
  339. package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateResponseModels.swift +0 -108
  340. package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerModels.swift +0 -1045
  341. package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerRequestModels.swift +0 -821
  342. package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerResponseModels.swift +0 -588
  343. package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptModels.swift +0 -187
  344. package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptRequestModels.swift +0 -84
  345. package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptResponseModels.swift +0 -59
  346. package/srcSwift/Sources/GearN/runtime/entity/models/ContentModels.swift +0 -195
  347. package/srcSwift/Sources/GearN/runtime/entity/models/ContentRequestModels.swift +0 -116
  348. package/srcSwift/Sources/GearN/runtime/entity/models/ContentResponseModels.swift +0 -81
  349. package/srcSwift/Sources/GearN/runtime/entity/models/DashboardModels.swift +0 -426
  350. package/srcSwift/Sources/GearN/runtime/entity/models/DashboardRequestModels.swift +0 -160
  351. package/srcSwift/Sources/GearN/runtime/entity/models/DashboardResponseModels.swift +0 -82
  352. package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerModels.swift +0 -1334
  353. package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerRequestModels.swift +0 -643
  354. package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerResponseModels.swift +0 -213
  355. package/srcSwift/Sources/GearN/runtime/entity/models/GenericModels.swift +0 -171
  356. package/srcSwift/Sources/GearN/runtime/entity/models/GroupModels.swift +0 -850
  357. package/srcSwift/Sources/GearN/runtime/entity/models/GroupRequestModels.swift +0 -485
  358. package/srcSwift/Sources/GearN/runtime/entity/models/GroupResponseModels.swift +0 -165
  359. package/srcSwift/Sources/GearN/runtime/entity/models/InventoryModels.swift +0 -679
  360. package/srcSwift/Sources/GearN/runtime/entity/models/InventoryRequestModels.swift +0 -413
  361. package/srcSwift/Sources/GearN/runtime/entity/models/InventoryResponseModels.swift +0 -141
  362. package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerModels.swift +0 -378
  363. package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerRequestModels.swift +0 -147
  364. package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerResponseModels.swift +0 -318
  365. package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerModels.swift +0 -319
  366. package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerRequestModels.swift +0 -125
  367. package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerResponseModels.swift +0 -45
  368. package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryModels.swift +0 -633
  369. package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryRequestModels.swift +0 -173
  370. package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryResponseModels.swift +0 -61
  371. package/srcSwift/Sources/GearN/runtime/entity/request/CustomOperationRequest.swift +0 -42
  372. package/srcSwift/Sources/GearN/runtime/entity/response/CustomOperationResponse.swift +0 -49
  373. package/srcSwift/Sources/GearN/runtime/entity/response/GetAuthInfoResponse.swift +0 -43
  374. package/srcSwift/Sources/GearN/runtime/entity/response/HealthCheckResponse.swift +0 -86
  375. package/srcSwift/Sources/GearN/runtime/entity/response/UploadFileResponse.swift +0 -15
  376. package/srcSwift/Sources/GearN/runtime/helper/CodeHelper.swift +0 -107
  377. package/srcSwift/Sources/GearN/runtime/helper/ConverterService.swift +0 -98
  378. package/srcSwift/Sources/GearN/runtime/helper/EnumUtility.swift +0 -34
  379. package/srcSwift/Sources/GearN/runtime/helper/GNSupport.swift +0 -41
  380. package/srcSwift/Sources/GearN/runtime/helper/GNUtils.swift +0 -66
  381. package/srcSwift/Sources/GearN/runtime/helper/MessagePackConverterService.swift +0 -21
  382. package/srcSwift/Sources/GearN/runtime/helper/StorageService.swift +0 -29
  383. package/srcSwift/Sources/GearN/runtime/logger/GNDebug.swift +0 -33
  384. package/srcSwift/Sources/GearN/runtime/networking/AuthenticateStatus.swift +0 -24
  385. package/srcSwift/Sources/GearN/runtime/networking/IPeer.swift +0 -8
  386. package/srcSwift/Sources/GearN/runtime/networking/NetworkingPeer.swift +0 -368
  387. package/srcSwift/Sources/GearN/runtime/networking/OperationPending.swift +0 -81
  388. package/srcSwift/Sources/GearN/runtime/networking/PeerBase.swift +0 -228
  389. package/srcSwift/Sources/GearN/runtime/networking/handler/IServerEventHandler.swift +0 -20
  390. package/srcSwift/Sources/GearN/runtime/networking/http/HttpPeer.swift +0 -226
  391. package/srcSwift/Sources/GearN/runtime/networking/http/HttpTypes.swift +0 -24
  392. package/srcSwift/Sources/GearN/runtime/networking/http/NetworkingHttpPeerBase.swift +0 -13
  393. package/srcSwift/Sources/GearN/runtime/networking/http/NetworkingPeerUrlSession.swift +0 -125
  394. package/srcSwift/Sources/GearN/runtime/networking/request/NetRequest.swift +0 -19
  395. package/srcSwift/Sources/GearN/runtime/networking/response/NetResponse.swift +0 -13
  396. package/srcSwift/Sources/GearN/runtime/networking/socket/NetworkingPeerSocketIOClient.swift +0 -244
  397. package/srcSwift/Sources/GearN/runtime/networking/socket/NetworkingSocketPeerBase.swift +0 -59
  398. package/srcSwift/Sources/GearN/runtime/networking/socket/SocketPeer.swift +0 -136
  399. package/tsconfig-build.cocos.json +0 -31
  400. package/webpack.config.cocos.mjs +0 -78
@@ -1,204 +0,0 @@
1
- import Foundation
2
-
3
- public class GNArrayBuilder {
4
- private var array: [Any] = []
5
-
6
- public init() {}
7
-
8
- public func add(_ value: Any) -> GNArrayBuilder {
9
- self.array.append(value)
10
- return self
11
- }
12
-
13
- public func addAll(_ array: [Any]) -> GNArrayBuilder {
14
- self.array.append(contentsOf: array)
15
- return self
16
- }
17
-
18
- public func build() -> GNArray {
19
- let answer = GNArray()
20
- for v in self.array {
21
- answer.add(v)
22
- }
23
- return answer
24
- }
25
- }
26
-
27
- public class GNArray: GNData, IGNData, CustomStringConvertible {
28
- private var array: [Any] = []
29
-
30
- public override init() {
31
- super.init()
32
- }
33
-
34
- public static func builder() -> GNArrayBuilder {
35
- return GNArrayBuilder()
36
- }
37
-
38
- public func clear() {
39
- self.array.removeAll()
40
- }
41
-
42
- public func remove(key: String) -> Bool {
43
- return false // Not applicable
44
- }
45
-
46
- public func remove(index: Int) -> Bool {
47
- if index >= 0 && index < self.array.count {
48
- self.array.remove(at: index)
49
- return true
50
- }
51
- return false
52
- }
53
-
54
- public func count() -> Int {
55
- return self.array.count
56
- }
57
-
58
- public func add(_ value: Any?) {
59
- if let v = value {
60
- self.array.append(GNData.createUseDataFromOriginData(value: v)!)
61
- }
62
- }
63
-
64
- // Getters by key - Not applicable
65
- public func getObject(key: String) -> Any? { return nil }
66
- public func getBoolean(key: String) -> Bool? { return nil }
67
- public func getString(key: String) -> String? { return nil }
68
- public func getNumber(key: String) -> Double? { return nil }
69
- public func getByte(key: String) -> UInt8? { return nil }
70
- public func getSByte(key: String) -> Int8? { return nil }
71
- public func getShort(key: String) -> Int16? { return nil }
72
- public func getInt(key: String) -> Int? { return nil }
73
- public func getLong(key: String) -> Int64? { return nil }
74
- public func getFloat(key: String) -> Float? { return nil }
75
- public func getDouble(key: String) -> Double? { return nil }
76
- public func getGNHashtable(key: String) -> GNHashtable? { return nil }
77
- public func getGNArray(key: String) -> GNArray? { return nil }
78
-
79
- // Getters by Index
80
- public func getObject(index: Int) -> Any? { return self.get(index) }
81
-
82
- public func getBoolean(index: Int) -> Bool? { return self.get(index) as? Bool }
83
-
84
- public func getString(index: Int) -> String? { return self.get(index) as? String }
85
-
86
- public func getNumber(index: Int) -> Double? { return self.getDouble(index: index) }
87
-
88
- public func getByte(index: Int) -> UInt8? {
89
- if let v = self.get(index) as? UInt8 { return v }
90
- if let v = self.get(index) as? NSNumber { return v.uint8Value }
91
- return nil
92
- }
93
-
94
- public func getSByte(index: Int) -> Int8? {
95
- if let v = self.get(index) as? Int8 { return v }
96
- if let v = self.get(index) as? NSNumber { return v.int8Value }
97
- return nil
98
- }
99
-
100
- public func getShort(index: Int) -> Int16? {
101
- if let v = self.get(index) as? Int16 { return v }
102
- if let v = self.get(index) as? NSNumber { return v.int16Value }
103
- return nil
104
- }
105
-
106
- public func getInt(index: Int) -> Int? {
107
- if let v = self.get(index) as? Int { return v }
108
- if let v = self.get(index) as? NSNumber { return v.intValue }
109
- return nil
110
- }
111
-
112
- public func getLong(index: Int) -> Int64? {
113
- if let v = self.get(index) as? Int64 { return v }
114
- if let v = self.get(index) as? NSNumber { return v.int64Value }
115
- return nil
116
- }
117
-
118
- public func getFloat(index: Int) -> Float? {
119
- if let v = self.get(index) as? Float { return v }
120
- if let v = self.get(index) as? NSNumber { return v.floatValue }
121
- return nil
122
- }
123
-
124
- public func getDouble(index: Int) -> Double? {
125
- if let v = self.get(index) as? Double { return v }
126
- if let v = self.get(index) as? NSNumber { return v.doubleValue }
127
- return nil
128
- }
129
-
130
- public func getGNHashtable(index: Int) -> GNHashtable? { return self.get(index) as? GNHashtable }
131
-
132
- public func getGNArray(index: Int) -> GNArray? { return self.get(index) as? GNArray }
133
-
134
- private func get(_ index: Int) -> Any? {
135
- if index >= 0 && index < self.array.count {
136
- return self.array[index]
137
- }
138
- return nil
139
- }
140
-
141
- public func toArray<T>() -> [T] {
142
- var result: [T] = []
143
- for item in self.array {
144
- if let converted = item as? T {
145
- result.append(converted)
146
- } else if let num = item as? NSNumber {
147
- // Try to convert NSNumber to T if T is a number type
148
- // Swift generics constraints don't easily allow checking "is Int"
149
- // But we can check via type casting
150
- if T.self == Int.self { result.append(num.intValue as! T) }
151
- else if T.self == Double.self { result.append(num.doubleValue as! T) }
152
- else if T.self == Float.self { result.append(num.floatValue as! T) }
153
- else if T.self == Int64.self { result.append(num.int64Value as! T) }
154
- else if T.self == UInt8.self { result.append(num.uint8Value as! T) }
155
- else if T.self == String.self { result.append(num.stringValue as! T) }
156
- // Add more as needed
157
- }
158
- }
159
- return result
160
- }
161
-
162
- public func toData() -> [Any] {
163
- return self.array.map { GNData.createDataFromUseData(value: $0)! }
164
- }
165
-
166
- public func toString() -> String {
167
- var parts: [String] = []
168
- for v in self.array {
169
- parts.append(stringify(v))
170
- }
171
- return "[" + parts.joined(separator: ",") + "]"
172
- }
173
-
174
- public var description: String {
175
- return self.toString()
176
- }
177
-
178
- private func stringify(_ value: Any) -> String {
179
- if value is NSNull { return "null" }
180
- if let str = value as? String { return "\"\(str)\"" }
181
- if let bool = value as? Bool { return bool ? "true" : "false" }
182
- if let ignStr = value as? IGNData { return ignStr.toString() }
183
- if let num = value as? NSNumber { return "\(num)" }
184
- return "\(value)"
185
- }
186
- }
187
-
188
- extension GNArray: Codable {
189
- public convenience init(from decoder: Decoder) throws {
190
- self.init()
191
- var container = try decoder.unkeyedContainer()
192
- while !container.isAtEnd {
193
- let value = try container.decode(AnyCodable.self)
194
- self.add(value.value)
195
- }
196
- }
197
-
198
- public func encode(to encoder: Encoder) throws {
199
- var container = encoder.unkeyedContainer()
200
- for value in self.toData() {
201
- try container.encode(AnyCodable(value))
202
- }
203
- }
204
- }
@@ -1,108 +0,0 @@
1
- import Foundation
2
-
3
- public protocol IGNData {
4
- func clear()
5
- func remove(key: String) -> Bool
6
- func remove(index: Int) -> Bool
7
- func count() -> Int
8
-
9
- // Getters by Key
10
- func getObject(key: String) -> Any?
11
- func getBoolean(key: String) -> Bool?
12
- func getString(key: String) -> String?
13
- func getNumber(key: String) -> Double?
14
-
15
- func getByte(key: String) -> UInt8?
16
- func getSByte(key: String) -> Int8?
17
- func getShort(key: String) -> Int16?
18
- func getInt(key: String) -> Int?
19
- func getLong(key: String) -> Int64?
20
- func getFloat(key: String) -> Float?
21
- func getDouble(key: String) -> Double?
22
-
23
- func getGNHashtable(key: String) -> GNHashtable?
24
- func getGNArray(key: String) -> GNArray?
25
-
26
- // Getters by Index
27
- func getObject(index: Int) -> Any?
28
- func getBoolean(index: Int) -> Bool?
29
- func getString(index: Int) -> String?
30
- func getNumber(index: Int) -> Double?
31
-
32
- func getByte(index: Int) -> UInt8?
33
- func getSByte(index: Int) -> Int8?
34
- func getShort(index: Int) -> Int16?
35
- func getInt(index: Int) -> Int?
36
- func getLong(index: Int) -> Int64?
37
- func getFloat(index: Int) -> Float?
38
- func getDouble(index: Int) -> Double?
39
-
40
- func getGNHashtable(index: Int) -> GNHashtable?
41
- func getGNArray(index: Int) -> GNArray?
42
-
43
- func toString() -> String
44
- }
45
-
46
- public class GNData {
47
- // Shared static helpers
48
-
49
- public static func createGNHashtableFromObject(value: [String: Any]) -> GNHashtable {
50
- let answer = GNHashtable()
51
- for (k, v) in value {
52
- answer.put(k, v)
53
- }
54
- return answer
55
- }
56
-
57
- public static func createGNArrayFromArray(value: [Any]) -> GNArray {
58
- let answer = GNArray()
59
- for v in value {
60
- answer.add(v)
61
- }
62
- return answer
63
- }
64
-
65
- public static func createUseDataFromOriginData(value: Any?) -> Any? {
66
- guard let value = value else { return nil }
67
-
68
- if let str = value as? String { return str }
69
- if let bool = value as? Bool { return bool }
70
-
71
- // Number types
72
- if let num = value as? NSNumber { return num }
73
- if let i = value as? Int { return i }
74
- if let d = value as? Double { return d }
75
- if let f = value as? Float { return f }
76
- if let i8 = value as? Int8 { return i8 }
77
- if let u8 = value as? UInt8 { return u8 }
78
- if let i16 = value as? Int16 { return i16 }
79
- if let i64 = value as? Int64 { return i64 }
80
-
81
- if let arr = value as? GNArray { return arr }
82
- if let ht = value as? GNHashtable { return ht }
83
-
84
- if let dict = value as? [String: Any] {
85
- return createGNHashtableFromObject(value: dict)
86
- }
87
-
88
- if let arr = value as? [Any] {
89
- return createGNArrayFromArray(value: arr)
90
- }
91
-
92
- return value // Return raw if undetermined? Or nil? Unity returns value.
93
- }
94
-
95
- public static func createDataFromUseData(value: Any?) -> Any? {
96
- guard let value = value else { return nil }
97
-
98
- if let arr = value as? GNArray {
99
- return arr.toData()
100
- }
101
-
102
- if let ht = value as? GNHashtable {
103
- return ht.toData()
104
- }
105
-
106
- return value
107
- }
108
- }
@@ -1,200 +0,0 @@
1
- import Foundation
2
-
3
- public class GNHashtableBuilder {
4
- private var dict: [String: Any] = [:]
5
-
6
- public init() {}
7
-
8
- public func add(_ key: String, _ value: Any) -> GNHashtableBuilder {
9
- self.dict[key] = value
10
- return self
11
- }
12
-
13
- public func addAll(_ dict: [String: Any]) -> GNHashtableBuilder {
14
- for (k, v) in dict {
15
- self.dict[k] = v
16
- }
17
- return self
18
- }
19
-
20
- public func build() -> GNHashtable {
21
- let answer = GNHashtable()
22
- for (k, v) in self.dict {
23
- answer.put(k, v)
24
- }
25
- return answer
26
- }
27
- }
28
-
29
- public class GNHashtable: GNData, IGNData, CustomStringConvertible {
30
- private var dict: [String: Any] = [:]
31
-
32
- public override init() {
33
- super.init()
34
- }
35
-
36
- public static func builder() -> GNHashtableBuilder {
37
- return GNHashtableBuilder()
38
- }
39
-
40
- public func clear() {
41
- self.dict.removeAll()
42
- }
43
-
44
- public func remove(key: String) -> Bool {
45
- return self.dict.removeValue(forKey: key) != nil
46
- }
47
-
48
- public func remove(index: Int) -> Bool {
49
- return false // Not applicable for Hashtable
50
- }
51
-
52
- public func count() -> Int {
53
- return self.dict.count
54
- }
55
-
56
- public func put(_ key: String, _ value: Any?) {
57
- if let v = value {
58
- self.dict[key] = GNData.createUseDataFromOriginData(value: v)
59
- } else {
60
- self.dict.removeValue(forKey: key)
61
- }
62
- }
63
-
64
- public func containsKey(_ key: String) -> Bool {
65
- return self.dict.keys.contains(key)
66
- }
67
-
68
- public func keys() -> [String] {
69
- return Array(self.dict.keys)
70
- }
71
-
72
- public func values() -> [Any] {
73
- return Array(self.dict.values)
74
- }
75
-
76
- // Getters
77
- public func getObject(key: String) -> Any? { return self.dict[key] }
78
- public func getObject(index: Int) -> Any? { return nil }
79
-
80
- public func getBoolean(key: String) -> Bool? { return self.get(key) as? Bool }
81
- public func getBoolean(index: Int) -> Bool? { return nil }
82
-
83
- public func getString(key: String) -> String? { return self.get(key) as? String }
84
- public func getString(index: Int) -> String? { return nil }
85
-
86
- public func getNumber(key: String) -> Double? { return self.getDouble(key: key) } // Mapping Number to Double generally
87
- public func getNumber(index: Int) -> Double? { return nil }
88
-
89
- // Typed Getters (Key)
90
- public func getByte(key: String) -> UInt8? {
91
- if let v = self.get(key) as? UInt8 { return v }
92
- if let v = self.get(key) as? NSNumber { return v.uint8Value }
93
- return nil
94
- }
95
-
96
- public func getSByte(key: String) -> Int8? {
97
- if let v = self.get(key) as? Int8 { return v }
98
- if let v = self.get(key) as? NSNumber { return v.int8Value }
99
- return nil
100
- }
101
-
102
- public func getShort(key: String) -> Int16? {
103
- if let v = self.get(key) as? Int16 { return v }
104
- if let v = self.get(key) as? NSNumber { return v.int16Value }
105
- return nil
106
- }
107
-
108
- public func getInt(key: String) -> Int? {
109
- if let v = self.get(key) as? Int { return v }
110
- if let v = self.get(key) as? NSNumber { return v.intValue }
111
- return nil
112
- }
113
-
114
- public func getLong(key: String) -> Int64? {
115
- if let v = self.get(key) as? Int64 { return v }
116
- if let v = self.get(key) as? NSNumber { return v.int64Value }
117
- return nil
118
- }
119
-
120
- public func getFloat(key: String) -> Float? {
121
- if let v = self.get(key) as? Float { return v }
122
- if let v = self.get(key) as? NSNumber { return v.floatValue }
123
- return nil
124
- }
125
-
126
- public func getDouble(key: String) -> Double? {
127
- if let v = self.get(key) as? Double { return v }
128
- if let v = self.get(key) as? NSNumber { return v.doubleValue }
129
- return nil
130
- }
131
-
132
- // Typed Getters (Index) - Not supported for Hashtable
133
- public func getByte(index: Int) -> UInt8? { return nil }
134
- public func getSByte(index: Int) -> Int8? { return nil }
135
- public func getShort(index: Int) -> Int16? { return nil }
136
- public func getInt(index: Int) -> Int? { return nil }
137
- public func getLong(index: Int) -> Int64? { return nil }
138
- public func getFloat(index: Int) -> Float? { return nil }
139
- public func getDouble(index: Int) -> Double? { return nil }
140
-
141
- public func getGNHashtable(key: String) -> GNHashtable? { return self.get(key) as? GNHashtable }
142
- public func getGNHashtable(index: Int) -> GNHashtable? { return nil }
143
-
144
- public func getGNArray(key: String) -> GNArray? { return self.get(key) as? GNArray }
145
- public func getGNArray(index: Int) -> GNArray? { return nil }
146
-
147
- private func get(_ key: String) -> Any? {
148
- return self.dict[key]
149
- }
150
-
151
- public func toData() -> [String: Any] {
152
- var answer: [String: Any] = [:]
153
- for (k, v) in self.dict {
154
- answer[k] = GNData.createDataFromUseData(value: v)
155
- }
156
- return answer
157
- }
158
-
159
- public func toString() -> String {
160
- var parts: [String] = []
161
- for (k, v) in self.dict {
162
- let keyStr = "\"\(k)\""
163
- let valStr = stringify(v)
164
- parts.append("\(keyStr):\(valStr)")
165
- }
166
- return "{" + parts.joined(separator: ",") + "}"
167
- }
168
-
169
- public var description: String {
170
- return self.toString()
171
- }
172
-
173
- private func stringify(_ value: Any) -> String {
174
- if value is NSNull { return "null" }
175
- if let str = value as? String { return "\"\(str)\"" }
176
- if let bool = value as? Bool { return bool ? "true" : "false" }
177
- if let ignStr = value as? IGNData { return ignStr.toString() }
178
- if let num = value as? NSNumber { return "\(num)" } // Covers all numbers
179
- // Add more types if needed
180
- return "\(value)"
181
- }
182
- }
183
-
184
- extension GNHashtable: Codable {
185
- public convenience init(from decoder: Decoder) throws {
186
- self.init()
187
- let container = try decoder.container(keyedBy: AnyCodingKey.self)
188
- for key in container.allKeys {
189
- let value = try container.decode(AnyCodable.self, forKey: key)
190
- self.put(key.stringValue, value.value)
191
- }
192
- }
193
-
194
- public func encode(to encoder: Encoder) throws {
195
- var container = encoder.container(keyedBy: AnyCodingKey.self)
196
- for (key, value) in self.toData() {
197
- try container.encode(AnyCodable(value), forKey: AnyCodingKey(stringValue: key)!)
198
- }
199
- }
200
- }
@@ -1,95 +0,0 @@
1
- import Foundation
2
-
3
- public enum MessageType: Int {
4
- case Json = 1
5
- case MsgPack = 2
6
- }
7
-
8
- public class GNServerSettings {
9
- private var serverAddress: String = "127.0.0.1"
10
- private var serverPort: Int = 2202
11
- private var serverSocketPort: Int = 2901
12
- private var useSsl: Bool = false
13
- private var useSocket: Bool = true
14
- private var useHttp: Bool = true
15
-
16
- private var defaultTimeoutInSeconds: Int = 20
17
- private var messageType: MessageType = .MsgPack
18
- private var sendRate: Int = 20
19
- private var reconnectDelay: Int = 5000 // ms
20
- private var pingInterval: Float = 20000 // ms
21
- private var pingTimeout: Float = 20000 // ms
22
-
23
- private var adminSecretKey: String?
24
- private var serverSecretKey: String?
25
- private var clientSecretKey: String?
26
-
27
- private var logType: LogType = .All
28
-
29
- public init() {}
30
-
31
- // Getters and Setters
32
-
33
- public func getServerAddress() -> String { return self.serverAddress }
34
- public func setServerAddress(_ serverAddress: String) { self.serverAddress = serverAddress }
35
-
36
- public func getServerPort() -> Int { return self.serverPort }
37
- public func setServerPort(_ serverPort: Int) { self.serverPort = serverPort }
38
-
39
- public func getServerSocketPort() -> Int { return self.serverSocketPort }
40
- public func setServerSocketPort(_ serverSocketPort: Int) { self.serverSocketPort = serverSocketPort }
41
-
42
- public func isUseSsl() -> Bool { return self.useSsl }
43
- public func setUseSsl(_ useSsl: Bool) { self.useSsl = useSsl }
44
-
45
- public func isUseSocket() -> Bool { return self.useSocket }
46
- public func setUseSocket(_ useSocket: Bool) { self.useSocket = useSocket }
47
-
48
- public func isUseHttp() -> Bool { return self.useHttp }
49
- public func setUseHttp(_ useHttp: Bool) { self.useHttp = useHttp }
50
-
51
- public func getDefaultTimeoutInSeconds() -> Int { return self.defaultTimeoutInSeconds }
52
- public func setDefaultTimeoutInSeconds(_ defaultTimeoutInSeconds: Int) { self.defaultTimeoutInSeconds = defaultTimeoutInSeconds }
53
-
54
- public func getMessageType() -> MessageType { return self.messageType }
55
- public func setMessageType(_ messageType: MessageType) { self.messageType = messageType }
56
-
57
- public func getSendRate() -> Int { return self.sendRate }
58
- public func setSendRate(_ sendRate: Int) { self.sendRate = sendRate }
59
-
60
- public func getReconnectDelay() -> Int { return self.reconnectDelay }
61
- public func setReconnectDelay(_ reconnectDelay: Int) { self.reconnectDelay = reconnectDelay }
62
-
63
- public func getPingInterval() -> Float { return self.pingInterval }
64
- public func setPingInterval(_ pingInterval: Float) { self.pingInterval = pingInterval }
65
-
66
- public func getPingTimeout() -> Float { return self.pingTimeout }
67
- public func setPingTimeout(_ pingTimeout: Float) { self.pingTimeout = pingTimeout }
68
-
69
- public func getAdminSecretKey() -> String? { return self.adminSecretKey }
70
- public func setAdminSecretKey(_ adminSecretKey: String?) { self.adminSecretKey = adminSecretKey }
71
-
72
- public func getServerSecretKey() -> String? { return self.serverSecretKey }
73
- public func setServerSecretKey(_ serverSecretKey: String?) { self.serverSecretKey = serverSecretKey }
74
-
75
- public func getClientSecretKey() -> String? { return self.clientSecretKey }
76
- public func setClientSecretKey(_ clientSecretKey: String?) { self.clientSecretKey = clientSecretKey }
77
-
78
- public func getLogType() -> LogType { return self.logType }
79
- public func setLogType(_ logType: LogType) { self.logType = logType }
80
-
81
- public func getSocketUrl() -> String {
82
- let proto = self.useSsl ? "https" : "http"
83
- return self.serverPort < 0 ? "\(proto)://\(self.serverAddress)" : "\(proto)://\(self.serverAddress):\(self.serverSocketPort)"
84
- }
85
-
86
- public func getHttpUrl() -> String {
87
- let proto = self.useSsl ? "https" : "http"
88
- return self.serverPort < 0 ? "\(proto)://\(self.serverAddress)" : "\(proto)://\(self.serverAddress):\(self.serverPort)"
89
- }
90
-
91
- private var gameId: String = ""
92
- public func getGameId() -> String { return self.gameId }
93
- public func setGameId(_ gameId: String) { self.gameId = gameId }
94
- }
95
-
@@ -1,28 +0,0 @@
1
- import Foundation
2
-
3
- public struct Commands {
4
- public static let USER_AGENT: String = "User-Agent"
5
-
6
- public static let CONTENT_TYPE: String = "Content-Type"
7
- public static let ACCEPT: String = "Accept"
8
- public static let CONTENT_LENGTH: String = "Content-Length"
9
- public static let APPLICATION_JSON: String = "application/json"
10
- public static let APPLICATION_MSGPACK: String = "application/msgpack"
11
-
12
- public static let RequestAuthTokenCmd: String = "Auth-Token"
13
- public static let RequestSecretCmd: String = "Secret-Key"
14
- public static let RequestGameIdCmd: String = "Game-Id"
15
-
16
- public static let RequestCmd_MsgPack: String = "rMsgPack"
17
- public static let ResponseCmd_MsgPack: String = "rMsgPack"
18
- public static let EventCmd_MsgPack: String = "eMsgPack"
19
-
20
- public static let RequestCmd_Json: String = "rJson"
21
- public static let ResponseCmd_Json: String = "rJson"
22
- public static let EventCmd_Json: String = "eJson"
23
-
24
- public static let Data: String = "data"
25
- public static let File: String = "file"
26
-
27
- public static let BaseUrl: String = "X-BaseUrl"
28
- }
@@ -1,10 +0,0 @@
1
- import Foundation
2
-
3
- public struct EventCode {
4
- public static let OnGamePlayerFriendUpdate: String = "onGamePlayerFriendUpdate"
5
- public static let OnCharacterPlayerFriendUpdate: String = "onCharacterPlayerFriendUpdate"
6
- public static let OnGamePlayerGroupUpdate: String = "onGamePlayerGroupUpdate"
7
- public static let OnGroupMemberUpdate: String = "onGroupMemberUpdate"
8
- public static let OnGroupMessageUpdate: String = "onGroupMessageUpdate"
9
- public static let OnCharacterPlayerGroupUpdate: String = "onCharacterPlayerGroupUpdate"
10
- }