give up dedi work

This commit is contained in:
kremsy 2014-02-20 17:59:09 +01:00 committed by Steffen Schröder
parent fc6718ae04
commit f77b5cb20a
2 changed files with 13 additions and 12 deletions

View File

@ -74,7 +74,7 @@ class AsynchronousFileReader {
->set(CURLOPT_ENCODING, "")//accept encoding ->set(CURLOPT_ENCODING, "")//accept encoding
->set(CURLOPT_AUTOREFERER, true)//accept link reference ->set(CURLOPT_AUTOREFERER, true)//accept link reference
->set(CURLOPT_HTTPHEADER, array("Content-Type: " . $contentType)) // ->set(CURLOPT_HTTPHEADER, array("Content-Type: " . $contentType)) //
->set(CURLOPT_USERAGENT, 'User-Agent: ManiaControl v' . ManiaControl::VERSION) // ->set(CURLOPT_USERAGENT, 'ManiaControl v' . ManiaControl::VERSION) //
->set(CURLOPT_RETURNTRANSFER, true); ->set(CURLOPT_RETURNTRANSFER, true);
$request->addListener('complete', function (\cURL\Event $event) use (&$function) { $request->addListener('complete', function (\cURL\Event $event) use (&$function) {
@ -129,6 +129,7 @@ class AsynchronousFileReader {
if ($compression) { if ($compression) {
$content = gzencode($content); $content = gzencode($content);
} }
$request = new Request($url); $request = new Request($url);
$request->getOptions()->set(CURLOPT_HEADER, false) //don't display response header $request->getOptions()->set(CURLOPT_HEADER, false) //don't display response header
->set(CURLOPT_CRLF, true) //linux linefeed ->set(CURLOPT_CRLF, true) //linux linefeed
@ -137,8 +138,8 @@ class AsynchronousFileReader {
->set(CURLOPT_POST, true) //post field ->set(CURLOPT_POST, true) //post field
->set(CURLOPT_POSTFIELDS, $content) //post content field ->set(CURLOPT_POSTFIELDS, $content) //post content field
->set(CURLOPT_HTTPHEADER, array("Content-Type: " . $contentType, "Keep-Alive: 300", "Connection: Keep-Alive", "Content-Encoding: gzip")) // ->set(CURLOPT_HTTPHEADER, array("Content-Type: " . $contentType, "Keep-Alive: 300", "Connection: Keep-Alive", "Content-Encoding: gzip")) //
//->set(CURLOPT_HTTPHEADER, array("Content-Type: " . $contentType, "Keep-Alive")) // //->set(CURLOPT_HTTPHEADER, array("Content-Type: " . $contentType, "Keep-Alive: 300", "Connection: Keep-Alive")) //
->set(CURLOPT_USERAGENT, 'User-Agent: ManiaControl v' . ManiaControl::VERSION) // ->set(CURLOPT_USERAGENT, 'ManiaControl v' . ManiaControl::VERSION) //
->set(CURLOPT_RETURNTRANSFER, true); ->set(CURLOPT_RETURNTRANSFER, true);
$request->addListener('complete', function (\cURL\Event $event) use (&$function) { $request->addListener('complete', function (\cURL\Event $event) use (&$function) {

View File

@ -303,14 +303,14 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
if (!isset($replays['Top1GReplay'])) { if (!isset($replays['Top1GReplay'])) {
$replays['Top1GReplay'] = ''; $replays['Top1GReplay'] = '';
} }
//$replays['VReplay'] = '';
$replays['Top1GReplay'] = '';
$replays['VReplay'] = base64_encode($replays['VReplay']);
//$replays['Top1GReplay'] = base64_encode($replays['Top1GReplay']);
//xmlrpc_set_type($replays['VReplay'], 'base64');
//xmlrpc_set_type($replays['Top1GReplay'], 'base64');
var_dump($replays); $replays['VReplay'] = base64_encode($replays['VReplay']);
$replays['Top1GReplay'] = base64_encode($replays['Top1GReplay']);
xmlrpc_set_type($replays['VReplay'], 'string');
xmlrpc_set_type($replays['Top1GReplay'], 'string');
//var_dump($replays);
$data = array($this->dedimaniaData->sessionId, $this->getMapInfo(), $gameMode, $times, $replays); $data = array($this->dedimaniaData->sessionId, $this->getMapInfo(), $gameMode, $times, $replays);
//var_dump($data); //var_dump($data);
$content = $this->encode_request(self::DEDIMANIA_SETCHALLENGETIMES, $data); $content = $this->encode_request(self::DEDIMANIA_SETCHALLENGETIMES, $data);
@ -321,7 +321,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
} }
var_dump($data); var_dump($data);
$data = $this->decode($data); $data = $this->decode($data);
var_dump($data); //var_dump($data);
if (is_array($data)) { if (is_array($data)) {
foreach($data as $index => $methodResponse) { foreach($data as $index => $methodResponse) {
if (xmlrpc_is_fault($methodResponse)) { if (xmlrpc_is_fault($methodResponse)) {