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
@@ -1,30 +1,93 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
- public class Commands
4
- {
5
- public const string USER_AGENT = "User-Agent";
3
+ /// <summary>
4
+ /// Holds constant values used throughout the GN networking system.
5
+ /// </summary>
6
+ public class Commands
7
+ {
8
+ /// <summary>
9
+ /// HTTP header key for specifying the user agent.
10
+ /// </summary>
11
+ public const string USER_AGENT = "User-Agent";
6
12
 
7
- public const string CONTENT_TYPE = "Content-Type";
8
- public const string CONTENT_LENGTH = "Content-Length";
9
- public const string APPLICATION_JSON = "application/json";
10
- public const string APPLICATION_MSGPACK = "application/msgpack";
13
+ /// <summary>
14
+ /// HTTP header key for specifying the content type.
15
+ /// </summary>
16
+ public const string CONTENT_TYPE = "Content-Type";
11
17
 
12
- public const string RequestAuthTokenCmd = "a";
13
- public const string RequestSecretCmd = "s";
18
+ /// <summary>
19
+ /// HTTP header key for specifying the content length.
20
+ /// </summary>
21
+ public const string CONTENT_LENGTH = "Content-Length";
14
22
 
15
- public const string RequestCmd_MsgPack = "r";
16
- public const string ResponseCmd_MsgPack = "r";
17
- public const string EventCmd_MsgPack = "e";
23
+ /// <summary>
24
+ /// MIME type for JSON content.
25
+ /// </summary>
26
+ public const string APPLICATION_JSON = "application/json";
18
27
 
19
- public const string RequestCmd_Json = "t";
20
- public const string ResponseCmd_Json = "t";
21
- public const string EventCmd_Json = "y";
28
+ /// <summary>
29
+ /// MIME type for MsgPack content.
30
+ /// </summary>
31
+ public const string APPLICATION_MSGPACK = "application/msgpack";
22
32
 
23
- public const string Data = "d";
24
- public const string File = "f";
33
+ /// <summary>
34
+ /// Key for the authentication token in requests.
35
+ /// </summary>
36
+ public const string RequestAuthTokenCmd = "a";
25
37
 
26
- private Commands() { }
38
+ /// <summary>
39
+ /// Key for the secret key in requests.
40
+ /// </summary>
41
+ public const string RequestSecretCmd = "s";
27
42
 
28
- }
43
+ /// <summary>
44
+ /// Key for the gameId key in requests.
45
+ /// </summary>
46
+ public const string RequestGameIdCmd = "g";
29
47
 
48
+ /// <summary>
49
+ /// Key for MsgPack request commands.
50
+ /// </summary>
51
+ public const string RequestCmd_MsgPack = "r";
52
+
53
+ /// <summary>
54
+ /// Key for MsgPack response commands.
55
+ /// </summary>
56
+ public const string ResponseCmd_MsgPack = "r";
57
+
58
+ /// <summary>
59
+ /// Key for MsgPack event commands.
60
+ /// </summary>
61
+ public const string EventCmd_MsgPack = "e";
62
+
63
+ /// <summary>
64
+ /// Key for JSON request commands.
65
+ /// </summary>
66
+ public const string RequestCmd_Json = "t";
67
+
68
+ /// <summary>
69
+ /// Key for JSON response commands.
70
+ /// </summary>
71
+ public const string ResponseCmd_Json = "t";
72
+
73
+ /// <summary>
74
+ /// Key for JSON event commands.
75
+ /// </summary>
76
+ public const string EventCmd_Json = "y";
77
+
78
+ /// <summary>
79
+ /// General key for data fields.
80
+ /// </summary>
81
+ public const string Data = "d";
82
+
83
+ /// <summary>
84
+ /// Key for file fields.
85
+ /// </summary>
86
+ public const string File = "f";
87
+
88
+ /// <summary>
89
+ /// Private constructor to prevent instantiation of this utility class.
90
+ /// </summary>
91
+ private Commands() { }
92
+ }
30
93
  }
@@ -1,10 +1,10 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
- public enum GoogleLoginType
4
- {
5
- AccessToken = 1,
6
- IdToken = 2,
3
+ public enum GoogleLoginType
4
+ {
5
+ AccessToken = 1,
6
+ IdToken = 2,
7
7
 
8
- }
8
+ }
9
9
 
10
10
  }
@@ -1,12 +1,12 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
- public enum GroupStatus
4
- {
5
- Member = 1,
6
- WaitingAccept = 2,
7
- SentRequestAndWaitingAccept = 3,
8
- NotMember = 4,
3
+ public enum GroupStatus
4
+ {
5
+ Member = 1,
6
+ WaitingAccept = 2,
7
+ SentRequestAndWaitingAccept = 3,
8
+ NotMember = 4,
9
9
 
10
- }
10
+ }
11
11
 
12
12
  }
@@ -1,10 +1,10 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
- public enum ItemType
4
- {
5
- NonComsumable = 1,
6
- Consumable = 2,
3
+ public enum ItemType
4
+ {
5
+ NonComsumable = 1,
6
+ Consumable = 2,
7
7
 
8
- }
8
+ }
9
9
 
10
10
  }
@@ -1,11 +1,11 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
- public enum MatchmakingMemberStatus
4
- {
5
- Pending = 1,
6
- Joined = 2,
7
- Canceled = 3,
3
+ public enum MatchmakingMemberStatus
4
+ {
5
+ Pending = 1,
6
+ Joined = 2,
7
+ Canceled = 3,
8
8
 
9
- }
9
+ }
10
10
 
11
11
  }
@@ -1,7 +1,7 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
- public enum MatchmakingTicketStatus
4
- {
3
+ public enum MatchmakingTicketStatus
4
+ {
5
5
  WaitingForMembers = 1,
6
6
  WaitingForMatch = 2,
7
7
  WaitingForServer = 3,
@@ -1,11 +1,12 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
- public enum OwnerType
4
- {
3
+ public enum OwnerType
4
+ {
5
5
  MasterPlayer = 1,
6
6
  GamePlayer = 2,
7
7
  CharacterPlayer = 3,
8
8
  Group = 4,
9
+ Inventory = 5,
9
10
 
10
11
  }
11
12
 
@@ -0,0 +1,10 @@
1
+ namespace XmobiTea.GN.Constant
2
+ {
3
+ public enum PushPlatformType
4
+ {
5
+ Android = 1,
6
+ iOS = 2,
7
+
8
+ }
9
+
10
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: e5328234caeb42a4aaeea3b94e7063f1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -13,6 +13,7 @@
13
13
  StoreInventory = 8,
14
14
  Dashboard = 9,
15
15
  Multiplayer = 10,
16
+ CloudScript = 11,
16
17
 
17
18
  }
18
19
 
@@ -0,0 +1,13 @@
1
+ namespace XmobiTea.GN.Constant
2
+ {
3
+ public enum StoreReceiveType
4
+ {
5
+ Buy = 1,
6
+ Present = 2,
7
+ AppleAppStore = 3,
8
+ FacebookStore = 4,
9
+ GooglePlayStore = 5,
10
+
11
+ }
12
+
13
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a1a2d4775563b0543ba4df31fb969322
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,54 +1,59 @@
1
- namespace XmobiTea.GN.Constant {
1
+ namespace XmobiTea.GN.Constant
2
+ {
2
3
  public partial class GNErrorCode
3
- {
4
- public const int Ok = 1;
4
+ {
5
+ public const int Ok = 1;
5
6
 
6
- public const int AccountNotFound = 2;
7
- public const int AccountPasswordWrong = 3;
8
- public const int AccountUsernameExists = 4;
9
- public const int VerifyTokenError = 5;
10
- public const int ServiceNameNotFound = 6;
11
- public const int CharacterPlayerNotFound = 7;
12
- public const int NotEnoughCurrency = 8;
13
- public const int KeyNotFound = 9;
14
- public const int ItemNotFound = 10;
15
- public const int CatalogIdNotFound = 11;
16
- public const int GroupNotFound = 12;
17
- public const int OwnerNotFound = 13;
18
- public const int ClassIdNotFound = 14;
19
- public const int MemberNotFound = 15;
20
- public const int PlayerNotMember = 16;
21
- public const int GamePlayerNotFound = 17;
22
- public const int FileNotFound = 18;
23
- public const int FileNotUpload = 19;
24
- public const int OwnerTypeNotSupport = 20;
25
- public const int ItemNotComsumable = 21;
26
- public const int GameNotFound = 22;
27
- public const int GameIsExists = 23;
28
- public const int SecretInfoNotFound = 24;
29
- public const int SecretInfoIsExists = 25;
30
- public const int ExternalNotLinked = 26;
31
- public const int ExternalLinkedOtherAccount = 27;
32
- public const int ExternalLinkedOtherValue = 28;
33
- public const int MasterPlayerNotFound = 29;
34
- public const int StoreItemNotFound = 30;
35
- public const int BuyerNotFound = 31;
36
- public const int CanNotBuyThisStoreItem = 32;
37
- public const int ExceptionWhenValidateReceipt = 33;
38
- public const int StoreInvalid = 34;
39
- public const int ReceiptInvalid = 35;
40
- public const int StoreItemHadBeenRemove = 36;
41
- public const int DisplayNameHasUse = 37;
42
- public const int PlayerBan = 38;
7
+ public const int AccountNotFound = 2;
8
+ public const int AccountPasswordWrong = 3;
9
+ public const int AccountUsernameExists = 4;
10
+ public const int VerifyTokenError = 5;
11
+ public const int ServiceNameNotFound = 6;
12
+ public const int CharacterPlayerNotFound = 7;
13
+ public const int NotEnoughCurrency = 8;
14
+ public const int KeyNotFound = 9;
15
+ public const int ItemNotFound = 10;
16
+ public const int CatalogIdNotFound = 11;
17
+ public const int GroupNotFound = 12;
18
+ public const int OwnerNotFound = 13;
19
+ public const int ClassIdNotFound = 14;
20
+ public const int MemberNotFound = 15;
21
+ public const int PlayerNotMember = 16;
22
+ public const int GamePlayerNotFound = 17;
23
+ public const int FileNotFound = 18;
24
+ public const int FileNotUpload = 19;
25
+ public const int OwnerTypeNotSupport = 20;
26
+ public const int ItemNotComsumable = 21;
27
+ public const int GameNotFound = 22;
28
+ public const int GameIsExists = 23;
29
+ public const int SecretInfoNotFound = 24;
30
+ public const int SecretInfoIsExists = 25;
31
+ public const int ExternalNotLinked = 26;
32
+ public const int ExternalLinkedOtherAccount = 27;
33
+ public const int ExternalLinkedOtherValue = 28;
34
+ public const int MasterPlayerNotFound = 29;
35
+ public const int StoreItemNotFound = 30;
36
+ public const int BuyerNotFound = 31;
37
+ public const int CanNotBuyThisStoreItem = 32;
38
+ public const int ExceptionWhenValidateReceipt = 33;
39
+ public const int StoreInvalid = 34;
40
+ public const int ReceiptInvalid = 35;
41
+ public const int StoreItemHadBeenRemove = 36;
42
+ public const int DisplayNameHasUse = 37;
43
+ public const int PlayerBan = 38;
43
44
 
44
- public const int MatchmakingTicketNotFound = 39;
45
- public const int MatchmakingTicketAlreadyCompleted = 40;
46
- public const int MatchmakingPlayerHasNotJoinedTicket = 41;
47
- public const int MatchNotFound = 42;
48
- public const int MatchmakingPlayerHasJoinedOtherTicket = 43;
49
- public const int MatchmakingQueueNotFound = 44;
50
- public const int TicketSizeError = 45;
45
+ public const int MatchmakingTicketNotFound = 39;
46
+ public const int MatchmakingTicketAlreadyCompleted = 40;
47
+ public const int MatchmakingPlayerHasNotJoinedTicket = 41;
48
+ public const int MatchNotFound = 42;
49
+ public const int MatchmakingPlayerHasJoinedOtherTicket = 43;
50
+ public const int MatchmakingQueueNotFound = 44;
51
+ public const int TicketSizeError = 45;
51
52
 
52
- }
53
+ public const int ExecuteError = 46;
54
+ public const int VersionInvalid = 47;
55
+ public const int EmailInvalid = 48;
56
+
57
+ }
53
58
 
54
59
  }
@@ -1,16 +1,43 @@
1
1
  namespace XmobiTea.GN.Constant
2
2
  {
3
+ /// <summary>
4
+ /// Defines constant event codes for handling various server events.
5
+ /// </summary>
3
6
  public partial class EventCode
4
7
  {
8
+ /// <summary>
9
+ /// Event code for when a game player's friend list is updated.
10
+ /// </summary>
5
11
  public const int OnGamePlayerFriendUpdate = 1;
12
+
13
+ /// <summary>
14
+ /// Event code for when a character player's friend list is updated.
15
+ /// </summary>
6
16
  public const int OnCharacterPlayerFriendUpdate = 2;
17
+
18
+ /// <summary>
19
+ /// Event code for when a game player's group list is updated.
20
+ /// </summary>
7
21
  public const int OnGamePlayerGroupUpdate = 3;
22
+
23
+ /// <summary>
24
+ /// Event code for when a group member's details are updated.
25
+ /// </summary>
8
26
  public const int OnGroupMemberUpdate = 4;
27
+
28
+ /// <summary>
29
+ /// Event code for when group messages are updated.
30
+ /// </summary>
9
31
  public const int OnGroupMessageUpdate = 5;
32
+
33
+ /// <summary>
34
+ /// Event code for when a character player's group list is updated.
35
+ /// </summary>
10
36
  public const int OnCharacterPlayerGroupUpdate = 6;
11
37
 
38
+ /// <summary>
39
+ /// Private constructor to prevent instantiation of this utility class.
40
+ /// </summary>
12
41
  private EventCode() { }
13
-
14
42
  }
15
-
16
43
  }