[U] add PlayFab SDK and SNS login improvements

- Add PlayFabSDK as local package dependency
- Add PlayFabTool.cs for PlayFab API integration
- Implement LoginBySns method in TYSdkFacade
- Add Android SNS login support in SDKManager and UnityBridgeFunc
- Add Build Android With Debug menu option
- Improve exception handling and timeout management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-29 16:12:17 +08:00
parent 638e6a3327
commit aa5ce1ff5a
226 changed files with 64975 additions and 62 deletions

View File

@@ -33,6 +33,7 @@ import com.tuyoo.gamesdk.event.EventBus;
import com.tuyoo.gamesdk.event.EventConsts;
import com.tuyoo.gamesdk.event.data.PayEventData;
import com.tuyoo.gamesdk.event.data.WeixinShareData;
import com.tuyoo.gamesdk.login.model.SnsInfo;
import com.tuyoo.gamesdk.model.InitParam;
import com.tuyoo.gamesdk.pay.model.PayType;
import com.tuyoo.gamesdk.util.SDKLog;
@@ -98,6 +99,7 @@ public class SDKManager {
public void callback(int i, String s) {
SDKLog.i("SDKCallBack.Login callback: " + i + " \n" + s);
parseLoginInfo(i, s);
tmpSnsInfo = null;
}
};
@@ -127,32 +129,29 @@ public class SDKManager {
public static void UnityLoginByTokenFun(String token) {
SDKLog.i("UnityLoginByTokenFun : " + token);
handler.post(new Runnable() {
@Override
public void run() {
SDKAPI.getIns().loginByToken(token, mLogin);
}
});
handler.post(() -> SDKAPI.getIns().loginByToken(token, mLogin));
}
public static void UnityLoginBySnsInfo()
{
if(tmpSnsInfo == null)
{
UnityPlayer.UnitySendMessage(ConfigManager.UNITY_FACADE_NAME, ConfigManager.LOGIN_CALLBACK_FUNCTION_NAME, "{\"code\":1}}");
return;
}
SDKLog.i("UnityLoginBySns : " + tmpSnsInfo);
handler.post(() -> SDKAPI.getIns().loginBySnsInfo(tmpSnsInfo, mLogin));
}
public static void UnityGetIdentityFun(String type) {
SDKLog.i("UnityGetIdentityFun : " + type);
handler.post(new Runnable() {
@Override
public void run() {
SDKAPI.getIns().loginByType(type, mLogin);
}
});
handler.post(() -> SDKAPI.getIns().loginByType(type, mLogin));
}
public static void UnityLogin(String type) {
SDKLog.i("UnityLogin : " + type);
handler.post(new Runnable() {
@Override
public void run() {
SDKAPI.getIns().loginByType(type, mLogin);
}
});
handler.post(() -> SDKAPI.getIns().loginByType(type, mLogin));
}
public static void UnityLogOutByChannel(String type) {
@@ -160,11 +159,13 @@ public class SDKManager {
handler.post(() -> SDKAPI.getIns().logout(type));
}
private static SnsInfo tmpSnsInfo;
public static void LinkAccount(String type, String userId)
{
SDKAPI.getIns().getSnsInfo(type, (snscode, snsInfo, snsmsg) ->{
if(snscode == SDKCallBack.CODE_SUCCESS && snsInfo !=null)
{
tmpSnsInfo = snsInfo;
SDKAPI.getIns().bindBySnsId(snsInfo, userId, (bindcode, bindmsg)->{
if(bindcode == SDKCallBack.CODE_SUCCESS)
{