Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to buy a player #51

Open
vinch1n opened this issue May 12, 2017 · 20 comments
Open

how to buy a player #51

vinch1n opened this issue May 12, 2017 · 20 comments
Assignees

Comments

@vinch1n
Copy link

vinch1n commented May 12, 2017

how to buy a player

@vinch1n
Copy link
Author

vinch1n commented May 12, 2017

https://utas.external.s2.fut.ea.com/ut/game/fifa17/trade/190797669347/bid

Accept:application/json
Accept-Encoding:gzip, deflate, br
Accept-Language:en,zh-CN;q=0.8,zh;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Content-Length:11
Content-Type:application/json
Cookie:utag_main=v_id:015bf142e0e7000ce74c83375cbb0506d018c06500bd0$_sn:2$_ss:1$_st:1494578626160$_pn:1%3Bexp-session$ses_id:1494576826160%3Bexp-session; _nx_mpcid=745e0d75-e47d-4eb2-9d88-d54bfeb809ff
Host:utas.external.s2.fut.ea.com
Origin:https://www.easports.com
Pragma:no-cache
Referer:https://www.easports.com/iframe/fut17/bundles/futweb/web/flash/FifaUltimateTeam.swf?cl=165353
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
X-HTTP-Method-Override:PUT
X-Requested-With:ShockwaveFlash/25.0.0.171
X-UT-Embed-Error:true
X-UT-PHISHING-TOKEN:8172032561996223974
X-UT-SID:927df96a-474a-4a78-a2e9-eaed7fd7d0f8

{"bid":200}

@vinch1n
Copy link
Author

vinch1n commented May 12, 2017

can i use handler.php/sendRequest function to buy player?

@vinch1n
Copy link
Author

vinch1n commented May 13, 2017

Array
(
[url] => https://utas.external.s2.fut.ea.com/ut/game/fifa17/trade/190849008774/bid
[content_type] => application/json;charset=utf-8
[http_code] => 200
[header_size] => 156
[request_size] => 899
[filetime] => -1
[ssl_verify_result] => 20
[redirect_count] => 0
[total_time] => 1.515
[namelookup_time] => 0
[connect_time] => 0.312
[pretransfer_time] => 1.219
[size_upload] => 11
[size_download] => 77
[speed_download] => 50
[speed_upload] => 7
[download_content_length] => 77
[upload_content_length] => 11
[starttransfer_time] => 1.515
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 95.138.141.11

[primary_port] => 443
[local_ip] => 169.254.92.207
[local_port] => 60898

[request_header] => POST /ut/game/fifa17/trade/190849008774/bid HTTP/1.1

Host: utas.external.s2.fut.ea.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Cookie: _nx_mpcid=251e71de-9202-42e5-b4c4-6f70fae0e23e;
Accept-Language: en-US,en;q=0.8
Cache-Control: no-cache
Accept: application/json
X-UT-Embed-Error: true
X-Requested-With: ShockwaveFlash/25.0.0.171
Referer: https://www.easports.com/iframe/fut17/bundles/futweb/web/flash/FifaUltimateTeam.swf?cl=165353
Content-type: application/json
X-UT-SID: 3f023b28-852f-4b3a-9312-701bdb9d5b6d
X-UT-PHISHING-TOKEN: 9165947517992578238
X-HTTP-Method-Override: PUT
Origin: https://www.easports.com
Pragma: no-cache
Content-Length: 11
)

request playload is : {"bid":200}

response:
Array
(
[debug] =>
[string] =>
[code] => 461
[reason] => Permission Denied
)

always got code 461 error ,why would be that? how to make it right? @JKetelaar

@ToniKuipers
Copy link

Please provide me your PHP code.

@JKetelaar
Copy link
Owner

Seems like it's missing some values from cookies. Have you tried gathering the curl object from the login class?

@vinch1n
Copy link
Author

vinch1n commented May 15, 2017

my code :

    	$finalUrl = sprintf(URL::API_PLACE_BID,$tradeId);
    	
    	$dataAry = array(
    		'bid' => (int)$buynowPrice+100
    	);
    	
    	$dataStr = json_encode($dataAry);
    	
    	$header = array(
    		'Content-type' => 'application/json',
    		'Accept' => 'application/json',
    		'Origin'	=> 'https://www.easports.com',
    		'Referer'	=> 'https://www.easports.com/iframe/fut17/bundles/futweb/web/flash/FifaUltimateTeam.swf?cl=165353',
    		'X-Requested-With' => 'ShockwaveFlash/25.0.0.171',
    		'X-UT-Embed-Error' => 'true',
    		'Pragma' => 'no-cache',
    		'DNT'=>null,
    		'Easw-Session-Data-Nucleus-Id'=>null,
    		'X-UT-Route'=>null,
    		'x-flash-version'=>null,
    	);
    	
    	$item = $this->handler->sendRequest($finalUrl,Method::PUT(),$dataStr,$header,false,true);

this code was excuted after $api->login() func, compare to webapp's request infomation, no utag_main cookie string contain in my request, i also curl it without logged cookies.txt.

@vinch1n
Copy link
Author

vinch1n commented May 18, 2017

the important thing is what's missing? i try to use "oczkers/fut" , got same premission denied error,is that ea changed auth way to prevent all bot actions? anyone knows? thanks very very much!

@JKetelaar
Copy link
Owner

Hmmm, this is somewhat related to the request to have a method to make requests to the trade market, regarding selling or buying (issue #44).
So I'll try to handle this either this weekend or the next, please stay tuned!

@JKetelaar JKetelaar self-assigned this May 18, 2017
@vinch1n
Copy link
Author

vinch1n commented May 18, 2017

okay,in the meantime,i will working on it too.

@ToniKuipers
Copy link

I'am not a pro like you guys, but i will try to work on it too.

@JKetelaar
Copy link
Owner

Thanks for all the help and support guys, really appreciate it!

@JKetelaar
Copy link
Owner

JKetelaar commented May 19, 2017

First base has been added in commit #de1f624.

Use it like the following:

    $handler = $api->getHandler();

    /**
     */
    $s = $handler->getSearcher()->searchFor(
        ItemType::PLAYER(),
        [],
        150,
        50
    ); // Just gathering some players

    $x = $s[0]; // Just grabbing a random object from the possible trades
    if ($x->getCurrentBid() >= 0 && $x->getCurrentBid() < 150) {
        $handler->getTrader()->placeBid($x->getId(), 150);
    }else{
        echo('Bid is above our price.');
    }

Composer:

composer require jketelaar/php-fut-api:dev-release/0.0.7

@vinch1n
Copy link
Author

vinch1n commented May 22, 2017

excellent ! check it immediately!

@vinch1n
Copy link
Author

vinch1n commented May 22, 2017

i just tried to use placebid function to buy a player , just still got 461 error message ,i wonder is that "temporary ban" rejected this request?

@JKetelaar
Copy link
Owner

What is the entire stacktrace? I had 461 a few times too and figured out it was because the player wasn't tradable (invalid price, already sold etc.)

@vinch1n
Copy link
Author

vinch1n commented May 22, 2017

no stacktrace,request is successful but response is 461 error。what's invalid price?

i'm setting bid price equal to buynowprice,is that correct?

i wanna buy it now,so i use buynowprice to placebid,not a higher price than startprice to bid.

@JKetelaar
Copy link
Owner

What if you print the current bid of the trade and also print the current status of the trade.

@vinch1n
Copy link
Author

vinch1n commented May 22, 2017

ok,i will try more ways to bid , see you around.

@vinch1n
Copy link
Author

vinch1n commented May 23, 2017

[tradeState] => active
[buyNowPrice] => 700
[currentBid] => 0
[offers] => 0
[watched] =>
[bidState] => none
[startingBid] => 650
[confidenceValue] => 100

that's a typical form of trade data,hmm,seems to be normal.

"log in
Array ( [debug] => [string] => [code] => 461 [reason] => Permission Denied )"

this is bid response text,login successfully,bid error,can u try it to see got same error like mine or success response,so i can find out what's wrong with my code or my account indeed.

@JKetelaar
Copy link
Owner

Hmm very weird, I'll give it another shot tomorrow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants