com.xd.sdk.account 6.22.4 → 6.23.0

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,16 @@
1
+ package com.xd.account.bridge;
2
+
3
+ import com.tds.common.bridge.IBridgeService;
4
+ import com.tds.common.bridge.annotation.BridgeMethod;
5
+ import com.tds.common.bridge.annotation.BridgeParam;
6
+ import com.tds.common.bridge.annotation.BridgeService;
7
+
8
+ @BridgeService("XDGLoginServiceUnity")
9
+ public interface XDGLoginServiceUnity extends IBridgeService {
10
+
11
+ @BridgeMethod("openUserDashboard")
12
+ void openUserDashboard(@BridgeParam("serverId") String serverId,
13
+ @BridgeParam("roleId") String roleId,
14
+ @BridgeParam("roleName") String roleName,
15
+ @BridgeParam("extra") String extra);
16
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: e25783246c0d43df925f38764dc8d334
3
+ timeCreated: 1728722090
@@ -0,0 +1,20 @@
1
+ package com.xd.account.bridge;
2
+
3
+ import com.xd.intl.account.XDGAccount;
4
+ import com.xd.intl.account.v2.entity.RoleInfo;
5
+
6
+ public class XDGLoginServiceUnityImpl implements XDGLoginServiceUnity {
7
+ private static final String TAG = XDGLoginServiceUnity.class.getSimpleName();
8
+
9
+ @Override
10
+ public void openUserDashboard(String serverId, String roleId, String roleName, String extra) {
11
+ XDGAccount.openUserDashboard(
12
+ RoleInfo.newBuilder()
13
+ .setRoleId(roleId)
14
+ .setRoleName(roleName)
15
+ .setServerId(serverId)
16
+ .setExtra(extra)
17
+ .build()
18
+ );
19
+ }
20
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 51946fca756346f3a1c2248afd79784c
3
+ timeCreated: 1728722102
@@ -26,19 +26,4 @@ const char*XDAccountBridgeGetUser() {
26
26
  return [userDic.tdsglobal_jsonString UTF8String];
27
27
  }
28
28
 
29
- void XDAccountOpenUserDashboard(const char* roleId, const char* roleName, const char* serverId, const char* extra) {
30
- XDGRoleInfo *roleInfo = [XDGRoleInfo new];
31
- if (roleId){
32
- roleInfo.roleId = [NSString stringWithUTF8String:roleId];
33
- }
34
- if (roleName){
35
- roleInfo.roleName = [NSString stringWithUTF8String:roleName];
36
- }
37
- if (serverId){
38
- roleInfo.serverId = [NSString stringWithUTF8String:serverId];
39
- }
40
- if (extra){
41
- roleInfo.extra = [NSString stringWithUTF8String:extra];
42
- }
43
- [XDGAccount openUserDashboardWithInfo:roleInfo];
44
- }
29
+
@@ -0,0 +1,17 @@
1
+ //
2
+ // XDGLoginServiceUnity.h
3
+ // XDCommonSDK
4
+ //
5
+ // Created by 韩志强 on 2024/10/12.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface XDGLoginServiceUnity : NSObject
13
+ // openUserDashboard
14
+ + (void)serverId:(NSString* )serverId roleId:(NSString *)roleId roleName:(NSString *)roleName extra:(NSString *)extra;
15
+ @end
16
+
17
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: bbc8e694c27b4519acc5cc217532fd71
3
+ timeCreated: 1728721972
@@ -0,0 +1,23 @@
1
+ //
2
+ // XDGLoginServiceUnity.m
3
+ // XDCommonSDK
4
+ //
5
+ // Created by 韩志强 on 2024/10/12.
6
+ //
7
+
8
+ #import "XDGLoginServiceUnity.h"
9
+ #import <Foundation/Foundation.h>
10
+ #import "XDAccountSDK/XDGAccount.h"
11
+
12
+ @implementation XDGLoginServiceUnity
13
+
14
+ + (void)serverId:(NSString* )serverId roleId:(NSString *)roleId roleName:(NSString *)roleName extra:(NSString *)extra {
15
+ XDGRoleInfo *roleInfo = [[XDGRoleInfo alloc] init];
16
+ roleInfo.serverId = serverId;
17
+ roleInfo.roleId = roleId;
18
+ roleInfo.roleName = roleName;
19
+ roleInfo.extra = extra;
20
+ [XDGAccount openUserDashboardWithInfo:roleInfo];
21
+ }
22
+
23
+ @end
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: b9d9b9d48b0744bb9b79255417f1f189
3
+ timeCreated: 1728722008
@@ -2,7 +2,6 @@
2
2
  using System;
3
3
  using System.Collections.Generic;
4
4
  using XD.SDK.Account;
5
- using XD.SDK.Account.Mobile.Bridge;
6
5
  using XD.SDK.Common;
7
6
  using LoginType = XD.SDK.Account.LoginType;
8
7
 
@@ -130,7 +129,7 @@ namespace XD.SDK.Account{
130
129
 
131
130
  public void OpenUserDashboard(XDGRoleInfo roleInfo)
132
131
  {
133
- AccountMobile.OpenUserDashboard(roleInfo);
132
+ XDGAccountMobileImpl.GetInstance().OpenUserDashboard(roleInfo);
134
133
  }
135
134
 
136
135
  #endregion
@@ -14,12 +14,17 @@ namespace XD.SDK.Account{
14
14
  //Account
15
15
  private static string ACCOUNT_SERVICE_NAME = "com.xd.intl.account.unitybridge.XDGLoginService";
16
16
  private static string ACCOUNT_SERVICE_IMPL = "com.xd.intl.account.unitybridge.XDGLoginServiceImpl";
17
+ private static string ACCOUNT_SERVICE_NAME_UNITY = "com.xd.account.bridge.XDGLoginServiceUnity";
18
+ private static string ACCOUNT_SERVICE_IMPL_UNITY = "com.xd.account.bridge.XDGLoginServiceUnityImpl";
17
19
  private XDGAccountMobileImpl(){
18
20
  EngineBridge.GetInstance()
19
21
  .Register(ACCOUNT_SERVICE_NAME, ACCOUNT_SERVICE_IMPL);
22
+ EngineBridge.GetInstance()
23
+ .Register(ACCOUNT_SERVICE_NAME_UNITY, ACCOUNT_SERVICE_IMPL_UNITY);
20
24
  }
21
25
 
22
26
  private readonly string XDG_ACCOUNT_SERVICE = "XDGLoginService"; //注意要和iOS本地的桥接文件名一样!
27
+ private readonly string XDG_ACCOUNT_SERVICE_UNITY = "XDGLoginServiceUnity"; //注意要和iOS本地的桥接文件名一样!
23
28
  private static volatile XDGAccountMobileImpl _instance;
24
29
  private static readonly object Locker = new object();
25
30
 
@@ -418,6 +423,22 @@ namespace XD.SDK.Account{
418
423
  callback(success);
419
424
  });
420
425
  }
421
-
426
+
427
+ public void OpenUserDashboard(XDGRoleInfo roleInfo){
428
+ var dic = new Dictionary<string, object>{
429
+ {"serverId", roleInfo.serverId},
430
+ {"roleId", roleInfo.roleId},
431
+ {"roleName", roleInfo.roleName},
432
+ {"extra", roleInfo.extra}
433
+ };
434
+ var command = new Command.Builder()
435
+ .Service(XDG_ACCOUNT_SERVICE_UNITY)
436
+ .Method("openUserDashboard")
437
+ .Args(dic)
438
+ .Callback(false)
439
+ .OnceTime(true)
440
+ .CommandBuilder();
441
+ EngineBridge.GetInstance().CallHandler(command);
442
+ }
422
443
  }
423
444
  }
@@ -4,5 +4,5 @@
4
4
  //
5
5
  // Created by Fattycat on 2023/4/14.
6
6
  //
7
- #define XDGAccount_VERSION @"6.22.3"
8
- // HASH 8f76a97
7
+ #define XDGAccount_VERSION @"6.23.0"
8
+ // HASH 98afc55
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 08fe1079ee053488b978901a4536f72d
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "com.xd.sdk.account",
3
3
  "displayName": "XDSDK Account",
4
- "version": "6.22.4",
4
+ "version": "6.23.0",
5
5
  "description": "XDSDK",
6
6
  "unity": "2018.3",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "com.xd.tds.bootstrap": "3.27.1-xd.1"
9
+ "com.xd.tds.bootstrap": "3.29.4-xd.2"
10
10
  }
11
11
  }
@@ -1,42 +0,0 @@
1
- #if UNITY_ANDROID || UNITY_IOS
2
-
3
- using System.Runtime.InteropServices;
4
- using UnityEngine;
5
-
6
- namespace XD.SDK.Account.Mobile.Bridge
7
- {
8
- public class AccountMobile
9
- {
10
- #if UNITY_ANDROID
11
- private static AndroidJavaClass _androidJavaClass;
12
-
13
- private static AndroidJavaClass GetInstance()
14
- {
15
- if (_androidJavaClass == null)
16
- {
17
- _androidJavaClass = new AndroidJavaClass("com.xd.intl.account.XDGAccount");
18
- }
19
-
20
- return _androidJavaClass;
21
- }
22
- #endif
23
-
24
- public static void OpenUserDashboard(XDGRoleInfo roleInfo)
25
- {
26
- #if UNITY_ANDROID
27
- using (AndroidJavaClass accountBridge = new AndroidJavaClass("com.xd.account.bridge.XDGAccountBridge")) {
28
- accountBridge.CallStatic("openUserDashboard", roleInfo.roleId, roleInfo.roleName, roleInfo.serverId, roleInfo.extra);
29
- }
30
- #else
31
- XDAccountOpenUserDashboard(roleInfo.roleId, roleInfo.roleName, roleInfo.serverId, roleInfo.extra);
32
- #endif
33
- }
34
-
35
- #if UNITY_IOS
36
- [DllImport("__Internal")]
37
- private static extern void XDAccountOpenUserDashboard(string roleId, string roleName, string serverId, string extra);
38
- #endif
39
- }
40
- }
41
-
42
- #endif
@@ -1,3 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: d77b9e2bf47e4fc79ce51ac1eaefc30b
3
- timeCreated: 1725936736
@@ -1,3 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: f0035c338ae2437db6e07eb885f07429
3
- timeCreated: 1725936726