$stmt->fetch(); $stmt->free_result(); $stmt = $link->prepare("INSERT INTO ids(player,ip,ticket,launcher_ver,os,os_arch,os_version) \n\t\tVALUES(?,?,?,?,?,?,?)"); $stmt->bind_param('sssssss', $jsonData['username'], $_SERVER['REMOTE_ADDR'], $jsonData['ticket'], $jsonData['launcherVersion'], $jsonData['platform']['os'], $jsonData['platform']['word'], $jsonData['platform']['version']); $stmt->execute(); $answer = array('accessToken' => $accessToken, 'clientToken' => $clientToken, 'availableProfiles' => array(array('id' => $clientToken, 'name' => $jsonData['username'], 'legacy' => false)), 'selectedProfile' => array('id' => $clientToken, 'name' => $jsonData['username'], 'legacy' => false)); echo_log(json_encode($answer)); break; case 'setskin': if (empty($jsonData['username']) || empty($jsonData['password']) || empty($jsonData['skinData'])) { die(echo_log(json_encode(array('error' => 'Bad request', 'errorMessage' => 'Bad request', 'cause' => 'Bad request')))); } if (!m_login($jsonData['username'], $jsonData['password'])) { die(echo_log(json_encode(array('error' => 'Bad login')))); } if (get_skin($jsonData['username'], $jsonData['skinData'])) { $answer = array('username' => $jsonData['username'], 'status' => 'accepted'); } else { $answer = array('error' => 'Bad request'); } echo_log(json_encode($answer)); break; case stripos($_GET['act'], 'skin/') === 0: $begin = strpos($_GET['act'], '/'); $end = strrpos($_GET['act'], '.'); if ($begin === false || $end === false) { header("HTTP/1.0 404 Not Found"); exit; } $name = substr($_GET['act'], $begin + 1, $end - $begin - 1); $link = newdb();
$result = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status == 301) { preg_match('/location:(.*)/i', $result, $matches); curl_setopt($ch, CURLOPT_URL, trim($matches[1])); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_NOBODY, 0); $result = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status == 200) { $output = $result; } } curl_close($ch); } return $output; } $skin = get_skin($user); $im = imagecreatefromstring($skin); $av = imagecreatetruecolor($size, $size); $x = array('f' => 8, 'l' => 16, 'r' => 0, 'b' => 24); imagecopyresized($av, $im, 0, 0, $x[$view], 8, $size, $size, 8, 8); // Face imagecolortransparent($im, imagecolorat($im, 63, 0)); // Black Hat Issue imagecopyresized($av, $im, 0, 0, $x[$view] + 32, 8, $size, $size, 8, 8); // Accessories header('Content-type: image/png'); imagepng($av); imagedestroy($im); imagedestroy($av);
<?php $size = isset($_GET['s']) ? max(16, min(800, $_GET['s'])) : 250; $user = isset($_GET['u']) ? preg_replace("/[^a-zA-Z0-9_]+/", "", $_GET['u']) : ''; require_once 'common.php'; $im = get_skin($user); while ($size / 16 != floor($size / 16)) { $size++; } $s = $size / 16; $h = floor($size * 2); $av = imagecreatetruecolor($size, $h); imagesavealpha($av, true); imagefill($av, 0, 0, imagecolorallocatealpha($av, 0, 0, 0, 127)); if (imagesy($im) > 32) { // 1.8+ Skin if (imagecolorat($im, 54, 20) >> 24 & 0x7f == 127) { // Alex Style Skin (3px Arm Width) // Front imagecopyresized($av, $im, $s * 4, 0, 8, 8, $s * 8, $s * 8, 8, 8); imagecopyresized($av, $im, $s * 4, $s * 8, 20, 20, $s * 8, $s * 12, 8, 12); imagecopyresized($av, $im, $s * 1, $s * 8, 44, 20, $s * 3, $s * 12, 3, 12); imagecopyresized($av, $im, $s * 12, $s * 8, 36, 52, $s * 3, $s * 12, 3, 12); imagecopyresized($av, $im, $s * 4, $s * 8 + $s * 12, 4, 20, $s * 4, $s * 12, 4, 12); imagecopyresized($av, $im, $s * 8, $s * 8 + $s * 12, 20, 52, $s * 4, $s * 12, 4, 12); // Black Hat Issue imagecolortransparent($im, imagecolorat($im, 63, 0)); // Face Accessories imagecopyresized($av, $im, $s * 4, 0, 40, 8, $s * 8, $s * 8, 8, 8); // Body Accessories imagecopyresized($av, $im, $s * 4, $s * 8, 20, 36, $s * 8, $s * 12, 8, 12);
function av_show_face($user = '******', $size = 80, $inc_acc = TRUE) { $skin = get_skin($user); $im = imagecreatefromstring($skin); $av = imagecreatetruecolor($size, $size); imagecopyresized($av, $im, 0, 0, 8, 8, $size, $size, 8, 8); // Face imagecolortransparent($im, imagecolorat($im, 63, 0)); // Black Hat Issue if ($inc_acc == TRUE) { imagecopyresized($av, $im, 0, 0, 40, 8, $size, $size, 8, 8); // Accessories } header('Content-type: image/png'); imagepng($av); imagedestroy($im); imagedestroy($av); }
function echofooter() { global $is_loged_in, $skin_footer, $lang_content_type, $skin_menu, $config_version_name; if ($is_loged_in == TRUE) { $skin_footer = str_replace("{menu}", $skin_menu, $skin_footer); } else { $skin_footer = str_replace("{menu}", " " . $config_version_name, $skin_footer); } $skin_footer = get_skin($skin_footer); $skin_footer = str_replace("{content-type}", $lang_content_type, $skin_footer); echo $skin_footer; }