Ejemplo n.º 1
0
$fid = $_GET['fid'];
$message = $_GET['message'];
if ($uid) {
    $user = new User($uid);
}
if ($lid) {
    $lobby = new Lobby($lid);
}
if ($uid && $lid) {
    $id = getLPid($uid, $lid);
}
if ($uid && $lid) {
    switch ($request) {
        case "userready":
            $status = readystatus($id, true);
            $leader = $lobby->lobbyLeader();
            $array = array('ready' => $status, 'leader' => $leader);
            echo json_encode($array);
            break;
        case "changeTeam":
            if (isset($team) && freeslots($lid, $team) > 0) {
                joinTeam($id, $team);
            }
            break;
        case "switchClass":
            if (isset($class)) {
                switchClass($id, $class);
            }
            break;
        case "readystatus":
            if (isset($ready)) {