Example #1
0
        require HIDDEN_FILES_PATH . 'gar.php';
        break;
    case 'Submit Move':
        require HIDDEN_FILES_PATH . 'kraftwerk.php';
        require HIDDEN_FILES_PATH . 'gas.php';
        break;
    case 'Add Comment':
        require HIDDEN_FILES_PATH . 'gat.php';
        break;
    default:
        $mypage = page::standard();
        $mypage->title_body('Error');
        $mypage->leaf('p', 'It looks as though you have been sent to the wrong page. Please click <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
}
$GAME = gamegetdata_board_do($EscapedGameID);
if ($GAME === false) {
    $mypage = page::standard();
    $mypage->title_body('Cannot find game');
    $mypage->leaf('p', 'Cannot find a game with that game ID number. Please click <a href="index.php">here</a> to return to the Main Page.');
    $mypage->finish();
}
if ($GAME == 'WRONG PAGE') {
    $mypage = page::standard();
    $mypage->title_body('Game has not yet started');
    $mypage->leaf('p', 'This game has not yet started. Please click <a href="lobby.php?GameID=' . $EscapedGameID . '">here</a> to go to the lobby page, or <a href="index.php">here</a> to return to the Main Page.');
    $mypage->finish();
}
if ($GAME == 'FINISHED') {
    $mypage = page::standard();
    $mypage->title_body('Game has finished');
Example #2
0
File: mt.php Project: hdp/brass
// 1. *** Look for games that have timed out, and act on them.
if (MAINTENANCE_DISABLED) {
    $OutputLines[] = 'Not searching for timed-out games: maintenance is currently disabled.';
} else {
    $QueryResult = dbquery(DBQUERY_READ_RESULTSET, 'CALL "Maintenance_TimeLimitGames"()');
    if ($QueryResult === 'NONE') {
        $OutputLines[] = 'Games timed out: none';
    } else {
        $gamestimedout = array();
        $SystemActing = true;
        $PersonActing = -50;
        require HIDDEN_FILES_PATH . 'gamegetdata_board_do.php';
        require HIDDEN_FILES_PATH . 'kraftwerk.php';
        require HIDDEN_FILES_PATH . 'downsizeresource.php';
        while ($row = db_fetch_assoc($QueryResult)) {
            $GAME = gamegetdata_board_do($row['Game']);
            $gamestimedout[] = $GAME['GameID'];
            if ($GAME['CurrentPlayers'] - $GAME['PlayersMissingThatMatter'] == $GAME['MinimumPlayersAllowed'] and $GAME['MinimumPlayersAllowed'] > 2 or $GAME['CurrentPlayers'] == 3) {
                if ($GAME['DoWhatAtB'] == 'Downsize') {
                    $GAME['DoWhatAtB'] = 'Abort';
                }
                if ($GAME['DoWhatAtB'] == 'Kick current player; subsequently downsize') {
                    $GAME['DoWhatAtB'] = 'Kick current player; subsequently abort';
                }
            }
            if ($GAME['PlayersMissing'] + 1 == $GAME['CurrentPlayers']) {
                abortgame(2);
            } else {
                if ($GAME['DoWhatAtB'] == 'Downsize') {
                    downsizegame(true);
                } else {