com.xmobitea.changx.gn-unity 1.0.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/Editor/GNServerSettingsEditor.cs +48 -94
  2. package/Runtime/Common/GNArray.cs +122 -81
  3. package/Runtime/Common/GNData.cs +13 -7
  4. package/Runtime/Common/GNHashtable.cs +71 -63
  5. package/Runtime/Common/IGNData.cs +3 -1
  6. package/Runtime/Config/GNServerSettings.cs +112 -45
  7. package/Runtime/Constant/Commands.cs +3 -0
  8. package/Runtime/Constant/EnumType/FriendStatus.cs +6 -4
  9. package/Runtime/Constant/EnumType/GoogleLoginType.cs +2 -0
  10. package/Runtime/Constant/EnumType/GroupStatus.cs +12 -0
  11. package/Runtime/Constant/EnumType/{UserRoleType.cs.meta → GroupStatus.cs.meta} +1 -1
  12. package/Runtime/Constant/EnumType/InvalidMemberType.cs +17 -15
  13. package/Runtime/Constant/EnumType/ItemType.cs +10 -0
  14. package/Runtime/Constant/EnumType/{LoginType.cs.meta → ItemType.cs.meta} +1 -1
  15. package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs +11 -0
  16. package/Runtime/Constant/{ErrorCode/DebugErrorCode.cs.meta → EnumType/MatchmakingMemberStatus.cs.meta} +11 -11
  17. package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs +13 -0
  18. package/Runtime/Constant/EnumType/{PlatformType.cs.meta → MatchmakingTicketStatus.cs.meta} +11 -11
  19. package/Runtime/Constant/EnumType/OwnerType.cs +12 -0
  20. package/Runtime/Constant/EnumType/OwnerType.cs.meta +11 -0
  21. package/Runtime/Constant/EnumType/PermissionDataItem.cs +10 -0
  22. package/Runtime/Constant/EnumType/PermissionDataItem.cs.meta +11 -0
  23. package/Runtime/Constant/EnumType/RequestRole.cs +11 -0
  24. package/Runtime/Constant/EnumType/RequestRole.cs.meta +7 -0
  25. package/Runtime/Constant/EnumType/RequestType.cs +19 -0
  26. package/Runtime/Constant/EnumType/RequestType.cs.meta +11 -0
  27. package/Runtime/Constant/ErrorCode/GNErrorCode.cs +54 -0
  28. package/Runtime/Constant/ErrorCode/GNErrorCode.cs.meta +7 -0
  29. package/Runtime/Constant/EventCode.cs +10 -1
  30. package/Runtime/Constant/OperationCode.cs +212 -14
  31. package/Runtime/Constant/ParameterCode/GNParameterCode.cs +470 -0
  32. package/Runtime/Constant/ParameterCode/GNParameterCode.cs.meta +11 -0
  33. package/Runtime/Constant/ParameterCode/ParameterCode.cs +2 -0
  34. package/Runtime/Constant/ReturnCode.cs +13 -7
  35. package/Runtime/Entity/DataMember.cs +124 -0
  36. package/Runtime/Entity/DataMember.cs.meta +11 -0
  37. package/Runtime/Entity/GNMetadata.cs +27 -0
  38. package/Runtime/Entity/GNMetadata.cs.meta +11 -0
  39. package/Runtime/Entity/InvalidMember.cs +8 -3
  40. package/Runtime/Entity/Models/AuthenticateModels.cs +316 -0
  41. package/Runtime/Entity/Models/AuthenticateModels.cs.meta +11 -0
  42. package/Runtime/Entity/Models/AuthenticateRequestModels.cs +186 -0
  43. package/Runtime/Entity/Models/AuthenticateRequestModels.cs.meta +11 -0
  44. package/Runtime/Entity/Models/AuthenticateResponseModels.cs +90 -0
  45. package/Runtime/Entity/Models/AuthenticateResponseModels.cs.meta +11 -0
  46. package/Runtime/Entity/Models/CharacterPlayerModels.cs +1208 -0
  47. package/Runtime/Entity/Models/CharacterPlayerModels.cs.meta +11 -0
  48. package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs +1233 -0
  49. package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs.meta +11 -0
  50. package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs +254 -0
  51. package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs.meta +11 -0
  52. package/Runtime/Entity/Models/ContentModels.cs +223 -0
  53. package/Runtime/Entity/Models/ContentModels.cs.meta +11 -0
  54. package/Runtime/Entity/Models/ContentRequestModels.cs +185 -0
  55. package/Runtime/Entity/Models/ContentRequestModels.cs.meta +11 -0
  56. package/Runtime/Entity/Models/ContentResponseModels.cs +44 -0
  57. package/Runtime/Entity/Models/ContentResponseModels.cs.meta +11 -0
  58. package/Runtime/Entity/Models/DashboardModels.cs +1696 -0
  59. package/Runtime/Entity/Models/DashboardModels.cs.meta +11 -0
  60. package/Runtime/Entity/Models/DashboardRequestModels.cs +208 -0
  61. package/Runtime/Entity/Models/DashboardRequestModels.cs.meta +11 -0
  62. package/Runtime/Entity/Models/DashboardResponseModels.cs +99 -0
  63. package/Runtime/Entity/Models/DashboardResponseModels.cs.meta +11 -0
  64. package/Runtime/Entity/Models/GamePlayerModels.cs +1326 -0
  65. package/Runtime/Entity/Models/GamePlayerModels.cs.meta +11 -0
  66. package/Runtime/Entity/Models/GamePlayerRequestModels.cs +1208 -0
  67. package/Runtime/Entity/Models/GamePlayerRequestModels.cs.meta +11 -0
  68. package/Runtime/Entity/Models/GamePlayerResponseModels.cs +249 -0
  69. package/Runtime/Entity/Models/GamePlayerResponseModels.cs.meta +11 -0
  70. package/Runtime/Entity/Models/GenericModels.cs +154 -0
  71. package/Runtime/Entity/Models/GenericModels.cs.meta +11 -0
  72. package/Runtime/Entity/Models/GroupModels.cs +957 -0
  73. package/Runtime/Entity/Models/GroupModels.cs.meta +11 -0
  74. package/Runtime/Entity/Models/GroupRequestModels.cs +933 -0
  75. package/Runtime/Entity/Models/GroupRequestModels.cs.meta +11 -0
  76. package/Runtime/Entity/Models/GroupResponseModels.cs +194 -0
  77. package/Runtime/Entity/Models/GroupResponseModels.cs.meta +11 -0
  78. package/Runtime/Entity/Models/InventoryModels.cs +789 -0
  79. package/Runtime/Entity/Models/InventoryModels.cs.meta +11 -0
  80. package/Runtime/Entity/Models/InventoryRequestModels.cs +810 -0
  81. package/Runtime/Entity/Models/InventoryRequestModels.cs.meta +11 -0
  82. package/Runtime/Entity/Models/InventoryResponseModels.cs +169 -0
  83. package/Runtime/Entity/Models/InventoryResponseModels.cs.meta +11 -0
  84. package/Runtime/Entity/Models/MasterPlayerModels.cs +1907 -0
  85. package/Runtime/Entity/Models/MasterPlayerModels.cs.meta +11 -0
  86. package/Runtime/Entity/Models/MasterPlayerRequestModels.cs +1744 -0
  87. package/Runtime/Entity/Models/MasterPlayerRequestModels.cs.meta +11 -0
  88. package/Runtime/Entity/Models/MasterPlayerResponseModels.cs +359 -0
  89. package/Runtime/Entity/Models/MasterPlayerResponseModels.cs.meta +11 -0
  90. package/Runtime/Entity/Models/MultiplayerModels.cs +323 -0
  91. package/Runtime/Entity/Models/MultiplayerModels.cs.meta +11 -0
  92. package/Runtime/Entity/Models/MultiplayerRequestModels.cs +208 -0
  93. package/Runtime/Entity/Models/MultiplayerRequestModels.cs.meta +11 -0
  94. package/Runtime/Entity/Models/MultiplayerResponseModels.cs +49 -0
  95. package/Runtime/Entity/Models/MultiplayerResponseModels.cs.meta +11 -0
  96. package/Runtime/Entity/Models/StoreInventoryModels.cs +474 -0
  97. package/Runtime/Entity/Models/StoreInventoryModels.cs.meta +11 -0
  98. package/Runtime/Entity/Models/StoreInventoryRequestModels.cs +235 -0
  99. package/Runtime/Entity/Models/StoreInventoryRequestModels.cs.meta +11 -0
  100. package/Runtime/Entity/Models/StoreInventoryResponseModels.cs +54 -0
  101. package/Runtime/Entity/Models/StoreInventoryResponseModels.cs.meta +11 -0
  102. package/Runtime/Entity/Models.meta +8 -0
  103. package/Runtime/Entity/OperationEvent.cs +14 -9
  104. package/Runtime/Entity/OperationHelper.cs +13 -7
  105. package/Runtime/Entity/OperationRequest.cs +20 -20
  106. package/Runtime/Entity/OperationResponse.cs +27 -17
  107. package/Runtime/Entity/Request/CustomOperationRequest.cs +37 -7
  108. package/Runtime/Entity/Response/CustomOperationResponse.cs +34 -11
  109. package/Runtime/GNNetwork.cs +80 -83
  110. package/Runtime/GNNetworkApi.cs +7 -115
  111. package/Runtime/GNNetworkAuthenticateApi.cs +110 -0
  112. package/Runtime/GNNetworkAuthenticateApi.cs.meta +11 -0
  113. package/Runtime/GNNetworkCharacterPlayerApi.cs +766 -0
  114. package/Runtime/GNNetworkCharacterPlayerApi.cs.meta +11 -0
  115. package/Runtime/GNNetworkContentApi.cs +136 -0
  116. package/Runtime/GNNetworkContentApi.cs.meta +11 -0
  117. package/Runtime/GNNetworkDashboardApi.cs +121 -0
  118. package/Runtime/GNNetworkDashboardApi.cs.meta +11 -0
  119. package/Runtime/GNNetworkGamePlayerApi.cs +751 -0
  120. package/Runtime/GNNetworkGamePlayerApi.cs.meta +11 -0
  121. package/Runtime/GNNetworkGroupApi.cs +586 -0
  122. package/Runtime/GNNetworkGroupApi.cs.meta +11 -0
  123. package/Runtime/GNNetworkInventoryApi.cs +511 -0
  124. package/Runtime/GNNetworkInventoryApi.cs.meta +11 -0
  125. package/Runtime/GNNetworkMasterPlayerApi.cs +1071 -0
  126. package/Runtime/GNNetworkMasterPlayerApi.cs.meta +11 -0
  127. package/Runtime/GNNetworkMultiplayerApi.cs +151 -0
  128. package/Runtime/GNNetworkMultiplayerApi.cs.meta +11 -0
  129. package/Runtime/GNNetworkStoreInventoryApi.cs +166 -0
  130. package/Runtime/GNNetworkStoreInventoryApi.cs.meta +11 -0
  131. package/Runtime/Helper/CodeHelper.cs +44 -23
  132. package/Runtime/Helper/ConverterService.cs +452 -0
  133. package/Runtime/Helper/ConverterService.cs.meta +11 -0
  134. package/Runtime/Logger/GNDebug.cs +4 -4
  135. package/Runtime/Networking/AuthenticateStatus.cs +35 -0
  136. package/Runtime/Networking/AuthenticateStatus.cs.meta +11 -0
  137. package/Runtime/Networking/Handler/IServerEventHandler.cs +14 -2
  138. package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs +32 -0
  139. package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs.meta +11 -0
  140. package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs +33 -0
  141. package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs.meta +11 -0
  142. package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs +32 -0
  143. package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs.meta +11 -0
  144. package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs +32 -0
  145. package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs.meta +11 -0
  146. package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs +29 -0
  147. package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs.meta +11 -0
  148. package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs +29 -0
  149. package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs.meta +11 -0
  150. package/Runtime/Networking/Http/HttpPeer.cs +176 -0
  151. package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs +25 -0
  152. package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs.meta +11 -0
  153. package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs +373 -0
  154. package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs.meta +11 -0
  155. package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs +207 -0
  156. package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs.meta +11 -0
  157. package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs +188 -0
  158. package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs.meta +11 -0
  159. package/Runtime/Networking/Http.meta +8 -0
  160. package/Runtime/Networking/IPeer.cs +6 -5
  161. package/Runtime/Networking/NetworkingPeer.cs +81 -52
  162. package/Runtime/Networking/NetworkingPeerAPI.cs +23 -311
  163. package/Runtime/Networking/OperationPending.cs +47 -10
  164. package/Runtime/Networking/PeerBase.cs +87 -84
  165. package/Runtime/Networking/{NetworkingPeerSocketV2.cs → Socket/NetworkingPeerSocketV2.cs} +44 -41
  166. package/Runtime/Networking/{NetworkingPeerSocketV3.cs → Socket/NetworkingPeerSocketV3.cs} +43 -40
  167. package/Runtime/Networking/{NetworkingPeerBase.cs → Socket/NetworkingSocketPeerBase.cs} +41 -49
  168. package/Runtime/Networking/Socket/SocketPeer.cs +193 -0
  169. package/Runtime/Networking/Socket.meta +8 -0
  170. package/Runtime/Unity/ServiceUpdate.cs +20 -0
  171. package/Runtime/Unity/ServiceUpdate.cs.meta +11 -0
  172. package/Runtime/Unity.meta +8 -0
  173. package/Runtime/XmobiTea.GN.runtime.asmdef +1 -2
  174. package/package.json +2 -4
  175. package/Runtime/Constant/EnumType/LoginType.cs +0 -14
  176. package/Runtime/Constant/EnumType/PlatformType.cs +0 -12
  177. package/Runtime/Constant/EnumType/UserRoleType.cs +0 -12
  178. package/Runtime/Constant/ErrorCode/DebugErrorCode.cs +0 -7
  179. package/Runtime/Constant/ErrorCode/EnterDisplayNameErrorCode.cs +0 -7
  180. package/Runtime/Constant/ErrorCode/EnterDisplayNameErrorCode.cs.meta +0 -11
  181. package/Runtime/Constant/ErrorCode/FetchAllDataErrorCode.cs +0 -8
  182. package/Runtime/Constant/ErrorCode/FetchAllDataErrorCode.cs.meta +0 -11
  183. package/Runtime/Constant/ErrorCode/FetchSparkPlayerErrorCode.cs +0 -8
  184. package/Runtime/Constant/ErrorCode/FetchSparkPlayerErrorCode.cs.meta +0 -11
  185. package/Runtime/Constant/ErrorCode/FileUploadInfoErrorCode.cs +0 -9
  186. package/Runtime/Constant/ErrorCode/FileUploadInfoErrorCode.cs.meta +0 -11
  187. package/Runtime/Constant/ErrorCode/GetAppConfigErrorCode.cs +0 -7
  188. package/Runtime/Constant/ErrorCode/GetAppConfigErrorCode.cs.meta +0 -11
  189. package/Runtime/Constant/ErrorCode/LoginErrorCode.cs +0 -14
  190. package/Runtime/Constant/ErrorCode/LoginErrorCode.cs.meta +0 -11
  191. package/Runtime/Constant/ErrorCode/RegisterSocketErrorCode.cs +0 -7
  192. package/Runtime/Constant/ErrorCode/RegisterSocketErrorCode.cs.meta +0 -11
  193. package/Runtime/Constant/ParameterCode/DebugParameterCode.cs +0 -11
  194. package/Runtime/Constant/ParameterCode/DebugParameterCode.cs.meta +0 -11
  195. package/Runtime/Constant/ParameterCode/EnterDisplayNameParameterCode.cs +0 -8
  196. package/Runtime/Constant/ParameterCode/EnterDisplayNameParameterCode.cs.meta +0 -11
  197. package/Runtime/Constant/ParameterCode/FetchAllDataParameterCode.cs +0 -11
  198. package/Runtime/Constant/ParameterCode/FetchAllDataParameterCode.cs.meta +0 -11
  199. package/Runtime/Constant/ParameterCode/FetchSparkPlayerParameterCode.cs +0 -19
  200. package/Runtime/Constant/ParameterCode/FetchSparkPlayerParameterCode.cs.meta +0 -11
  201. package/Runtime/Constant/ParameterCode/FileUploadInfoParameterCode.cs +0 -15
  202. package/Runtime/Constant/ParameterCode/FileUploadInfoParameterCode.cs.meta +0 -11
  203. package/Runtime/Constant/ParameterCode/GetAppConfigParameterCode.cs +0 -8
  204. package/Runtime/Constant/ParameterCode/GetAppConfigParameterCode.cs.meta +0 -11
  205. package/Runtime/Constant/ParameterCode/LoginParameterCode.cs +0 -22
  206. package/Runtime/Constant/ParameterCode/LoginParameterCode.cs.meta +0 -11
  207. package/Runtime/Constant/ParameterCode/RegisterSocketParameterCode.cs +0 -7
  208. package/Runtime/Constant/ParameterCode/RegisterSocketParameterCode.cs.meta +0 -11
  209. package/Runtime/Entity/Request/CreateNewFileUploadInfoOperationRequest.cs +0 -21
  210. package/Runtime/Entity/Request/CreateNewFileUploadInfoOperationRequest.cs.meta +0 -11
  211. package/Runtime/Entity/Request/DebugOperationRequest.cs +0 -25
  212. package/Runtime/Entity/Request/DebugOperationRequest.cs.meta +0 -11
  213. package/Runtime/Entity/Request/EnterDisplayNameOperationRequest.cs +0 -21
  214. package/Runtime/Entity/Request/EnterDisplayNameOperationRequest.cs.meta +0 -11
  215. package/Runtime/Entity/Request/FetchAllDataOperationRequest.cs +0 -19
  216. package/Runtime/Entity/Request/FetchAllDataOperationRequest.cs.meta +0 -11
  217. package/Runtime/Entity/Request/FetchSparkPlayerOperationRequest.cs +0 -19
  218. package/Runtime/Entity/Request/FetchSparkPlayerOperationRequest.cs.meta +0 -11
  219. package/Runtime/Entity/Request/GetAppConfigOperationRequest.cs +0 -21
  220. package/Runtime/Entity/Request/GetAppConfigOperationRequest.cs.meta +0 -11
  221. package/Runtime/Entity/Request/GetFileUploadInfoOperationRequest.cs +0 -21
  222. package/Runtime/Entity/Request/GetFileUploadInfoOperationRequest.cs.meta +0 -11
  223. package/Runtime/Entity/Request/LoginOperationRequest.cs +0 -140
  224. package/Runtime/Entity/Request/LoginOperationRequest.cs.meta +0 -11
  225. package/Runtime/Entity/Request/LogoutOperationRequest.cs +0 -19
  226. package/Runtime/Entity/Request/LogoutOperationRequest.cs.meta +0 -11
  227. package/Runtime/Entity/Request/RegisterAccountOperationRequest.cs +0 -22
  228. package/Runtime/Entity/Request/RegisterAccountOperationRequest.cs.meta +0 -11
  229. package/Runtime/Entity/Request/RegisterSocketOperationRequest.cs +0 -21
  230. package/Runtime/Entity/Request/RegisterSocketOperationRequest.cs.meta +0 -11
  231. package/Runtime/Entity/Request/TemplateOperationRequest.cs +0 -21
  232. package/Runtime/Entity/Request/TemplateOperationRequest.cs.meta +0 -11
  233. package/Runtime/Entity/Response/CreateNewFileUploadInfoOperationResponse.cs +0 -32
  234. package/Runtime/Entity/Response/CreateNewFileUploadInfoOperationResponse.cs.meta +0 -11
  235. package/Runtime/Entity/Response/DebugOperationResponse.cs +0 -33
  236. package/Runtime/Entity/Response/DebugOperationResponse.cs.meta +0 -11
  237. package/Runtime/Entity/Response/EnterDisplayNameOperationResponse.cs +0 -26
  238. package/Runtime/Entity/Response/EnterDisplayNameOperationResponse.cs.meta +0 -11
  239. package/Runtime/Entity/Response/FetchAllDataOperationResponse.cs +0 -35
  240. package/Runtime/Entity/Response/FetchAllDataOperationResponse.cs.meta +0 -11
  241. package/Runtime/Entity/Response/FetchSparkPlayerOperationResponse.cs +0 -59
  242. package/Runtime/Entity/Response/FetchSparkPlayerOperationResponse.cs.meta +0 -11
  243. package/Runtime/Entity/Response/GetAppConfigOperationResponse.cs +0 -24
  244. package/Runtime/Entity/Response/GetAppConfigOperationResponse.cs.meta +0 -11
  245. package/Runtime/Entity/Response/GetFileUploadInfoOperationResponse.cs +0 -56
  246. package/Runtime/Entity/Response/GetFileUploadInfoOperationResponse.cs.meta +0 -11
  247. package/Runtime/Entity/Response/LoginOperationResponse.cs +0 -34
  248. package/Runtime/Entity/Response/LoginOperationResponse.cs.meta +0 -11
  249. package/Runtime/Entity/Response/LogoutOperationResponse.cs +0 -27
  250. package/Runtime/Entity/Response/LogoutOperationResponse.cs.meta +0 -11
  251. package/Runtime/Entity/Response/PublicAddressGetRandomMessageOperationResponse.cs +0 -24
  252. package/Runtime/Entity/Response/PublicAddressGetRandomMessageOperationResponse.cs.meta +0 -11
  253. package/Runtime/Entity/Response/RegisterAccountOperationResponse.cs +0 -23
  254. package/Runtime/Entity/Response/RegisterAccountOperationResponse.cs.meta +0 -11
  255. package/Runtime/Entity/Response/RegisterSocketOperationResponse.cs +0 -23
  256. package/Runtime/Entity/Response/RegisterSocketOperationResponse.cs.meta +0 -11
  257. package/Runtime/Entity/Response/TemplateOperationResponse.cs +0 -24
  258. package/Runtime/Entity/Response/TemplateOperationResponse.cs.meta +0 -11
  259. package/Runtime/Networking/Handler/OnDebugEventHandler.cs +0 -17
  260. package/Runtime/Networking/Handler/OnDebugEventHandler.cs.meta +0 -11
  261. package/Runtime/Networking/HttpPeer.cs +0 -497
  262. package/Runtime/Networking/SocketPeer.cs +0 -179
  263. /package/Runtime/Networking/{HttpPeer.cs.meta → Http/HttpPeer.cs.meta} +0 -0
  264. /package/Runtime/Networking/{NetworkingPeerSocketV2.cs.meta → Socket/NetworkingPeerSocketV2.cs.meta} +0 -0
  265. /package/Runtime/Networking/{NetworkingPeerSocketV3.cs.meta → Socket/NetworkingPeerSocketV3.cs.meta} +0 -0
  266. /package/Runtime/Networking/{NetworkingPeerBase.cs.meta → Socket/NetworkingSocketPeerBase.cs.meta} +0 -0
  267. /package/Runtime/Networking/{SocketPeer.cs.meta → Socket/SocketPeer.cs.meta} +0 -0
@@ -24,10 +24,12 @@
24
24
  SerializedProperty pingInterval;
25
25
  SerializedProperty pingTimout;
26
26
  SerializedProperty peerSocketVersion;
27
- SerializedProperty codeCanSendNotAuthorized;
28
27
  SerializedProperty gnServerSourcePath;
29
28
  SerializedProperty httpRequestType;
30
29
  SerializedProperty logType;
30
+ SerializedProperty adminSecretKey;
31
+ SerializedProperty serverSecretKey;
32
+ SerializedProperty clientSecretKey;
31
33
 
32
34
  private Dictionary<int, string> operationCodeFieldDict;
33
35
 
@@ -35,115 +37,67 @@
35
37
 
36
38
  private void OnEnable()
37
39
  {
38
- serverAddress = serializedObject.FindProperty("_serverAddress");
39
- serverPort = serializedObject.FindProperty("_serverPort");
40
- useSsl = serializedObject.FindProperty("_useSsl");
41
- useSocket = serializedObject.FindProperty("_useSocket");
42
- useHttp = serializedObject.FindProperty("_useHttp");
43
- sendRate = serializedObject.FindProperty("_sendRate");
44
- reconnectDelay = serializedObject.FindProperty("_reconnectDelay");
45
- pingInterval = serializedObject.FindProperty("_pingInterval");
46
- pingTimout = serializedObject.FindProperty("_pingTimeout");
47
- peerSocketVersion = serializedObject.FindProperty("_peerSocketVersion");
48
- codeCanSendNotAuthorized = serializedObject.FindProperty("_codeCanSendNotAuthorized");
49
- gnServerSourcePath = serializedObject.FindProperty("_gnServerSourcePath");
50
- httpRequestType = serializedObject.FindProperty("_httpRequestType");
51
- //postType = serializedObject.FindProperty("_postType");
52
- logType = serializedObject.FindProperty("_logType");
40
+ this.serverAddress = serializedObject.FindProperty("serverAddress");
41
+ this.serverPort = serializedObject.FindProperty("serverPort");
42
+ this.useSsl = serializedObject.FindProperty("useSsl");
43
+ this.useSocket = serializedObject.FindProperty("useSocket");
44
+ this.useHttp = serializedObject.FindProperty("useHttp");
45
+ this.sendRate = serializedObject.FindProperty("sendRate");
46
+ this.reconnectDelay = serializedObject.FindProperty("reconnectDelay");
47
+ this.pingInterval = serializedObject.FindProperty("pingInterval");
48
+ this.pingTimout = serializedObject.FindProperty("pingTimeout");
49
+ this.peerSocketVersion = serializedObject.FindProperty("peerSocketVersion");
50
+ this.gnServerSourcePath = serializedObject.FindProperty("gnServerSourcePath");
51
+ this.httpRequestType = serializedObject.FindProperty("httpRequestType");
52
+ //postType = serializedObject.FindProperty("postType");
53
+ this.logType = serializedObject.FindProperty("logType");
54
+ this.adminSecretKey = serializedObject.FindProperty("adminSecretKey");
55
+ this.serverSecretKey = serializedObject.FindProperty("serverSecretKey");
56
+ this.clientSecretKey = serializedObject.FindProperty("clientSecretKey");
53
57
 
54
58
  var fields = typeof(OperationCode).GetFields();
55
59
 
56
- if (operationCodeFieldDict == null) operationCodeFieldDict = new Dictionary<int, string>();
57
- else operationCodeFieldDict.Clear();
60
+ if (this.operationCodeFieldDict == null) this.operationCodeFieldDict = new Dictionary<int, string>();
61
+ else this.operationCodeFieldDict.Clear();
58
62
 
59
63
  for (var i = 0; i < fields.Length; i++)
60
64
  {
61
65
  var field = fields[i];
62
66
 
63
- operationCodeFieldDict[(int)field.GetValue(null)] = field.Name;
67
+ this.operationCodeFieldDict[(int)field.GetValue(null)] = field.Name;
64
68
  }
65
69
  }
66
70
 
67
71
  public override void OnInspectorGUI()
68
72
  {
69
- serializedObject.Update();
73
+ this.serializedObject.Update();
70
74
 
71
- EditorGUILayout.LabelField($"GN Unity Client SDK Version v{GNNetwork.GetClientSdkVersion()}");
75
+ EditorGUILayout.LabelField($"GN Unity Client SDK Version v{GNNetwork.getClientSdkVersion()}");
72
76
  EditorGUILayout.Space(20);
73
77
 
74
- EditorGUILayout.PropertyField(serverAddress);
75
- EditorGUILayout.PropertyField(serverPort);
76
- EditorGUILayout.PropertyField(useSsl);
77
- EditorGUILayout.PropertyField(useSocket);
78
- EditorGUILayout.PropertyField(useHttp);
79
- EditorGUILayout.PropertyField(sendRate);
80
- EditorGUILayout.PropertyField(reconnectDelay);
81
- EditorGUILayout.PropertyField(pingInterval);
82
- EditorGUILayout.PropertyField(pingTimout);
83
- EditorGUILayout.PropertyField(peerSocketVersion);
78
+ EditorGUILayout.PropertyField(this.serverAddress);
79
+ EditorGUILayout.PropertyField(this.serverPort);
80
+ EditorGUILayout.PropertyField(this.useSsl);
81
+ EditorGUILayout.PropertyField(this.useSocket);
82
+ EditorGUILayout.PropertyField(this.useHttp);
83
+ EditorGUILayout.PropertyField(this.sendRate);
84
+ EditorGUILayout.PropertyField(this.reconnectDelay);
85
+ EditorGUILayout.PropertyField(this.pingInterval);
86
+ EditorGUILayout.PropertyField(this.pingTimout);
87
+ EditorGUILayout.PropertyField(this.peerSocketVersion);
84
88
  EditorGUILayout.Space(20);
85
89
 
86
- EditorGUILayout.BeginVertical();
87
- EditorGUILayout.LabelField($"Code Can Send Not Authorized size is {codeCanSendNotAuthorized.arraySize}");
88
-
89
- //scrollPosition = GUILayout.BeginScrollView(scrollPosition);
90
-
91
-
92
- for (var i = 0; i < codeCanSendNotAuthorized.arraySize; i++)
93
- {
94
- var serializedProperty = codeCanSendNotAuthorized.GetArrayElementAtIndex(i);
95
-
96
- var operationCodeName = string.Empty;
97
-
98
- if (operationCodeFieldDict.ContainsKey(serializedProperty.intValue)) operationCodeName = $"({serializedProperty.intValue}) {operationCodeFieldDict[serializedProperty.intValue]}";
99
- else operationCodeName = "Choose an operation code";
100
-
101
- EditorGUILayout.BeginHorizontal();
102
-
103
- if (EditorGUILayout.DropdownButton(new GUIContent(operationCodeName), FocusType.Passive))
104
- {
105
- var operationCodeMenu = new GenericMenu();
106
- operationCodeMenu.AddItem(new GUIContent("None"), !operationCodeFieldDict.ContainsKey(serializedProperty.intValue), id =>
107
- {
108
- serializedProperty.intValue = (int)id;
109
- if (serializedObject.hasModifiedProperties) serializedObject.ApplyModifiedProperties();
110
- }, int.MinValue);
111
- operationCodeMenu.AddSeparator("");
112
-
113
- foreach (var c in operationCodeFieldDict)
114
- {
115
- operationCodeMenu.AddItem(new GUIContent($"({c.Key}) {c.Value}"), serializedProperty.intValue == c.Key, id =>
116
- {
117
- serializedProperty.intValue = (int)id;
118
- if (serializedObject.hasModifiedProperties) serializedObject.ApplyModifiedProperties();
119
- }, c.Key);
120
- }
121
-
122
- operationCodeMenu.ShowAsContext();
123
- }
124
-
125
- if (GUILayout.Button("-", GUILayout.MaxWidth(50)))
126
- {
127
- codeCanSendNotAuthorized.DeleteArrayElementAtIndex(i);
128
- }
129
-
130
- EditorGUILayout.EndHorizontal();
131
- }
132
-
133
- if (GUILayout.Button("+"))
134
- {
135
- codeCanSendNotAuthorized.arraySize += 1;
136
- }
90
+ EditorGUILayout.PropertyField(this.gnServerSourcePath);
91
+ EditorGUILayout.PropertyField(this.httpRequestType);
92
+ //EditorGUILayout.PropertyField(postType);
93
+ EditorGUILayout.PropertyField(this.logType);
137
94
 
138
- EditorGUILayout.EndVertical();
139
95
  EditorGUILayout.Space(20);
96
+ EditorGUILayout.PropertyField(this.adminSecretKey);
97
+ EditorGUILayout.PropertyField(this.serverSecretKey);
98
+ EditorGUILayout.PropertyField(this.clientSecretKey);
140
99
 
141
- EditorGUILayout.PropertyField(gnServerSourcePath);
142
- EditorGUILayout.PropertyField(httpRequestType);
143
- //EditorGUILayout.PropertyField(postType);
144
- EditorGUILayout.PropertyField(logType);
145
-
146
- if (serializedObject.hasModifiedProperties) serializedObject.ApplyModifiedProperties();
100
+ if (this.serializedObject.hasModifiedProperties) this.serializedObject.ApplyModifiedProperties();
147
101
  }
148
102
 
149
103
  [MenuItem("XmobiTea GN/Open Settings")]
@@ -201,7 +155,7 @@
201
155
  private static void SyncEnumTypeFolder()
202
156
  {
203
157
  var gnServerSettings = GetSettings();
204
- var dir = Application.dataPath + "/../../" + gnServerSettings.gnServerSourcePath + "/src/common/constant/enumType";
158
+ var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/enumType";
205
159
 
206
160
  var allPathFiles = Directory.GetFiles(dir, "*.ts");
207
161
  for (var i = 0; i < allPathFiles.Length; i++)
@@ -258,7 +212,7 @@
258
212
  private static void SyncParameterCodeFolder()
259
213
  {
260
214
  var gnServerSettings = GetSettings();
261
- var dir = Application.dataPath + "/../../" + gnServerSettings.gnServerSourcePath + "/src/common/constant/parameterCode";
215
+ var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/parameterCode";
262
216
 
263
217
  var allPathFiles = Directory.GetFiles(dir, "*.ts");
264
218
  for (var i = 0; i < allPathFiles.Length; i++)
@@ -321,7 +275,7 @@
321
275
  private static void SyncErrorCodeFolder()
322
276
  {
323
277
  var gnServerSettings = GetSettings();
324
- var dir = Application.dataPath + "/../../" + gnServerSettings.gnServerSourcePath + "/src/common/constant/errorCode";
278
+ var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/errorCode";
325
279
 
326
280
  var allPathFiles = Directory.GetFiles(dir, "*.ts");
327
281
  for (var i = 0; i < allPathFiles.Length; i++)
@@ -392,7 +346,7 @@
392
346
  const string Template = "public const int $name = $code;";
393
347
 
394
348
  var gnServerSettings = GetSettings();
395
- var dirPath = Application.dataPath + "/../../" + gnServerSettings.gnServerSourcePath + "/src/common/constant/OperationCode.ext.ts";
349
+ var dirPath = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/OperationCode.ext.ts";
396
350
  var allLines = File.ReadAllLines(dirPath);
397
351
 
398
352
  var stringBuilder = new StringBuilder();
@@ -435,7 +389,7 @@
435
389
  const string Template = "public const int $name = $code;";
436
390
 
437
391
  var gnServerSettings = GetSettings();
438
- var dirPath = Application.dataPath + "/../../" + gnServerSettings.gnServerSourcePath + "/src/common/constant/EventCode.ext.ts";
392
+ var dirPath = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/EventCode.ext.ts";
439
393
  var allLines = File.ReadAllLines(dirPath);
440
394
 
441
395
  var stringBuilder = new StringBuilder();
@@ -4,86 +4,122 @@
4
4
  using System.Collections.Generic;
5
5
  using System.Text;
6
6
 
7
+ /// <summary>
8
+ /// The GNData array, it store Array can be use to request or response
9
+ /// </summary>
7
10
  public class GNArray : GNData
8
11
  {
12
+ /// <summary>
13
+ /// Builder for GNArray
14
+ /// </summary>
9
15
  public class Builder
10
16
  {
11
- private List<object> originArray;
12
-
13
- public Builder Add(object value)
17
+ /// <summary>
18
+ /// The origin array
19
+ /// </summary>
20
+ private List<object> array;
21
+
22
+ /// <summary>
23
+ /// Add a value to origin array
24
+ /// </summary>
25
+ /// <param name="value">The value type must is string, bool, number, Map or Array</param>
26
+ /// <returns></returns>
27
+ public Builder add(object value)
14
28
  {
15
- originArray.Add(value);
29
+ this.array.Add(value);
16
30
 
17
31
  return this;
18
32
  }
19
33
 
20
- public Builder AddAll(System.Collections.IList list)
34
+ /// <summary>
35
+ /// Add some values to origin array
36
+ /// </summary>
37
+ /// <param name="list">The element value type must is type string, bool, number, Map or Array</param>
38
+ /// <returns></returns>
39
+ public Builder addAll(System.Collections.IList list)
21
40
  {
22
41
  foreach (var o in list)
23
42
  {
24
- Add(o);
43
+ this.add(o);
25
44
  }
26
45
 
27
46
  return this;
28
47
  }
29
48
 
30
- public GNArray Build()
49
+ /// <summary>
50
+ /// Build GNArray
51
+ /// </summary>
52
+ /// <returns></returns>
53
+ public GNArray build()
31
54
  {
32
55
  var awnser = new GNArray();
33
56
 
34
- foreach (var o in originArray)
57
+ foreach (var o in this.array)
35
58
  {
36
- awnser.Add(o);
59
+ awnser.add(o);
37
60
  }
38
61
 
39
62
  return awnser;
40
63
  }
41
64
 
65
+ /// <summary>
66
+ /// Constructor for GNArray builder
67
+ /// </summary>
42
68
  public Builder()
43
69
  {
44
- originArray = new List<object>();
70
+ this.array = new List<object>();
45
71
  }
46
72
  }
47
73
 
48
- private List<object> originArray;
74
+ /// <summary>
75
+ /// The GN array
76
+ /// </summary>
77
+ private List<object> array;
49
78
 
79
+ /// <summary>
80
+ /// The constructor for GNArray
81
+ /// </summary>
50
82
  public GNArray()
51
83
  {
52
- this.originArray = new List<object>();
84
+ this.array = new List<object>();
53
85
  }
54
86
 
55
- public void Add(object value)
87
+ /// <summary>
88
+ /// Add a value
89
+ /// </summary>
90
+ /// <param name="value">The </param>
91
+ public void add(object value)
56
92
  {
57
- this.originArray.Add(CreateUseDataFromOriginData(value));
93
+ this.array.Add(GNData.createUseDataFromOriginData(value));
58
94
  }
59
95
 
60
- public ICollection<object> Values()
96
+ public ICollection<object> values()
61
97
  {
62
- return this.originArray;
98
+ return this.array;
63
99
  }
64
100
 
65
- public void Clear()
101
+ public void clear()
66
102
  {
67
- this.originArray.Clear();
103
+ this.array.Clear();
68
104
  }
69
105
 
70
- public bool Remove(int index)
106
+ public bool remove(int index)
71
107
  {
72
- this.originArray.RemoveAt(index);
108
+ this.array.RemoveAt(index);
73
109
 
74
110
  return true;
75
111
  }
76
112
 
77
- public int Count()
113
+ public int count()
78
114
  {
79
- return this.originArray.Count;
115
+ return this.array.Count;
80
116
  }
81
117
 
82
- protected object Get<T>(int k, T defaultValue = default(T))
118
+ protected object get<T>(int k, T defaultValue = default(T))
83
119
  {
84
- if (k < 0 || k > this.originArray.Count - 1) return defaultValue;
120
+ if (k < 0 || k > this.array.Count - 1) return defaultValue;
85
121
 
86
- var value = this.originArray[k];
122
+ var value = this.array[k];
87
123
 
88
124
  if (value == null) return defaultValue;
89
125
 
@@ -95,155 +131,155 @@
95
131
  return value;
96
132
  }
97
133
 
98
- public T[] ToArray<T>()
134
+ public T[] toArray<T>()
99
135
  {
100
- var answer = new T[this.originArray.Count];
136
+ var answer = new T[this.array.Count];
101
137
 
102
- for (var i = 0; i < this.originArray.Count; i++)
138
+ for (var i = 0; i < this.array.Count; i++)
103
139
  {
104
- answer[i] = (T)this.CustomGet(i);
140
+ answer[i] = (T)this.customGet(i);
105
141
  }
106
142
 
107
143
  return answer;
108
144
  }
109
145
 
110
- public IList<T> ToList<T>()
146
+ public IList<T> toList<T>()
111
147
  {
112
148
  var answer = new List<T>();
113
149
 
114
- for (var i = 0; i < this.originArray.Count; i++)
150
+ for (var i = 0; i < this.array.Count; i++)
115
151
  {
116
- answer.Add((T)this.CustomGet(i));
152
+ answer.Add((T)this.customGet(i));
117
153
  }
118
154
 
119
155
  return answer;
120
156
  }
121
157
 
122
- private object CustomGet(int k)
158
+ private object customGet(int k)
123
159
  {
124
- var obj = this.Get<object>(k);
160
+ var obj = this.get<object>(k);
125
161
  if (obj == null) return null;
126
162
 
127
163
  var objType = obj.GetType();
128
- if (objType == typeof(byte)) return this.GetByte(k);
129
- else if (objType == typeof(sbyte)) return this.GetSByte(k);
130
- else if (objType == typeof(short)) return this.GetShort(k);
131
- else if (objType == typeof(int)) return this.GetInt(k);
132
- else if (objType == typeof(float)) return this.GetFloat(k);
133
- else if (objType == typeof(long)) return this.GetLong(k);
134
- else if (objType == typeof(double)) return this.GetDouble(k);
135
- else if (objType == typeof(bool)) return this.GetBool(k);
136
- else if (objType == typeof(string)) return this.GetString(k);
137
- else if (objType == typeof(GNArray) || objType == typeof(System.Collections.IList)) return this.GetGNArray(k);
138
- else if (objType == typeof(GNHashtable) || objType == typeof(System.Collections.IDictionary)) return this.GetGNHashtable(k);
164
+ if (objType == typeof(byte)) return this.getByte(k);
165
+ else if (objType == typeof(sbyte)) return this.getSByte(k);
166
+ else if (objType == typeof(short)) return this.getShort(k);
167
+ else if (objType == typeof(int)) return this.getInt(k);
168
+ else if (objType == typeof(float)) return this.getFloat(k);
169
+ else if (objType == typeof(long)) return this.getLong(k);
170
+ else if (objType == typeof(double)) return this.getDouble(k);
171
+ else if (objType == typeof(bool)) return this.getBool(k);
172
+ else if (objType == typeof(string)) return this.getString(k);
173
+ else if (objType == typeof(GNArray) || objType == typeof(System.Collections.IList)) return this.getGNArray(k);
174
+ else if (objType == typeof(GNHashtable) || objType == typeof(System.Collections.IDictionary)) return this.getGNHashtable(k);
139
175
 
140
176
  return obj;
141
177
  }
142
178
 
143
- public byte GetByte(int k, byte defaultValue = 0)
179
+ public byte getByte(int k, byte defaultValue = 0)
144
180
  {
145
- return Convert.ToByte(this.Get(k, defaultValue));
181
+ return Convert.ToByte(this.get(k, defaultValue));
146
182
  }
147
183
 
148
- public sbyte GetSByte(int k, sbyte defaultValue = 0)
184
+ public sbyte getSByte(int k, sbyte defaultValue = 0)
149
185
  {
150
- return Convert.ToSByte(this.Get(k, defaultValue));
186
+ return Convert.ToSByte(this.get(k, defaultValue));
151
187
  }
152
188
 
153
- public short GetShort(int k, short defaultValue = 0)
189
+ public short getShort(int k, short defaultValue = 0)
154
190
  {
155
- return Convert.ToInt16(this.Get(k, defaultValue));
191
+ return Convert.ToInt16(this.get(k, defaultValue));
156
192
  }
157
193
 
158
- public int GetInt(int k, int defaultValue = 0)
194
+ public int getInt(int k, int defaultValue = 0)
159
195
  {
160
- return Convert.ToInt32(this.Get(k, defaultValue));
196
+ return Convert.ToInt32(this.get(k, defaultValue));
161
197
  }
162
198
 
163
- public float GetFloat(int k, float defaultValue = 0)
199
+ public float getFloat(int k, float defaultValue = 0)
164
200
  {
165
- return Convert.ToSingle(this.Get(k, defaultValue));
201
+ return Convert.ToSingle(this.get(k, defaultValue));
166
202
  }
167
203
 
168
- public long GetLong(int k, long defaultValue = 0)
204
+ public long getLong(int k, long defaultValue = 0)
169
205
  {
170
- return Convert.ToInt64(this.Get(k, defaultValue));
206
+ return Convert.ToInt64(this.get(k, defaultValue));
171
207
  }
172
208
 
173
- public double GetDouble(int k, double defaultValue = 0)
209
+ public double getDouble(int k, double defaultValue = 0)
174
210
  {
175
- return Convert.ToDouble(this.Get(k, defaultValue));
211
+ return Convert.ToDouble(this.get(k, defaultValue));
176
212
  }
177
213
 
178
- public bool GetBool(int k, bool defaultValue = false)
214
+ public bool getBool(int k, bool defaultValue = false)
179
215
  {
180
- return Convert.ToBoolean(this.Get(k, defaultValue));
216
+ return Convert.ToBoolean(this.get(k, defaultValue));
181
217
  }
182
218
 
183
- public string GetString(int k, string defaultValue = null)
219
+ public string getString(int k, string defaultValue = null)
184
220
  {
185
- return Convert.ToString(this.Get(k, defaultValue));
221
+ return Convert.ToString(this.get(k, defaultValue));
186
222
  }
187
223
 
188
- public object GetObject(int k, object defaultValue = null)
224
+ public object getObject(int k, object defaultValue = null)
189
225
  {
190
- return this.Get(k, defaultValue);
226
+ return this.get(k, defaultValue);
191
227
  }
192
228
 
193
- public T[] GetArray<T>(int k, T[] defaultValue = null)
229
+ public T[] getArray<T>(int k, T[] defaultValue = null)
194
230
  {
195
- var value0 = this.GetGNArray(k);
231
+ var value0 = this.getGNArray(k);
196
232
  if (value0 != null)
197
233
  {
198
- return value0.ToArray<T>();
234
+ return value0.toArray<T>();
199
235
  }
200
236
 
201
237
  return defaultValue;
202
238
  }
203
239
 
204
- public IList<T> GetList<T>(int k, IList<T> defaultValue = null)
240
+ public IList<T> getList<T>(int k, IList<T> defaultValue = null)
205
241
  {
206
- var value0 = this.GetGNArray(k);
242
+ var value0 = this.getGNArray(k);
207
243
  if (value0 != null)
208
244
  {
209
- return value0.ToList<T>();
245
+ return value0.toList<T>();
210
246
  }
211
247
 
212
248
  return defaultValue;
213
249
  }
214
250
 
215
- public GNArray GetGNArray(int k, GNArray defaultValue = null)
251
+ public GNArray getGNArray(int k, GNArray defaultValue = null)
216
252
  {
217
- return (GNArray)this.Get(k, defaultValue);
253
+ return (GNArray)this.get(k, defaultValue);
218
254
  }
219
255
 
220
- public GNHashtable GetGNHashtable(int k, GNHashtable defaultValue = null)
256
+ public GNHashtable getGNHashtable(int k, GNHashtable defaultValue = null)
221
257
  {
222
- return (GNHashtable)this.Get(k, defaultValue);
258
+ return (GNHashtable)this.get(k, defaultValue);
223
259
  }
224
260
 
225
- public override object ToData()
261
+ public override object toData()
226
262
  {
227
263
  var answer = new List<object>();
228
264
 
229
- foreach (var c in originArray)
265
+ foreach (var c in this.array)
230
266
  {
231
- answer.Add(CreateGNDataFromUseData(c));
267
+ answer.Add(GNData.createDataFromUseData(c));
232
268
  }
233
269
 
234
270
  return answer;
235
271
  }
236
272
 
237
- public override string ToString()
273
+ public override string toString()
238
274
  {
239
275
  var stringBuilder = new StringBuilder();
240
276
  stringBuilder.Append("[");
241
277
 
242
- for (var i = 0; i < originArray.Count; i++)
278
+ for (var i = 0; i < this.array.Count; i++)
243
279
  {
244
280
  if (i != 0) stringBuilder.Append(",");
245
281
 
246
- var value = originArray[i];
282
+ var value = this.array[i];
247
283
 
248
284
  if (value == null) stringBuilder.Append("null");
249
285
  else if (value is GNData gnData) stringBuilder.Append(gnData.ToString());
@@ -256,6 +292,11 @@
256
292
  return stringBuilder.ToString();
257
293
  }
258
294
 
295
+ public override string ToString()
296
+ {
297
+ return this.toString();
298
+ }
299
+
259
300
  }
260
301
 
261
302
  }
@@ -1,21 +1,25 @@
1
1
  namespace XmobiTea.GN.Common
2
2
  {
3
- public class GNData : IGNData
3
+
4
+ /// <summary>
5
+ /// The base class for GNData
6
+ /// </summary>
7
+ public abstract class GNData : IGNData
4
8
  {
5
- protected static object CreateUseDataFromOriginData(object value)
9
+ protected static object createUseDataFromOriginData(object value)
6
10
  {
7
11
  if (value == null) return null;
8
12
 
9
13
  if (value is System.Collections.IList list)
10
14
  {
11
- var answer = new GNArray.Builder().AddAll(list).Build();
15
+ var answer = new GNArray.Builder().addAll(list).build();
12
16
 
13
17
  return answer;
14
18
  }
15
19
 
16
20
  if (value is System.Collections.IDictionary dict)
17
21
  {
18
- var answer = new GNHashtable.Builder().AddAll(dict).Build();
22
+ var answer = new GNHashtable.Builder().addAll(dict).build();
19
23
 
20
24
  return answer;
21
25
  }
@@ -23,19 +27,21 @@
23
27
  return value;
24
28
  }
25
29
 
26
- protected static object CreateGNDataFromUseData(object value)
30
+ protected static object createDataFromUseData(object value)
27
31
  {
28
32
  if (value == null) return null;
29
33
 
30
34
  if (value is IGNData gnData)
31
35
  {
32
- return gnData.ToData();
36
+ return gnData.toData();
33
37
  }
34
38
 
35
39
  return value;
36
40
  }
37
41
 
38
- public virtual object ToData() { return null; }
42
+ public abstract object toData();
43
+
44
+ public abstract string toString();
39
45
 
40
46
  }
41
47