本文整理汇总了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;