com.xmobitea.changx.gn-unity 2.0.3 → 2.4.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.
- package/Editor/GNServerSettingsEditor.cs +16 -300
- package/Runtime/Common/GNArray.cs +387 -302
- package/Runtime/Common/GNArray.cs.meta +11 -11
- package/Runtime/Common/GNData.cs +61 -48
- package/Runtime/Common/GNData.cs.meta +11 -11
- package/Runtime/Common/GNHashtable.cs +404 -241
- package/Runtime/Common/GNHashtable.cs.meta +11 -11
- package/Runtime/Common/IGNData.cs +20 -11
- package/Runtime/Common/IGNData.cs.meta +11 -11
- package/Runtime/Common.meta +8 -8
- package/Runtime/Config/GNServerSettings.cs +136 -92
- package/Runtime/Config/GNServerSettings.cs.meta +11 -11
- package/Runtime/Config.meta +8 -8
- package/Runtime/Constant/Commands.cs +82 -19
- package/Runtime/Constant/Commands.cs.meta +11 -11
- package/Runtime/Constant/EnumType/FriendStatus.cs +12 -12
- package/Runtime/Constant/EnumType/FriendStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/GoogleLoginType.cs +5 -5
- package/Runtime/Constant/EnumType/GoogleLoginType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/GroupStatus.cs +7 -7
- package/Runtime/Constant/EnumType/GroupStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/InvalidMemberType.cs +23 -23
- package/Runtime/Constant/EnumType/InvalidMemberType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/ItemType.cs +5 -5
- package/Runtime/Constant/EnumType/ItemType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs +6 -6
- package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs +2 -2
- package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/OwnerType.cs +3 -2
- package/Runtime/Constant/EnumType/OwnerType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/PermissionDataItem.cs +10 -10
- package/Runtime/Constant/EnumType/PermissionDataItem.cs.meta +11 -11
- package/Runtime/Constant/EnumType/PushPlatformType.cs +10 -0
- package/Runtime/Constant/EnumType/PushPlatformType.cs.meta +11 -0
- package/Runtime/Constant/EnumType/RequestRole.cs +11 -11
- package/Runtime/Constant/EnumType/RequestRole.cs.meta +7 -7
- package/Runtime/Constant/EnumType/RequestType.cs +20 -19
- package/Runtime/Constant/EnumType/RequestType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/StoreReceiveType.cs +13 -0
- package/Runtime/Constant/EnumType/StoreReceiveType.cs.meta +11 -0
- package/Runtime/Constant/EnumType.meta +8 -8
- package/Runtime/Constant/ErrorCode/GNErrorCode.cs +53 -48
- package/Runtime/Constant/ErrorCode/GNErrorCode.cs.meta +7 -7
- package/Runtime/Constant/ErrorCode.meta +8 -8
- package/Runtime/Constant/EventCode.cs +43 -16
- package/Runtime/Constant/EventCode.cs.meta +11 -11
- package/Runtime/Constant/OperationCode.cs +249 -211
- package/Runtime/Constant/OperationCode.cs.meta +11 -11
- package/Runtime/Constant/ParameterCode/GNParameterCode.cs +614 -466
- package/Runtime/Constant/ParameterCode/GNParameterCode.cs.meta +11 -11
- package/Runtime/Constant/ParameterCode/ParameterCode.cs +12 -12
- package/Runtime/Constant/ParameterCode/ParameterCode.cs.meta +11 -11
- package/Runtime/Constant/ParameterCode.meta +8 -8
- package/Runtime/Constant/ReturnCode.cs +73 -25
- package/Runtime/Constant/ReturnCode.cs.meta +11 -11
- package/Runtime/Constant.meta +8 -8
- package/Runtime/Entity/DataMember.cs +342 -124
- package/Runtime/Entity/DataMember.cs.meta +11 -11
- package/Runtime/Entity/GNMetadata.cs +72 -27
- package/Runtime/Entity/GNMetadata.cs.meta +11 -11
- package/Runtime/Entity/InvalidMember.cs +52 -33
- package/Runtime/Entity/InvalidMember.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateModels.cs +251 -207
- package/Runtime/Entity/Models/AuthenticateModels.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateRequestModels.cs +153 -131
- package/Runtime/Entity/Models/AuthenticateRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateResponseModels.cs +61 -51
- package/Runtime/Entity/Models/AuthenticateResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerModels.cs +985 -849
- package/Runtime/Entity/Models/CharacterPlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs +957 -885
- package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs +165 -150
- package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CloudScriptModels.cs +185 -0
- package/Runtime/Entity/Models/CloudScriptModels.cs.meta +11 -0
- package/Runtime/Entity/Models/CloudScriptRequestModels.cs +134 -0
- package/Runtime/Entity/Models/CloudScriptRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/CloudScriptResponseModels.cs +34 -0
- package/Runtime/Entity/Models/CloudScriptResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/ContentModels.cs +150 -153
- package/Runtime/Entity/Models/ContentModels.cs.meta +11 -11
- package/Runtime/Entity/Models/ContentRequestModels.cs +129 -129
- package/Runtime/Entity/Models/ContentRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/ContentResponseModels.cs +24 -24
- package/Runtime/Entity/Models/ContentResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardModels.cs +1684 -1156
- package/Runtime/Entity/Models/DashboardModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardRequestModels.cs +220 -147
- package/Runtime/Entity/Models/DashboardRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardResponseModels.cs +92 -57
- package/Runtime/Entity/Models/DashboardResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerModels.cs +1073 -933
- package/Runtime/Entity/Models/GamePlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerRequestModels.cs +939 -867
- package/Runtime/Entity/Models/GamePlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerResponseModels.cs +162 -147
- package/Runtime/Entity/Models/GamePlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GenericModels.cs +102 -102
- package/Runtime/Entity/Models/GenericModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupModels.cs +812 -676
- package/Runtime/Entity/Models/GroupModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupRequestModels.cs +741 -669
- package/Runtime/Entity/Models/GroupRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupResponseModels.cs +129 -114
- package/Runtime/Entity/Models/GroupResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryModels.cs +667 -558
- package/Runtime/Entity/Models/InventoryModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryRequestModels.cs +626 -579
- package/Runtime/Entity/Models/InventoryRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryResponseModels.cs +109 -99
- package/Runtime/Entity/Models/InventoryResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerModels.cs +1882 -1340
- package/Runtime/Entity/Models/MasterPlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerRequestModels.cs +1643 -1253
- package/Runtime/Entity/Models/MasterPlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs +293 -213
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerModels.cs +293 -223
- package/Runtime/Entity/Models/MultiplayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs +199 -149
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs +59 -49
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryModels.cs +514 -323
- package/Runtime/Entity/Models/StoreInventoryModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryRequestModels.cs +236 -165
- package/Runtime/Entity/Models/StoreInventoryRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryResponseModels.cs +45 -30
- package/Runtime/Entity/Models/StoreInventoryResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models.meta +8 -8
- package/Runtime/Entity/OperationEvent.cs +111 -75
- package/Runtime/Entity/OperationEvent.cs.meta +11 -11
- package/Runtime/Entity/OperationHelper.cs +51 -35
- package/Runtime/Entity/OperationHelper.cs.meta +11 -11
- package/Runtime/Entity/OperationRequest.cs +142 -99
- package/Runtime/Entity/OperationRequest.cs.meta +11 -11
- package/Runtime/Entity/OperationResponse.cs +111 -63
- package/Runtime/Entity/OperationResponse.cs.meta +11 -11
- package/Runtime/Entity/Request/CustomOperationRequest.cs +112 -61
- package/Runtime/Entity/Request/CustomOperationRequest.cs.meta +11 -11
- package/Runtime/Entity/Request.meta +8 -8
- package/Runtime/Entity/Response/CustomOperationResponse.cs +84 -63
- package/Runtime/Entity/Response/CustomOperationResponse.cs.meta +11 -11
- package/Runtime/Entity/Response.meta +8 -8
- package/Runtime/Entity.meta +8 -8
- package/Runtime/GNNetwork.cs +501 -182
- package/Runtime/GNNetwork.cs.meta +11 -11
- package/Runtime/GNNetworkApi.cs +38 -19
- package/Runtime/GNNetworkApi.cs.meta +11 -11
- package/Runtime/GNNetworkAuthenticateApi.cs +531 -98
- package/Runtime/GNNetworkAuthenticateApi.cs.meta +11 -11
- package/Runtime/GNNetworkCharacterPlayerApi.cs +1587 -762
- package/Runtime/GNNetworkCharacterPlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkCloudScriptApi.cs +181 -0
- package/Runtime/GNNetworkCloudScriptApi.cs.meta +11 -0
- package/Runtime/GNNetworkContentApi.cs +238 -132
- package/Runtime/GNNetworkContentApi.cs.meta +11 -11
- package/Runtime/GNNetworkDashboardApi.cs +278 -117
- package/Runtime/GNNetworkDashboardApi.cs.meta +11 -11
- package/Runtime/GNNetworkGamePlayerApi.cs +1558 -747
- package/Runtime/GNNetworkGamePlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkGroupApi.cs +1228 -582
- package/Runtime/GNNetworkGroupApi.cs.meta +11 -11
- package/Runtime/GNNetworkInventoryApi.cs +1048 -507
- package/Runtime/GNNetworkInventoryApi.cs.meta +11 -11
- package/Runtime/GNNetworkMasterPlayerApi.cs +2586 -1067
- package/Runtime/GNNetworkMasterPlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkMultiplayerApi.cs +328 -147
- package/Runtime/GNNetworkMultiplayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkStoreInventoryApi.cs +388 -162
- package/Runtime/GNNetworkStoreInventoryApi.cs.meta +11 -11
- package/Runtime/Helper/CodeHelper.cs +140 -98
- package/Runtime/Helper/CodeHelper.cs.meta +11 -11
- package/Runtime/Helper/ConverterService.cs +236 -52
- package/Runtime/Helper/ConverterService.cs.meta +11 -11
- package/Runtime/Helper/ParseGNHelper.cs +451 -451
- package/Runtime/Helper/ParseGNHelper.cs.meta +11 -11
- package/Runtime/Helper.meta +8 -8
- package/Runtime/Logger/GNDebug.cs +92 -49
- package/Runtime/Logger/GNDebug.cs.meta +11 -11
- package/Runtime/Logger.meta +8 -8
- package/Runtime/Networking/AuthenticateStatus.cs +57 -35
- package/Runtime/Networking/AuthenticateStatus.cs.meta +11 -11
- package/Runtime/Networking/Handler/IServerEventHandler.cs +25 -25
- package/Runtime/Networking/Handler/IServerEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs +61 -32
- package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs +54 -33
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs +54 -32
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs +54 -32
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs +48 -29
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs +47 -29
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler.meta +8 -8
- package/Runtime/Networking/Http/HttpPeer.cs +68 -25
- package/Runtime/Networking/Http/HttpPeer.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs +65 -25
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs +513 -486
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs +172 -142
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs +225 -188
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs.meta +11 -11
- package/Runtime/Networking/Http.meta +8 -8
- package/Runtime/Networking/IPeer.cs +41 -19
- package/Runtime/Networking/IPeer.cs.meta +11 -11
- package/Runtime/Networking/NetworkingPeer.cs +198 -144
- package/Runtime/Networking/NetworkingPeer.cs.meta +11 -11
- package/Runtime/Networking/NetworkingPeerAPI.cs +20 -21
- package/Runtime/Networking/NetworkingPeerAPI.cs.meta +11 -11
- package/Runtime/Networking/OperationPending.cs +159 -95
- package/Runtime/Networking/OperationPending.cs.meta +11 -11
- package/Runtime/Networking/PeerBase.cs +305 -242
- package/Runtime/Networking/PeerBase.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingPeerSocketV2.cs +222 -185
- package/Runtime/Networking/Socket/NetworkingPeerSocketV2.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingPeerSocketV3.cs +235 -177
- package/Runtime/Networking/Socket/NetworkingPeerSocketV3.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingSocketPeerBase.cs +165 -23
- package/Runtime/Networking/Socket/NetworkingSocketPeerBase.cs.meta +11 -11
- package/Runtime/Networking/Socket/SocketPeer.cs +242 -197
- package/Runtime/Networking/Socket/SocketPeer.cs.meta +11 -11
- package/Runtime/Networking/Socket.meta +8 -8
- package/Runtime/Networking.meta +8 -8
- package/Runtime/Unity/ServiceCoroutine.cs +10 -0
- package/Runtime/Unity/ServiceCoroutine.cs.meta +11 -0
- package/Runtime/Unity/ServiceUpdate.cs +33 -20
- package/Runtime/Unity/ServiceUpdate.cs.meta +11 -11
- package/Runtime/Unity.meta +8 -8
- package/Runtime/XmobiTea.GN.runtime.asmdef +16 -16
- package/Runtime/XmobiTea.GN.runtime.asmdef.meta +7 -7
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e756455ecd3ead342b621705760fbd70
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e756455ecd3ead342b621705760fbd70
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 62fae030df0a7984ebea98436b8a5e9c
|
|
3
|
-
folderAsset: yes
|
|
4
|
-
DefaultImporter:
|
|
5
|
-
externalObjects: {}
|
|
6
|
-
userData:
|
|
7
|
-
assetBundleName:
|
|
8
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 62fae030df0a7984ebea98436b8a5e9c
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
DefaultImporter:
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
userData:
|
|
7
|
+
assetBundleName:
|
|
8
|
+
assetBundleVariant:
|
|
@@ -1,75 +1,111 @@
|
|
|
1
|
-
namespace XmobiTea.GN.Entity
|
|
2
|
-
{
|
|
3
|
-
using System.Text;
|
|
4
|
-
|
|
5
|
-
using XmobiTea.GN.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
public int
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
public
|
|
33
|
-
{
|
|
34
|
-
return this.
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
public string
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
namespace XmobiTea.GN.Entity
|
|
2
|
+
{
|
|
3
|
+
using System.Text;
|
|
4
|
+
using XmobiTea.GN.Common;
|
|
5
|
+
using XmobiTea.GN.Helper;
|
|
6
|
+
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Represents an operation event with a code, parameters, and encryption status.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public class OperationEvent
|
|
11
|
+
{
|
|
12
|
+
private int eventCode;
|
|
13
|
+
private GNHashtable parameters;
|
|
14
|
+
private bool encrypted;
|
|
15
|
+
|
|
16
|
+
/// <summary>
|
|
17
|
+
/// Initializes a new instance of the <see cref="OperationEvent"/> class.
|
|
18
|
+
/// </summary>
|
|
19
|
+
/// <param name="eventCode">The event code.</param>
|
|
20
|
+
/// <param name="parameters">Optional parameters associated with the event.</param>
|
|
21
|
+
/// <param name="encrypted">Whether the event is encrypted.</param>
|
|
22
|
+
public OperationEvent(int eventCode, GNHashtable parameters = null, bool encrypted = true)
|
|
23
|
+
{
|
|
24
|
+
this.eventCode = eventCode;
|
|
25
|
+
this.parameters = parameters;
|
|
26
|
+
this.encrypted = encrypted;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// <summary>
|
|
30
|
+
/// Gets the event code.
|
|
31
|
+
/// </summary>
|
|
32
|
+
public int getEventCode()
|
|
33
|
+
{
|
|
34
|
+
return this.eventCode;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// <summary>
|
|
38
|
+
/// Gets the parameters associated with the event.
|
|
39
|
+
/// </summary>
|
|
40
|
+
public GNHashtable getParameters()
|
|
41
|
+
{
|
|
42
|
+
return this.parameters;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// <summary>
|
|
46
|
+
/// Determines if the event is encrypted.
|
|
47
|
+
/// </summary>
|
|
48
|
+
public bool isEncrypted()
|
|
49
|
+
{
|
|
50
|
+
return this.encrypted;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
/// Sets a parameter for the event.
|
|
55
|
+
/// </summary>
|
|
56
|
+
/// <param name="key">The parameter key.</param>
|
|
57
|
+
/// <param name="value">The parameter value.</param>
|
|
58
|
+
/// <returns>The updated <see cref="OperationEvent"/>.</returns>
|
|
59
|
+
public OperationEvent setParameter(string key, object value)
|
|
60
|
+
{
|
|
61
|
+
if (this.parameters == null) this.parameters = new GNHashtable();
|
|
62
|
+
|
|
63
|
+
this.parameters.add(key, value);
|
|
64
|
+
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// <summary>
|
|
69
|
+
/// Sets the parameters for the event.
|
|
70
|
+
/// </summary>
|
|
71
|
+
/// <param name="parameters">The parameters to set.</param>
|
|
72
|
+
/// <returns>The updated <see cref="OperationEvent"/>.</returns>
|
|
73
|
+
public OperationEvent setParameters(GNHashtable parameters)
|
|
74
|
+
{
|
|
75
|
+
this.parameters = parameters;
|
|
76
|
+
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
/// Sets the encryption status of the event.
|
|
82
|
+
/// </summary>
|
|
83
|
+
/// <param name="encrypted">Whether the event is encrypted.</param>
|
|
84
|
+
/// <returns>The updated <see cref="OperationEvent"/>.</returns>
|
|
85
|
+
public OperationEvent setEncrypted(bool encrypted)
|
|
86
|
+
{
|
|
87
|
+
this.encrypted = encrypted;
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/// <summary>
|
|
92
|
+
/// Converts the operation event to a string representation.
|
|
93
|
+
/// </summary>
|
|
94
|
+
/// <returns>A string describing the operation event.</returns>
|
|
95
|
+
public string toString()
|
|
96
|
+
{
|
|
97
|
+
var stringBuilder = new StringBuilder();
|
|
98
|
+
stringBuilder.Append("Code: " + CodeHelper.getEventCodeName(this.eventCode) + ", parameters: " + this.parameters + ", encrypted: " + this.encrypted);
|
|
99
|
+
return stringBuilder.ToString();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/// <summary>
|
|
103
|
+
/// Overrides the default ToString method.
|
|
104
|
+
/// </summary>
|
|
105
|
+
/// <returns>A string describing the operation event.</returns>
|
|
106
|
+
public override string ToString()
|
|
107
|
+
{
|
|
108
|
+
return this.toString();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 6ef975058055fad46a3e413890c4049c
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 6ef975058055fad46a3e413890c4049c
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,35 +1,51 @@
|
|
|
1
|
-
using XmobiTea.GN.Constant;
|
|
2
|
-
|
|
3
|
-
namespace XmobiTea.GN.Entity
|
|
4
|
-
{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
1
|
+
using XmobiTea.GN.Constant;
|
|
2
|
+
|
|
3
|
+
namespace XmobiTea.GN.Entity
|
|
4
|
+
{
|
|
5
|
+
/// <summary>
|
|
6
|
+
/// Utility class for handling operations and formatting data for socket or HTTP communication.
|
|
7
|
+
/// </summary>
|
|
8
|
+
public class OperationHelper
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Converts an operation request to a format suitable for socket transmission.
|
|
12
|
+
/// </summary>
|
|
13
|
+
/// <param name="requestType">The type of the request (e.g., command, query).</param>
|
|
14
|
+
/// <param name="requestRole">The role of the request (e.g., client, admin).</param>
|
|
15
|
+
/// <param name="request">The operation request to be formatted.</param>
|
|
16
|
+
/// <returns>A formatted object array ready for socket transmission.</returns>
|
|
17
|
+
public static object toSocketData(RequestType requestType, RequestRole requestRole, OperationRequest request)
|
|
18
|
+
{
|
|
19
|
+
var requestId = request.getRequestId();
|
|
20
|
+
|
|
21
|
+
if (requestId == -1)
|
|
22
|
+
return new object[] {
|
|
23
|
+
request.getOperationCode(),
|
|
24
|
+
(int)requestType,
|
|
25
|
+
(int)requestRole,
|
|
26
|
+
(request.getParameters() == null) ? null : request.getParameters().toData()
|
|
27
|
+
};
|
|
28
|
+
else
|
|
29
|
+
return new object[] {
|
|
30
|
+
request.getOperationCode(),
|
|
31
|
+
(int)requestType,
|
|
32
|
+
(int)requestRole,
|
|
33
|
+
(request.getParameters() == null) ? null : request.getParameters().toData(),
|
|
34
|
+
requestId
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
/// Converts an operation request to a format suitable for HTTP transmission.
|
|
40
|
+
/// </summary>
|
|
41
|
+
/// <param name="requestType">The type of the request (e.g., command, query).</param>
|
|
42
|
+
/// <param name="requestRole">The role of the request (e.g., client, admin).</param>
|
|
43
|
+
/// <param name="request">The operation request to be formatted.</param>
|
|
44
|
+
/// <returns>A formatted object representing the HTTP request data.</returns>
|
|
45
|
+
public static object toHttpData(RequestType requestType, RequestRole requestRole, OperationRequest request)
|
|
46
|
+
{
|
|
47
|
+
// Implementation to format data for HTTP communication.
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: c46d8cd7ac42a034f9a879be5d8bd295
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: c46d8cd7ac42a034f9a879be5d8bd295
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,99 +1,142 @@
|
|
|
1
|
-
namespace XmobiTea.GN.Entity
|
|
2
|
-
{
|
|
3
|
-
using System.Text;
|
|
4
|
-
|
|
5
|
-
using XmobiTea.GN.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
namespace XmobiTea.GN.Entity
|
|
2
|
+
{
|
|
3
|
+
using System.Text;
|
|
4
|
+
using XmobiTea.GN.Common;
|
|
5
|
+
using XmobiTea.GN.Helper;
|
|
6
|
+
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Represents an operation request, encapsulating details such as operation code, parameters, encryption, and timeout.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public class OperationRequest
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Default timeout for operation requests in seconds.
|
|
14
|
+
/// </summary>
|
|
15
|
+
public const int defaultTimeOut = 15;
|
|
16
|
+
|
|
17
|
+
private int operationCode;
|
|
18
|
+
private int requestId;
|
|
19
|
+
private GNHashtable parameters;
|
|
20
|
+
private bool encrypted;
|
|
21
|
+
private int timeout;
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
/// Initializes a new instance of the <see cref="OperationRequest"/> class.
|
|
25
|
+
/// </summary>
|
|
26
|
+
/// <param name="operationCode">The code representing the operation.</param>
|
|
27
|
+
/// <param name="encrypted">Indicates whether the request is encrypted.</param>
|
|
28
|
+
/// <param name="timeout">Timeout duration for the request.</param>
|
|
29
|
+
public OperationRequest(int operationCode, bool encrypted = true, int timeout = defaultTimeOut)
|
|
30
|
+
{
|
|
31
|
+
this.operationCode = operationCode;
|
|
32
|
+
this.encrypted = encrypted;
|
|
33
|
+
this.timeout = timeout;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// <summary>
|
|
37
|
+
/// Gets the operation code of the request.
|
|
38
|
+
/// </summary>
|
|
39
|
+
public int getOperationCode() => this.operationCode;
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
/// Gets the request ID of the operation.
|
|
43
|
+
/// </summary>
|
|
44
|
+
public int getRequestId() => this.requestId;
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
/// Gets the parameters associated with the operation.
|
|
48
|
+
/// </summary>
|
|
49
|
+
public GNHashtable getParameters() => this.parameters;
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
/// Determines whether the request is encrypted.
|
|
53
|
+
/// </summary>
|
|
54
|
+
public bool isEncrypted() => this.encrypted;
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
/// Gets the timeout duration for the request.
|
|
58
|
+
/// </summary>
|
|
59
|
+
public int getTimeout() => this.timeout;
|
|
60
|
+
|
|
61
|
+
/// <summary>
|
|
62
|
+
/// Sets the request ID for the operation.
|
|
63
|
+
/// </summary>
|
|
64
|
+
/// <param name="requestId">The request ID to set.</param>
|
|
65
|
+
/// <returns>The updated <see cref="OperationRequest"/> instance.</returns>
|
|
66
|
+
public OperationRequest setRequestId(int requestId)
|
|
67
|
+
{
|
|
68
|
+
this.requestId = requestId;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
/// Adds or updates a parameter for the operation.
|
|
74
|
+
/// </summary>
|
|
75
|
+
/// <param name="key">The parameter key.</param>
|
|
76
|
+
/// <param name="value">The parameter value.</param>
|
|
77
|
+
/// <returns>The updated <see cref="OperationRequest"/> instance.</returns>
|
|
78
|
+
public OperationRequest setParameter(string key, object value)
|
|
79
|
+
{
|
|
80
|
+
if (this.parameters == null) this.parameters = new GNHashtable();
|
|
81
|
+
this.parameters.add(key, value);
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/// <summary>
|
|
86
|
+
/// Sets the parameters for the operation.
|
|
87
|
+
/// </summary>
|
|
88
|
+
/// <param name="parameters">The parameters to set.</param>
|
|
89
|
+
/// <returns>The updated <see cref="OperationRequest"/> instance.</returns>
|
|
90
|
+
public OperationRequest setParameters(GNHashtable parameters)
|
|
91
|
+
{
|
|
92
|
+
this.parameters = parameters;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/// <summary>
|
|
97
|
+
/// Sets whether the request is encrypted.
|
|
98
|
+
/// </summary>
|
|
99
|
+
/// <param name="encrypted">True if the request should be encrypted; otherwise false.</param>
|
|
100
|
+
/// <returns>The updated <see cref="OperationRequest"/> instance.</returns>
|
|
101
|
+
public OperationRequest setEncrypted(bool encrypted)
|
|
102
|
+
{
|
|
103
|
+
this.encrypted = encrypted;
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/// <summary>
|
|
108
|
+
/// Sets the timeout duration for the request.
|
|
109
|
+
/// </summary>
|
|
110
|
+
/// <param name="timeout">Timeout duration in seconds.</param>
|
|
111
|
+
/// <returns>The updated <see cref="OperationRequest"/> instance.</returns>
|
|
112
|
+
public OperationRequest setTimeout(int timeout)
|
|
113
|
+
{
|
|
114
|
+
this.timeout = timeout;
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// <summary>
|
|
119
|
+
/// Converts the operation request to a string representation.
|
|
120
|
+
/// </summary>
|
|
121
|
+
/// <returns>A string representation of the operation request.</returns>
|
|
122
|
+
public string toString()
|
|
123
|
+
{
|
|
124
|
+
var stringBuilder = new StringBuilder();
|
|
125
|
+
stringBuilder.Append("Code: ")
|
|
126
|
+
.Append(CodeHelper.getOperationCodeName(this.operationCode))
|
|
127
|
+
.Append(", requestId: ")
|
|
128
|
+
.Append(this.requestId)
|
|
129
|
+
.Append(", parameters: ")
|
|
130
|
+
.Append(this.parameters)
|
|
131
|
+
.Append(", encrypted: ")
|
|
132
|
+
.Append(this.encrypted);
|
|
133
|
+
return stringBuilder.ToString();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/// <summary>
|
|
137
|
+
/// Returns a string that represents the current operation request.
|
|
138
|
+
/// </summary>
|
|
139
|
+
/// <returns>A string representation of the operation request.</returns>
|
|
140
|
+
public override string ToString() => this.toString();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: fc808c7b335fef74d82a3679087337a5
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: fc808c7b335fef74d82a3679087337a5
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|