com.xmobitea.changx.gn-unity 2.0.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/Editor/GNServerSettingsEditor.cs +42 -322
  2. package/Runtime/Common/GNArray.cs +120 -35
  3. package/Runtime/Common/GNData.cs +19 -6
  4. package/Runtime/Common/GNHashtable.cs +174 -11
  5. package/Runtime/Common/IGNData.cs +11 -2
  6. package/Runtime/Config/GNServerSettings.cs +136 -92
  7. package/Runtime/Constant/Commands.cs +82 -19
  8. package/Runtime/Constant/EnumType/GoogleLoginType.cs +5 -5
  9. package/Runtime/Constant/EnumType/GroupStatus.cs +7 -7
  10. package/Runtime/Constant/EnumType/ItemType.cs +5 -5
  11. package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs +6 -6
  12. package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs +2 -2
  13. package/Runtime/Constant/EnumType/OwnerType.cs +3 -2
  14. package/Runtime/Constant/EnumType/PushPlatformType.cs +10 -0
  15. package/Runtime/Constant/EnumType/PushPlatformType.cs.meta +11 -0
  16. package/Runtime/Constant/EnumType/RequestType.cs +1 -0
  17. package/Runtime/Constant/EnumType/StoreReceiveType.cs +13 -0
  18. package/Runtime/Constant/EnumType/StoreReceiveType.cs.meta +11 -0
  19. package/Runtime/Constant/ErrorCode/GNErrorCode.cs +53 -48
  20. package/Runtime/Constant/EventCode.cs +29 -2
  21. package/Runtime/Constant/OperationCode.cs +249 -211
  22. package/Runtime/Constant/ParameterCode/GNParameterCode.cs +610 -466
  23. package/Runtime/Constant/ReturnCode.cs +50 -2
  24. package/Runtime/Entity/DataMember.cs +221 -3
  25. package/Runtime/Entity/GNMetadata.cs +46 -1
  26. package/Runtime/Entity/InvalidMember.cs +24 -5
  27. package/Runtime/Entity/Models/AuthenticateModels.cs +251 -207
  28. package/Runtime/Entity/Models/AuthenticateRequestModels.cs +153 -131
  29. package/Runtime/Entity/Models/AuthenticateResponseModels.cs +61 -51
  30. package/Runtime/Entity/Models/CharacterPlayerModels.cs +985 -849
  31. package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs +957 -885
  32. package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs +165 -150
  33. package/Runtime/Entity/Models/CloudScriptModels.cs +185 -0
  34. package/Runtime/Entity/Models/CloudScriptModels.cs.meta +11 -0
  35. package/Runtime/Entity/Models/CloudScriptRequestModels.cs +134 -0
  36. package/Runtime/Entity/Models/CloudScriptRequestModels.cs.meta +11 -0
  37. package/Runtime/Entity/Models/CloudScriptResponseModels.cs +34 -0
  38. package/Runtime/Entity/Models/CloudScriptResponseModels.cs.meta +11 -0
  39. package/Runtime/Entity/Models/ContentModels.cs +150 -153
  40. package/Runtime/Entity/Models/ContentRequestModels.cs +129 -129
  41. package/Runtime/Entity/Models/ContentResponseModels.cs +24 -24
  42. package/Runtime/Entity/Models/DashboardModels.cs +1684 -1156
  43. package/Runtime/Entity/Models/DashboardRequestModels.cs +220 -147
  44. package/Runtime/Entity/Models/DashboardResponseModels.cs +92 -57
  45. package/Runtime/Entity/Models/GamePlayerModels.cs +1073 -933
  46. package/Runtime/Entity/Models/GamePlayerRequestModels.cs +939 -867
  47. package/Runtime/Entity/Models/GamePlayerResponseModels.cs +162 -147
  48. package/Runtime/Entity/Models/GenericModels.cs +102 -102
  49. package/Runtime/Entity/Models/GroupModels.cs +812 -676
  50. package/Runtime/Entity/Models/GroupRequestModels.cs +741 -669
  51. package/Runtime/Entity/Models/GroupResponseModels.cs +129 -114
  52. package/Runtime/Entity/Models/InventoryModels.cs +667 -558
  53. package/Runtime/Entity/Models/InventoryRequestModels.cs +626 -579
  54. package/Runtime/Entity/Models/InventoryResponseModels.cs +109 -99
  55. package/Runtime/Entity/Models/MasterPlayerModels.cs +1882 -1340
  56. package/Runtime/Entity/Models/MasterPlayerRequestModels.cs +1643 -1253
  57. package/Runtime/Entity/Models/MasterPlayerResponseModels.cs +293 -213
  58. package/Runtime/Entity/Models/MultiplayerModels.cs +293 -223
  59. package/Runtime/Entity/Models/MultiplayerRequestModels.cs +199 -149
  60. package/Runtime/Entity/Models/MultiplayerResponseModels.cs +10 -0
  61. package/Runtime/Entity/Models/StoreInventoryModels.cs +514 -323
  62. package/Runtime/Entity/Models/StoreInventoryRequestModels.cs +236 -165
  63. package/Runtime/Entity/Models/StoreInventoryResponseModels.cs +45 -30
  64. package/Runtime/Entity/OperationEvent.cs +43 -7
  65. package/Runtime/Entity/OperationHelper.cs +18 -2
  66. package/Runtime/Entity/OperationRequest.cs +80 -37
  67. package/Runtime/Entity/OperationResponse.cs +111 -63
  68. package/Runtime/Entity/Request/CustomOperationRequest.cs +53 -2
  69. package/Runtime/Entity/Response/CustomOperationResponse.cs +25 -4
  70. package/Runtime/GNNetwork.cs +333 -21
  71. package/Runtime/GNNetworkApi.cs +25 -13
  72. package/Runtime/GNNetworkAuthenticateApi.cs +531 -98
  73. package/Runtime/GNNetworkCharacterPlayerApi.cs +1587 -762
  74. package/Runtime/GNNetworkCloudScriptApi.cs +181 -0
  75. package/Runtime/GNNetworkCloudScriptApi.cs.meta +11 -0
  76. package/Runtime/GNNetworkContentApi.cs +238 -132
  77. package/Runtime/GNNetworkDashboardApi.cs +278 -117
  78. package/Runtime/GNNetworkGamePlayerApi.cs +1558 -747
  79. package/Runtime/GNNetworkGroupApi.cs +1228 -582
  80. package/Runtime/GNNetworkInventoryApi.cs +1048 -507
  81. package/Runtime/GNNetworkMasterPlayerApi.cs +2586 -1067
  82. package/Runtime/GNNetworkMultiplayerApi.cs +328 -147
  83. package/Runtime/GNNetworkStoreInventoryApi.cs +388 -162
  84. package/Runtime/Helper/CodeHelper.cs +45 -3
  85. package/Runtime/Helper/ConverterService.cs +240 -85
  86. package/Runtime/Logger/GNDebug.cs +46 -3
  87. package/Runtime/Networking/AuthenticateStatus.cs +30 -8
  88. package/Runtime/Networking/Handler/IServerEventHandler.cs +8 -8
  89. package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs +31 -2
  90. package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs +24 -3
  91. package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs +24 -2
  92. package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs +24 -2
  93. package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs +21 -2
  94. package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs +20 -2
  95. package/Runtime/Networking/Http/HttpPeer.cs +68 -25
  96. package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs +44 -4
  97. package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs +63 -40
  98. package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs +43 -13
  99. package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs +72 -39
  100. package/Runtime/Networking/IPeer.cs +24 -2
  101. package/Runtime/Networking/NetworkingPeer.cs +64 -10
  102. package/Runtime/Networking/NetworkingPeerAPI.cs +20 -21
  103. package/Runtime/Networking/OperationPending.cs +79 -15
  104. package/Runtime/Networking/PeerBase.cs +86 -23
  105. package/Runtime/Networking/Socket/NetworkingPeerSocketV2.cs +57 -18
  106. package/Runtime/Networking/Socket/NetworkingPeerSocketV3.cs +70 -10
  107. package/Runtime/Networking/Socket/NetworkingSocketPeerBase.cs +165 -23
  108. package/Runtime/Networking/Socket/SocketPeer.cs +63 -12
  109. package/Runtime/Unity/ServiceCoroutine.cs +10 -0
  110. package/Runtime/Unity/ServiceCoroutine.cs.meta +11 -0
  111. package/Runtime/Unity/ServiceUpdate.cs +14 -1
  112. package/package.json +1 -1
@@ -6,44 +6,76 @@
6
6
 
7
7
  using XmobiTea.GN.Constant;
8
8
 
9
+ /// <summary>
10
+ /// Base class for managing code-to-name mappings.
11
+ /// </summary>
9
12
  internal class CodeHelperBase
10
13
  {
11
14
  private static string unknownCode = "Unknown";
12
15
 
16
+ // Dictionary to map codes to their names.
13
17
  private Dictionary<int, string> codeDict;
14
18
 
19
+ /// <summary>
20
+ /// Retrieves the name associated with a code.
21
+ /// </summary>
22
+ /// <param name="code">The code to look up.</param>
23
+ /// <returns>The name associated with the code or "Unknown" if not found.</returns>
15
24
  public string getCodeName(int code)
16
25
  {
17
26
  return this.codeDict.ContainsKey(code) ? this.codeDict[code] : CodeHelperBase.unknownCode;
18
27
  }
19
28
 
29
+ /// <summary>
30
+ /// Constructor to initialize the code dictionary.
31
+ /// </summary>
32
+ /// <param name="codeDict">The dictionary mapping codes to names.</param>
20
33
  public CodeHelperBase(Dictionary<int, string> codeDict)
21
34
  {
22
35
  this.codeDict = codeDict;
23
36
  }
24
37
  }
25
38
 
39
+ /// <summary>
40
+ /// Provides utility methods for retrieving names of operation, event, and return codes.
41
+ /// </summary>
26
42
  public class CodeHelper
27
43
  {
28
44
  private static CodeHelperBase operationCodeHelper;
29
45
  private static CodeHelperBase eventCodeHelper;
30
46
  private static CodeHelperBase returnCodeHelper;
31
47
 
48
+ /// <summary>
49
+ /// Gets the name of an operation code.
50
+ /// </summary>
51
+ /// <param name="operationCode">The operation code to look up.</param>
52
+ /// <returns>The name of the operation code.</returns>
32
53
  public static string getOperationCodeName(int operationCode)
33
54
  {
34
55
  return CodeHelper.operationCodeHelper.getCodeName(operationCode);
35
56
  }
36
57
 
58
+ /// <summary>
59
+ /// Gets the name of an event code.
60
+ /// </summary>
61
+ /// <param name="eventCode">The event code to look up.</param>
62
+ /// <returns>The name of the event code.</returns>
37
63
  public static string getEventCodeName(int eventCode)
38
64
  {
39
65
  return CodeHelper.eventCodeHelper.getCodeName(eventCode);
40
66
  }
41
67
 
68
+ /// <summary>
69
+ /// Gets the name of a return code.
70
+ /// </summary>
71
+ /// <param name="returnCode">The return code to look up.</param>
72
+ /// <returns>The name of the return code.</returns>
42
73
  public static string getReturnCodeName(int returnCode)
43
74
  {
44
75
  return CodeHelper.returnCodeHelper.getCodeName(returnCode);
45
76
  }
46
77
 
78
+ // Static constructor to initialize the helper dictionaries.
47
79
  static CodeHelper()
48
80
  {
49
81
  CodeHelper.setOperationCodeDic();
@@ -51,10 +83,14 @@
51
83
  CodeHelper.setReturnCodeDic();
52
84
  }
53
85
 
86
+ /// <summary>
87
+ /// Sets up the operation code dictionary by reflecting on the OperationCode class.
88
+ /// </summary>
54
89
  private static void setOperationCodeDic()
55
90
  {
56
91
  var codeDict = new Dictionary<int, string>();
57
92
 
93
+ // Retrieve all public static fields in the OperationCode class.
58
94
  var fields = typeof(OperationCode).GetFields(BindingFlags.Public | BindingFlags.Static);
59
95
 
60
96
  foreach (var field in fields)
@@ -65,10 +101,14 @@
65
101
  CodeHelper.operationCodeHelper = new CodeHelperBase(codeDict);
66
102
  }
67
103
 
104
+ /// <summary>
105
+ /// Sets up the event code dictionary by reflecting on the EventCode class.
106
+ /// </summary>
68
107
  private static void setEventCodeDic()
69
108
  {
70
109
  var codeDict = new Dictionary<int, string>();
71
110
 
111
+ // Retrieve all public static fields in the EventCode class.
72
112
  var fields = typeof(EventCode).GetFields(BindingFlags.Public | BindingFlags.Static);
73
113
 
74
114
  foreach (var field in fields)
@@ -79,10 +119,14 @@
79
119
  CodeHelper.eventCodeHelper = new CodeHelperBase(codeDict);
80
120
  }
81
121
 
122
+ /// <summary>
123
+ /// Sets up the return code dictionary by reflecting on the ReturnCode class.
124
+ /// </summary>
82
125
  private static void setReturnCodeDic()
83
126
  {
84
127
  var codeDict = new Dictionary<int, string>();
85
128
 
129
+ // Retrieve all public static fields in the ReturnCode class.
86
130
  var fields = typeof(ReturnCode).GetFields(BindingFlags.Public | BindingFlags.Static);
87
131
 
88
132
  foreach (var field in fields)
@@ -92,7 +136,5 @@
92
136
 
93
137
  CodeHelper.returnCodeHelper = new CodeHelperBase(codeDict);
94
138
  }
95
-
96
139
  }
97
-
98
- }
140
+ }