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.
- package/Editor/GNServerSettingsEditor.cs +48 -94
- package/Runtime/Common/GNArray.cs +122 -81
- package/Runtime/Common/GNData.cs +13 -7
- package/Runtime/Common/GNHashtable.cs +71 -63
- package/Runtime/Common/IGNData.cs +3 -1
- package/Runtime/Config/GNServerSettings.cs +112 -45
- package/Runtime/Constant/Commands.cs +3 -0
- package/Runtime/Constant/EnumType/FriendStatus.cs +6 -4
- package/Runtime/Constant/EnumType/GoogleLoginType.cs +2 -0
- package/Runtime/Constant/EnumType/GroupStatus.cs +12 -0
- package/Runtime/Constant/EnumType/{UserRoleType.cs.meta → GroupStatus.cs.meta} +1 -1
- package/Runtime/Constant/EnumType/InvalidMemberType.cs +17 -15
- package/Runtime/Constant/EnumType/ItemType.cs +10 -0
- package/Runtime/Constant/EnumType/{LoginType.cs.meta → ItemType.cs.meta} +1 -1
- package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs +11 -0
- package/Runtime/Constant/{ErrorCode/DebugErrorCode.cs.meta → EnumType/MatchmakingMemberStatus.cs.meta} +11 -11
- package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs +13 -0
- package/Runtime/Constant/EnumType/{PlatformType.cs.meta → MatchmakingTicketStatus.cs.meta} +11 -11
- package/Runtime/Constant/EnumType/OwnerType.cs +12 -0
- package/Runtime/Constant/EnumType/OwnerType.cs.meta +11 -0
- package/Runtime/Constant/EnumType/PermissionDataItem.cs +10 -0
- package/Runtime/Constant/EnumType/PermissionDataItem.cs.meta +11 -0
- package/Runtime/Constant/EnumType/RequestRole.cs +11 -0
- package/Runtime/Constant/EnumType/RequestRole.cs.meta +7 -0
- package/Runtime/Constant/EnumType/RequestType.cs +19 -0
- package/Runtime/Constant/EnumType/RequestType.cs.meta +11 -0
- package/Runtime/Constant/ErrorCode/GNErrorCode.cs +54 -0
- package/Runtime/Constant/ErrorCode/GNErrorCode.cs.meta +7 -0
- package/Runtime/Constant/EventCode.cs +10 -1
- package/Runtime/Constant/OperationCode.cs +212 -14
- package/Runtime/Constant/ParameterCode/GNParameterCode.cs +470 -0
- package/Runtime/Constant/ParameterCode/GNParameterCode.cs.meta +11 -0
- package/Runtime/Constant/ParameterCode/ParameterCode.cs +2 -0
- package/Runtime/Constant/ReturnCode.cs +13 -7
- package/Runtime/Entity/DataMember.cs +124 -0
- package/Runtime/Entity/DataMember.cs.meta +11 -0
- package/Runtime/Entity/GNMetadata.cs +27 -0
- package/Runtime/Entity/GNMetadata.cs.meta +11 -0
- package/Runtime/Entity/InvalidMember.cs +8 -3
- package/Runtime/Entity/Models/AuthenticateModels.cs +316 -0
- package/Runtime/Entity/Models/AuthenticateModels.cs.meta +11 -0
- package/Runtime/Entity/Models/AuthenticateRequestModels.cs +186 -0
- package/Runtime/Entity/Models/AuthenticateRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/AuthenticateResponseModels.cs +90 -0
- package/Runtime/Entity/Models/AuthenticateResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/CharacterPlayerModels.cs +1208 -0
- package/Runtime/Entity/Models/CharacterPlayerModels.cs.meta +11 -0
- package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs +1233 -0
- package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs +254 -0
- package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/ContentModels.cs +223 -0
- package/Runtime/Entity/Models/ContentModels.cs.meta +11 -0
- package/Runtime/Entity/Models/ContentRequestModels.cs +185 -0
- package/Runtime/Entity/Models/ContentRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/ContentResponseModels.cs +44 -0
- package/Runtime/Entity/Models/ContentResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/DashboardModels.cs +1696 -0
- package/Runtime/Entity/Models/DashboardModels.cs.meta +11 -0
- package/Runtime/Entity/Models/DashboardRequestModels.cs +208 -0
- package/Runtime/Entity/Models/DashboardRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/DashboardResponseModels.cs +99 -0
- package/Runtime/Entity/Models/DashboardResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/GamePlayerModels.cs +1326 -0
- package/Runtime/Entity/Models/GamePlayerModels.cs.meta +11 -0
- package/Runtime/Entity/Models/GamePlayerRequestModels.cs +1208 -0
- package/Runtime/Entity/Models/GamePlayerRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/GamePlayerResponseModels.cs +249 -0
- package/Runtime/Entity/Models/GamePlayerResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/GenericModels.cs +154 -0
- package/Runtime/Entity/Models/GenericModels.cs.meta +11 -0
- package/Runtime/Entity/Models/GroupModels.cs +957 -0
- package/Runtime/Entity/Models/GroupModels.cs.meta +11 -0
- package/Runtime/Entity/Models/GroupRequestModels.cs +933 -0
- package/Runtime/Entity/Models/GroupRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/GroupResponseModels.cs +194 -0
- package/Runtime/Entity/Models/GroupResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/InventoryModels.cs +789 -0
- package/Runtime/Entity/Models/InventoryModels.cs.meta +11 -0
- package/Runtime/Entity/Models/InventoryRequestModels.cs +810 -0
- package/Runtime/Entity/Models/InventoryRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/InventoryResponseModels.cs +169 -0
- package/Runtime/Entity/Models/InventoryResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/MasterPlayerModels.cs +1907 -0
- package/Runtime/Entity/Models/MasterPlayerModels.cs.meta +11 -0
- package/Runtime/Entity/Models/MasterPlayerRequestModels.cs +1744 -0
- package/Runtime/Entity/Models/MasterPlayerRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs +359 -0
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/MultiplayerModels.cs +323 -0
- package/Runtime/Entity/Models/MultiplayerModels.cs.meta +11 -0
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs +208 -0
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs +49 -0
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/StoreInventoryModels.cs +474 -0
- package/Runtime/Entity/Models/StoreInventoryModels.cs.meta +11 -0
- package/Runtime/Entity/Models/StoreInventoryRequestModels.cs +235 -0
- package/Runtime/Entity/Models/StoreInventoryRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/StoreInventoryResponseModels.cs +54 -0
- package/Runtime/Entity/Models/StoreInventoryResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models.meta +8 -0
- package/Runtime/Entity/OperationEvent.cs +14 -9
- package/Runtime/Entity/OperationHelper.cs +13 -7
- package/Runtime/Entity/OperationRequest.cs +20 -20
- package/Runtime/Entity/OperationResponse.cs +27 -17
- package/Runtime/Entity/Request/CustomOperationRequest.cs +37 -7
- package/Runtime/Entity/Response/CustomOperationResponse.cs +34 -11
- package/Runtime/GNNetwork.cs +80 -83
- package/Runtime/GNNetworkApi.cs +7 -115
- package/Runtime/GNNetworkAuthenticateApi.cs +110 -0
- package/Runtime/GNNetworkAuthenticateApi.cs.meta +11 -0
- package/Runtime/GNNetworkCharacterPlayerApi.cs +766 -0
- package/Runtime/GNNetworkCharacterPlayerApi.cs.meta +11 -0
- package/Runtime/GNNetworkContentApi.cs +136 -0
- package/Runtime/GNNetworkContentApi.cs.meta +11 -0
- package/Runtime/GNNetworkDashboardApi.cs +121 -0
- package/Runtime/GNNetworkDashboardApi.cs.meta +11 -0
- package/Runtime/GNNetworkGamePlayerApi.cs +751 -0
- package/Runtime/GNNetworkGamePlayerApi.cs.meta +11 -0
- package/Runtime/GNNetworkGroupApi.cs +586 -0
- package/Runtime/GNNetworkGroupApi.cs.meta +11 -0
- package/Runtime/GNNetworkInventoryApi.cs +511 -0
- package/Runtime/GNNetworkInventoryApi.cs.meta +11 -0
- package/Runtime/GNNetworkMasterPlayerApi.cs +1071 -0
- package/Runtime/GNNetworkMasterPlayerApi.cs.meta +11 -0
- package/Runtime/GNNetworkMultiplayerApi.cs +151 -0
- package/Runtime/GNNetworkMultiplayerApi.cs.meta +11 -0
- package/Runtime/GNNetworkStoreInventoryApi.cs +166 -0
- package/Runtime/GNNetworkStoreInventoryApi.cs.meta +11 -0
- package/Runtime/Helper/CodeHelper.cs +44 -23
- package/Runtime/Helper/ConverterService.cs +452 -0
- package/Runtime/Helper/ConverterService.cs.meta +11 -0
- package/Runtime/Logger/GNDebug.cs +4 -4
- package/Runtime/Networking/AuthenticateStatus.cs +35 -0
- package/Runtime/Networking/AuthenticateStatus.cs.meta +11 -0
- package/Runtime/Networking/Handler/IServerEventHandler.cs +14 -2
- package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs +32 -0
- package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs.meta +11 -0
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs +33 -0
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs.meta +11 -0
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs +32 -0
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs.meta +11 -0
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs +32 -0
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs.meta +11 -0
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs +29 -0
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs.meta +11 -0
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs +29 -0
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs.meta +11 -0
- package/Runtime/Networking/Http/HttpPeer.cs +176 -0
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs +25 -0
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs.meta +11 -0
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs +373 -0
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs.meta +11 -0
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs +207 -0
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs.meta +11 -0
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs +188 -0
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs.meta +11 -0
- package/Runtime/Networking/Http.meta +8 -0
- package/Runtime/Networking/IPeer.cs +6 -5
- package/Runtime/Networking/NetworkingPeer.cs +81 -52
- package/Runtime/Networking/NetworkingPeerAPI.cs +23 -311
- package/Runtime/Networking/OperationPending.cs +47 -10
- package/Runtime/Networking/PeerBase.cs +87 -84
- package/Runtime/Networking/{NetworkingPeerSocketV2.cs → Socket/NetworkingPeerSocketV2.cs} +44 -41
- package/Runtime/Networking/{NetworkingPeerSocketV3.cs → Socket/NetworkingPeerSocketV3.cs} +43 -40
- package/Runtime/Networking/{NetworkingPeerBase.cs → Socket/NetworkingSocketPeerBase.cs} +41 -49
- package/Runtime/Networking/Socket/SocketPeer.cs +193 -0
- package/Runtime/Networking/Socket.meta +8 -0
- package/Runtime/Unity/ServiceUpdate.cs +20 -0
- package/Runtime/Unity/ServiceUpdate.cs.meta +11 -0
- package/Runtime/Unity.meta +8 -0
- package/Runtime/XmobiTea.GN.runtime.asmdef +1 -2
- package/package.json +2 -4
- package/Runtime/Constant/EnumType/LoginType.cs +0 -14
- package/Runtime/Constant/EnumType/PlatformType.cs +0 -12
- package/Runtime/Constant/EnumType/UserRoleType.cs +0 -12
- package/Runtime/Constant/ErrorCode/DebugErrorCode.cs +0 -7
- package/Runtime/Constant/ErrorCode/EnterDisplayNameErrorCode.cs +0 -7
- package/Runtime/Constant/ErrorCode/EnterDisplayNameErrorCode.cs.meta +0 -11
- package/Runtime/Constant/ErrorCode/FetchAllDataErrorCode.cs +0 -8
- package/Runtime/Constant/ErrorCode/FetchAllDataErrorCode.cs.meta +0 -11
- package/Runtime/Constant/ErrorCode/FetchSparkPlayerErrorCode.cs +0 -8
- package/Runtime/Constant/ErrorCode/FetchSparkPlayerErrorCode.cs.meta +0 -11
- package/Runtime/Constant/ErrorCode/FileUploadInfoErrorCode.cs +0 -9
- package/Runtime/Constant/ErrorCode/FileUploadInfoErrorCode.cs.meta +0 -11
- package/Runtime/Constant/ErrorCode/GetAppConfigErrorCode.cs +0 -7
- package/Runtime/Constant/ErrorCode/GetAppConfigErrorCode.cs.meta +0 -11
- package/Runtime/Constant/ErrorCode/LoginErrorCode.cs +0 -14
- package/Runtime/Constant/ErrorCode/LoginErrorCode.cs.meta +0 -11
- package/Runtime/Constant/ErrorCode/RegisterSocketErrorCode.cs +0 -7
- package/Runtime/Constant/ErrorCode/RegisterSocketErrorCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/DebugParameterCode.cs +0 -11
- package/Runtime/Constant/ParameterCode/DebugParameterCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/EnterDisplayNameParameterCode.cs +0 -8
- package/Runtime/Constant/ParameterCode/EnterDisplayNameParameterCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/FetchAllDataParameterCode.cs +0 -11
- package/Runtime/Constant/ParameterCode/FetchAllDataParameterCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/FetchSparkPlayerParameterCode.cs +0 -19
- package/Runtime/Constant/ParameterCode/FetchSparkPlayerParameterCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/FileUploadInfoParameterCode.cs +0 -15
- package/Runtime/Constant/ParameterCode/FileUploadInfoParameterCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/GetAppConfigParameterCode.cs +0 -8
- package/Runtime/Constant/ParameterCode/GetAppConfigParameterCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/LoginParameterCode.cs +0 -22
- package/Runtime/Constant/ParameterCode/LoginParameterCode.cs.meta +0 -11
- package/Runtime/Constant/ParameterCode/RegisterSocketParameterCode.cs +0 -7
- package/Runtime/Constant/ParameterCode/RegisterSocketParameterCode.cs.meta +0 -11
- package/Runtime/Entity/Request/CreateNewFileUploadInfoOperationRequest.cs +0 -21
- package/Runtime/Entity/Request/CreateNewFileUploadInfoOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/DebugOperationRequest.cs +0 -25
- package/Runtime/Entity/Request/DebugOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/EnterDisplayNameOperationRequest.cs +0 -21
- package/Runtime/Entity/Request/EnterDisplayNameOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/FetchAllDataOperationRequest.cs +0 -19
- package/Runtime/Entity/Request/FetchAllDataOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/FetchSparkPlayerOperationRequest.cs +0 -19
- package/Runtime/Entity/Request/FetchSparkPlayerOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/GetAppConfigOperationRequest.cs +0 -21
- package/Runtime/Entity/Request/GetAppConfigOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/GetFileUploadInfoOperationRequest.cs +0 -21
- package/Runtime/Entity/Request/GetFileUploadInfoOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/LoginOperationRequest.cs +0 -140
- package/Runtime/Entity/Request/LoginOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/LogoutOperationRequest.cs +0 -19
- package/Runtime/Entity/Request/LogoutOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/RegisterAccountOperationRequest.cs +0 -22
- package/Runtime/Entity/Request/RegisterAccountOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/RegisterSocketOperationRequest.cs +0 -21
- package/Runtime/Entity/Request/RegisterSocketOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Request/TemplateOperationRequest.cs +0 -21
- package/Runtime/Entity/Request/TemplateOperationRequest.cs.meta +0 -11
- package/Runtime/Entity/Response/CreateNewFileUploadInfoOperationResponse.cs +0 -32
- package/Runtime/Entity/Response/CreateNewFileUploadInfoOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/DebugOperationResponse.cs +0 -33
- package/Runtime/Entity/Response/DebugOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/EnterDisplayNameOperationResponse.cs +0 -26
- package/Runtime/Entity/Response/EnterDisplayNameOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/FetchAllDataOperationResponse.cs +0 -35
- package/Runtime/Entity/Response/FetchAllDataOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/FetchSparkPlayerOperationResponse.cs +0 -59
- package/Runtime/Entity/Response/FetchSparkPlayerOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/GetAppConfigOperationResponse.cs +0 -24
- package/Runtime/Entity/Response/GetAppConfigOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/GetFileUploadInfoOperationResponse.cs +0 -56
- package/Runtime/Entity/Response/GetFileUploadInfoOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/LoginOperationResponse.cs +0 -34
- package/Runtime/Entity/Response/LoginOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/LogoutOperationResponse.cs +0 -27
- package/Runtime/Entity/Response/LogoutOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/PublicAddressGetRandomMessageOperationResponse.cs +0 -24
- package/Runtime/Entity/Response/PublicAddressGetRandomMessageOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/RegisterAccountOperationResponse.cs +0 -23
- package/Runtime/Entity/Response/RegisterAccountOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/RegisterSocketOperationResponse.cs +0 -23
- package/Runtime/Entity/Response/RegisterSocketOperationResponse.cs.meta +0 -11
- package/Runtime/Entity/Response/TemplateOperationResponse.cs +0 -24
- package/Runtime/Entity/Response/TemplateOperationResponse.cs.meta +0 -11
- package/Runtime/Networking/Handler/OnDebugEventHandler.cs +0 -17
- package/Runtime/Networking/Handler/OnDebugEventHandler.cs.meta +0 -11
- package/Runtime/Networking/HttpPeer.cs +0 -497
- package/Runtime/Networking/SocketPeer.cs +0 -179
- /package/Runtime/Networking/{HttpPeer.cs.meta → Http/HttpPeer.cs.meta} +0 -0
- /package/Runtime/Networking/{NetworkingPeerSocketV2.cs.meta → Socket/NetworkingPeerSocketV2.cs.meta} +0 -0
- /package/Runtime/Networking/{NetworkingPeerSocketV3.cs.meta → Socket/NetworkingPeerSocketV3.cs.meta} +0 -0
- /package/Runtime/Networking/{NetworkingPeerBase.cs.meta → Socket/NetworkingSocketPeerBase.cs.meta} +0 -0
- /package/Runtime/Networking/{SocketPeer.cs.meta → Socket/SocketPeer.cs.meta} +0 -0
|
@@ -4,41 +4,44 @@
|
|
|
4
4
|
using System.Collections.Generic;
|
|
5
5
|
using System.Text;
|
|
6
6
|
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// The GNData dictionary, it store Dictionary can be use to request or response
|
|
9
|
+
/// </summary>
|
|
7
10
|
public class GNHashtable : GNData
|
|
8
11
|
{
|
|
9
12
|
public class Builder
|
|
10
13
|
{
|
|
11
|
-
private IDictionary<string, object>
|
|
14
|
+
private IDictionary<string, object> dict;
|
|
12
15
|
|
|
13
|
-
public Builder
|
|
16
|
+
public Builder add(string key, object value)
|
|
14
17
|
{
|
|
15
|
-
this.
|
|
18
|
+
this.dict[key] = value;
|
|
16
19
|
|
|
17
20
|
return this;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
public Builder
|
|
23
|
+
public Builder addAll(System.Collections.IDictionary dict)
|
|
21
24
|
{
|
|
22
25
|
var keys = dict.Keys;
|
|
23
26
|
foreach (var key in keys)
|
|
24
27
|
{
|
|
25
28
|
if (key is string keyStr)
|
|
26
29
|
{
|
|
27
|
-
this.
|
|
30
|
+
this.add(keyStr, dict[key]);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
return this;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
public GNHashtable
|
|
37
|
+
public GNHashtable build()
|
|
35
38
|
{
|
|
36
39
|
var awnser = new GNHashtable();
|
|
37
40
|
|
|
38
|
-
var keys =
|
|
41
|
+
var keys = this.dict.Keys;
|
|
39
42
|
foreach (var key in keys)
|
|
40
43
|
{
|
|
41
|
-
awnser.
|
|
44
|
+
awnser.add(key, this.dict[key]);
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
return awnser;
|
|
@@ -46,57 +49,57 @@
|
|
|
46
49
|
|
|
47
50
|
public Builder()
|
|
48
51
|
{
|
|
49
|
-
this.
|
|
52
|
+
this.dict = new Dictionary<string, object>();
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
private IDictionary<string, object>
|
|
56
|
+
private IDictionary<string, object> dict;
|
|
54
57
|
|
|
55
58
|
public GNHashtable()
|
|
56
59
|
{
|
|
57
|
-
this.
|
|
60
|
+
this.dict = new Dictionary<string, object>();
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
public void
|
|
63
|
+
public void add(string key, object value)
|
|
61
64
|
{
|
|
62
|
-
this.
|
|
65
|
+
this.dict[key] = GNData.createUseDataFromOriginData(value);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
public ICollection<object>
|
|
68
|
+
public ICollection<object> values()
|
|
66
69
|
{
|
|
67
|
-
return this.
|
|
70
|
+
return this.dict.Values;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
|
-
public ICollection<string>
|
|
73
|
+
public ICollection<string> keys()
|
|
71
74
|
{
|
|
72
|
-
return this.
|
|
75
|
+
return this.dict.Keys;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
public bool
|
|
78
|
+
public bool containsKey(string key)
|
|
76
79
|
{
|
|
77
|
-
return this.
|
|
80
|
+
return this.dict.ContainsKey(key);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
public void
|
|
83
|
+
public void clear()
|
|
81
84
|
{
|
|
82
|
-
this.
|
|
85
|
+
this.dict.Clear();
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
public bool
|
|
88
|
+
public bool remove(string key)
|
|
86
89
|
{
|
|
87
|
-
return this.
|
|
90
|
+
return this.dict.Remove(key);
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
public int
|
|
93
|
+
public int count()
|
|
91
94
|
{
|
|
92
|
-
return this.
|
|
95
|
+
return this.dict.Count;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
|
-
protected object
|
|
98
|
+
protected object get<T>(string k, T defaultValue = default(T))
|
|
96
99
|
{
|
|
97
|
-
if (this.
|
|
100
|
+
if (this.dict.ContainsKey(k))
|
|
98
101
|
{
|
|
99
|
-
var value = this.
|
|
102
|
+
var value = this.dict[k];
|
|
100
103
|
|
|
101
104
|
if (value == null) return defaultValue;
|
|
102
105
|
|
|
@@ -111,107 +114,107 @@
|
|
|
111
114
|
return defaultValue;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
public byte
|
|
117
|
+
public byte getByte(string k, byte defaultValue = 0)
|
|
115
118
|
{
|
|
116
|
-
return Convert.ToByte(this.
|
|
119
|
+
return Convert.ToByte(this.get(k, defaultValue));
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
public sbyte
|
|
122
|
+
public sbyte getSByte(string k, sbyte defaultValue = 0)
|
|
120
123
|
{
|
|
121
|
-
return Convert.ToSByte(this.
|
|
124
|
+
return Convert.ToSByte(this.get(k, defaultValue));
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
public short
|
|
127
|
+
public short getShort(string k, short defaultValue = 0)
|
|
125
128
|
{
|
|
126
|
-
return Convert.ToInt16(this.
|
|
129
|
+
return Convert.ToInt16(this.get(k, defaultValue));
|
|
127
130
|
}
|
|
128
131
|
|
|
129
|
-
public int
|
|
132
|
+
public int getInt(string k, int defaultValue = 0)
|
|
130
133
|
{
|
|
131
|
-
return Convert.ToInt32(this.
|
|
134
|
+
return Convert.ToInt32(this.get(k, defaultValue));
|
|
132
135
|
}
|
|
133
136
|
|
|
134
|
-
public float
|
|
137
|
+
public float getFloat(string k, float defaultValue = 0)
|
|
135
138
|
{
|
|
136
|
-
return Convert.ToSingle(this.
|
|
139
|
+
return Convert.ToSingle(this.get(k, defaultValue));
|
|
137
140
|
}
|
|
138
141
|
|
|
139
|
-
public long
|
|
142
|
+
public long getLong(string k, long defaultValue = 0)
|
|
140
143
|
{
|
|
141
|
-
return Convert.ToInt64(this.
|
|
144
|
+
return Convert.ToInt64(this.get(k, defaultValue));
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
public double
|
|
147
|
+
public double getDouble(string k, double defaultValue = 0)
|
|
145
148
|
{
|
|
146
|
-
return Convert.ToDouble(this.
|
|
149
|
+
return Convert.ToDouble(this.get(k, defaultValue));
|
|
147
150
|
}
|
|
148
151
|
|
|
149
|
-
public bool
|
|
152
|
+
public bool getBool(string k, bool defaultValue = false)
|
|
150
153
|
{
|
|
151
|
-
return Convert.ToBoolean(this.
|
|
154
|
+
return Convert.ToBoolean(this.get(k, defaultValue));
|
|
152
155
|
}
|
|
153
156
|
|
|
154
|
-
public string
|
|
157
|
+
public string getString(string k, string defaultValue = null)
|
|
155
158
|
{
|
|
156
|
-
return Convert.ToString(this.
|
|
159
|
+
return Convert.ToString(this.get(k, defaultValue));
|
|
157
160
|
}
|
|
158
161
|
|
|
159
|
-
public object
|
|
162
|
+
public object getObject(string k, object defaultValue = null)
|
|
160
163
|
{
|
|
161
|
-
return this.
|
|
164
|
+
return this.get(k, defaultValue);
|
|
162
165
|
}
|
|
163
166
|
|
|
164
|
-
public T[]
|
|
167
|
+
public T[] getArray<T>(string k, T[] defaultValue = null)
|
|
165
168
|
{
|
|
166
|
-
var value0 = this.
|
|
169
|
+
var value0 = this.getGNArray(k);
|
|
167
170
|
if (value0 != null)
|
|
168
171
|
{
|
|
169
|
-
return value0.
|
|
172
|
+
return value0.toArray<T>();
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
return defaultValue;
|
|
173
176
|
}
|
|
174
177
|
|
|
175
|
-
public IList<T>
|
|
178
|
+
public IList<T> getList<T>(string k, IList<T> defaultValue = null)
|
|
176
179
|
{
|
|
177
|
-
var value0 = this.
|
|
180
|
+
var value0 = this.getGNArray(k);
|
|
178
181
|
if (value0 != null)
|
|
179
182
|
{
|
|
180
|
-
return value0.
|
|
183
|
+
return value0.toList<T>();
|
|
181
184
|
}
|
|
182
185
|
|
|
183
186
|
return defaultValue;
|
|
184
187
|
}
|
|
185
188
|
|
|
186
|
-
public GNArray
|
|
189
|
+
public GNArray getGNArray(string k, GNArray defaultValue = null)
|
|
187
190
|
{
|
|
188
|
-
return (GNArray)this.
|
|
191
|
+
return (GNArray)this.get(k, defaultValue);
|
|
189
192
|
}
|
|
190
193
|
|
|
191
|
-
public GNHashtable
|
|
194
|
+
public GNHashtable getGNHashtable(string k, GNHashtable defaultValue = null)
|
|
192
195
|
{
|
|
193
|
-
return (GNHashtable)this.
|
|
196
|
+
return (GNHashtable)this.get(k, defaultValue);
|
|
194
197
|
}
|
|
195
198
|
|
|
196
|
-
public override object
|
|
199
|
+
public override object toData()
|
|
197
200
|
{
|
|
198
201
|
var answer = new Dictionary<string, object>();
|
|
199
202
|
|
|
200
|
-
foreach (var c in this.
|
|
203
|
+
foreach (var c in this.dict)
|
|
201
204
|
{
|
|
202
|
-
answer.Add(c.Key,
|
|
205
|
+
answer.Add(c.Key, GNData.createDataFromUseData(c.Value));
|
|
203
206
|
}
|
|
204
207
|
|
|
205
208
|
return answer;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
|
-
public override string
|
|
211
|
+
public override string toString()
|
|
209
212
|
{
|
|
210
213
|
var stringBuilder = new StringBuilder();
|
|
211
214
|
stringBuilder.Append("{");
|
|
212
215
|
|
|
213
216
|
var i = 0;
|
|
214
|
-
foreach (var c in this.
|
|
217
|
+
foreach (var c in this.dict)
|
|
215
218
|
{
|
|
216
219
|
if (i != 0) stringBuilder.Append(",");
|
|
217
220
|
|
|
@@ -228,6 +231,11 @@
|
|
|
228
231
|
return stringBuilder.ToString();
|
|
229
232
|
}
|
|
230
233
|
|
|
234
|
+
public override string ToString()
|
|
235
|
+
{
|
|
236
|
+
return this.toString();
|
|
237
|
+
}
|
|
238
|
+
|
|
231
239
|
}
|
|
232
240
|
|
|
233
241
|
}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
namespace XmobiTea.GN.Config
|
|
2
2
|
{
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
|
|
5
3
|
using UnityEngine;
|
|
6
4
|
|
|
7
|
-
using XmobiTea.GN.Constant;
|
|
8
|
-
|
|
9
5
|
public enum PeerSocketVersion
|
|
10
6
|
{
|
|
11
7
|
V2_v2 = 0,
|
|
12
8
|
V2_v3 = 1,
|
|
13
9
|
V3 = 2,
|
|
10
|
+
|
|
14
11
|
}
|
|
15
|
-
|
|
12
|
+
|
|
16
13
|
public enum HttpRequestType
|
|
17
14
|
{
|
|
18
15
|
UnityWebRequest = 0,
|
|
19
16
|
HTTPRequest = 1,
|
|
17
|
+
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
//[CreateAssetMenu(fileName = GNServerSettings.ResourcesPath, menuName = "GN/GNServerSettings", order = 1)]
|
|
@@ -25,79 +23,148 @@
|
|
|
25
23
|
public const string ResourcesPath = "GNServerSettings";
|
|
26
24
|
|
|
27
25
|
[SerializeField]
|
|
28
|
-
private string
|
|
29
|
-
|
|
26
|
+
private string serverAddress = "127.0.0.1";
|
|
27
|
+
|
|
28
|
+
[SerializeField]
|
|
29
|
+
private int serverPort = 2202;
|
|
30
30
|
|
|
31
31
|
[SerializeField]
|
|
32
|
-
private
|
|
33
|
-
public int serverPort => this._serverPort;
|
|
32
|
+
private bool useSsl = false;
|
|
34
33
|
|
|
35
34
|
[SerializeField]
|
|
36
|
-
private bool
|
|
37
|
-
public bool useSsl => this._useSsl;
|
|
35
|
+
private bool useSocket = true;
|
|
38
36
|
|
|
39
37
|
[SerializeField]
|
|
40
|
-
private bool
|
|
41
|
-
public bool useSocket => this._useSocket;
|
|
38
|
+
private bool useHttp = true;
|
|
42
39
|
|
|
43
40
|
[SerializeField]
|
|
44
|
-
private
|
|
45
|
-
public bool useHttp => this._useHttp;
|
|
41
|
+
private int sendRate = 20;
|
|
46
42
|
|
|
47
43
|
[SerializeField]
|
|
48
|
-
private int
|
|
49
|
-
public int sendRate => this._sendRate;
|
|
44
|
+
private int reconnectDelay = 5000;
|
|
50
45
|
|
|
51
46
|
[SerializeField]
|
|
52
|
-
private
|
|
53
|
-
public int reconnectDelay => this._reconnectDelay;
|
|
47
|
+
private float pingInterval = 20000;
|
|
54
48
|
|
|
55
49
|
[SerializeField]
|
|
56
|
-
private float
|
|
57
|
-
public float pingInterval => this._pingInterval;
|
|
50
|
+
private float pingTimeout = 20000;
|
|
58
51
|
|
|
59
52
|
[SerializeField]
|
|
60
|
-
private
|
|
61
|
-
public float pingTimeout => this._pingTimeout;
|
|
53
|
+
private string adminSecretKey;
|
|
62
54
|
|
|
63
55
|
[SerializeField]
|
|
64
|
-
private
|
|
65
|
-
public PeerSocketVersion peerSocketVersion => this._peerSocketVersion;
|
|
56
|
+
private string serverSecretKey;
|
|
66
57
|
|
|
67
58
|
[SerializeField]
|
|
68
|
-
private
|
|
69
|
-
public List<int> codeCanSendNotAuthorized => this._codeCanSendNotAuthorized;
|
|
59
|
+
private string clientSecretKey;
|
|
70
60
|
|
|
71
61
|
[SerializeField]
|
|
72
|
-
private
|
|
73
|
-
public string gnServerSourcePath => this._gnServerSourcePath;
|
|
62
|
+
private PeerSocketVersion peerSocketVersion = PeerSocketVersion.V3;
|
|
74
63
|
|
|
75
64
|
[SerializeField]
|
|
76
|
-
private
|
|
77
|
-
public HttpRequestType httpRequestType => this._httpRequestType;
|
|
65
|
+
private string gnServerSourcePath = "Template_GN-server";
|
|
78
66
|
|
|
79
67
|
[SerializeField]
|
|
80
|
-
private
|
|
81
|
-
|
|
68
|
+
private HttpRequestType httpRequestType = HttpRequestType.HTTPRequest;
|
|
69
|
+
|
|
70
|
+
[SerializeField]
|
|
71
|
+
private GN.Logger.LogType logType = GN.Logger.LogType.All;
|
|
72
|
+
|
|
73
|
+
public string getServerAddress()
|
|
74
|
+
{
|
|
75
|
+
return this.serverAddress;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public int getServerPort()
|
|
79
|
+
{
|
|
80
|
+
return this.serverPort;
|
|
81
|
+
}
|
|
82
82
|
|
|
83
|
-
public
|
|
83
|
+
public bool isUseSsl()
|
|
84
84
|
{
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
if (this._serverPort < 0) return string.Format((this._useSsl ? "https" : "http") + "://{0}", this._serverAddress);
|
|
88
|
-
else return string.Format((this._useSsl ? "https" : "http") + "://{0}:{1}", this._serverAddress, this._serverPort);
|
|
89
|
-
}
|
|
85
|
+
return this.useSsl;
|
|
90
86
|
}
|
|
91
87
|
|
|
92
|
-
|
|
88
|
+
|
|
89
|
+
public bool isUseSocket()
|
|
90
|
+
{
|
|
91
|
+
return this.useSocket;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public bool isUseHttp()
|
|
93
95
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
return this.useHttp;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public int getSendRate()
|
|
100
|
+
{
|
|
101
|
+
return this.sendRate;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public int getReconnectDelay()
|
|
105
|
+
{
|
|
106
|
+
return this.reconnectDelay;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public float getPingInterval()
|
|
110
|
+
{
|
|
111
|
+
return this.pingInterval;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public float getPingTimeout()
|
|
115
|
+
{
|
|
116
|
+
return this.pingTimeout;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public string getAdminSecretKey()
|
|
120
|
+
{
|
|
121
|
+
return this.adminSecretKey;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public string getServerSecretKey()
|
|
125
|
+
{
|
|
126
|
+
return this.serverSecretKey;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public string getClientSecretKey()
|
|
130
|
+
{
|
|
131
|
+
return this.clientSecretKey;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public PeerSocketVersion getPeerSocketVersion()
|
|
135
|
+
{
|
|
136
|
+
return this.peerSocketVersion;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public string getGNServerSourcePath()
|
|
140
|
+
{
|
|
141
|
+
return this.gnServerSourcePath;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public HttpRequestType getHttpRequestType()
|
|
145
|
+
{
|
|
146
|
+
return this.httpRequestType;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public GN.Logger.LogType getLogType()
|
|
150
|
+
{
|
|
151
|
+
return this.logType;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
public string getSocketUrl()
|
|
156
|
+
{
|
|
157
|
+
if (this.serverPort < 0) return string.Format((this.useSsl ? "https" : "http") + "://{0}", this.serverAddress);
|
|
158
|
+
else return string.Format((this.useSsl ? "https" : "http") + "://{0}:{1}", this.serverAddress, this.serverPort);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public string getHttpUrl()
|
|
162
|
+
{
|
|
163
|
+
if (this.serverPort < 0) return string.Format((this.useSsl ? "https" : "http") + "://{0}", this.serverAddress);
|
|
164
|
+
else return string.Format((this.useSsl ? "https" : "http") + "://{0}:{1}", this.serverAddress, this.serverPort);
|
|
99
165
|
}
|
|
100
166
|
|
|
101
167
|
}
|
|
102
168
|
|
|
103
169
|
}
|
|
170
|
+
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
public const string APPLICATION_MSGPACK = "application/msgpack";
|
|
11
11
|
|
|
12
12
|
public const string RequestAuthTokenCmd = "a";
|
|
13
|
+
public const string RequestSecretCmd = "s";
|
|
13
14
|
|
|
14
15
|
public const string RequestCmd_MsgPack = "r";
|
|
15
16
|
public const string ResponseCmd_MsgPack = "r";
|
|
@@ -23,5 +24,7 @@
|
|
|
23
24
|
public const string File = "f";
|
|
24
25
|
|
|
25
26
|
private Commands() { }
|
|
27
|
+
|
|
26
28
|
}
|
|
29
|
+
|
|
27
30
|
}
|
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
{
|
|
3
3
|
public enum InvalidMemberType
|
|
4
4
|
{
|
|
5
|
-
UnknownError =
|
|
6
|
-
DataRequired =
|
|
7
|
-
TypeInvalid =
|
|
8
|
-
StringNull =
|
|
9
|
-
StringMinLength =
|
|
10
|
-
StringMaxLength =
|
|
11
|
-
NumberMinValue =
|
|
12
|
-
NumberMaxValue =
|
|
13
|
-
NumberMustInt =
|
|
14
|
-
GNHashtableNull =
|
|
15
|
-
GNHashtableMinLength =
|
|
16
|
-
GNHashtableMaxLength =
|
|
17
|
-
GNArrayNull =
|
|
18
|
-
GNArrayMinLength =
|
|
19
|
-
GNArrayMaxLength =
|
|
5
|
+
UnknownError = 1,
|
|
6
|
+
DataRequired = 2,
|
|
7
|
+
TypeInvalid = 3,
|
|
8
|
+
StringNull = 4,
|
|
9
|
+
StringMinLength = 5,
|
|
10
|
+
StringMaxLength = 6,
|
|
11
|
+
NumberMinValue = 7,
|
|
12
|
+
NumberMaxValue = 8,
|
|
13
|
+
NumberMustInt = 9,
|
|
14
|
+
GNHashtableNull = 10,
|
|
15
|
+
GNHashtableMinLength = 11,
|
|
16
|
+
GNHashtableMaxLength = 12,
|
|
17
|
+
GNArrayNull = 13,
|
|
18
|
+
GNArrayMinLength = 14,
|
|
19
|
+
GNArrayMaxLength = 15,
|
|
20
|
+
|
|
20
21
|
}
|
|
22
|
+
|
|
21
23
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid:
|
|
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: 3d0ecb4f8957d344aadaae7e4069f4f0
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|