//do checks $userName = $lines[0]; $passHash = $lines[1]; $user = GetUserByName($userName); if (CheckUserPassword($user, $passHash) === false) { DieError(-1); } $userId = $user['id']; $userRank = $user['status']; $userName = $user['username']; //in case casing is different if ($userRank == 0) { ActivateUser($userId); } if ($userRank == -1) { DieError(-3); } //banned //TODO: implement these things $pp = 0; //TODO: implement pp $globalRank = 0; $totalScore = GetTotalScoreFromId($user['id']); $accuracy = GetAccuracyFromId($user['id']); $playCount = GetPlaycountFromId($user['id']); //5,000 / 3 * (4n^3 - 3n^2 - n) + 1.25 * 1.8^(n - 60) $experience = 0; //$totalscore; //actually, nvm $toprint = array_merge(CreatePacket(92, 0), CreatePacket(5, $userId), CreatePacket(75, $protocolVersion), CreatePacket(71, $userRank), CreatePacket(72, array(1, 2)), CreatePacket(83, array('id' => $userId, 'playerName' => $userName, 'utcOffset' => 0 + 24, 'country' => 0, 'playerRank' => $userRank, 'longitude' => 0, 'latitude' => 0, 'globalRank' => $globalRank)), CreatePacket(11, array('id' => $userId, 'bStatus' => 0, 'string0' => '', 'string1' => '', 'mods' => 0, 'playmode' => 0, 'int0' => 0, 'score' => $totalScore, 'accuracy' => $accuracy, 'playcount' => $playCount, 'experience' => $experience, 'int1' => $globalRank, 'pp' => $pp)), CreatePacket(83, array('id' => 3, 'playerName' => GetUserById(3)['username'], 'utcOffset' => 0 + 24, 'country' => 1, 'playerRank' => 0, 'longitude' => 0, 'latitude' => 0, 'globalRank' => 0)), CreatePacket(96, array(0, $userId)), CreatePacket(89, null), CreatePacket(64, '#osu'), CreatePacket(64, '#news'), CreatePacket(65, array('#osu', 'Main channel', 2147483647 - 1)), CreatePacket(65, array('#news', 'This will contain announcements and info, while beta lasts.', 1)), CreatePacket(65, array('#kfc', 'Kawaii friends club', 0)), CreatePacket(65, array('#aqn', 'cuz f**k yeah', 1337)), CreatePacket(07, array('BanchoBob', 'This is a test message! First step to getting chat working!', '#osu', 3))); } } else {
error_reporting($conf['debug']['level']); } // check install ---------------------------------------- function DieError($m) { echo "<h2 color='red'>Fatal Error</h2>{$m}"; exit; } if (!file_exists($conf['paths']['caches'] . 'version')) { echo "<H1>Installing {$conf['app']['name']} (version {$conf['app']['version']})</H1>"; echo "Checking cache folder : "; if (!is_writable($conf['paths']['caches'])) { DieError("<p><b>{$conf['paths']['caches']}</b> is not writable, please chmod it to 777</p><i>chmod -R 777 {$conf['paths']['caches']}</i>"); } echo "OK<br> Checking minimum config :"; if (!$conf['app']['api']) { DieError('Client API is not set'); } echo "OK<br>"; //success file_put_contents($conf['paths']['caches'] . 'version', $conf['app']['version']); echo "<p>Cool! <b>{$conf['app']['name']} has been successfully installed!</b></p>"; echo "<i>(Please refresh this page if not done automatically) <meta http-equiv='refresh' content='5'></i>"; exit; } if (file_exists($conf['paths']['caches'] . 'last_version')) { $conf['app']['last_version'] = (double) file_get_contents($conf['paths']['caches'] . 'last_version'); } //starting ------------------------------------------------------ require_once $conf['libs']['kernel']; $dw = new PMD_Kernel();