function groupInfo($key) { global $debug; $result = rest("get_group_profile", "group={$key}"); if ($result == null) { logMessage('sl', 0, "Error retrieving group profile for {$key}", null, null); return null; } $xml = new SimpleXMLElement($result); return $xml->groupprofile->name . "," . $xml->groupprofile->insignia . "," . $xml->groupprofile->maturepublish . "," . $xml->groupprofile->charter; }
function calls() { //************** Entirely Random ***************************// $randomAPICall = rand(100000, 9999999); $service_url = 'http://api.tripadvisor.com/api/partner/2.0/location/' . $randomAPICall . '/?key=8B89F4BDB7F64B79A1533D6EA207C3D5'; //*************** Demo Purposes ******************************// // $rand = rand(0,19); // $service_url = 'http://api.tripadvisor.com/api/partner/2.0/location/'.$cityCodes[$rand].'/?key=8B89F4BDB7F64B79A1533D6EA207C3D5'; // ****************************************************** // $curl = curl_init($service_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); if ($curl_response === false) { $info = curl_getinfo($curl); curl_close($curl); die('error occured during curl exec. Additional info: ' . var_export($info)); } $json = json_decode($curl_response, true); rest($json); }
function getRegionMap($sim) { $result = rest("region_image", "region=" . urlencode($sim)); if ($result == null) { logMessage('sl', 0, "Error looking up region handle for {$sim}", null, null); return null; } $xml = new SimpleXMLElement($result); return $xml->image; }
function reduce($combiner, $in, $identity) { if (!empty($in)) { return $combiner(first($in), reduce($combiner, rest($in), $identity)); } else { $identity; } }
function getAvatarGroupListDetailed($key) { $result = rest("avatar_groups", "key={$key}"); if ($result == null) { logMessage('sl', 0, "Error looking up profile for {$key}", null, null); return null; } $xml = new SimpleXMLElement($result); $return = ""; foreach ($xml->groups->group as $group) { $return = $return . $group->key . "," . $group->name . "," . $group->title . "," . $group->notices . "," . $group->powers . "," . friendlyUUID($group->insignia) . ","; } return $return; }
}, 'keys' => function ($a) { return keys($a); }, 'vals' => function ($a) { return vals($a); }, 'sequential?' => function ($a) { return _sequential_Q($a); }, 'cons' => function ($a, $b) { return cons($a, $b); }, 'concat' => function () { return call_user_func_array('concat', func_get_args()); }, 'nth' => function ($a, $b) { return nth($a, $b); }, 'first' => function ($a) { return first($a); }, 'rest' => function ($a) { return rest($a); }, 'empty?' => function ($a) { return empty_Q($a); }, 'count' => function ($a) { return scount($a); }, 'conj' => function () { return call_user_func_array('conj', func_get_args()); }, 'apply' => function () { return call_user_func_array('apply', func_get_args()); }, 'map' => function ($a, $b) { return map($a, $b); }, 'with-meta' => function ($a, $b) { return with_meta($a, $b); }, 'meta' => function ($a) { return meta($a); }, 'atom' => function ($a) {
/** * */ function loop(array $bindings) { $args = func_get_args(); $exprs = rest($args); if (!even(count($bindings))) { throw new Exception('Bindings should be an array with an even number of values'); } }
$routes->connect('/players/:plin/characters', $defaults, $routeOptions); } } rest($routes, 'Players', ['Characters']); rest($routes, 'Characters', ['Items'], [], ['Conditions', 'Powers', 'Skills', 'Spells']); rest($routes, 'Conditions', [], ['Characters']); rest($routes, 'Powers', [], ['Characters']); rest($routes, 'Skills', [], ['Characters']); rest($routes, 'Spells', [], ['Characters']); rest($routes, 'Items', [], [], ['Attributes']); rest($routes, 'Attributes', [], ['Items']); rest($routes, 'Believes', ['Characters']); rest($routes, 'Factions', ['Characters']); rest($routes, 'Groups', ['Characters']); rest($routes, 'Worlds', ['Characters']); rest($routes, 'Lammies'); $defaults = []; $defaults['_method'] = 'GET'; $defaults['controller'] = 'Lammies'; $routeOptions = ['pass' => ['id'], 'id' => '[0-9]+']; $actions = [['pdfSingle', 0, '/lammies/single'], ['pdfSingle', 1, '/lammies/single/:id'], ['pdfDouble', 0, '/lammies/double'], ['pdfDouble', 1, '/lammies/double/:id'], ['jobItems', 1, '/lammies/jobs/:id'], ['pdfJobSingle', 1, '/lammies/jobs/:id/single'], ['pdfJobDouble', 1, '/lammies/jobs/:id/double']]; foreach ($actions as list($act, $ids, $url)) { $defaults['action'] = $act; $routes->connect($url, $defaults, $ids ? $routeOptions : []); } if (strcmp(substr($_SERVER['SERVER_SOFTWARE'], 0, 8), "lighttpd") == 0) { $defaults = []; $defaults['_method'] = 'GET'; $defaults['controller'] = 'Pages'; $defaults['action'] = 'lighttpd'; $routes->connect('/va-void/', $defaults);
} else { $log .= "称号选择非法!<br>"; } } } $mode = 'command'; } } elseif ($mode == 'senditem') { include_once GAME_ROOT . './include/game/battle.func.php'; senditem(); } elseif ($mode == 'combat') { include_once GAME_ROOT . './include/game/combat.func.php'; combat(1, $command); } elseif ($mode == 'rest') { include_once GAME_ROOT . './include/state.func.php'; rest($command); // } elseif($mode == 'chgpassword') { // include_once GAME_ROOT.'./include/game/special.func.php'; // chgpassword($oldpswd,$newpswd,$newpswd2); // } elseif($mode == 'chgword') { // include_once GAME_ROOT.'./include/game/special.func.php'; // chgword($newmotto,$newlastword,$newkillmsg); } elseif ($mode == 'corpse') { include_once GAME_ROOT . './include/game/itemmain.func.php'; getcorpse($command); } elseif ($mode == 'team') { include_once GAME_ROOT . './include/game/team.func.php'; if ($command == "teammake") { teammake($nteamID, $nteamPass); } if ($command == "teamjoin") {
function act() { if (eval(__MAGIC__)) { return $___RET_VALUE; } eval(import_module('sys', 'player', 'logger')); if ($mode == 'command' && ($command == 'rest1' || $command == 'rest2' || $command == 'rest3')) { eval(import_module('rest')); if ($command == 'rest3' && !in_array($pls, $rest_hospital_list)) { $log .= '<span class="yellow">你所在的位置并非医院,不能静养!</span><br>'; } else { $state = substr($command, 4, 1); $mode = 'rest'; } return; } if ($mode == 'rest') { rest($command); return; } $chprocess(); }