本文整理匯總了PHP中city::finish_build方法的典型用法代碼示例。如果您正苦於以下問題:PHP city::finish_build方法的具體用法?PHP city::finish_build怎麽用?PHP city::finish_build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類city
的用法示例。
在下文中一共展示了city::finish_build方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: die
//if this is a friendly transfer
$city->setValue('unit_' . $transaction['unit_id'], $transaction['unit_count'], true);
} else {
//battle
$unit_data = mysql_query("SELECT function FROM units WHERE unit_id=" . $transaction['unit_id'], $db) or die(mysql_error());
$unit_data = mysql_fetch_assoc($unit_data);
unit_functions::$unit_data['function']($transaction, $city, $db);
}
//end if-else user == user
}
//end while transaction
mysql_query("DELETE FROM server_unit_transaction WHERE eta < {$time}") or die(mysql_error());
$transactions = mysql_query("SELECT city_id,building_id FROM server_building_transaction WHERE eta < {$time}") or die(mysql_error());
while ($transaction = mysql_fetch_assoc($transactions)) {
$city = new city($transaction['city_id']);
$city->finish_build($transaction['building_id']);
}
//end while transaction
mysql_query("DELETE FROM server_building_transaction WHERE eta < {$time}") or die(mysql_error());
mysql_query("DELETE FROM messages WHERE time < " . ceil($time - 60 * 3)) or die(mysql_error());
//delete all messages more than 3 minutes old
/* TWITTER */
$xml = get_tweets();
$first = true;
foreach ($xml->xpath('//direct_message') as $message) {
// if($first) file_put_contents('last_twitter', $message->id.'');
$first = false;
$user = mysql_query("SELECT user_id, last_server FROM users WHERE twitter='{$message->sender_screen_name}' LIMIT 1", $db) or die(mysql_error());
$user = mysql_fetch_assoc($user);
if (!$user || !$user['user_id']) {
continue;