com.xmobitea.changx.gn-unity 2.0.1 → 2.0.3
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 +27 -23
- package/Runtime/Common/GNArray.cs +302 -302
- package/Runtime/Common/GNArray.cs.meta +11 -11
- package/Runtime/Common/GNData.cs +48 -48
- package/Runtime/Common/GNData.cs.meta +11 -11
- package/Runtime/Common/GNHashtable.cs +241 -241
- package/Runtime/Common/GNHashtable.cs.meta +11 -11
- package/Runtime/Common/IGNData.cs +11 -11
- package/Runtime/Common/IGNData.cs.meta +11 -11
- package/Runtime/Common.meta +8 -8
- package/Runtime/Config/GNServerSettings.cs.meta +11 -11
- package/Runtime/Config.meta +8 -8
- 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.meta +11 -11
- 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.meta +11 -11
- package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs.meta +11 -11
- 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/RequestRole.cs +11 -11
- package/Runtime/Constant/EnumType/RequestRole.cs.meta +7 -7
- package/Runtime/Constant/EnumType/RequestType.cs +19 -19
- package/Runtime/Constant/EnumType/RequestType.cs.meta +11 -11
- package/Runtime/Constant/EnumType.meta +8 -8
- package/Runtime/Constant/ErrorCode/GNErrorCode.cs.meta +7 -7
- package/Runtime/Constant/ErrorCode.meta +8 -8
- package/Runtime/Constant/EventCode.cs +16 -16
- package/Runtime/Constant/EventCode.cs.meta +11 -11
- package/Runtime/Constant/OperationCode.cs.meta +11 -11
- 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 +25 -25
- package/Runtime/Constant/ReturnCode.cs.meta +11 -11
- package/Runtime/Constant.meta +8 -8
- package/Runtime/Entity/DataMember.cs +124 -124
- package/Runtime/Entity/DataMember.cs.meta +11 -11
- package/Runtime/Entity/GNMetadata.cs +27 -27
- package/Runtime/Entity/GNMetadata.cs.meta +11 -11
- package/Runtime/Entity/InvalidMember.cs +33 -33
- package/Runtime/Entity/InvalidMember.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateModels.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/ContentModels.cs.meta +11 -11
- package/Runtime/Entity/Models/ContentRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/ContentResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GenericModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs +49 -49
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models.meta +8 -8
- package/Runtime/Entity/OperationEvent.cs +75 -75
- package/Runtime/Entity/OperationEvent.cs.meta +11 -11
- package/Runtime/Entity/OperationHelper.cs +35 -35
- package/Runtime/Entity/OperationHelper.cs.meta +11 -11
- package/Runtime/Entity/OperationRequest.cs +99 -99
- package/Runtime/Entity/OperationRequest.cs.meta +11 -11
- package/Runtime/Entity/OperationResponse.cs.meta +11 -11
- package/Runtime/Entity/Request/CustomOperationRequest.cs +61 -61
- package/Runtime/Entity/Request/CustomOperationRequest.cs.meta +11 -11
- package/Runtime/Entity/Request.meta +8 -8
- package/Runtime/Entity/Response/CustomOperationResponse.cs +63 -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 +182 -184
- package/Runtime/GNNetwork.cs.meta +11 -11
- package/Runtime/GNNetworkApi.cs +19 -26
- package/Runtime/GNNetworkApi.cs.meta +11 -11
- package/Runtime/GNNetworkAuthenticateApi.cs.meta +11 -11
- package/Runtime/GNNetworkCharacterPlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkContentApi.cs.meta +11 -11
- package/Runtime/GNNetworkDashboardApi.cs.meta +11 -11
- package/Runtime/GNNetworkGamePlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkGroupApi.cs.meta +11 -11
- package/Runtime/GNNetworkInventoryApi.cs.meta +11 -11
- package/Runtime/GNNetworkMasterPlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkMultiplayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkStoreInventoryApi.cs.meta +11 -11
- package/Runtime/Helper/CodeHelper.cs +97 -97
- package/Runtime/Helper/CodeHelper.cs.meta +11 -11
- package/Runtime/Helper/ConverterService.cs +12 -22
- 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 +49 -49
- package/Runtime/Logger/GNDebug.cs.meta +11 -11
- package/Runtime/Logger.meta +8 -8
- package/Runtime/Networking/AuthenticateStatus.cs +35 -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 +32 -32
- package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs +33 -33
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs +32 -32
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs +32 -32
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs +29 -29
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs +29 -29
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler.meta +8 -8
- package/Runtime/Networking/Http/HttpPeer.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs +25 -25
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs +486 -486
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs +142 -142
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs +188 -192
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs.meta +11 -11
- package/Runtime/Networking/Http.meta +8 -8
- package/Runtime/Networking/IPeer.cs +19 -19
- package/Runtime/Networking/IPeer.cs.meta +11 -11
- package/Runtime/Networking/NetworkingPeer.cs +144 -144
- package/Runtime/Networking/NetworkingPeer.cs.meta +11 -11
- package/Runtime/Networking/NetworkingPeerAPI.cs.meta +11 -11
- package/Runtime/Networking/OperationPending.cs +95 -95
- package/Runtime/Networking/OperationPending.cs.meta +11 -11
- package/Runtime/Networking/PeerBase.cs +242 -242
- package/Runtime/Networking/PeerBase.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingPeerSocketV2.cs +185 -183
- package/Runtime/Networking/Socket/NetworkingPeerSocketV2.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingPeerSocketV3.cs +177 -175
- package/Runtime/Networking/Socket/NetworkingPeerSocketV3.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingSocketPeerBase.cs.meta +11 -11
- package/Runtime/Networking/Socket/SocketPeer.cs +197 -191
- 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/ServiceUpdate.cs +20 -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,183 +1,185 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
using
|
|
7
|
-
using XmobiTea.GN.
|
|
8
|
-
using XmobiTea.
|
|
9
|
-
using XmobiTea.
|
|
10
|
-
using XmobiTea.GN.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private
|
|
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
|
-
this.socketManager.Socket.On(SocketIOEventTypes.
|
|
53
|
-
this.socketManager.Socket.On(SocketIOEventTypes.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.socketManager.Socket.On(Commands.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.socketManager.Socket.On(Commands.
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
1
|
+
#if UNITY_USING_BEST_HTTP
|
|
2
|
+
namespace XmobiTea.GN.Networking.Socket
|
|
3
|
+
{
|
|
4
|
+
using System;
|
|
5
|
+
|
|
6
|
+
using BestHTTP.SocketIO;
|
|
7
|
+
using XmobiTea.GN.Entity;
|
|
8
|
+
using XmobiTea.GN.Constant;
|
|
9
|
+
using XmobiTea.MsgPack;
|
|
10
|
+
using XmobiTea.GN.Logger;
|
|
11
|
+
using XmobiTea.GN.Common;
|
|
12
|
+
|
|
13
|
+
internal class NetworkingPeerSocketV2 : NetworkingSocketPeerBase
|
|
14
|
+
{
|
|
15
|
+
private SocketManager socketManager;
|
|
16
|
+
private bool isConnected;
|
|
17
|
+
|
|
18
|
+
internal override bool isWsConnected => this.socketManager != null ? this.socketManager.State == SocketManager.States.Open : false;
|
|
19
|
+
|
|
20
|
+
private SupportedSocketIOVersions serverVersion = SupportedSocketIOVersions.v3;
|
|
21
|
+
|
|
22
|
+
public void setServerVersion(SupportedSocketIOVersions serverVersion)
|
|
23
|
+
{
|
|
24
|
+
this.serverVersion = serverVersion;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
internal override void sendRequestAuthSocket()
|
|
28
|
+
{
|
|
29
|
+
base.sendRequestAuthSocket();
|
|
30
|
+
|
|
31
|
+
if (!string.IsNullOrEmpty(this.clientId))
|
|
32
|
+
this.socketManager.Socket.Emit(Commands.RequestAuthTokenCmd, GNNetwork.getAuthenticateStatus().getAuthToken());
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
internal override void reInitNewSocket()
|
|
36
|
+
{
|
|
37
|
+
base.reInitNewSocket();
|
|
38
|
+
|
|
39
|
+
if (this.socketManager == null)
|
|
40
|
+
{
|
|
41
|
+
var uri = new Uri(this.url + "/socket.io/");
|
|
42
|
+
this.socketManager = new SocketManager(uri, new SocketOptions()
|
|
43
|
+
{
|
|
44
|
+
ServerVersion = serverVersion,
|
|
45
|
+
Reconnection = true,
|
|
46
|
+
ReconnectionDelay = TimeSpan.FromMilliseconds(this.reconnectDelay),
|
|
47
|
+
Timeout = TimeSpan.FromMilliseconds(this.pingTimeout),
|
|
48
|
+
AutoConnect = false,
|
|
49
|
+
ConnectWith = BestHTTP.SocketIO.Transports.TransportTypes.WebSocket
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
this.socketManager.Socket.On(SocketIOEventTypes.Connect, onConnect);
|
|
53
|
+
this.socketManager.Socket.On(SocketIOEventTypes.Disconnect, onDisconnect);
|
|
54
|
+
this.socketManager.Socket.On(SocketIOEventTypes.Error, onError);
|
|
55
|
+
|
|
56
|
+
this.socketManager.Socket.On(Commands.ResponseCmd_MsgPack, onResponseMsgPack);
|
|
57
|
+
this.socketManager.Socket.On(Commands.EventCmd_MsgPack, onEventMsgPack);
|
|
58
|
+
|
|
59
|
+
this.socketManager.Socket.On(Commands.ResponseCmd_Json, onResponseJson);
|
|
60
|
+
this.socketManager.Socket.On(Commands.EventCmd_Json, onEventJson);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private void onResponseMsgPack(Socket socket, Packet packet, object[] args)
|
|
65
|
+
{
|
|
66
|
+
lock (this.messageLstLock)
|
|
67
|
+
{
|
|
68
|
+
this.responsePacketLst.Add(new SocketPacket(packet.Attachments[0], true));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private void onEventMsgPack(Socket socket, Packet packet, object[] args)
|
|
73
|
+
{
|
|
74
|
+
lock (this.messageLstLock)
|
|
75
|
+
{
|
|
76
|
+
this.eventPacketLst.Add(new SocketPacket(packet.Attachments[0], true));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private void onResponseJson(Socket socket, Packet packet, object[] args)
|
|
81
|
+
{
|
|
82
|
+
lock (this.messageLstLock)
|
|
83
|
+
{
|
|
84
|
+
this.responsePacketLst.Add(new SocketPacket(packet.DecodedArgs[0], false));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private void onEventJson(Socket socket, Packet packet, object[] args)
|
|
89
|
+
{
|
|
90
|
+
lock (this.messageLstLock)
|
|
91
|
+
{
|
|
92
|
+
this.eventPacketLst.Add(new SocketPacket(packet.DecodedArgs[0], false));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private void onConnect(Socket socket, Packet packet, object[] args)
|
|
97
|
+
{
|
|
98
|
+
GNDebug.log("[GN Socket RECV] HandleOpen " + socket.Id);
|
|
99
|
+
|
|
100
|
+
this.clientId = socket.Id;
|
|
101
|
+
|
|
102
|
+
this.onConnectHandler();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private void onDisconnect(Socket socket, Packet packet, object[] args)
|
|
106
|
+
{
|
|
107
|
+
GNDebug.log("[GN Socket RECV] HandleClose ");
|
|
108
|
+
|
|
109
|
+
this.clientId = string.Empty;
|
|
110
|
+
|
|
111
|
+
this.onDisconnectHandler();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private void onError(Socket socket, Packet packet, object[] args)
|
|
115
|
+
{
|
|
116
|
+
GNDebug.logError(string.Format("Error: {0}", args[0].ToString()));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
internal override void init(string url, int reconnectDelay, float pingInterval, float pingTimeout)
|
|
120
|
+
{
|
|
121
|
+
base.init(url, reconnectDelay, pingInterval, pingTimeout);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
protected override void emit(RequestType requestType, RequestRole requestRole, OperationRequest operationRequest, string authToken, string secretKey, GNHashtable customTags)
|
|
125
|
+
{
|
|
126
|
+
base.emit(requestType, requestRole, operationRequest, authToken, secretKey, customTags);
|
|
127
|
+
|
|
128
|
+
if (this.socketManager == null || this.socketManager.Socket == null)
|
|
129
|
+
{
|
|
130
|
+
// callback here
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (customTags != null) operationRequest.setParameter(GNParameterCode.CustomTags, customTags);
|
|
135
|
+
|
|
136
|
+
var dataSend = OperationHelper.toSocketData(requestType, requestRole, operationRequest);
|
|
137
|
+
|
|
138
|
+
if (operationRequest.isEncrypted())
|
|
139
|
+
this.socketManager.Socket.Emit(Commands.RequestCmd_MsgPack, MsgPackSerializer.Serialize(dataSend));
|
|
140
|
+
else
|
|
141
|
+
this.socketManager.Socket.Emit(Commands.RequestCmd_Json, dataSend);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
internal override void close(Action _onSocketDisconnect)
|
|
145
|
+
{
|
|
146
|
+
base.close(_onSocketDisconnect);
|
|
147
|
+
|
|
148
|
+
this.isConnected = false;
|
|
149
|
+
|
|
150
|
+
if (this.socketManager != null)
|
|
151
|
+
{
|
|
152
|
+
if (this.socketManager.State != SocketManager.States.Closed)
|
|
153
|
+
{
|
|
154
|
+
this.socketManager.Close();
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
GNDebug.log("[GN Socket] Disconnecting via SocketIOv2 BestHTTP 2");
|
|
160
|
+
|
|
161
|
+
onDisconnectHandler();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
internal override void connect(Action _onSocketConnect)
|
|
165
|
+
{
|
|
166
|
+
base.connect(_onSocketConnect);
|
|
167
|
+
|
|
168
|
+
if (this.isConnected)
|
|
169
|
+
{
|
|
170
|
+
GNDebug.log("[GN Socket] Reconnecting");
|
|
171
|
+
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
this.isConnected = true;
|
|
176
|
+
|
|
177
|
+
GNDebug.log("[GN Socket] Connecting via SocketIOv2 BestHTTP 2");
|
|
178
|
+
|
|
179
|
+
if (this.socketManager != null) this.socketManager.Open();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
}
|
|
185
|
+
#endif
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 65c2e705603a61748a4b0767c71d3f18
|
|
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: 65c2e705603a61748a4b0767c71d3f18
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|