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

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.
@@ -0,0 +1,13 @@
1
+ namespace XmobiTea.GN.Constant
2
+ {
3
+ public enum ExecuteResponseStatus
4
+ {
5
+ Ok = 1,
6
+ Exception = 2,
7
+ FunctionNameNotFound = 3,
8
+ VersionInvalid = 4,
9
+ Timeout = 5,
10
+
11
+ }
12
+
13
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a47fe9a70cba79b42a406fea5719b286
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -613,6 +613,23 @@
613
613
  public const string Body = "body";
614
614
  public const string TargetPlatforms = "targetPlatforms";
615
615
 
616
+ public const string OperationSystem = "operationSystem";
617
+ public const string RequestComplete = "requestComplete";
618
+ public const string CpuUsage = "cpuUsage";
619
+ public const string MemoryUsage = "memoryUsage";
620
+ public const string StorageUsage = "storageUsage";
621
+ public const string FreeMemoryInBytes = "freeMemoryInBytes";
622
+ public const string TotalMemoryInBytes = "totalMemoryInBytes";
623
+ public const string ErrorCode = "errorCode";
624
+ public const string Count = "count";
625
+ public const string FsTotalSizeInBytes = "fsTotalSizeInBytes";
626
+ public const string FsUsedSizeInBytes = "fsUsedSizeInBytes";
627
+ public const string TotalSizeInBytes = "totalSizeInBytes";
628
+ public const string Collections = "collections";
629
+ public const string Objects = "objects";
630
+ public const string Indexes = "indexes";
631
+ public const string DatabaseSystem = "databaseSystem";
632
+
616
633
  }
617
634
 
618
635
  }
@@ -34,7 +34,7 @@
34
34
 
35
35
  public class LoginByAppleRequestData
36
36
  {
37
- [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 512, mustNonNull = true)]
37
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
38
38
  public string token;
39
39
 
40
40
  [BooleanDataMember(code = GNParameterCode.CreatePlayerIfNotExists, isOptional = true, defaultValue = false)]
@@ -86,7 +86,7 @@
86
86
 
87
87
  public class LoginByFacebookRequestData
88
88
  {
89
- [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 512, mustNonNull = true)]
89
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
90
90
  public string token;
91
91
 
92
92
  [BooleanDataMember(code = GNParameterCode.CreatePlayerIfNotExists, isOptional = true, defaultValue = false)]
@@ -115,7 +115,7 @@
115
115
 
116
116
  public class LoginByGoogleRequestData
117
117
  {
118
- [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 512, mustNonNull = true)]
118
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
119
119
  public string token;
120
120
 
121
121
  [NumberDataMember(code = GNParameterCode.Type, minValue = 1, maxValue = 2, mustInt = true)]
@@ -131,7 +131,7 @@
131
131
 
132
132
  public class LoginByGooglePlayGameServiceRequestData
133
133
  {
134
- [StringDataMember(code = GNParameterCode.Token, minLength = 20, maxLength = 512, mustNonNull = true)]
134
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
135
135
  public string token;
136
136
 
137
137
  [BooleanDataMember(code = GNParameterCode.CreatePlayerIfNotExists, isOptional = true, defaultValue = false)]
@@ -147,16 +147,16 @@
147
147
  [StringDataMember(code = GNParameterCode.PlayerId, minLength = 2, maxLength = 64, mustNonNull = true)]
148
148
  public string playerId;
149
149
 
150
- [StringDataMember(code = GNParameterCode.Name, minLength = 2, maxLength = 64, mustNonNull = true)]
150
+ [StringDataMember(code = GNParameterCode.Name, minLength = 2, maxLength = 128, mustNonNull = true)]
151
151
  public string name;
152
152
 
153
- [StringDataMember(code = GNParameterCode.PublicKeyUrl, minLength = 2, maxLength = 256, mustNonNull = true)]
153
+ [StringDataMember(code = GNParameterCode.PublicKeyUrl, minLength = 2, maxLength = 2048, mustNonNull = true)]
154
154
  public string publicKeyUrl;
155
155
 
156
- [StringDataMember(code = GNParameterCode.Signature, minLength = 2, maxLength = 512, mustNonNull = true)]
156
+ [StringDataMember(code = GNParameterCode.Signature, minLength = 2, maxLength = 2048, mustNonNull = true)]
157
157
  public string signature;
158
158
 
159
- [StringDataMember(code = GNParameterCode.Salt, minLength = 2, maxLength = 128, mustNonNull = true)]
159
+ [StringDataMember(code = GNParameterCode.Salt, minLength = 2, maxLength = 256, mustNonNull = true)]
160
160
  public string salt;
161
161
 
162
162
  [NumberDataMember(code = GNParameterCode.Timestamp)]
@@ -194,6 +194,21 @@
194
194
  [NumberDataMember(code = GNParameterCode.Timestamp, minValue = 0, isOptional = true)]
195
195
  public long? timestamp;
196
196
 
197
+ [BooleanDataMember(code = GNParameterCode.AnalyticsItem, isOptional = true)]
198
+ public bool? analyticsItem;
199
+
200
+ [BooleanDataMember(code = GNParameterCode.Country, isOptional = true)]
201
+ public bool? country;
202
+
203
+ [BooleanDataMember(code = GNParameterCode.RequestComplete, isOptional = true)]
204
+ public bool? requestComplete;
205
+
206
+ [BooleanDataMember(code = GNParameterCode.OperationSystem, isOptional = true)]
207
+ public bool? operationSystem;
208
+
209
+ [BooleanDataMember(code = GNParameterCode.DatabaseSystem, isOptional = true)]
210
+ public bool? databaseSystem;
211
+
197
212
  }
198
213
 
199
214
  public class GetEventCallbackCloudScriptRequestData
@@ -205,7 +220,7 @@
205
220
  [StringDataMember(code = GNParameterCode.EventName, minLength = 6, maxLength = 128, mustNonNull = true)]
206
221
  public string eventName;
207
222
 
208
- [StringDataMember(code = GNParameterCode.Script, minLength = 6, maxLength = 128, mustNonNull = true)]
223
+ [StringDataMember(code = GNParameterCode.Script, minLength = 6, maxLength = int.MaxValue, mustNonNull = true)]
209
224
  public string script;
210
225
 
211
226
  }
@@ -2087,6 +2102,84 @@
2087
2102
 
2088
2103
  }
2089
2104
 
2105
+ public class MemoryUsageResponseData
2106
+ {
2107
+ [NumberDataMember(code = GNParameterCode.FreeMemoryInBytes)]
2108
+ public double freeMemoryInBytes;
2109
+
2110
+ [NumberDataMember(code = GNParameterCode.TotalMemoryInBytes)]
2111
+ public double totalMemoryInBytes;
2112
+
2113
+ }
2114
+
2115
+ public class StorageUsageResponseData
2116
+ {
2117
+ [StringDataMember(code = GNParameterCode.Name)]
2118
+ public string name;
2119
+
2120
+ [NumberDataMember(code = GNParameterCode.FsTotalSizeInBytes)]
2121
+ public double fsTotalSizeInBytes;
2122
+
2123
+ [NumberDataMember(code = GNParameterCode.FsUsedSizeInBytes)]
2124
+ public double fsUsedSizeInBytes;
2125
+
2126
+ }
2127
+
2128
+ public class DatabaseSystemResponseData
2129
+ {
2130
+ [NumberDataMember(code = GNParameterCode.FsTotalSizeInBytes)]
2131
+ public double fsTotalSizeInBytes;
2132
+
2133
+ [NumberDataMember(code = GNParameterCode.FsUsedSizeInBytes)]
2134
+ public double fsUsedSizeInBytes;
2135
+
2136
+ [NumberDataMember(code = GNParameterCode.TotalSizeInBytes)]
2137
+ public double totalSizeInBytes;
2138
+
2139
+ [NumberDataMember(code = GNParameterCode.Collections)]
2140
+ public int collections;
2141
+
2142
+ [NumberDataMember(code = GNParameterCode.Objects)]
2143
+ public int objects;
2144
+
2145
+ [NumberDataMember(code = GNParameterCode.Indexes)]
2146
+ public int indexes;
2147
+
2148
+ }
2149
+
2150
+ public class OperationSystemResponseData
2151
+ {
2152
+ [NumberDataMember(code = GNParameterCode.CpuUsage)]
2153
+ public double cpuUsage;
2154
+
2155
+ [GNHashtableDataMember(code = GNParameterCode.MemoryUsage)]
2156
+ public MemoryUsageResponseData memoryUsage;
2157
+
2158
+ [GNArrayDataMember(code = GNParameterCode.StorageUsage, elementCls = typeof(StorageUsageResponseData))]
2159
+ public List<StorageUsageResponseData>? storageUsage;
2160
+
2161
+ }
2162
+
2163
+ public class RequestCompleteErrorCodeResponseData
2164
+ {
2165
+ [NumberDataMember(code = GNParameterCode.ErrorCode)]
2166
+ public int errorCode;
2167
+
2168
+ [NumberDataMember(code = GNParameterCode.Count)]
2169
+ public int count;
2170
+
2171
+ }
2172
+
2173
+ public class RequestCompleteResponseData
2174
+ {
2175
+ [StringDataMember(code = GNParameterCode.EventName)]
2176
+ public string eventName;
2177
+
2178
+ [GNArrayDataMember(code = GNParameterCode.Results, elementCls = typeof(RequestCompleteErrorCodeResponseData))]
2179
+ public List<RequestCompleteErrorCodeResponseData>? results;
2180
+
2181
+ }
2182
+
2090
2183
  public class GetAnalyticsResponseData
2091
2184
  {
2092
2185
  [GNHashtableDataMember(code = GNParameterCode.AnalyticsItem, isOptional = true)]
@@ -2095,6 +2188,15 @@
2095
2188
  [GNArrayDataMember(code = GNParameterCode.Country, elementCls = typeof(CountryResponseData), isOptional = true)]
2096
2189
  public List<CountryResponseData>? country;
2097
2190
 
2191
+ [GNHashtableDataMember(code = GNParameterCode.OperationSystem, isOptional = true)]
2192
+ public OperationSystemResponseData? operationSystem;
2193
+
2194
+ [GNArrayDataMember(code = GNParameterCode.RequestComplete, elementCls = typeof(RequestCompleteResponseData), isOptional = true)]
2195
+ public List<RequestCompleteResponseData>? requestComplete;
2196
+
2197
+ [GNHashtableDataMember(code = GNParameterCode.DatabaseSystem, isOptional = true)]
2198
+ public DatabaseSystemResponseData? databaseSystem;
2199
+
2098
2200
  }
2099
2201
 
2100
2202
  public class ChildScriptResponseData
@@ -648,7 +648,7 @@
648
648
  [StringDataMember(code = GNParameterCode.UserId, minLength = 10, maxLength = 10, isOptional = true)]
649
649
  public string? userId;
650
650
 
651
- [StringDataMember(code = GNParameterCode.Token, minLength = 64, maxLength = 512, mustNonNull = true)]
651
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
652
652
  public string token;
653
653
 
654
654
  [BooleanDataMember(code = GNParameterCode.ForceLink, isOptional = true, defaultValue = false)]
@@ -744,7 +744,7 @@
744
744
  [StringDataMember(code = GNParameterCode.UserId, minLength = 10, maxLength = 10, isOptional = true)]
745
745
  public string? userId;
746
746
 
747
- [StringDataMember(code = GNParameterCode.Token, minLength = 64, maxLength = 512, mustNonNull = true)]
747
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
748
748
  public string token;
749
749
 
750
750
  [BooleanDataMember(code = GNParameterCode.ForceLink, isOptional = true, defaultValue = false)]
@@ -795,7 +795,7 @@
795
795
  [StringDataMember(code = GNParameterCode.UserId, minLength = 10, maxLength = 10, isOptional = true)]
796
796
  public string? userId;
797
797
 
798
- [StringDataMember(code = GNParameterCode.Token, maxLength = 512, minLength = 32, mustNonNull = true)]
798
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
799
799
  public string token;
800
800
 
801
801
  [NumberDataMember(code = GNParameterCode.Type, minValue = 1, maxValue = 2)]
@@ -822,7 +822,7 @@
822
822
  [StringDataMember(code = GNParameterCode.UserId, minLength = 10, maxLength = 10, isOptional = true)]
823
823
  public string? userId;
824
824
 
825
- [StringDataMember(code = GNParameterCode.Token, minLength = 20, maxLength = 512, mustNonNull = true)]
825
+ [StringDataMember(code = GNParameterCode.Token, minLength = 32, maxLength = 2048, mustNonNull = true)]
826
826
  public string token;
827
827
 
828
828
  [BooleanDataMember(code = GNParameterCode.ForceLink, isOptional = true, defaultValue = false)]
@@ -849,16 +849,16 @@
849
849
  [StringDataMember(code = GNParameterCode.PlayerId, minLength = 2, maxLength = 64, mustNonNull = true)]
850
850
  public string playerId;
851
851
 
852
- [StringDataMember(code = GNParameterCode.Name, minLength = 2, maxLength = 64, mustNonNull = true)]
852
+ [StringDataMember(code = GNParameterCode.Name, minLength = 2, maxLength = 128, mustNonNull = true)]
853
853
  public string name;
854
854
 
855
- [StringDataMember(code = GNParameterCode.PublicKeyUrl, minLength = 2, maxLength = 256, mustNonNull = true)]
855
+ [StringDataMember(code = GNParameterCode.PublicKeyUrl, minLength = 2, maxLength = 2048, mustNonNull = true)]
856
856
  public string publicKeyUrl;
857
857
 
858
- [StringDataMember(code = GNParameterCode.Signature, minLength = 2, maxLength = 512, mustNonNull = true)]
858
+ [StringDataMember(code = GNParameterCode.Signature, minLength = 2, maxLength = 2048, mustNonNull = true)]
859
859
  public string signature;
860
860
 
861
- [StringDataMember(code = GNParameterCode.Salt, minLength = 2, maxLength = 128, mustNonNull = true)]
861
+ [StringDataMember(code = GNParameterCode.Salt, minLength = 2, maxLength = 256, mustNonNull = true)]
862
862
  public string salt;
863
863
 
864
864
  [NumberDataMember(code = GNParameterCode.Timestamp)]
@@ -149,82 +149,82 @@
149
149
 
150
150
  }
151
151
 
152
- public class LinkAccountOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
152
+ public class LinkAccountOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
153
153
  {
154
154
 
155
155
  }
156
156
 
157
- public class LinkAndroidDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
157
+ public class LinkAndroidDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
158
158
  {
159
159
 
160
160
  }
161
161
 
162
- public class LinkAppleOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
162
+ public class LinkAppleOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
163
163
  {
164
164
 
165
165
  }
166
166
 
167
- public class LinkCustomDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
167
+ public class LinkCustomDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
168
168
  {
169
169
 
170
170
  }
171
171
 
172
- public class LinkCustomIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
172
+ public class LinkCustomIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
173
173
  {
174
174
 
175
175
  }
176
176
 
177
- public class LinkEditorDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
177
+ public class LinkEditorDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
178
178
  {
179
179
 
180
180
  }
181
181
 
182
- public class LinkFacebookOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
182
+ public class LinkFacebookOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
183
183
  {
184
184
 
185
185
  }
186
186
 
187
- public class LinkGenericServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
187
+ public class LinkGenericServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
188
188
  {
189
189
 
190
190
  }
191
191
 
192
- public class LinkGoogleOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
192
+ public class LinkGoogleOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
193
193
  {
194
194
 
195
195
  }
196
196
 
197
- public class LinkGooglePlayGameServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
197
+ public class LinkGooglePlayGameServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
198
198
  {
199
199
 
200
200
  }
201
201
 
202
- public class LinkGameCenterOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
202
+ public class LinkGameCenterOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
203
203
  {
204
204
 
205
205
  }
206
206
 
207
- public class LinkiOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
207
+ public class LinkiOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
208
208
  {
209
209
 
210
210
  }
211
211
 
212
- public class LinkLinuxDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
212
+ public class LinkLinuxDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
213
213
  {
214
214
 
215
215
  }
216
216
 
217
- public class LinkMacOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
217
+ public class LinkMacOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
218
218
  {
219
219
 
220
220
  }
221
221
 
222
- public class LinkWindowsDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
222
+ public class LinkWindowsDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
223
223
  {
224
224
 
225
225
  }
226
226
 
227
- public class LinkWindowsPhoneDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.EmptyResponseData>
227
+ public class LinkWindowsPhoneDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
228
228
  {
229
229
 
230
230
  }
@@ -0,0 +1,24 @@
1
+ namespace XmobiTea.GN.Entity.Response
2
+ {
3
+ using XmobiTea.GN.Common;
4
+
5
+ public class AuthInfoResponse
6
+ {
7
+ public string gnToken;
8
+ public string userId;
9
+ public bool isRemove;
10
+ public long tsExpire;
11
+ public GNHashtable otherDatas;
12
+ public long tsCreate;
13
+ public string secretKey;
14
+
15
+ }
16
+
17
+ public class GetAuthInfoResponse
18
+ {
19
+ public string error;
20
+ public AuthInfoResponse? data;
21
+
22
+ }
23
+
24
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: eb6ed512707f2c14cbbb6cb233d0e14c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -2,6 +2,7 @@
2
2
  {
3
3
  using System;
4
4
  using System.Threading.Tasks;
5
+ using XmobiTea.GN.Entity.Response;
5
6
 
6
7
  public static partial class GNNetwork
7
8
  {
@@ -34,5 +35,37 @@
34
35
  // Return the Task to the caller, allowing them to await the result.
35
36
  return taskCompletionSource.Task;
36
37
  }
38
+
39
+ /// <summary>
40
+ /// Validate a GN authToken
41
+ /// </summary>
42
+ /// <param name="authToken"></param>
43
+ /// <param name="onResponse"></param>
44
+ public static void getAuthInfo(string authToken, Action<GetAuthInfoResponse> onResponse = null)
45
+ {
46
+ GNNetwork.peer.getAuthInfo(authToken, onResponse);
47
+ }
48
+
49
+ /// <summary>
50
+ /// Asynchronously validate a GN authToken
51
+ /// </summary>
52
+ /// <param name="authToken"></param>
53
+ /// <returns></returns>
54
+ public static Task<GetAuthInfoResponse> getAuthInfoAsync(string authToken)
55
+ {
56
+ // Create a TaskCompletionSource to manage the asynchronous operation.
57
+ var taskCompletionSource = new TaskCompletionSource<GetAuthInfoResponse>();
58
+
59
+ // Call the syncTs method and use the callback to set the Task result.
60
+ GNNetwork.getAuthInfo(authToken, response =>
61
+ {
62
+ // Set the result of the Task once the callback is invoked.
63
+ taskCompletionSource.SetResult(response);
64
+ });
65
+
66
+ // Return the Task to the caller, allowing them to await the result.
67
+ return taskCompletionSource.Task;
68
+ }
69
+
37
70
  }
38
71
  }
@@ -4,6 +4,7 @@
4
4
  using System.Collections;
5
5
  using XmobiTea.GN.Common;
6
6
  using XmobiTea.GN.Constant;
7
+ using XmobiTea.GN.Entity.Response;
7
8
  using XmobiTea.GN.Helper;
8
9
 
9
10
  /// <summary>
@@ -12,6 +13,7 @@
12
13
  public partial class NetworkingPeer
13
14
  {
14
15
  internal const string SYNC_TS = "ts"; // API endpoint for synchronizing timestamps.
16
+ internal const string GET_AUTH_INFO = "getAuthInfo"; // API endpoint for validate an GN authToken.
15
17
  internal const string UPLOAD_FILE = "upload"; // API endpoint for file uploads.
16
18
  internal const string DOWNLOAD_FILE = "download"; // API endpoint for file downloads.
17
19
  internal const string API_JSON = "api/" + Commands.RequestCmd_Json; // Base path for JSON API requests.
@@ -54,5 +56,61 @@
54
56
  onResponse?.Invoke(this.getServerTimestamp());
55
57
  });
56
58
  }
59
+
60
+ internal void getAuthInfo(string authToken, Action<GetAuthInfoResponse> onResponse)
61
+ {
62
+ // Sends a request to the GET_AUTH_INFO endpoint using the HTTP peer.
63
+ (this.httpPeer as Http.HttpPeer).getRequest(NetworkingPeer.GET_AUTH_INFO + "?authToken=" + authToken, httpAppResponse =>
64
+ {
65
+ // Processes the response if there is no error.
66
+ if (!httpAppResponse.hasError())
67
+ {
68
+ if (httpAppResponse.statusCode == 200) // HTTP success status.
69
+ {
70
+ // Parses the response text into a list and converts it to a GNArray.
71
+ var returnDatas = new GNHashtable.Builder().addAll((IDictionary)Parser.Parse(httpAppResponse.text)).build();
72
+ if (returnDatas["error"] != null)
73
+ {
74
+ onResponse?.Invoke(new GetAuthInfoResponse()
75
+ {
76
+ error = (string)returnDatas["error"]
77
+ });
78
+ }
79
+ else
80
+ {
81
+ onResponse?.Invoke(new GetAuthInfoResponse()
82
+ {
83
+ error = null,
84
+ data = new AuthInfoResponse()
85
+ {
86
+ gnToken = returnDatas.getString("gnToken"),
87
+ userId = returnDatas.getString("userId"),
88
+ isRemove = returnDatas.getBool("isRemove"),
89
+ tsExpire = returnDatas.getLong("tsExpire"),
90
+ otherDatas = returnDatas.getGNHashtable("otherDatas"),
91
+ tsCreate = returnDatas.getLong("tsCreate"),
92
+ secretKey = returnDatas.getString("secretKey"),
93
+ }
94
+ });
95
+ }
96
+ }
97
+ else
98
+ {
99
+ onResponse?.Invoke(new GetAuthInfoResponse()
100
+ {
101
+ error = "unknown error"
102
+ });
103
+ }
104
+
105
+ return;
106
+ }
107
+
108
+ // Invokes the callback with the current server timestamp.
109
+ onResponse?.Invoke(new GetAuthInfoResponse()
110
+ {
111
+ error = httpAppResponse.error
112
+ });
113
+ });
114
+ }
57
115
  }
58
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.xmobitea.changx.gn-unity",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
4
4
  "displayName": "XmobiTea GN Unity",
5
5
  "description": "XmobiTea Unity packages",
6
6
  "unity": "2020.3",