function tribReviewCase($case, $punish, $captcha, $realm, $ch, $cookies) { $url = "http://{$realm}.leagueoflegends.com/tribunal/en/vote/{$case}/"; $data = array("decision" => $punish ? "punish" : "pardon"); $data = http_build_query($data); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $result = getHtmlHeaderandCookies($ch, $url, $cookies); if ($result === false) { return false; } curl_setopt($ch, CURLOPT_POST, false); return tribGetCase($realm, $ch, $result["cookies"]); }
echo '{"status":"unknown"}'; break; default: echo '{"status":"ok","case":"' . $result["case"] . '","numGames":' . $result["numGames"] . ',"votesToday":' . $result["votesToday"] . ',"votesAllowed":' . $result["votesAllowed"] . '}'; break; } } } } } if (!empty($feedback)) { echo json_encode(array('status' => 'error', 'feedback' => $feedback)); } break; case "getCase": $result = tribGetCase($_SESSION['realm'], $ch, $_SESSION['cookies']); if ($result === false) { echo '{"status":"failed"}'; } else { $_SESSION['cookies'] = $result['cookies']; $_SESSION['case'] = $result['case']; if ($result['case'] == "finished") { echo '{"status":"finished"}'; } elseif ($result['case'] == "recess") { echo '{"status":"recess"}'; } else { echo '{"status":"ok","case":"' . $result["case"] . '","numGames":' . $result["numGames"] . ',"votesToday":' . $result["votesToday"] . ',"votesAllowed":' . $result["votesAllowed"] . '}'; } } break; case "getGame":