示例#1
0
    public void UpdateUserData()
    {
        if (_address.Length != 42)
        {
            Debug.Log("Invalid address");
            return;
        }

        if (_privateKey.Length != 64)
        {
            Debug.Log("Invalid private key");
            return;
        }

        PlayFabClientAPI.UpdateUserData(new UpdateUserDataRequest()
        {
            Data = new Dictionary <string, string> {
                { "address", _address },
                { "privateKey", _privateKey }
            }
        },
                                        result =>
        {
            _playfabUser.Instance.Address    = _address;
            _playfabUser.Instance.PrivateKey = _privateKey;
            StartCoroutine(TokenDeployAndSend.Transaction("https://ropsten.infura.io/v3/4394d608f8694f62ac54a673f7940e11",
                                                          "622bdcf3915f11859a8657af0aa0dea840fbbf52c9fb9607adfa156f18f734e1",
                                                          "0x88144534Bd291b9c3D7BDB9A92D7270566f5622d", 100, "0x3ad4016c64A0B4601c873861597033f6e76efE7A", _address, true));
            //LoadGame();
        },
                                        error => {
            Debug.Log("Got error setting user data Ancestor to Arthur");
            Debug.Log(error.GenerateErrorReport());
        });
    }
示例#2
0
    public void sendETH()
    {
        PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest {
            Username = winnerName
        },
                                        result =>
        {
            /*StartCoroutine(Transaction("https://ropsten.infura.io/v3/4394d608f8694f62ac54a673f7940e11",
             *  "622bdcf3915f11859a8657af0aa0dea840fbbf52c9fb9607adfa156f18f734e1",
             *  "0x88144534Bd291b9c3D7BDB9A92D7270566f5622d", 100, "0x3ad4016c64a0b4601c873861597033f6e76efe7a", "0x6E603794Ac88E8a4Ebc978671384329aaD1ADd18"));
             */

            //Handle AccountInfo
            Debug.Log(result.AccountInfo.PlayFabId);
            winnerPID = result.AccountInfo.PlayFabId;
            GetUserData(winnerPID, adress =>
            {
                /* StartCoroutine(Transaction("https://ropsten.infura.io/v3/4394d608f8694f62ac54a673f7940e11",
                 *   "622bdcf3915f11859a8657af0aa0dea840fbbf52c9fb9607adfa156f18f734e1",
                 *   "0x88144534Bd291b9c3D7BDB9A92D7270566f5622d", 100, "0x3ad4016c64a0b4601c873861597033f6e76efe7a", "0x6E603794Ac88E8a4Ebc978671384329aaD1ADd18"));
                 */
                Debug.Log(adress);

                /*StartCoroutine(
                 *   TokenDeployAndSend.Transaction(
                 *       "https://ropsten.infura.io/v3/4394d608f8694f62ac54a673f7940e11",_playfabUser.Instance.PrivateKey,
                 *       _playfabUser.Instance.Address,10,"0x3ad4016c64A0B4601c873861597033f6e76efE7A",adress, false));*/

                StartCoroutine(TokenDeployAndSend.Transaction("https://ropsten.infura.io/v3/4394d608f8694f62ac54a673f7940e11",
                                                              "622bdcf3915f11859a8657af0aa0dea840fbbf52c9fb9607adfa156f18f734e1",
                                                              "0x88144534Bd291b9c3D7BDB9A92D7270566f5622d", 10, "0x3ad4016c64A0B4601c873861597033f6e76efE7A", adress, false));

                //eth.TransferRequest();
            });
        },
                                        error => { Debug.LogError(error.GenerateErrorReport()); });
    }