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.
- package/Runtime/Constant/EnumType/ExecuteResponseStatus.cs +13 -0
- package/Runtime/Constant/EnumType/ExecuteResponseStatus.cs.meta +11 -0
- package/Runtime/Constant/ParameterCode/GNParameterCode.cs +17 -0
- package/Runtime/Entity/Models/AuthenticateModels.cs +8 -8
- package/Runtime/Entity/Models/DashboardModels.cs +103 -1
- package/Runtime/Entity/Models/MasterPlayerModels.cs +8 -8
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs +16 -16
- package/Runtime/Entity/Response/GetAuthInfoResponse.cs +24 -0
- package/Runtime/Entity/Response/GetAuthInfoResponse.cs.meta +11 -0
- package/Runtime/GNNetworkApi.cs +33 -0
- package/Runtime/Networking/NetworkingPeerAPI.cs +58 -0
- package/package.json +1 -1
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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,
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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.
|
|
152
|
+
public class LinkAccountOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
153
153
|
{
|
|
154
154
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
public class LinkAndroidDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
157
|
+
public class LinkAndroidDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
158
158
|
{
|
|
159
159
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
public class LinkAppleOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
162
|
+
public class LinkAppleOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
163
163
|
{
|
|
164
164
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
public class LinkCustomDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
167
|
+
public class LinkCustomDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
168
168
|
{
|
|
169
169
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
public class LinkCustomIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
172
|
+
public class LinkCustomIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
173
173
|
{
|
|
174
174
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
public class LinkEditorDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
177
|
+
public class LinkEditorDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
178
178
|
{
|
|
179
179
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
public class LinkFacebookOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
182
|
+
public class LinkFacebookOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
183
183
|
{
|
|
184
184
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
public class LinkGenericServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
187
|
+
public class LinkGenericServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
188
188
|
{
|
|
189
189
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
public class LinkGoogleOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
192
|
+
public class LinkGoogleOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
193
193
|
{
|
|
194
194
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
public class LinkGooglePlayGameServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
197
|
+
public class LinkGooglePlayGameServiceOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
198
198
|
{
|
|
199
199
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
public class LinkGameCenterOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
202
|
+
public class LinkGameCenterOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
203
203
|
{
|
|
204
204
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
public class LinkiOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
207
|
+
public class LinkiOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
208
208
|
{
|
|
209
209
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
public class LinkLinuxDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
212
|
+
public class LinkLinuxDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
213
213
|
{
|
|
214
214
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
public class LinkMacOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
217
|
+
public class LinkMacOSDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
218
218
|
{
|
|
219
219
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
public class LinkWindowsDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
222
|
+
public class LinkWindowsDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.MasterPlayerResponseData>
|
|
223
223
|
{
|
|
224
224
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
public class LinkWindowsPhoneDeviceIdOperationResponse : CustomOperationResponse<MasterPlayerModels.
|
|
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
|
+
}
|
package/Runtime/GNNetworkApi.cs
CHANGED
|
@@ -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
|
}
|