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