當前位置: 首頁>>代碼示例>>PHP>>正文


PHP city::finish_build方法代碼示例

本文整理匯總了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;
開發者ID:honchoman,項目名稱:singpolyma,代碼行數:31,代碼來源:process_transactions.php


注:本文中的city::finish_build方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。