private function _fvAMFSend($amf) { $serializer = new AMFSerializer(); $result3 = $serializer->serialize($amf); // serialize the data $answer = Request('', $result3); $amf2 = new AMFObject($answer); $deserializer2 = new AMFDeserializer($amf2->rawData); // deserialize the data $deserializer2->deserialize($amf2); // run the deserializer $doinit = 0; if (!isset($amf2->_bodys[0]->_value['data'][0])) { DoInit(); return false; } Check4Rewards($amf2); foreach (@$amf2->_bodys[0]->_value['data'] as $key => $returned) { $resp = $returned['errorType']; $err = $returned['errorData']; if ($resp == 28 || $resp == 29) { if (strpos($err, 'MC::lock()') !== false) { //Ignore Quietly Now, even if Debug is on $iguser = load_array('ignores.txt'); preg_match('/rts_USER_(.*)_lock/', $err, $matches); $iguser[floatval($matches[1])] = floatval($matches[1]); save_array($iguser, 'ignores.txt'); } else { if ($this->settings['debug'] == 1 && $err != 'Remaining function') { AddLog2('fvManager Error: ' . $resp . ' - ' . $err); } } unset($amf2->_bodys[0]->_value['data'][$key]); if ($doinit == 0) { DoInit(); } $doinit = 1; if ($key == 0) { return false; } } } return $amf2; }
function RequestAMF2($amf) { $serializer = new AMFSerializer(); $result = $serializer->serialize($amf); // serialize the data $answer = Request('', $result); $amf2 = new AMFObject($answer); $deserializer2 = new AMFDeserializer($amf2->rawData); // deserialize the data $deserializer2->deserialize($amf2); // run the deserializer Check4Rewards($amf2); // Check if there was a error // Check if there was data[0] and or data[1] $errorfound = 'N'; $errorType = ''; $errorData = ''; if (@$amf2->_bodys[0]->_value['errorType'] != 0) { $errorfound = 'Y'; $errorType = $amf2->_bodys[0]->_value['errorType']; $errorData = $amf2->_bodys[0]->_value['errorData']; } if (isset($amf2->_bodys[0]->_value['data'][0])) { if (@$amf2->_bodys[0]->_value['data'][0]['errorType'] != 0) { $errorfound = 'Y'; $errorType = $amf2->_bodys[0]->_value['data'][0]['errorType']; $errorData = $amf2->_bodys[0]->_value['data'][0]['errorData']; } } if (isset($amf2->_bodys[0]->_value['data'][1])) { if (@$amf2->_bodys[0]->_value['data'][1]['errorType'] != 0) { $errorfound = 'Y'; $errorType = $amf2->_bodys[0]->_value['data'][1]['errorType']; $errorData = $amf2->_bodys[0]->_value['data'][1]['errorData']; } } if ($errorfound == 'Y') { if ($errorData == "There is a new version of the farm game released") { AddLog2('FV UPDATE: New Version of FV Released'); AddLog2('Work Will Restart in 15 Seconds'); unlink('unit_check.txt'); RestartBot(); } else { if ($errorData == "token value failed") { AddLog2('FV FUBAR: Game Opened in Another Browser'); AddLog2('Work Will Restart in 15 Seconds'); RestartBot(); } else { if ($errorData == "token too old") { AddLog2('FV FUBAR: Your Session Has Expired'); AddLog2('Work Will Restart in 15 Seconds'); RestartBot(); } else { if ($errorType == 29) { AddLog2('FV FUBAR: Server Sequence Was Reset'); DoInit(); } else { $res = "Error: " . $errorType . " " . $errorData; DoInit(); } } } } } else { if (!isset($amf2->_bodys[0]->_value['data'][0])) { echo "\n*****\nError:\n BAD AMF REPLY - Possible Server problem or farm badly out of sync\n*****\n"; $res = "BAD AMF REPLY (OOS?)"; } else { if ($errorType == '' && $errorData == '') { $res = 'OK'; } else { $res = 'Unknown'; } } } //if (isset($amf2->_bodys[0]->_value['data'][0])) { //$res = $errorType . " " . $errorData; //} //} return $res; }
private function _fvAMFSend($amf) { $serializer = new AMFSerializer(); $result3 = $serializer->serialize($amf); // serialize the data $answer = Request('', $result3); $amf2 = new AMFObject($answer); $deserializer2 = new AMFDeserializer($amf2->rawData); // deserialize the data $deserializer2->deserialize($amf2); // run the deserializer $doinit = 0; if (!isset($amf2->_bodys[0]->_value['data'][0])) { DoInit(); return false; } Check4Rewards($amf2); foreach (@$amf2->_bodys[0]->_value['data'] as $key => $returned) { $resp = $returned['errorType']; $err = $returned['errorData']; if ($resp == 28 || $resp == 29) { if ($err != 'Remaining function') { AddLog2('fvFarmer Error: ' . $resp . ' - ' . $err); } unset($amf2->_bodys[0]->_value['data'][$key]); if ($doinit == 0) { DoInit(); } $doinit = 1; if ($key == 0) { return false; } } } return $amf2; }
function RequestAMF($amf, $includeamf = false) { $amf2 = RequestAMFIntern($amf); Check4Rewards($amf2); $res = CheckAMF2Response($amf2); if ($includeamf) { return array('res' => $res, 'amf2' => $amf2); } return $res; }
private function _fvAMFSend($amf) { $serializer = new AMFSerializer(); $result3 = $serializer->serialize($amf); // serialize the data $answer = Request('', $result3); $amf2 = new AMFObject($answer); $deserializer2 = new AMFDeserializer($amf2->rawData); // deserialize the data $deserializer2->deserialize($amf2); // run the deserializer if (!isset($amf2->_bodys[0]->_value['data'][0])) { DoInit(); return false; } Check4Rewards($amf2); foreach (@$amf2->_bodys[0]->_value['data'] as $key => $returned) { $resp = $returned['errorType']; $err = $returned['errorData']; if ($resp == 28 || $resp == 29) { $this->reload = true; } } return $amf2; }