com.xd.sdk.account 7.2.0 → 7.2.1-alpha.2
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/Internal/Standalone/AccessToken/AccessTokenModule.cs +4 -0
- package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs +13 -5
- package/Runtime/Internal/Standalone/Auth/SteamAuth.cs +4 -4
- package/Runtime/Internal/Standalone/LoginModule/Email/EmailModule.cs +1 -1
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModule.cs +1 -1
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModuleIO.cs +1 -1
- package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs +4 -0
- package/Runtime/Internal/Standalone/Track/AliyunTrack.Login.cs +1 -3
- package/Runtime/Internal/Standalone/UI/CodeUnbindAlert.cs +1 -1
- package/Runtime/Internal/Standalone/UI/Email/EmailAlert.cs +1 -1
- package/Runtime/Internal/Standalone/UI/PhoneIO/AreaCodeCell.cs +1 -1
- package/Runtime/Internal/Standalone/UI/PhoneIO/PhoneAlertIO.cs +1 -1
- package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs +1 -1
- package/Runtime/Internal/Standalone/UI/PhoneVerification/VerifyCodeInputAlert.cs +1 -1
- package/Runtime/Internal/Standalone/UserModule.cs +31 -6
- package/package.json +2 -2
|
@@ -116,11 +116,15 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
116
116
|
if (xdException.Code == ResponseCode.Account.TokenExpired || xdException.HttpStatusCode == 401)
|
|
117
117
|
errorMsg = "XD_TOKEN_EXPIRED";
|
|
118
118
|
// 触发风控以及登陆频繁不需要发送 PreFail
|
|
119
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
119
120
|
if (xdException.Code != PhoneModule.INVALID_VERIFY_CODE &&
|
|
120
121
|
xdException.Code != PhoneModule.LOGIN_REQUEST_FREQUENTLY)
|
|
121
122
|
{
|
|
122
123
|
AliyunTrack.LoginPreFail(errorMsg);
|
|
123
124
|
}
|
|
125
|
+
#else
|
|
126
|
+
AliyunTrack.LoginPreFail(errorMsg);
|
|
127
|
+
#endif
|
|
124
128
|
|
|
125
129
|
throw xdException;
|
|
126
130
|
}
|
|
@@ -66,11 +66,11 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
66
66
|
}
|
|
67
67
|
catch (XDGError xe)
|
|
68
68
|
{
|
|
69
|
-
errorCallback?.Invoke(xe);
|
|
69
|
+
errorCallback?.Invoke(xe.ParseToError());
|
|
70
70
|
}
|
|
71
71
|
catch (Exception e)
|
|
72
72
|
{
|
|
73
|
-
errorCallback?.Invoke(
|
|
73
|
+
errorCallback?.Invoke(e.ParseToError());
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -117,6 +117,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
117
117
|
|
|
118
118
|
public async void OpenUserDashboard(XDGRoleInfo roleInfo)
|
|
119
119
|
{
|
|
120
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
120
121
|
try
|
|
121
122
|
{
|
|
122
123
|
if (!XDGCommonInternal.IsCn())
|
|
@@ -184,6 +185,9 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
184
185
|
{
|
|
185
186
|
XDGLogger.Error(new XDGError(ResponseCode.Common.Failed, e.Message), XDGLoggerTag.Account);
|
|
186
187
|
}
|
|
188
|
+
#else
|
|
189
|
+
XDGLogger.Error("This function need vuplex enabled", XDGLoggerTag.Account);
|
|
190
|
+
#endif
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
public async void OpenAccountDeletion()
|
|
@@ -207,7 +211,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
207
211
|
}
|
|
208
212
|
catch (XDGError e)
|
|
209
213
|
{
|
|
210
|
-
callback?.Invoke(false,
|
|
214
|
+
callback?.Invoke(false, e.ParseToError());
|
|
211
215
|
}
|
|
212
216
|
}
|
|
213
217
|
|
|
@@ -239,8 +243,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
239
243
|
{
|
|
240
244
|
var user = await UserModule.Login(loginType);
|
|
241
245
|
AliyunTrack.LoginAntiAddictionStartup();
|
|
242
|
-
var complianceResult =
|
|
243
|
-
await XDGEventBus.PublishAsync<Dictionary<string, object>>(XDGEvents.TapSDKComplianceStartup, ConfigModule.IsGlobal, user.UserId);
|
|
246
|
+
var complianceResult = await XDGEventBus.PublishAsync<Dictionary<string, object>>(XDGEvents.TapSDKComplianceStartup, ConfigModule.IsGlobal, user.UserId);
|
|
244
247
|
// TODO 统一走回调进行埋点
|
|
245
248
|
// AliyunTrack.LoginAntiAddictionResult(XDDictionary.GetValue(complianceResult, "code", -100),
|
|
246
249
|
// XDDictionary.GetValue<string>(complianceResult, "reason"),
|
|
@@ -249,6 +252,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
249
252
|
if (XDDictionary.GetValue<bool>(compliance, "success"))
|
|
250
253
|
{
|
|
251
254
|
await AgreementModule.SignAgreement(user.UserId);
|
|
255
|
+
AliyunTrack.LoginSuccess();
|
|
252
256
|
return user;
|
|
253
257
|
}
|
|
254
258
|
|
|
@@ -327,6 +331,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
327
331
|
|
|
328
332
|
private async Task CancelAccount()
|
|
329
333
|
{
|
|
334
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
330
335
|
var current = UserModule.current;
|
|
331
336
|
if (current == null)
|
|
332
337
|
{
|
|
@@ -389,6 +394,9 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
389
394
|
{
|
|
390
395
|
UIManager.DismissLoading();
|
|
391
396
|
}
|
|
397
|
+
#else
|
|
398
|
+
XDGLogger.Error("This function need vuplex enabled", XDGLoggerTag.Account);
|
|
399
|
+
#endif
|
|
392
400
|
}
|
|
393
401
|
|
|
394
402
|
private static async Task<XDGUser> InvokeXdgPaymentCheckRefundStatusWithUI(XDGUser user)
|
|
@@ -14,7 +14,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
14
14
|
|
|
15
15
|
internal static async Task<Dictionary<string, object>> GetAuthData()
|
|
16
16
|
{
|
|
17
|
-
if (
|
|
17
|
+
if (SteamWrapper.Initialized())
|
|
18
18
|
{
|
|
19
19
|
// 先尝试从 Steam SDK 中获取 auth data
|
|
20
20
|
Dictionary<string, object> authData = await GetAuthDataFromSDK();
|
|
@@ -38,7 +38,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
38
38
|
AliyunTrack.LoginAuthorize();
|
|
39
39
|
try
|
|
40
40
|
{
|
|
41
|
-
string ticket = await
|
|
41
|
+
string ticket = await SteamWrapper.Instance.GetAuthTicket();
|
|
42
42
|
if (string.IsNullOrWhiteSpace(ticket))
|
|
43
43
|
{
|
|
44
44
|
// 登陆授权失败
|
|
@@ -70,12 +70,12 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
70
70
|
|
|
71
71
|
public static string GetSteamIdFromSDK()
|
|
72
72
|
{
|
|
73
|
-
return
|
|
73
|
+
return SteamWrapper.Instance.GetSteamId();
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
public static Dictionary<string, object> GetCacheData()
|
|
77
77
|
{
|
|
78
|
-
if (!
|
|
78
|
+
if (!SteamWrapper.Initialized())
|
|
79
79
|
{
|
|
80
80
|
return null;
|
|
81
81
|
}
|
|
@@ -440,12 +440,10 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
440
440
|
content["user_login_type"] = string.IsNullOrEmpty(current) ? "" : userLoginTypeString;
|
|
441
441
|
content["logid"] = CommonTrack.GetLogId(LoginEventSessionId, eventName);
|
|
442
442
|
content["isLoginModule"] = "true";
|
|
443
|
-
|
|
444
|
-
if (SteamUtils.IsSDKSupported)
|
|
443
|
+
if (SteamWrapper.Initialized())
|
|
445
444
|
{
|
|
446
445
|
content["console_type"] = "steam";
|
|
447
446
|
}
|
|
448
|
-
#endif
|
|
449
447
|
|
|
450
448
|
if (isPhoneLogin)
|
|
451
449
|
{
|
|
@@ -108,6 +108,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
108
108
|
if (loginType == LoginType.Phone)
|
|
109
109
|
{
|
|
110
110
|
AliyunTrack.ResetPhoneLoginData();
|
|
111
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
111
112
|
if (XDGCommonInternal.IsCn())
|
|
112
113
|
{
|
|
113
114
|
await PhoneModule.Bind();
|
|
@@ -116,6 +117,9 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
116
117
|
{
|
|
117
118
|
await PhoneModuleIO.LoginOrBind(false);
|
|
118
119
|
}
|
|
120
|
+
#else
|
|
121
|
+
throw new XDGError(ResponseCode.Common.Failed, "This function need vuplex enabled");
|
|
122
|
+
#endif
|
|
119
123
|
|
|
120
124
|
return;
|
|
121
125
|
}
|
|
@@ -124,11 +128,15 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
124
128
|
if (XDGCommonInternal.IsCn())
|
|
125
129
|
{
|
|
126
130
|
XDGLogger.Warn("暂不支持的登录方式", XDGLoggerTag.Account);
|
|
127
|
-
throw new XDGError(ResponseCode.
|
|
131
|
+
throw new XDGError(ResponseCode.Account.TypeNotAvailable, "Email auth is not support in CN");
|
|
128
132
|
}
|
|
129
133
|
else
|
|
130
134
|
{
|
|
135
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
131
136
|
await EmailModule.LoginOrBind(false);
|
|
137
|
+
#else
|
|
138
|
+
throw new XDGError(ResponseCode.Common.Failed, "This function need vuplex enabled");
|
|
139
|
+
#endif
|
|
132
140
|
}
|
|
133
141
|
|
|
134
142
|
return;
|
|
@@ -143,6 +151,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
143
151
|
if (loginType == LoginType.Phone)
|
|
144
152
|
{
|
|
145
153
|
AliyunTrack.ResetPhoneLoginData();
|
|
154
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
146
155
|
// 手机号解绑需要验证码
|
|
147
156
|
if (XDGCommonInternal.IsCn())
|
|
148
157
|
{
|
|
@@ -152,17 +161,24 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
152
161
|
{
|
|
153
162
|
return PhoneModuleIO.Unbind(extras);
|
|
154
163
|
}
|
|
164
|
+
#else
|
|
165
|
+
throw new XDGError(ResponseCode.Common.Failed, "This function need vuplex enabled");
|
|
166
|
+
#endif
|
|
155
167
|
}
|
|
156
168
|
else if (loginType == LoginType.Email)
|
|
157
169
|
{
|
|
158
170
|
if (XDGCommonInternal.IsCn())
|
|
159
171
|
{
|
|
160
172
|
XDGLogger.Warn($"暂不支持的登录方式:{LoginType.Email}", XDGLoggerTag.Account);
|
|
161
|
-
throw new XDGError(ResponseCode.Common.UnavailableService, "
|
|
173
|
+
throw new XDGError(ResponseCode.Common.UnavailableService, "Email auth is not support in CN");
|
|
162
174
|
}
|
|
163
175
|
else
|
|
164
176
|
{
|
|
177
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
165
178
|
return EmailModule.Unbind(extras);
|
|
179
|
+
#else
|
|
180
|
+
throw new XDGError(ResponseCode.Common.Failed, "This function need vuplex enabled");
|
|
181
|
+
#endif
|
|
166
182
|
}
|
|
167
183
|
}
|
|
168
184
|
|
|
@@ -216,7 +232,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
216
232
|
catch (XDGError e)
|
|
217
233
|
{
|
|
218
234
|
XDGLogger.Warn(e.ErrorMsg, XDGLoggerTag.Account);
|
|
219
|
-
throw
|
|
235
|
+
throw;
|
|
220
236
|
}
|
|
221
237
|
}
|
|
222
238
|
|
|
@@ -228,7 +244,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
228
244
|
{
|
|
229
245
|
if (e.HttpStatusCode == 401 || e.Code == 40311 || e.Code == 40312)
|
|
230
246
|
{
|
|
231
|
-
throw
|
|
247
|
+
throw;
|
|
232
248
|
}
|
|
233
249
|
}
|
|
234
250
|
catch (Exception e)
|
|
@@ -249,6 +265,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
249
265
|
{
|
|
250
266
|
AliyunTrack.ResetPhoneLoginData();
|
|
251
267
|
AliyunTrack.LoginEnableSDKLoginTrack();
|
|
268
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
252
269
|
if (XDGCommonInternal.IsCn())
|
|
253
270
|
{
|
|
254
271
|
await PhoneModule.Login();
|
|
@@ -259,13 +276,21 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
259
276
|
}
|
|
260
277
|
|
|
261
278
|
UIManager.ShowLoading();
|
|
279
|
+
#else
|
|
280
|
+
throw new XDGError(ResponseCode.Common.Failed, "This function need vuplex enabled");
|
|
281
|
+
#endif
|
|
262
282
|
}
|
|
263
283
|
else if (loginType == LoginType.Email)
|
|
264
284
|
{
|
|
265
285
|
AliyunTrack.ResetEmailLoginData();
|
|
266
286
|
AliyunTrack.LoginEnableSDKLoginTrack();
|
|
287
|
+
#if (UNITY_EDITOR || UNITY_STANDALONE) && !XDSDK_DISABLE_VUPLEX
|
|
267
288
|
await EmailModule.LoginOrBind(true);
|
|
268
289
|
UIManager.ShowLoading();
|
|
290
|
+
#else
|
|
291
|
+
throw new XDGError(ResponseCode.Common.Failed, "This function need vuplex enabled");
|
|
292
|
+
#endif
|
|
293
|
+
|
|
269
294
|
}
|
|
270
295
|
else
|
|
271
296
|
{
|
|
@@ -356,7 +381,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
356
381
|
public static async Task<XDGUser> LoginByConsole()
|
|
357
382
|
{
|
|
358
383
|
// 判断当前有接入哪个主机 SDK
|
|
359
|
-
if (
|
|
384
|
+
if (SteamWrapper.Initialized())
|
|
360
385
|
{
|
|
361
386
|
try
|
|
362
387
|
{
|
|
@@ -444,7 +469,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
444
469
|
case LoginType.Facebook:
|
|
445
470
|
return await FacebookAuth.GetAuthData();
|
|
446
471
|
default:
|
|
447
|
-
|
|
472
|
+
throw new XDGError(ResponseCode.Account.TypeNotAvailable, "暂不支持的登录方式");
|
|
448
473
|
}
|
|
449
474
|
}
|
|
450
475
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.account",
|
|
3
3
|
"displayName": "XDGSDK Account",
|
|
4
|
-
"version": "7.2.
|
|
4
|
+
"version": "7.2.1-alpha.2",
|
|
5
5
|
"description": "XDGSDK",
|
|
6
6
|
"unity": "2019.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.sdk.common": "7.2.
|
|
9
|
+
"com.xd.sdk.common": "7.2.1-alpha.2"
|
|
10
10
|
}
|
|
11
11
|
}
|