Example #1
0
function que_build($user, $planet, $build_mode = BUILD_CREATE, $redirect = true)
{
    global $lang, $config;
    $is_autoconvert = false;
    if ($build_mode == BUILD_AUTOCONVERT || sys_get_param_int('auto_convert')) {
        $build_mode = BUILD_CREATE;
        $is_autoconvert = true;
    }
    $unit_amount_qued = 0;
    try {
        if (!$user['id']) {
            throw new exception('{Нет идентификатора пользователя - сообщите Администрации}', ERR_ERROR);
            // TODO EXCEPTION
        }
        $unit_id = sys_get_param_int('unit_id');
        /*
        if(!$unit_id && is_array($unit_list = sys_get_param('fmenge')))
        {
          foreach($unit_list as $unit_id => $unit_amount) if($unit_amount) break;
        }
        */
        if (!$unit_id) {
            throw new exception('{Нет идентификатора юнита - сообщите Администрации}', ERR_ERROR);
            // TODO EXCEPTION
        }
        $que_id = que_get_unit_que($unit_id);
        if (!$que_id) {
            throw new exception('{Неправильный тип очереди - сообщите Администрации}', ERR_ERROR);
            // TODO EXCEPTION
        }
        if ($build_mode == BUILD_DESTROY && $que_id != QUE_STRUCTURES) {
            throw new exception('{Уничтожать можно только здания на планете}', ERR_ERROR);
            // TODO EXCEPTION
        }
        $que_data = sn_get_groups('ques');
        $que_data = $que_data[$que_id];
        // TODO Переделать под подочереди
        if ($que_id == QUE_STRUCTURES) {
            $sn_groups_build_allow = sn_get_groups('build_allow');
            $que_data['unit_list'] = $sn_groups_build_allow[$planet['planet_type']];
            if (!isset($que_data['unit_list'][$unit_id])) {
                throw new exception('{Это здание нельзя строить на ' . ($planet['planet_type'] == PT_PLANET ? 'планете' : 'луне'), ERR_ERROR);
                // TODO EXCEPTION
            }
        }
        /*
        // TODO Разделить очереди для Верфи и Обороны
        elseif($que_id == QUE_HANGAR)
        {
          $que_data['mercenary'] = in_array($unit_id, sn_get_groups('defense')) ? MRC_FORTIFIER : MRC_ENGINEER;
        }
        elseif($que_id == QUE_HANGAR)
        {
          $que_data['mercenary'] = in_array($unit_id, sn_get_groups('defense')) ? MRC_FORTIFIER : MRC_ENGINEER;
        }
        */
        sn_db_transaction_start();
        // Это нужно, что бы заблокировать пользователя и работу с очередями
        $user = db_user_by_id($user['id']);
        // Это нужно, что бы заблокировать планету от списания ресурсов
        if (isset($planet['id']) && $planet['id']) {
            $planet = db_planet_by_id($planet['id'], true);
        } else {
            $planet['id'] = 0;
        }
        $planet_id = $que_id == QUE_RESEARCH ? 0 : intval($planet['id']);
        $que = que_get($user['id'], $planet['id'], $que_id, true);
        $in_que =& $que['in_que'][$que_id][$user['id']][$planet_id];
        $que_max_length = que_get_max_que_length($user, $planet, $que_id, $que_data);
        // TODO Добавить вызовы функций проверок текущей и максимальной длин очередей
        if (count($in_que) >= $que_max_length) {
            throw new exception('{Все слоты очереди заняты}', ERR_ERROR);
            // TODO EXCEPTION
        }
        // TODO Отдельно посмотреть на уничтожение зданий - что бы можно было уничтожать их без планов
        switch (eco_can_build_unit($user, $planet, $unit_id)) {
            case BUILD_ALLOWED:
                break;
            case BUILD_UNIT_BUSY:
                throw new exception('{Строение занято}', ERR_ERROR);
                break;
                // TODO EXCEPTION eco_bld_msg_err_laboratory_upgrading
                // case BUILD_REQUIRE_NOT_MEET:
            // TODO EXCEPTION eco_bld_msg_err_laboratory_upgrading
            // case BUILD_REQUIRE_NOT_MEET:
            default:
                if ($build_mode == BUILD_CREATE) {
                    throw new exception('{Требования не удовлетворены}', ERR_ERROR);
                }
                break;
                // TODO EXCEPTION eco_bld_msg_err_requirements_not_meet
        }
        $unit_amount = floor(sys_get_param_float('unit_amount', 1));
        $unit_amount_qued = $unit_amount;
        $units_qued = isset($in_que[$unit_id]) ? $in_que[$unit_id] : 0;
        $unit_level = mrc_get_level($user, $planet, $unit_id, true, true) + $units_qued;
        if ($unit_max = get_unit_param($unit_id, P_MAX_STACK)) {
            if ($unit_level >= $unit_max) {
                throw new exception('{Максимальное количество юнитов данного типа уже достигнуто или будет достигнуто по окончанию очереди}', ERR_ERROR);
                // TODO EXCEPTION
            }
            $unit_amount = max(0, min($unit_amount, $unit_max - $unit_level));
        }
        if ($unit_amount < 1) {
            throw new exception('{Неправильное количество юнитов - сообщите Администрации}', ERR_ERROR);
            // TODO EXCEPTION
        }
        /*
        if($unit_max && $unit_level + $unit_amount > $unit_max)
        {
          throw new exception("Постройка {$unit_amount} {$lang['tech'][$unit_id]} приведет к привышению максимально возможного количества юнитов данного типа", ERR_ERROR); // TODO EXCEPTION
        }
        */
        // TODO Переделать eco_unit_busy для всех типов зданий
        //  if(eco_unit_busy($user, $planet, $que, $unit_id))
        //  {
        //    die('Unit busy'); // TODO EXCEPTION
        //  }
        if (get_unit_param($unit_id, P_STACKABLE)) {
            // TODO Поле 'max_Lot_size' для ограничения размера стэка в очереди - то ли в юниты, то ли в очередь
            if (in_array($unit_id, $group_missile = sn_get_groups('missile'))) {
                // TODO Поле 'container' - указывает на родительску структуру, в которой хранится данный юнит и по вместительности которой нужно применять размер юнита
                $used_silo = 0;
                foreach ($group_missile as $missile_id) {
                    $missile_qued = isset($in_que[$missile_id]) ? $in_que[$missile_id] : 0;
                    $used_silo += (mrc_get_level($user, $planet, $missile_id, true, true) + $missile_qued) * get_unit_param($missile_id, P_UNIT_SIZE);
                }
                $free_silo = mrc_get_level($user, $planet, STRUC_SILO) * get_unit_param(STRUC_SILO, P_CAPACITY) - $used_silo;
                if ($free_silo <= 0) {
                    throw new exception('{Ракетная шахта уже заполнена или будет заполнена по окончанию очереди}', ERR_ERROR);
                    // TODO EXCEPTION
                }
                $unit_size = get_unit_param($unit_id, P_UNIT_SIZE);
                if ($free_silo < $unit_size) {
                    throw new exception("{В ракетной шахте нет места для {$lang['tech'][$unit_id]}}", ERR_ERROR);
                    // TODO EXCEPTION
                }
                $unit_amount = max(0, min($unit_amount, floor($free_silo / $unit_size)));
            }
            $unit_level = $new_unit_level = 0;
        } else {
            $unit_amount = 1;
            if ($que_id == QUE_STRUCTURES) {
                // if($build_mode == BUILD_CREATE && eco_planet_fields_max($planet) - $planet['field_current'] - $que['sectors'][$planet['id']] <= 0)
                $sectors_qued = is_array($in_que) ? array_sum($in_que) : 0;
                if ($build_mode == BUILD_CREATE && eco_planet_fields_max($planet) - $planet['field_current'] - $sectors_qued <= 0) {
                    throw new exception('{Не хватает секторов на планете}', ERR_ERROR);
                    // TODO EXCEPTION
                }
                // И что это я такое написал? Зачем?
                //if($build_mode == BUILD_DESTROY && $planet['field_current'] <= $que['amounts'][$que_id])
                //{
                //  die('Too much buildings'); // TODO EXCEPTION
                //}
            }
            $build_multiplier = $build_mode == BUILD_CREATE ? 1 : -1;
            $new_unit_level = $unit_level + $unit_amount * $build_multiplier;
        }
        $build_data = eco_get_build_data($user, $planet, $unit_id, $unit_level);
        $exchange = array();
        $market_get_autoconvert_cost = market_get_autoconvert_cost();
        if ($is_autoconvert && $build_data[BUILD_AUTOCONVERT]) {
            $dark_matter = mrc_get_level($user, null, RES_DARK_MATTER);
            if (mrc_get_level($user, null, RES_DARK_MATTER) < $market_get_autoconvert_cost) {
                throw new exception("{Нет хватает " . ($market_get_autoconvert_cost - $dark_matter) . "ТМ на постройки с автоконвертацией ресурсов}", ERR_ERROR);
                // TODO EXCEPTION
            }
            !get_unit_param($unit_id, P_STACKABLE) ? $unit_amount = 1 : false;
            $resources_loot = sn_get_groups('resources_loot');
            $resource_got = array();
            $resource_exchange_rates = array();
            $resource_diff = array();
            $all_positive = true;
            foreach ($resources_loot as $resource_id) {
                $resource_db_name = pname_resource_name($resource_id);
                $resource_got[$resource_id] = floor(mrc_get_level($user, $planet, $resource_id));
                $resource_exchange_rates[$resource_id] = $config->__get("rpg_exchange_{$resource_db_name}");
                $resource_diff[$resource_id] = $resource_got[$resource_id] - $build_data[BUILD_CREATE][$resource_id] * $unit_amount;
                $all_positive = $all_positive && $resource_diff[$resource_id] > 0;
            }
            // Нужна автоконвертация
            if ($all_positive) {
                $is_autoconvert = false;
            } else {
                foreach ($resource_diff as $resource_diff_id => &$resource_diff_amount) {
                    if ($resource_diff_amount >= 0) {
                        continue;
                    }
                    foreach ($resource_diff as $resource_got_id => &$resource_got_amount) {
                        if ($resource_got_amount <= 0) {
                            continue;
                        }
                        $current_exchange = $resource_exchange_rates[$resource_got_id] / $resource_exchange_rates[$resource_diff_id];
                        $will_exchage_to = min(-$resource_diff_amount, floor($resource_got_amount * $current_exchange));
                        $will_exchage_from = $will_exchage_to / $current_exchange;
                        $resource_diff_amount += $will_exchage_to;
                        $resource_got_amount -= $will_exchage_from;
                        $exchange[$resource_diff_id] += $will_exchage_to;
                        $exchange[$resource_got_id] -= $will_exchage_from;
                    }
                }
                $is_autoconvert_ok = true;
                foreach ($resource_diff as $resource_diff_amount2) {
                    if ($resource_diff_amount2 < 0) {
                        $is_autoconvert_ok = false;
                        break;
                    }
                }
                if ($is_autoconvert_ok) {
                    $build_data['RESULT'][$build_mode] = BUILD_ALLOWED;
                    $build_data['CAN'][$build_mode] = $unit_amount;
                } else {
                    $unit_amount = 0;
                }
            }
        }
        $unit_amount = min($build_data['CAN'][$build_mode], $unit_amount);
        if ($unit_amount <= 0) {
            throw new exception('{Не хватает ресурсов}', ERR_ERROR);
            // TODO EXCEPTION
        }
        if ($new_unit_level < 0) {
            throw new exception('{Нельзя уничтожить больше юнитов, чем есть}', ERR_ERROR);
            // TODO EXCEPTION
        }
        if ($build_data['RESULT'][$build_mode] != BUILD_ALLOWED) {
            throw new exception('{Строительство блокировано}', ERR_ERROR);
            // TODO EXCEPTION
        }
        if ($is_autoconvert) {
            ksort($exchange);
            ksort($resource_got);
            db_change_units($user, $planet, array(RES_METAL => !empty($exchange[RES_METAL]) ? $exchange[RES_METAL] : 0, RES_CRYSTAL => !empty($exchange[RES_CRYSTAL]) ? $exchange[RES_CRYSTAL] : 0, RES_DEUTERIUM => !empty($exchange[RES_DEUTERIUM]) ? $exchange[RES_DEUTERIUM] : 0));
            rpg_points_change($user['id'], RPG_BUILD_AUTOCONVERT, -$market_get_autoconvert_cost, sprintf($lang['bld_autoconvert'], $unit_id, $unit_amount, uni_render_planet_full($planet, '', false, true), $lang['tech'][$unit_id], sys_unit_arr2str($build_data[BUILD_CREATE]), sys_unit_arr2str($resource_got), sys_unit_arr2str($exchange)));
        }
        $unit_amount_qued = 0;
        while ($unit_amount > 0 && count($que['ques'][$que_id][$user['id']][$planet_id]) < $que_max_length) {
            $place = min($unit_amount, MAX_FLEET_OR_DEFS_PER_ROW);
            que_add_unit($unit_id, $user, $planet, $build_data, $new_unit_level, $place, $build_mode);
            $unit_amount -= $place;
            $que = que_get($user['id'], $planet['id'], $que_id, true);
            $unit_amount_qued += $place;
        }
        sn_db_transaction_commit();
        if ($redirect) {
            sys_redirect("{$_SERVER['PHP_SELF']}?mode=" . sys_get_param_str('mode') . "&ally_id=" . sys_get_param_id('ally_id'));
            die;
        }
        $operation_result = array('STATUS' => ERR_NONE, 'MESSAGE' => '{Строительство начато}');
    } catch (exception $e) {
        sn_db_transaction_rollback();
        $operation_result = array('STATUS' => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR, 'MESSAGE' => $e->getMessage());
    }
    if (!empty($operation_result['MESSAGE'])) {
        $operation_result['MESSAGE'] .= ' ' . ($unit_amount_qued ? $unit_amount_qued : $unit_amount) . 'x[' . $lang['tech'][$unit_id] . ']';
    }
    return $operation_result;
}
Example #2
0
 } elseif (($hire = sys_get_param_int('hire')) && in_array($hire, sn_get_groups('governors')) && (!get_unit_param($hire, P_MAX_STACK) || $planetrow['PLANET_GOVERNOR_ID'] != $hire || $planetrow['PLANET_GOVERNOR_ID'] == $hire && $planetrow['PLANET_GOVERNOR_LEVEL'] < get_unit_param($hire, P_MAX_STACK))) {
     sn_db_transaction_start();
     $user = db_user_by_id($user['id'], true);
     $planetrow = db_planet_by_id($planetrow['id'], true);
     $build_data = eco_get_build_data($user, $planetrow, $hire, $planetrow['PLANET_GOVERNOR_ID'] == $hire ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0);
     if ($build_data['CAN'][BUILD_CREATE]) {
         if ($planetrow['PLANET_GOVERNOR_ID'] == $hire) {
             $planetrow['PLANET_GOVERNOR_LEVEL']++;
             $query = '`PLANET_GOVERNOR_LEVEL` + 1';
         } else {
             $planetrow['PLANET_GOVERNOR_LEVEL'] = 1;
             $planetrow['PLANET_GOVERNOR_ID'] = $hire;
             $query = '1';
         }
         db_planet_set_by_id($planetrow['id'], "`PLANET_GOVERNOR_ID` = {$hire}, `PLANET_GOVERNOR_LEVEL` = {$query}");
         rpg_points_change($user['id'], RPG_GOVERNOR, -$build_data[BUILD_CREATE][RES_DARK_MATTER], sprintf($lang['ov_governor_purchase'], $lang['tech'][$hire], $hire, $planetrow['PLANET_GOVERNOR_LEVEL'], uni_render_planet_full($planetrow, '', false, true)));
         //  => 'Игрок купил Губернатора %1$s ID %2$d уровня %3$d на планету %4$s',
         // die();
     }
     sn_db_transaction_commit();
     sys_redirect('overview.php?mode=manage');
     die;
 }
 lng_include('mrc_mercenary');
 int_planet_pretemplate($planetrow, $template);
 foreach (sn_get_groups('governors') as $governor_id) {
     if ($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) {
         continue;
     }
     $governor_level = $planetrow['PLANET_GOVERNOR_ID'] == $governor_id ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0;
     $build_data = eco_get_build_data($user, $planetrow, $governor_id, $governor_level);
Example #3
0
/**
 * @param array $user
 * @param array $planetrow
 *
 * @return string|template
 */
function sn_tpl_render_topnav(&$user, $planetrow)
{
    if (!is_array($user)) {
        return '';
    }
    global $lang, $config, $sn_module_list;
    $GET_mode = sys_get_param_str('mode');
    $template = gettemplate('topnav', true);
    /*
    $planetrow = $planetrow ? $planetrow : $user['current_planet'];
    
    sn_db_transaction_start();
    $planetrow = sys_o_get_updated($user, $planetrow, SN_TIME_NOW);
    sn_db_transaction_commit();
    $planetrow = $planetrow['planet'];
    */
    $ThisUsersPlanets = db_planet_list_sorted($user);
    // while ($CurPlanet = db_fetch($ThisUsersPlanets))
    foreach ($ThisUsersPlanets as $CurPlanet) {
        if ($CurPlanet['destruyed']) {
            continue;
        }
        $fleet_listx = flt_get_fleets_to_planet($CurPlanet);
        $template->assign_block_vars('topnav_planets', array('ID' => $CurPlanet['id'], 'NAME' => $CurPlanet['name'], 'TYPE' => $CurPlanet['planet_type'], 'TYPE_TEXT' => $lang['sys_planet_type_sh'][$CurPlanet['planet_type']], 'PLIMAGE' => $CurPlanet['image'], 'FLEET_ENEMY' => $fleet_listx['enemy']['count'], 'COORDS' => uni_render_coordinates($CurPlanet), 'SELECTED' => $CurPlanet['id'] == $user['current_planet'] ? ' selected' : ''));
    }
    $fleet_flying_list = tpl_get_fleets_flying($user);
    tpl_topnav_event_build($template, $fleet_flying_list[0]);
    tpl_topnav_event_build($template, $fleet_flying_list[MT_EXPLORE], 'expedition');
    que_tpl_parse($template, QUE_STRUCTURES, $user, $planetrow, null, true);
    que_tpl_parse($template, QUE_RESEARCH, $user, array(), null, !classSupernova::$user_options[PLAYER_OPTION_NAVBAR_RESEARCH_WIDE]);
    que_tpl_parse($template, SUBQUE_FLEET, $user, $planetrow, null, true);
    $str_date_format = "%3\$02d %2\$0s %1\$04d {$lang['top_of_year']} %4\$02d:%5\$02d:%6\$02d";
    $time_now_parsed = getdate(SN_TIME_NOW);
    $time_local_parsed = getdate(defined('SN_CLIENT_TIME_LOCAL') ? SN_CLIENT_TIME_LOCAL : SN_TIME_NOW);
    if ($config->game_news_overview) {
        $user_last_read_safe = intval($user['news_lastread']);
        nws_render($template, "WHERE UNIX_TIMESTAMP(`tsTimeStamp`) >= {$user_last_read_safe}", $config->game_news_overview);
    }
    $notes_query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `sticky` = 1 ORDER BY priority DESC, time DESC");
    while ($note_row = db_fetch($notes_query)) {
        note_assign($template, $note_row);
    }
    $premium_lvl = mrc_get_level($user, false, UNIT_PREMIUM, true, true);
    $template->assign_vars(array('HALLOWEEN' => !empty($sn_module_list['event']['event_halloween_2015']) && $sn_module_list['event']['event_halloween_2015']->manifest['active'], 'QUE_ID' => QUE_RESEARCH, 'QUE_HTML' => 'topnav', 'RESEARCH_ONGOING' => (bool) $user['que'], 'TIME_TEXT' => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'], $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds']), 'TIME_TEXT_LOCAL' => sprintf($str_date_format, $time_local_parsed['year'], $lang['months'][$time_local_parsed['mon']], $time_local_parsed['mday'], $time_local_parsed['hours'], $time_local_parsed['minutes'], $time_local_parsed['seconds']), 'GAME_BLITZ_REGISTER' => $config->game_blitz_register, 'GAME_BLITZ_REGISTER_TEXT' => $lang['sys_blitz_registration_mode_list'][$config->game_blitz_register], 'BLITZ_REGISTER_OPEN' => $config->game_blitz_register == BLITZ_REGISTER_OPEN, 'BLITZ_REGISTER_CLOSED' => $config->game_blitz_register == BLITZ_REGISTER_CLOSED, 'BLITZ_REGISTER_SHOW_LOGIN' => $config->game_blitz_register == BLITZ_REGISTER_SHOW_LOGIN, 'BLITZ_REGISTER_DISCLOSURE_NAMES' => $config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES, 'GAME_BLITZ' => $config->game_mode == GAME_BLITZ, 'USERS_ONLINE' => $config->var_online_user_count, 'USERS_TOTAL' => $config->users_amount, 'USER_RANK' => $user['total_rank'], 'USER_NICK' => $user['username'], 'USER_AVATAR' => $user['avatar'], 'USER_AVATARID' => $user['id'], 'USER_PREMIUM' => $premium_lvl, 'USER_RACE' => $user['player_race'], 'TOPNAV_CURRENT_PLANET' => $user['current_planet'], 'TOPNAV_CURRENT_PLANET_NAME' => uni_render_planet_full($planetrow), 'TOPNAV_CURRENT_PLANET_IMAGE' => $planetrow['image'], 'TOPNAV_COLONIES_CURRENT' => get_player_current_colonies($user), 'TOPNAV_COLONIES_MAX' => get_player_max_colonies($user), 'TOPNAV_MODE' => $GET_mode, 'TOPNAV_DARK_MATTER' => mrc_get_level($user, '', RES_DARK_MATTER), 'TOPNAV_DARK_MATTER_TEXT' => pretty_number(mrc_get_level($user, '', RES_DARK_MATTER)), 'TOPNAV_DARK_MATTER_PLAIN' => mrc_get_level($user, '', RES_DARK_MATTER, false, true), 'TOPNAV_DARK_MATTER_PLAIN_TEXT' => pretty_number(mrc_get_level($user, '', RES_DARK_MATTER, false, true)), 'TOPNAV_METAMATTER' => mrc_get_level($user, '', RES_METAMATTER), 'TOPNAV_METAMATTER_TEXT' => pretty_number(mrc_get_level($user, '', RES_METAMATTER)), 'TOPNAV_PAYMENT' => sn_module_get_active_count('payment') && !defined('SN_GOOGLE'), 'TOPNAV_MESSAGES_ADMIN' => $user['msg_admin'], 'TOPNAV_MESSAGES_PLAYER' => $user['mnl_joueur'], 'TOPNAV_MESSAGES_ALLIANCE' => $user['mnl_alliance'], 'TOPNAV_MESSAGES_ATTACK' => $user['mnl_attaque'], 'TOPNAV_MESSAGES_ALL' => $user['new_message'], 'TOPNAV_FLEETS_FLYING' => count($fleet_flying_list[0]), 'TOPNAV_FLEETS_TOTAL' => GetMaxFleets($user), 'TOPNAV_EXPEDITIONS_FLYING' => count($fleet_flying_list[MT_EXPLORE]), 'TOPNAV_EXPEDITIONS_TOTAL' => get_player_max_expeditons($user), 'TOPNAV_QUEST_COMPLETE' => get_quest_amount_complete($user['id']), 'GAME_NEWS_OVERVIEW' => $config->game_news_overview, 'GAME_RESEARCH_DISABLED' => defined('GAME_RESEARCH_DISABLED') && GAME_RESEARCH_DISABLED, 'GAME_DEFENSE_DISABLED' => defined('GAME_DEFENSE_DISABLED') && GAME_DEFENSE_DISABLED, 'GAME_STRUCTURES_DISABLED' => defined('GAME_STRUCTURES_DISABLED') && GAME_STRUCTURES_DISABLED, 'GAME_HANGAR_DISABLED' => defined('GAME_HANGAR_DISABLED') && GAME_HANGAR_DISABLED, 'PLAYER_OPTION_NAVBAR_DISABLE_RESEARCH' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_DISABLE_RESEARCH], 'PLAYER_OPTION_NAVBAR_DISABLE_PLANET' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_DISABLE_PLANET], 'PLAYER_OPTION_NAVBAR_DISABLE_HANGAR' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_DISABLE_HANGAR], 'PLAYER_OPTION_NAVBAR_DISABLE_FLYING_FLEETS' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_DISABLE_FLYING_FLEETS], 'PLAYER_OPTION_NAVBAR_DISABLE_EXPEDITIONS' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_DISABLE_EXPEDITIONS], 'PLAYER_OPTION_NAVBAR_DISABLE_QUESTS' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_DISABLE_QUESTS], 'PLAYER_OPTION_NAVBAR_DISABLE_META_MATTER' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_DISABLE_META_MATTER], 'PLAYER_OPTION_NAVBAR_RESEARCH_WIDE' => classSupernova::$user_options[PLAYER_OPTION_NAVBAR_RESEARCH_WIDE], 'SUBQUE_FLEET' => SUBQUE_FLEET, 'QUE_RESEARCH' => QUE_RESEARCH, 'QUE_STRUCTURES' => QUE_STRUCTURES));
    if (defined('SN_RENDER_NAVBAR_PLANET') && SN_RENDER_NAVBAR_PLANET === true || $user['option_list'][OPT_INTERFACE]['opt_int_navbar_resource_force'] && SN_RENDER_NAVBAR_PLANET !== false) {
        tpl_set_resource_info($template, $planetrow);
        $template->assign_vars(array('SN_RENDER_NAVBAR_PLANET' => true, 'SN_NAVBAR_HIDE_FLEETS' => true));
    }
    return $template;
}