当前位置: 首页>>代码示例>>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;未经允许,请勿转载。