trydis / FIFA-Ultimate-Team-Toolkit

FIFA Ultimate Team Toolkit
MIT License
236 stars 111 forks source link

FutException was caught , Unable to login #49

Closed khha closed 10 years ago

khha commented 10 years ago

I am a c# .net developer and would like to try creating auto buyer windows application. I have a working account and playing fut 15 on ps4. I have used my username, password and secred answer. I still got the error below. What is my issue?

FutException was caught , Unable to login

Here is my code:

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using UltimateTeam.Toolkit; using UltimateTeam.Toolkit.Exceptions; using UltimateTeam.Toolkit.Models; using UltimateTeam.Toolkit.Parameters;

namespace FUT { public partial class Form1 : Form { FutClient client = new FutClient(); public Form1() { InitializeComponent(); }

    private async void button1_Click(object sender, EventArgs e)
    {
        try
        {
            var loginDetails = new LoginDetails(textBoxUsername.Text, textBoxPassword.Text, textBoxSecredAnswer.Text, Platform.Ps4);
            var loginResponse = await client.LoginAsync(loginDetails);
        }
        catch (FutException ex)
        {
            textBoxStatus.Text = ex.Message;
        }
    }

    private void button2_Click(object sender, EventArgs e)
    {
        searchPlayers();
    }

    private async void searchPlayers()
    {
        if (client != null)
        {
            var searchParameters = new PlayerSearchParameters
            {
                Page = 1,
                Level = Level.Gold,
                ChemistryStyle = ChemistryStyle.Sniper,
                League = League.BarclaysPremierLeague,
                Nation = Nation.Norway,
                Position = Position.Striker,
                Team = Team.ManchesterUnited
            };

            var searchResponse = await client.SearchAsync(searchParameters);
            foreach (var auctionInfo in searchResponse.AuctionInfo)
            {
                // Handle auction data
            }
        }
    }
}

}

Kuzuto commented 10 years ago

Have you added PS4 to LoginRequest.cs and UltimateTeam.Toolkit.Models.Platform ? Can see you are using PS4 in your loginDetails but is not implemented in the code by default. Could be the reason..

khha commented 10 years ago

yes it is true I would like to use this auto buyer for fifa fut 15 for ps4. I have add a new item in my enum:

public enum Platform { Ps3, Ps4, Xbox360, Pc }

I have add now also ps4:

switch (platform) { case Platform.Ps3: return "ps3"; case Platform.Ps4: return "ps4"; case Platform.Xbox360: return "360"; case Platform.Pc: return "pc"; default: throw new ArgumentOutOfRangeException("platform"); }

I did some debugging and the code is finding my account, but can find only the account which is connected to platform ps3. Thats strange because I used fut 15 on ps4. BUT this is the first time. Is there some location where I need to change ps3 to ps4? Maybe my account settings on the website of EA or PSN?

Kuzuto commented 10 years ago

I'm also playing on PS4 but using PS3 in my program. See if that works anyway. You can't be logged in on another device while using your program. They will disconnect each other all the time and your session expires. Always see if you are able to login on easports.com/fifa/ultimate-team/web-app if you experience problems. You might be banned/blocked or the server is down. If you can't see why your login isn't working. Use Fiddler to capture the EA Respond or debug/break every respond in "public async Task PerformRequestAsync()" in UltimateTeam.Toolkit.Requests.LoginRequest to see where it fails.

khha commented 10 years ago

I have use the platform ps3 and it is working now. Why is ps4 not working?

Kuzuto commented 10 years ago

I've havn't spend so much time looking in the requests with Fiddler when using the Web App. I have both a PS3 (from fifa 14) and now a PS4 (fifa 15) account on the webpage, and worked fine with Platform.PS3. Think maybe Trydis is able to sniff out the correct parameter for PS4 :)

artielange commented 10 years ago

IIRC, Markets are shared between PS3/4 and Xbox360/One, when you use the Ps3 platform, the market you search is both Ps3 & Ps4

khha commented 10 years ago

Thank you artielange for this information..