Exemplo n.º 1
0
 private void OnInfoResult(GetAccountInfoResult obj)
 {
     displayName  = obj.AccountInfo.TitleInfo.DisplayName.ToString();
     contactEmail = obj.AccountInfo.PrivateInfo.Email.ToString();
     print("<color=#00bc04>" + displayName + "</color>");
     GetPlayerData();
 }
Exemplo n.º 2
0
    void Success(GetAccountInfoResult _result)
    {
        MyPlayfabID = _result.AccountInfo.PlayFabId;

        PlayFabClientAPI.GetUserData(new GetUserDataRequest()
        {
            PlayFabId = MyPlayfabID,
            Keys      = null
        }, result => {
            Debug.Log("Got user data:");
            if (result.Data == null || !result.Data.ContainsKey("PosX"))
            {
                Debug.Log("PosX");
            }
            else
            {
                Debug.Log("PosX: " + result.Data["PosX"].Value);

                //transform.position.Set()
                //transform.rotation.SetEulerAngles()
            }
        }, (error) => {
            Debug.Log(error.GenerateErrorReport());
        });
    }
Exemplo n.º 3
0
 // ACCOUNT INFO
 private void OnGetAccountInfoSuccess(GetAccountInfoResult result)
 {
     gameObject.SetActive(true);
     username.text = result.AccountInfo.Username;
     Debug.Log("got account");
     finishedLoadingCount++;
 }
Exemplo n.º 4
0
 private void AccountTaken(GetAccountInfoResult result)
 {
     notification.SetActive(true);
     notification.GetComponent <Notification>().UseNotification(
         username + " is taken.\n Please choose another.", 4.0f);
     loginSuccess    = false;
     requestReturned = true;
 }
Exemplo n.º 5
0
 private void LoadAccountInfo(GetAccountInfoResult result)
 {
     Debug.Log("Fetching player in-game name...");
     // Load player data based on key-value pairs from PlayFab
     myPlayer.username        = result.AccountInfo.TitleInfo.DisplayName;
     PhotonNetwork.playerName = myPlayer.username;
     Instantiate(chatGUI, Vector3.zero, Quaternion.identity);
 }
 /// <summary>
 /// Callback for GetAccountInfo Success
 /// </summary>
 /// <param name="Result"> Result - from the API Call</param>
 static void OnGetAccountInfoSuccess(GetAccountInfoResult result)
 {
     PlayFabLoginCalls.LoggedInUserInfo = result.AccountInfo;
     if (OnPlayfabCallbackSuccess != null)
     {
         OnPlayfabCallbackSuccess("", PlayFabAPIMethods.GetAccountInfo);
     }
 }
Exemplo n.º 7
0
    private void GetAccountSuccess(GetAccountInfoResult result)
    {
        print("Account를 정상적으로 받아옴");
        //UserNickname = result.AccountInfo.Username;
        UserNickname = result.AccountInfo.TitleInfo.DisplayName;

        Debug.Log(UserNickname);
        roomInformation.Connect();
    }
Exemplo n.º 8
0
    private void OnGotAccountInfo(GetAccountInfoResult result)
    {
        GetAccountInfoCommandResult getAccountInfoResult = new GetAccountInfoCommandResult
        {
            Username = result.AccountInfo.Username
        };

        Callback?.Invoke(getAccountInfoResult);
    }
    /// <summary>
    /// Callback for GetAccountInfo Success
    /// </summary>
    /// <param name="Result"> Result - from the API Call</param>
    static void OnGetAccountInfoSuccess(GetAccountInfoResult result)
    {
        Debug.Log(result.AccountInfo.TitleInfo.DisplayName);

        // Set DisplayName in PlayerPrefs
        PlayerPrefs.SetString("DisplayName", result.AccountInfo.TitleInfo.DisplayName);

        PhotonNetwork.NickName = result.AccountInfo.TitleInfo.DisplayName;
    }
Exemplo n.º 10
0
    private void GetUserData(GetAccountInfoResult result)
    {
        // Grab name
        PlayerPersistentData.playerName = result.AccountInfo.TitleInfo.DisplayName;
        PhotonNetwork.playerName        = result.AccountInfo.TitleInfo.DisplayName;

        // Open lobby
        logRegisterPanel.SetActive(false);
        lobbyPanel.SetActive(true);
    }
        private void AcctInfoCallback(GetAccountInfoResult result)
        {
            if (result.AccountInfo == null || result.AccountInfo.TitleInfo == null || result.AccountInfo.TitleInfo.Origination == null ||
                !Enum.IsDefined(typeof(UserOrigination), result.AccountInfo.TitleInfo.Origination.Value))
            {
                lastReceivedMessage = "Enums not properly tested";
                return;
            }

            lastReceivedMessage = "Enums tested";
        }
Exemplo n.º 12
0
    void OnSignInSuccess(string user, LoginResult result, Action <LoginResult> action)
    {
        var request = new UpdateUserTitleDisplayNameRequest();

        request.DisplayName = user;
        PlayFabClientAPI.UpdateUserTitleDisplayName(request, null, null);

        var newResult = new GetAccountInfoResult();

        action(result);
    }
Exemplo n.º 13
0
        private void AcctInfoCallback(GetAccountInfoResult result)
        {
            var enumCorrect = (result.AccountInfo != null &&
                               result.AccountInfo.TitleInfo != null &&
                               result.AccountInfo.TitleInfo.Origination != null &&
                               Enum.IsDefined(typeof(UserOrigination), result.AccountInfo.TitleInfo.Origination.Value));

            var testContext = (UUnitTestContext)result.CustomData;

            testContext.True(enumCorrect, "Enum value does not match expected options");
            testContext.EndTest(UUnitFinishState.PASSED, null);
        }
Exemplo n.º 14
0
    /*
     * Step 2
     * We request Photon authentication token from PlayFab.
     * This is a crucial step, because Photon uses different authentication tokens
     * than PlayFab. Thus, you cannot directly use PlayFab SessionTicket and
     * you need to explicitely request a token. This API call requires you to
     * pass Photon App ID. App ID may be hardcoded, but, in this example,
     * We are accessing it using convenient static field on PhotonNetwork class
     * We pass in AuthenticateWithPhoton as a callback to be our next step, if
     * we have acquired token succesfully
     */
    private void RequestPhotonToken(GetAccountInfoResult obj)
    {
        LogMessage("PlayFab authenticated. Requesting photon token...");

        //We can player PlayFabId. This will come in handy during next step
        _playFabPlayerIdCache = obj.AccountInfo.PlayFabId;

        PlayFabClientAPI.GetPhotonAuthenticationToken(new GetPhotonAuthenticationTokenRequest()
        {
            PhotonApplicationId = PhotonNetwork.PhotonServerSettings.AppID
        }, AuthenticateWithPhoton, OnPlayFabError);
    }
Exemplo n.º 15
0
    void OnAccountSuccess(GetAccountInfoResult result)
    {
        string nickname = result.AccountInfo.TitleInfo.DisplayName;

        if (nickname == null)
        {
            return;
        }
        else
        {
            PlayerPrefs.SetString("NickName", nickname);
        }
    }
Exemplo n.º 16
0
    private void GetAccountSuccess(GetAccountInfoResult result)
    {
        print("Accout를 정상적으로 받아옴");

        string nickname = result.AccountInfo.TitleInfo.DisplayName;

        if (nickname == null)
        {
            SceneManager.LoadScene("NicknameSet");
        }
        else
        {
            PlayerPrefs.SetString("Nickname", nickname);
            SceneManager.LoadScene("Lobby");
        }
    }
    private void OnGetAccountInfoSuccess(GetAccountInfoResult resultData)
    {
        // If infopanel is disabled then enable it ,it's like toggle
        if (!infoPanel.activeSelf)
        {
            infoPanel.SetActive(true);
        }

        print("Account Created Date.");

        // Data output
        print(resultData.AccountInfo.Username);
        // Display result on text
        infoUsername.text = resultData.AccountInfo.Username.ToString();

        infoCreatedAt.text = resultData.AccountInfo.PrivateInfo.Email.ToString();
        print(resultData.AccountInfo.Created);
    }
Exemplo n.º 18
0
    private void OnUserDetailsResult(GetAccountInfoResult result)
    {
        // User Custom ID is known check if they have email created
        if (result.AccountInfo.PrivateInfo.Email == null)
        {
            //user needs to add email

            Debug.Log("User needs to create more account information");
            uxPlayFab.ShowCreateAccount();
        }
        else
        {
            // good to go!
            Debug.Log("User:" + result.AccountInfo.Username);
            localStorage.SetPrefLoggedInCustomIDandEmail();
            CheckRights();
        }
    }
Exemplo n.º 19
0
    private void OnGetAccountInfoSuccess(GetAccountInfoResult accountInfo)
    {
        string displayName = null;

        if (accountInfo.AccountInfo.TitleInfo != null)
        {
            displayName = accountInfo.AccountInfo.TitleInfo.DisplayName;
        }

        if (displayName == "" || displayName == null)
        {
            Debug.Log("Successful anonymous login.");
        }
        else
        {
            Debug.Log("Successful login account. Display name is: [" + displayName + "]");

            playerInfo.PlayerName = displayName;

            OnPlayerNameChanged.Invoke(displayName);
        }
    }
Exemplo n.º 20
0
 private void onGetAccountInfoSuccess(GetAccountInfoResult obj)
 {
     userprofile.displayname = obj.AccountInfo.TitleInfo.DisplayName;
 }
Exemplo n.º 21
0
 private void OnGetAccountInfoSuccess(GetAccountInfoResult result)
 {
     _playfabUser.Instance.PlayfabId = result.AccountInfo.PlayFabId;
 }
Exemplo n.º 22
0
    public GetAccountInfoResult GetAccountInfo(String Request)
    {
        GetAccountInfoResult getAccountInfoResult = new GetAccountInfoResult();
        String ReturnCode = "";
        String Descriptioin = "";
        StringBuilder Response = new StringBuilder();
        Response.AppendFormat("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        #region
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(Request);
        XmlNode versionNode = xmlDoc.SelectNodes("/root/callinfo/version")[0];
        String version = versionNode.Attributes["value"].Value;

        XmlNode SPIDNode = xmlDoc.SelectNodes("/root/callinfo/SPID")[0];
        String SPID = SPIDNode.Attributes["value"].Value;

        XmlNode CustIDNode = xmlDoc.SelectNodes("/root/srchcond/conds/CUSTID")[0];
        String CustID = CustIDNode.Attributes["value"].Value;

        XmlNode BesttoneAccountNode = xmlDoc.SelectNodes("/root/srchcond/conds/BesttoneAccount")[0];
        String BA = BesttoneAccountNode.Attributes["value"].Value;
        #endregion

        int Result = 0;
        String ErrMsg = "";

        StringBuilder strLog = new StringBuilder();
        try
        {
            #region 条件校验
            if (CommonUtility.IsEmpty(SPID))
            {
                ReturnCode = Convert.ToString(ErrorDefinition.CIP_IError_Result_SPIDInValid_Code);
                Descriptioin = ErrorDefinition.CIP_IError_Result_SPIDInValid_Msg;
                Response.AppendFormat("<result returnCode = {0} msg = {1} />", ReturnCode, Descriptioin);
                //return Response.ToString();
                getAccountInfoResult.ReturnCode = Convert.ToString(ErrorDefinition.CIP_IError_Result_SPIDInValid_Code);
                getAccountInfoResult.Msg = ErrorDefinition.CIP_IError_Result_SPIDInValid_Msg;
                return getAccountInfoResult;
            }

            //IP是否允许访问
            Result = CommonBizRules.CheckIPLimit(SPID, HttpContext.Current.Request.UserHostAddress, this.Context, out ErrMsg);
            strLog.AppendFormat("请求方ip:{0}\r\n", HttpContext.Current.Request.UserHostAddress);
            strLog.AppendFormat("CheckIPLimit Result:{0},ErrMsg:{1}\r\n", Result, ErrMsg);
            if (Result != 0)
            {
                ReturnCode = Convert.ToString(ErrorDefinition.BT_IError_Result_BizIPLimit_Code);
                Descriptioin = ErrorDefinition.BT_IError_Result_BizIPLimit_Msg;
                //Response.AppendFormat("<result returnCode = {0} msg = {1} />", ReturnCode, Descriptioin);
                //return Response.ToString();
                getAccountInfoResult.ReturnCode = Convert.ToString(ErrorDefinition.BT_IError_Result_BizIPLimit_Code);
                getAccountInfoResult.Msg = ErrorDefinition.BT_IError_Result_BizIPLimit_Msg;
                return getAccountInfoResult;
            }

            //接口访问权限判断
            Result = CommonBizRules.CheckInterfaceLimit(SPID, "GetAccountInfo", this.Context, out ErrMsg);
            strLog.AppendFormat("CheckInterfaceLimit Result:{0},ErrMsg:{1}\r\n", Result, ErrMsg);
            if (Result != 0)
            {
                //return Result;
                ReturnCode = Convert.ToString(ErrorDefinition.BT_IError_Result_BizInterfaceLimit_Code);
                Descriptioin = ErrorDefinition.BT_IError_Result_BizInterfaceLimit_Msg;
                Response.AppendFormat("<result returnCode = {0} msg = {1} />", ReturnCode, Descriptioin);
                //return Response.ToString();
                getAccountInfoResult.ReturnCode = ReturnCode;
                getAccountInfoResult.Msg = Descriptioin;
                return getAccountInfoResult;
            }

            if (CommonUtility.IsEmpty(CustID) && CommonUtility.IsEmpty(BA))
            {
                ReturnCode = Convert.ToString(ErrorDefinition.BT_IError_Result_BizInterfaceLimit_Code);
                Descriptioin = "CustID和BesttoneAccount不能同时为空!";
                Response.AppendFormat("<result returnCode = {0} msg = {1} />", ReturnCode, Descriptioin);
                //return Response.ToString();
                getAccountInfoResult.ReturnCode = ReturnCode;
                getAccountInfoResult.Msg = Descriptioin;
                return getAccountInfoResult;
            }
            BesttoneAccount account = null;
            BesttoneAccountDAO dao = new BesttoneAccountDAO();

            if (!CommonUtility.IsEmpty(CustID))
            {
                account = dao.QueryByCustID(CustID);
            }

            if (!CommonUtility.IsEmpty(BA))
            {
                account = dao.QueryByBestAccount(BA);
            }

            if (account == null)
            {
                ReturnCode = Convert.ToString(ErrorDefinition.BT_IError_Result_BizInterfaceLimit_Code);
                Descriptioin = "账户不存在!";
                Response.AppendFormat("<result returnCode = {0} msg = {1} />", ReturnCode, Descriptioin);
                //return Response.ToString();
                getAccountInfoResult.ReturnCode = ReturnCode;
                getAccountInfoResult.Msg = Descriptioin;
                return getAccountInfoResult;
            }

            //查询账户余额
            AccountItem item;
            Result = BesttoneAccountHelper.QueryBesttoneAccount(account.BestPayAccount, out item, out ErrMsg);
            if (Result == 0)
            {
                AccountInfoData data = new AccountInfoData();
                getAccountInfoResult.ReturnCode = "0";
                getAccountInfoResult.Msg = "成.功";
                data.Id = "";
                data.CustID = account.CustID;
                data.BesttoneAccount = account.BestPayAccount;
                data.AccountType = item.AccountType;
                data.AccountStatus = item.AccountStatus;
                data.AccountBalance = item.AccountBalance;
                data.PredayBalance = item.PredayBalance;
                data.PremonthBalance = item.PreMonthBalance;
                data.AvailableBalance = item.AvailableBalance;
                data.UnavailableBalance = item.UnAvailableBalance;
                data.AvailableCash = item.AvailableLecash;
                data.CardNum = item.CardNum;
                data.CardType = item.CardType;
                getAccountInfoResult.data = data;
                //Response.AppendFormat("<Result returnCode = \"0\" msg = \"成功\">");
                //Response.AppendFormat("<Data ID = \"\">");
                //Response.AppendFormat("<CUSTID>{0}</CUSTID>", account.CustID);
                //Response.AppendFormat("<BESTTONEACCOUNT>{0}</BESTTONEACCOUNT>", account.BestPayAccount);
                //Response.AppendFormat("<ACCOUNTTYPE>{0}</ACCOUNTTYPE>", item.AccountType);

                //Response.AppendFormat("<ACCOUNTSTATUS>{0}</ACCOUNTSTATUS>", item.AccountStatus);
                //Response.AppendFormat("<ACCOUNTBALANCE>{0}</ACCOUNTBALANCE>", item.AvailableBalance);
                //Response.AppendFormat("<PREDAYBALANCE>{0}</PREDAYBALANCE>", item.PredayBalance);
                //Response.AppendFormat("<PREMONTHBALANCE>{0}</PREMONTHBALANCE>", item.PreMonthBalance);
                //Response.AppendFormat("<AVAILABLEBALANCE>{0}</AVAILABLEBALANCE>", item.AvailableBalance);
                //Response.AppendFormat("<UNAVAILABLEBALANCE>{0}</UNAVAILABLEBALANCE>", item.UnAvailableBalance);
                //Response.AppendFormat("<AVAILABLECASH>{0}</AVAILABLECASH>", item.AvailableLecash);
                //Response.AppendFormat("<CARDNUM>{0}</CARDNUM>", item.CardNum);
                //Response.AppendFormat("<CARDTYPE>{0}</CARDTYPE>", item.CardType);
                //Response.AppendFormat("</Data>");
                //Response.AppendFormat("</Result>");

            }
            else {
                ReturnCode = Convert.ToString(ErrorDefinition.BT_IError_Result_BizInterfaceLimit_Code);
                Descriptioin = "账户查询失败!";
                //Response.AppendFormat("<result returnCode = {0} msg = {1} />", ReturnCode, Descriptioin);
                getAccountInfoResult.ReturnCode = ReturnCode;
                getAccountInfoResult.Msg = Descriptioin;
            }
            #endregion
        }
        catch (Exception e)
        {
            getAccountInfoResult.ReturnCode = "-9001";
            getAccountInfoResult.Msg = e.ToString();
        }
        //return Response.ToString();
        return getAccountInfoResult;
    }
Exemplo n.º 23
0
 public void GetAccountInfoSuccess(GetAccountInfoResult result)
 {
     Debug.Log("Get account info successfully!");
     PhotonNetwork.NickName = result.AccountInfo.Username;
 }
Exemplo n.º 24
0
 void Successs(GetAccountInfoResult result)
 {
     MyPlayfabID = result.AccountInfo.Username;
     Debug.Log(MyPlayfabID);
 }
Exemplo n.º 25
0
 private void GetAccountInfoSuccesss(GetAccountInfoResult result)
 {
     PhotonNetwork.NickName = result.AccountInfo.Username;
     SceneManager.LoadScene("Main");
 }
Exemplo n.º 26
0
 void success(GetAccountInfoResult result)
 {
     MyPlayfabID = result.AccountInfo.PlayFabId;
     Debug.Log("Successfully obtain PlayFabID");
 }
Exemplo n.º 27
0
 void Successs(GetAccountInfoResult result)
 {
     NickName = result.AccountInfo.Username;
     PlayerPrefs.SetString(NameKey, NickName);
 }
Exemplo n.º 28
0
 private void OnGetInfoSucceed(GetAccountInfoResult result)
 {
     username = result.AccountInfo.Username;
 }
Exemplo n.º 29
0
 private void OnAccountInfoSucess(GetAccountInfoResult accountInfo)
 {
     playfabInfo = accountInfo;
     ConnectToPhoton(PlayerPrefs.GetString("USERNAME"));
     //conect to photon with the username;
 }
Exemplo n.º 30
0
 void Successs(GetAccountInfoResult result)
 {
     playerName = result.AccountInfo.Username;
 }
Exemplo n.º 31
0
 private void OnInfoResult(GetAccountInfoResult obj)
 {
     nickname.text = obj.AccountInfo.TitleInfo.DisplayName.ToString();
     print("<color=#00bc04>" + nickname.text + "</color>");
 }