示例#1
0
<?php

$game =& Globals::getGameInfo($var['game_id']);
$template->assignByRef('Game', $game);
// do we need credits for this game?
if ($game['GameCreditsRequired'] > 0) {
    // do we have enough
    if ($account->getTotalSmrCredits() < $game['GameCreditsRequired']) {
        create_error('Sorry you do not have enough SMR Credits to play this game.<br />To get SMR credits you need to donate to SMR.');
    }
}
// is the game already full?
if (SmrGame::getGame($var['game_id'])->getTotalPlayers() >= $game['GameMaxPlayers']) {
    create_error('The maximum number of players in that game is reached!');
}
//if (TIME < $game['StartDate'])
//	create_error('You want to join a game that hasn\'t started yet?');
if (TIME > $game['EndDate']) {
    create_error('You want to join a game that is already over?');
}
$template->assign('PageTopic', 'Join Game');
$raceInfo =& Globals::getRaces();
$raceDescriptions = '';
$first = true;
foreach ($raceInfo as $race) {
    if ($first) {
        $raceDescriptions .= '\'' . str_replace('\'', '\\\'"', $race['Description']) . '\'';
        $first = false;
    } else {
        $raceDescriptions .= ', \'' . str_replace('\'', '\\\'', $race['Description']) . '\'';
    }
示例#2
0
        case RACE_THEVIAN:
            $ship_id = SHIP_TYPE_SWIFT_VENTURE;
            break;
        case RACE_WQHUMAN:
            $ship_id = SHIP_TYPE_SLIP_FREIGHTER;
            break;
        case RACE_NIJARIN:
            $ship_id = SHIP_TYPE_REDEEMER;
            break;
        default:
            $ship_id = SHIP_TYPE_GALACTIC_SEMI;
    }
    $amount_shields = 50;
    $amount_armour = 50;
}
$last_turn_update = SmrGame::getGame($gameID)->getStartTurnsDate();
//// newbie leaders need to put into there alliances
if (SmrSession::$account_id == ACCOUNT_ID_NHL) {
    $alliance_id = 302;
} else {
    $alliance_id = 0;
}
$db->lockTable('player');
// get last registered player id in that game and increase by one.
$db->query('SELECT MAX(player_id) FROM player WHERE game_id = ' . $db->escapeNumber($gameID));
if ($db->nextRecord()) {
    $player_id = $db->getInt('MAX(player_id)') + 1;
} else {
    $player_id = 1;
}
// insert into player table.
示例#3
0
?>
</td>
					</tr>
					<tr>
						<td align="right">Max Turns</td>
						<td>&nbsp;</td>
						<td align="left"><?php 
echo number_format(Globals::getGameMaxTurns($StatsGameID));
?>
</td>
					</tr>
					<tr>
						<td align="right">Start Turn Hours</td>
						<td>&nbsp;</td>
						<td align="left"><?php 
echo number_format(SmrGame::getGame($StatsGameID)->getStartTurnHours());
?>
</td>
					</tr>
					<tr>
						<td align="right">Max Players</td>
						<td>&nbsp;</td>
						<td align="left"><?php 
echo number_format(Globals::getGameMaxPlayers($StatsGameID));
?>
</td>
					</tr>
					<tr>
						<td align="right">Alliance Max Players</td>
						<td>&nbsp;</td>
						<td align="left"><?php