com.xmobitea.changx.gn-unity 2.4.8 → 2.4.10

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.
@@ -370,7 +370,7 @@
370
370
  return answer;
371
371
  }
372
372
 
373
- private System.Collections.IList castList(System.Collections.IList objectLst, System.Type cls, bool isArray)
373
+ public System.Collections.IList castList(System.Collections.IList objectLst, System.Type cls, bool isArray)
374
374
  {
375
375
  if (isArray)
376
376
  {
@@ -585,7 +585,7 @@
585
585
  /// <returns>A list of deserialized elements.</returns>
586
586
  public static System.Collections.IList deserializeArray<T>(GNArray gnArray)
587
587
  {
588
- return ConverterService.deserializeArray<T>(gnArray);
588
+ return ConverterService.deserializeArray(gnArray, typeof(T));
589
589
  }
590
590
 
591
591
  /// <summary>
@@ -596,7 +596,9 @@
596
596
  /// <returns>A list of deserialized elements.</returns>
597
597
  public static System.Collections.IList deserializeArray(GNArray gnArray, Type cls)
598
598
  {
599
- return ConverterService.deserializeConverter.deserializeArray(gnArray, cls);
599
+ var answer = ConverterService.deserializeConverter.deserializeArray(gnArray, cls);
600
+
601
+ return ConverterService.deserializeConverter.castList(answer, cls, false);
600
602
  }
601
603
 
602
604
  /// <summary>
@@ -106,9 +106,10 @@
106
106
  internal override void send(OperationPending operationPending)
107
107
  {
108
108
  base.send(operationPending);
109
- GNDebug.log("[GN Http SEND] " + operationPending.getOperationRequest().ToString());
110
109
 
111
110
  var operationRequest = operationPending.getOperationRequest();
111
+ GNDebug.log("[GN Http SEND] " + operationRequest.ToString());
112
+
112
113
  var authToken = operationPending.getAuthToken();
113
114
  var secretKey = operationPending.getSecretKey();
114
115
  var gameId = operationPending.getGameId();
@@ -123,6 +124,11 @@
123
124
  }, operationRequest.getTimeout(), authToken, secretKey, customTags, gameId);
124
125
  }
125
126
 
127
+ protected override void onEnqueue(OperationPending operationPending)
128
+ {
129
+ GNDebug.log("[GN Http ENQUEUE] " + operationPending.getOperationRequest().ToString());
130
+ }
131
+
126
132
  /// <summary>
127
133
  /// Handles the response of an operation request.
128
134
  /// </summary>
@@ -108,10 +108,16 @@
108
108
  return;
109
109
  }
110
110
 
111
+ if (operationRequest.getRequestId() != -1) operationRequest.setRequestId(PeerBase.requestId++);
112
+
111
113
  var operationPending = new OperationPending(requestType, requestRole, operationRequest, onOperationResponse, authToken, secretKey, customTags, gameId);
112
114
  this.operationPendingQueue.Enqueue(operationPending);
115
+
116
+ onEnqueue(operationPending);
113
117
  }
114
118
 
119
+ protected abstract void onEnqueue(OperationPending operationPending);
120
+
115
121
  /// <summary>
116
122
  /// Checks if this peer is in use.
117
123
  /// </summary>
@@ -278,8 +284,6 @@
278
284
 
279
285
  if (operationRequest.getRequestId() != -1)
280
286
  {
281
- operationRequest.setRequestId(PeerBase.requestId++);
282
-
283
287
  if (operationPending.getCallback() != null)
284
288
  {
285
289
  this.operationWaitingResponseDict[operationRequest.getRequestId()] = operationPending;
@@ -201,6 +201,11 @@
201
201
  this.networkingSocketPeerBase.send(operationPending.getRequestType(), operationPending.getRequestRole(), operationPending.getOperationRequest(), authToken, secretKey, customTags, gameId);
202
202
  }
203
203
 
204
+ protected override void onEnqueue(OperationPending operationPending)
205
+ {
206
+ GNDebug.log("[GN Socket ENQUEUE] " + operationPending.getOperationRequest().ToString());
207
+ }
208
+
204
209
  /// <summary>
205
210
  /// Handles incoming socket events and invokes appropriate handlers.
206
211
  /// </summary>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.xmobitea.changx.gn-unity",
3
- "version": "2.4.8",
3
+ "version": "2.4.10",
4
4
  "displayName": "XmobiTea GN Unity",
5
5
  "description": "XmobiTea Unity packages",
6
6
  "unity": "2020.3",