private AndroidJavaObject getUserAccount() { QGameKit.UserAccount userAccount = this.accountDelegate(); AndroidJavaObject androidJavaObject = new AndroidJavaObject("com.tencent.qgame.livesdk.webview.Account", new object[0]); androidJavaObject.Set <string>("openId", userAccount.id); androidJavaObject.Set <string>("accessToken", userAccount.token); androidJavaObject.Set <int>("loginType", (int)userAccount.platform); androidJavaObject.Set <string>("appId", userAccount.appId); return(androidJavaObject); }
public static bool Setup(string gameId, string wnsAppId, QGameKit.CaptureType captureType, QGameKit.UserAccountDelegate accountDelegate, QGameKit.Environment env) { QGameKit.QGameKitObj = QGameKitAndroidBridge.Setup(gameId, wnsAppId, captureType, accountDelegate, env); if (null == QGameKit.QGameKitObj) { Debug.LogError("QGameKitObj init failed!"); return(false); } QGameKit.UserAccount account = accountDelegate(); QGameKit.UpdateUserAccount(account); QGameKit.liveStatus = QGameKit.LiveStatus.Prepared; return(true); }
public void UpdateUserAccount(QGameKit.UserAccount account) { if (this.androidBridge == IntPtr.Zero || account == null) { UnityEngine.Debug.LogError("Update user account failed because bridge object or account is null!"); return; } jvalue[] array = new jvalue[4]; int i = 0; if (account.platform == QGameKit.LoginPlatform.QQ) { i = 1; } else if (account.platform == QGameKit.LoginPlatform.WeChat) { i = 2; } array[0].i = i; array[1].l = AndroidJNI.NewStringUTF(account.appId); array[2].l = AndroidJNI.NewStringUTF(account.id); array[3].l = AndroidJNI.NewStringUTF(account.token); AndroidJNI.CallVoidMethod(this.androidBridge, QGameKitAndroidBridge.updateUserAccountMethodID, array); }
public static void UpdateUserAccount(QGameKit.UserAccount account) { QGameKit.QGameKitObj.UpdateUserAccount(account); }