com.xd.sdk.account 7.2.0 → 7.2.1-alpha

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.
@@ -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(new XDGError(ResponseCode.Common.Failed, e.Message));
73
+ errorCallback?.Invoke(e.ParseToError());
74
74
  }
75
75
  }
76
76
 
@@ -207,7 +207,7 @@ namespace XD.SDK.Account.Internal.Standalone
207
207
  }
208
208
  catch (XDGError e)
209
209
  {
210
- callback?.Invoke(false, new XDGError(ResponseCode.Common.Failed, e.ErrorMsg));
210
+ callback?.Invoke(false, e.ParseToError());
211
211
  }
212
212
  }
213
213
 
@@ -239,8 +239,7 @@ namespace XD.SDK.Account.Internal.Standalone
239
239
  {
240
240
  var user = await UserModule.Login(loginType);
241
241
  AliyunTrack.LoginAntiAddictionStartup();
242
- var complianceResult =
243
- await XDGEventBus.PublishAsync<Dictionary<string, object>>(XDGEvents.TapSDKComplianceStartup, ConfigModule.IsGlobal, user.UserId);
242
+ var complianceResult = await XDGEventBus.PublishAsync<Dictionary<string, object>>(XDGEvents.TapSDKComplianceStartup, ConfigModule.IsGlobal, user.UserId);
244
243
  // TODO 统一走回调进行埋点
245
244
  // AliyunTrack.LoginAntiAddictionResult(XDDictionary.GetValue(complianceResult, "code", -100),
246
245
  // XDDictionary.GetValue<string>(complianceResult, "reason"),
@@ -249,6 +248,7 @@ namespace XD.SDK.Account.Internal.Standalone
249
248
  if (XDDictionary.GetValue<bool>(compliance, "success"))
250
249
  {
251
250
  await AgreementModule.SignAgreement(user.UserId);
251
+ AliyunTrack.LoginSuccess();
252
252
  return user;
253
253
  }
254
254
 
@@ -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 (SteamUtils.IsSDKSupported)
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 SteamUtils.Instance.GetAuthTicket();
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 SteamUtils.Instance.GetSteamId();
73
+ return SteamWrapper.Instance.GetSteamId();
74
74
  }
75
75
 
76
76
  public static Dictionary<string, object> GetCacheData()
77
77
  {
78
- if (!SteamUtils.IsSDKSupported)
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
- #if XD_STEAM_SUPPORT
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
  {
@@ -124,7 +124,7 @@ namespace XD.SDK.Account.Internal.Standalone
124
124
  if (XDGCommonInternal.IsCn())
125
125
  {
126
126
  XDGLogger.Warn("暂不支持的登录方式", XDGLoggerTag.Account);
127
- throw new XDGError(ResponseCode.Common.UnavailableService, "暂不支持的登录方式");
127
+ throw new XDGError(ResponseCode.Account.TypeNotAvailable, "Email auth is not support in CN");
128
128
  }
129
129
  else
130
130
  {
@@ -158,7 +158,7 @@ namespace XD.SDK.Account.Internal.Standalone
158
158
  if (XDGCommonInternal.IsCn())
159
159
  {
160
160
  XDGLogger.Warn($"暂不支持的登录方式:{LoginType.Email}", XDGLoggerTag.Account);
161
- throw new XDGError(ResponseCode.Common.UnavailableService, "暂不支持的登录方式");
161
+ throw new XDGError(ResponseCode.Common.UnavailableService, "Email auth is not support in CN");
162
162
  }
163
163
  else
164
164
  {
@@ -216,7 +216,7 @@ namespace XD.SDK.Account.Internal.Standalone
216
216
  catch (XDGError e)
217
217
  {
218
218
  XDGLogger.Warn(e.ErrorMsg, XDGLoggerTag.Account);
219
- throw new XDGError(ResponseCode.Common.Failed, e.ErrorMsg);
219
+ throw;
220
220
  }
221
221
  }
222
222
 
@@ -228,7 +228,7 @@ namespace XD.SDK.Account.Internal.Standalone
228
228
  {
229
229
  if (e.HttpStatusCode == 401 || e.Code == 40311 || e.Code == 40312)
230
230
  {
231
- throw e;
231
+ throw;
232
232
  }
233
233
  }
234
234
  catch (Exception e)
@@ -356,7 +356,7 @@ namespace XD.SDK.Account.Internal.Standalone
356
356
  public static async Task<XDGUser> LoginByConsole()
357
357
  {
358
358
  // 判断当前有接入哪个主机 SDK
359
- if (SteamUtils.IsSDKSupported)
359
+ if (SteamWrapper.Initialized())
360
360
  {
361
361
  try
362
362
  {
@@ -444,7 +444,7 @@ namespace XD.SDK.Account.Internal.Standalone
444
444
  case LoginType.Facebook:
445
445
  return await FacebookAuth.GetAuthData();
446
446
  default:
447
- return new Dictionary<string, object>();
447
+ throw new XDGError(ResponseCode.Account.TypeNotAvailable, "暂不支持的登录方式");
448
448
  }
449
449
  }
450
450
 
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.0",
4
+ "version": "7.2.1-alpha",
5
5
  "description": "XDGSDK",
6
6
  "unity": "2019.3",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "com.xd.sdk.common": "7.2.0"
9
+ "com.xd.sdk.common": "7.2.1-alpha"
10
10
  }
11
11
  }