feat: update Bootstrap and Login changeLog
parent
f6fa8f25cf
commit
2f804358fa
18
CHANGELOG.md
18
CHANGELOG.md
|
@ -1,5 +1,23 @@
|
|||
# ChangeLog
|
||||
|
||||
## 3.0.0
|
||||
|
||||
TapSDK 3.0 开始,我们在单纯的 TapTap 登录之外,还提供了一个内建账户系统供游戏使用:开发者可以直接用 TapTap OAuth 授权的结果生成一个游戏内的账号(TDSUser),然后用该账号保存更多玩家数据。同时,我们也支持将更多第三方认证登录的结果绑定到这一账号上来(以及后续的解绑操作)。
|
||||
|
||||
### New Feature
|
||||
|
||||
- 新增 `TDSUser` 用于内建账户系统操作
|
||||
|
||||
### BreakingChange
|
||||
|
||||
- `TapBootstrap` 模块仅保留 `TapBootstrap.Init(tapConfig)` 接口
|
||||
|
||||
### Dependencies
|
||||
|
||||
- LeanCloud.Storage v0.8.3
|
||||
- TapTap.Login v3.0.0
|
||||
- TapTap.Common v3.0.0
|
||||
|
||||
## 2.1.7
|
||||
|
||||
### Dependencies
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
# 使用 TapTap.Bootstrap
|
||||
|
||||
## 使用前提
|
||||
|
||||
使用 TapTap.Bootstrap 前提是必须依赖以下库:
|
||||
* [TapTap.Common](https://github.com/TapTap/TapCommon-Unity.git)
|
||||
* [TapTap.Login](https://github.com/TapTap/TapLogin-Unity.git)
|
||||
* [LeanCloud.Storage](https://github.com/leancloud/csharp-sdk)
|
||||
|
||||
## 命名空间
|
||||
|
||||
|
@ -14,80 +17,58 @@ using TapTap.Bootstrap;
|
|||
|
||||
### 1.初始化
|
||||
|
||||
> TapBootstrap 会根据 TapConfig 中的 TapDBConfig 配置来进行 TapDB 的自动初始化。
|
||||
#### TapBootstrap 会根据 TapConfig 中的 TapDBConfig 配置来进行 TapDB 的自动初始化。
|
||||
|
||||
开启 TapDB
|
||||
##### 开启 TapDB
|
||||
```c#
|
||||
var config = new TapConfig.TapConfigBuilder()
|
||||
.ClientID("client_id")
|
||||
.ClientSecret("client_secret")
|
||||
.ServerURL("https://ikggdre2.lc-cn-n1-shared.com")
|
||||
.RegionType(RegionType.CN)
|
||||
.TapDBConfig(true,"channel","gameVersion",true)
|
||||
.Builder();
|
||||
```
|
||||
关闭 TapDB
|
||||
##### 关闭 TapDB
|
||||
```c#
|
||||
var config = new TapConfig.TapConfigBuilder()
|
||||
.ClientID("client_id")
|
||||
.ClientSecret("client_secret")
|
||||
.ServerURL("https://ikggdre2.lc-cn-n1-shared.com")
|
||||
.RegionType(RegionType.CN)
|
||||
//# .TapDBConfig(false,null,null,false)
|
||||
.EnableTapDB(false)
|
||||
.Builder();
|
||||
```
|
||||
初始化 TapSDK
|
||||
##### 初始化
|
||||
```c#
|
||||
TapBootstrap.Init(config);
|
||||
```
|
||||
|
||||
### 2.登陆
|
||||
### 2.账户系统
|
||||
|
||||
> 登陆成功之后,都会得到一个 `TDSUser` 实例
|
||||
|
||||
#### 使用 TapTap OAuth 授权结果直接登陆账户系统
|
||||
|
||||
```c#
|
||||
TapBootstrap.Login(LoginType loginType, string[] permissions);
|
||||
var tdsUser = await TDSUser.LoginWithTapTap();
|
||||
```
|
||||
|
||||
### 3.设置语言
|
||||
#### 游客登陆
|
||||
```c#
|
||||
TapBootstrap.SetPreferLanguage(TapLanguage tapLanguage);
|
||||
var tdsUser = await TDSUser.LoginAnonymously();
|
||||
```
|
||||
|
||||
### 4.绑定TapTap账号(已废弃)
|
||||
#### 绑定第三方平台账号
|
||||
```c#
|
||||
TapBootstrap.Bind(LoginType loginType, string[] permissions);
|
||||
var tdsUser = await TDSUser.LoginWithAuthData(Dictionary<string, object> authData, string platform,
|
||||
LCUserAuthDataLoginOption option = null);
|
||||
```
|
||||
|
||||
### 5.注册用户状态回调
|
||||
|
||||
#### 退出登陆
|
||||
```c#
|
||||
TapBootstrap.RegisterUserStatusChangedListener(ITapUserStatusChangedListener listener);
|
||||
TDSUser.Logout();
|
||||
```
|
||||
|
||||
### 6.注册登陆回调
|
||||
```c#
|
||||
TapBootstrap.RegisterLoginResultListener(ITapLoginResultListener listener);
|
||||
```
|
||||
|
||||
### 7.获取用户信息
|
||||
```c#
|
||||
TapBootstrap.GetUser(Action<TapUser,TapError> action);
|
||||
```
|
||||
|
||||
### 8.获取详细用户信息
|
||||
```c#
|
||||
TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action);
|
||||
```
|
||||
|
||||
### 9.篝火测试资格
|
||||
```c#
|
||||
TapBootstrap.GetTestQualification(Action<bool,TapError> action);
|
||||
```
|
||||
|
||||
### 10.获取AccessToken
|
||||
```c#
|
||||
TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action);
|
||||
```
|
||||
|
||||
### 11.登出
|
||||
```c#
|
||||
TapBootstrap.Logout();
|
||||
```
|
63
README.md
63
README.md
|
@ -4,6 +4,8 @@
|
|||
|
||||
使用 TapTap.Bootstrap 前提是必须依赖以下库:
|
||||
* [TapTap.Common](https://github.com/TapTap/TapCommon-Unity.git)
|
||||
* [TapTap.Login](https://github.com/TapTap/TapLogin-Unity.git)
|
||||
* [LeanCloud.Storage](https://github.com/leancloud/csharp-sdk)
|
||||
|
||||
## 命名空间
|
||||
|
||||
|
@ -15,81 +17,58 @@ using TapTap.Bootstrap;
|
|||
|
||||
### 1.初始化
|
||||
|
||||
> TapBootstrap 会根据 TapConfig 中的 TapDBConfig 配置来进行 TapDB 的自动初始化。
|
||||
#### TapBootstrap 会根据 TapConfig 中的 TapDBConfig 配置来进行 TapDB 的自动初始化。
|
||||
|
||||
开启 TapDB
|
||||
##### 开启 TapDB
|
||||
```c#
|
||||
var config = new TapConfig.TapConfigBuilder()
|
||||
.ClientID("client_id")
|
||||
.ClientSecret("client_secret")
|
||||
.ServerURL("https://ikggdre2.lc-cn-n1-shared.com")
|
||||
.RegionType(RegionType.CN)
|
||||
.TapDBConfig(true,"channel","gameVersion",true)
|
||||
.Builder();
|
||||
```
|
||||
关闭 TapDB
|
||||
##### 关闭 TapDB
|
||||
```c#
|
||||
var config = new TapConfig.TapConfigBuilder()
|
||||
.ClientID("client_id")
|
||||
.ClientSecret("client_secret")
|
||||
.ServerURL("https://ikggdre2.lc-cn-n1-shared.com")
|
||||
.RegionType(RegionType.CN)
|
||||
//# .TapDBConfig(false,null,null,false)
|
||||
.EnableTapDB(false)
|
||||
.Builder();
|
||||
```
|
||||
初始化 TapSDK
|
||||
##### 初始化
|
||||
```c#
|
||||
TapBootstrap.Init(config);
|
||||
```
|
||||
|
||||
### 2.登陆
|
||||
### 2.账户系统
|
||||
|
||||
> 登陆成功之后,都会得到一个 `TDSUser` 实例
|
||||
|
||||
#### 使用 TapTap OAuth 授权结果直接登陆账户系统
|
||||
|
||||
```c#
|
||||
TapBootstrap.Login(LoginType loginType, string[] permissions);
|
||||
var tdsUser = await TDSUser.LoginWithTapTap();
|
||||
```
|
||||
|
||||
### 3.设置语言
|
||||
#### 游客登陆
|
||||
```c#
|
||||
TapBootstrap.SetPreferLanguage(TapLanguage tapLanguage);
|
||||
var tdsUser = await TDSUser.LoginAnonymously();
|
||||
```
|
||||
|
||||
### 4.绑定TapTap账号(已废弃)
|
||||
#### 绑定第三方平台账号
|
||||
```c#
|
||||
TapBootstrap.Bind(LoginType loginType, string[] permissions);
|
||||
var tdsUser = await TDSUser.LoginWithAuthData(Dictionary<string, object> authData, string platform,
|
||||
LCUserAuthDataLoginOption option = null);
|
||||
```
|
||||
|
||||
### 5.注册用户状态回调
|
||||
|
||||
#### 退出登陆
|
||||
```c#
|
||||
TapBootstrap.RegisterUserStatusChangedListener(ITapUserStatusChangedListener listener);
|
||||
TDSUser.Logout();
|
||||
```
|
||||
|
||||
### 6.注册登陆回调
|
||||
```c#
|
||||
TapBootstrap.RegisterLoginResultListener(ITapLoginResultListener listener);
|
||||
```
|
||||
|
||||
### 7.获取用户信息
|
||||
```c#
|
||||
TapBootstrap.GetUser(Action<TapUser,TapError> action);
|
||||
```
|
||||
|
||||
### 8.获取详细用户信息
|
||||
```c#
|
||||
TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action);
|
||||
```
|
||||
|
||||
### 9.篝火测试资格
|
||||
```c#
|
||||
TapBootstrap.GetTestQualification(Action<bool,TapError> action);
|
||||
```
|
||||
|
||||
### 10.获取AccessToken
|
||||
```c#
|
||||
TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action);
|
||||
```
|
||||
|
||||
### 11.登出
|
||||
```c#
|
||||
TapBootstrap.Logout();
|
||||
```
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
"unity": "2018.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"com.taptap.tds.common": "https://github.com/TapTap/TapCommon-Unity.git#3.0.0"
|
||||
"com.taptap.tds.common": "https://github.com/TapTap/TapCommon-Unity.git#3.0.0",
|
||||
"com.taptap.tds.login": "https://github.com/TapTap/TapLogin-Unity.git#3.0.0",
|
||||
"com.leancloud.storage": "https://github.com/leancloud/csharp-sdk-upm.git#storage-0.8.2"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue