<commit_before><?php

// If on a planet, forward to planet_main.php
if($player->isLandedOnPlanet()) {
	forward(create_container('skeleton.php', 'planet_main.php', $var));
}

$sector =& $player->getSector();

$template->assign('ThisSector',$sector);
$template->assign('SpaceView',true);

$template->assign('PageTopic','Current Sector: ' . $player->getSectorID() . ' (' .$sector->getGalaxyName() . ')');

require_once(get_file_loc('menu.inc'));
create_nav_menu($template,$player);


// *******************************************
// *
// * Sector List
// *
// *******************************************

// Sector links
$links = array();
$links['Up'] = array('ID'=>$sector->getLinkUp());
$links['Right'] = array('ID'=>$sector->getLinkRight());
$links['Down'] = array('ID'=>$sector->getLinkDown());
$links['Left'] = array('ID'=>$sector->getLinkLeft());
$links['Warp'] = array('ID'=>$sector->getWarp());

$unvisited = array();

$db->query('SELECT sector_id FROM player_visited_sector WHERE sector_id IN (' . $db->escapeString($links,false) . ') AND account_id=' . $db->escapeNumber($player->getAccountID()) . ' AND game_id=' . $db->escapeNumber($player->getGameID()));
while($db->nextRecord()) {
	$unvisited[$db->getField('sector_id')] = TRUE;
}

foreach($links as $key => $linkArray) {
	if($linkArray['ID']>0 && $linkArray['ID']!=$player->getSectorID()) {
		if ($player->getLastSectorID() == $linkArray['ID']) $class = 'lastVisited';
		else if(isset($unvisited[$linkArray['ID']])) $class = 'unvisited';
		else $class = 'visited';
		$links[$key]['Class']=$class;
	}
}

$template->assign('Sectors',$links);

doTickerAssigns($template, $player, $db);

if(!isset($var['UnreadMissions'])) {
	$unreadMissions = $player->markMissionsRead();
	SmrSession::updateVar('UnreadMissions', $unreadMissions);
}
$template->assign('UnreadMissions', $var['UnreadMissions']);

// *******************************************
// *
// * Force and other Results
// *
// *******************************************
$turnsMessage = '';
switch($player->getTurnsLevel()) {
	case 'NONE':
		$turnsMessage = '<span class="red">WARNING</span>: You have run out of turns!';
	break;
	case 'LOW':
		$turnsMessage = '<span class="red">WARNING</span>: You are almost out of turns!';
	break;
	case 'MEDIUM':
		$turnsMessage = '<span class="yellow">WARNING</span>: You are running out of turns!';
	break;
}

$template->assign('TurnsMessage',$turnsMessage);

$protectionMessage = '';
if ($player->getNewbieTurns()) {
	if ($player->getNewbieTurns() < 25) {
		$protectionMessage = '<span class="blue">PROTECTION</span>: You are almost out of <span class="green">NEWBIE</span> protection.';
	}
	else
		$protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="green">NEWBIE</span> protection.';
}
elseif ($player->hasFederalProtection()) {
	$protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="blue">FEDERAL</span> protection.';<commit_msg>current_sector.php: pre-game turns message<commit_after><?php

// If on a planet, forward to planet_main.php
if($player->isLandedOnPlanet()) {
	forward(create_container('skeleton.php', 'planet_main.php', $var));
}

$sector =& $player->getSector();

$template->assign('ThisSector',$sector);
$template->assign('SpaceView',true);

$template->assign('PageTopic','Current Sector: ' . $player->getSectorID() . ' (' .$sector->getGalaxyName() . ')');

require_once(get_file_loc('menu.inc'));
create_nav_menu($template,$player);


// *******************************************
// *
// * Sector List
// *
// *******************************************

// Sector links
$links = array();
$links['Up'] = array('ID'=>$sector->getLinkUp());
$links['Right'] = array('ID'=>$sector->getLinkRight());
$links['Down'] = array('ID'=>$sector->getLinkDown());
$links['Left'] = array('ID'=>$sector->getLinkLeft());
$links['Warp'] = array('ID'=>$sector->getWarp());

$unvisited = array();

$db->query('SELECT sector_id FROM player_visited_sector WHERE sector_id IN (' . $db->escapeString($links,false) . ') AND account_id=' . $db->escapeNumber($player->getAccountID()) . ' AND game_id=' . $db->escapeNumber($player->getGameID()));
while($db->nextRecord()) {
	$unvisited[$db->getField('sector_id')] = TRUE;
}

foreach($links as $key => $linkArray) {
	if($linkArray['ID']>0 && $linkArray['ID']!=$player->getSectorID()) {
		if ($player->getLastSectorID() == $linkArray['ID']) $class = 'lastVisited';
		else if(isset($unvisited[$linkArray['ID']])) $class = 'unvisited';
		else $class = 'visited';
		$links[$key]['Class']=$class;
	}
}

$template->assign('Sectors',$links);

doTickerAssigns($template, $player, $db);

if(!isset($var['UnreadMissions'])) {
	$unreadMissions = $player->markMissionsRead();
	SmrSession::updateVar('UnreadMissions', $unreadMissions);
}
$template->assign('UnreadMissions', $var['UnreadMissions']);

// *******************************************
// *
// * Force and other Results
// *
// *******************************************
$turnsMessage = '';
$game = SmrGame::getGame($player->getGameID());
if ($game->getStartTurnsDate() > TIME) {
	$turnsMessage = 'Turns will be given when the game starts in ' . format_time($game->getStartTurnsDate() - TIME) . '!';
} else {
	switch($player->getTurnsLevel()) {
		case 'NONE':
			$turnsMessage = '<span class="red">WARNING</span>: You have run out of turns!';
		break;
		case 'LOW':
			$turnsMessage = '<span class="red">WARNING</span>: You are almost out of turns!';
		break;
		case 'MEDIUM':
			$turnsMessage = '<span class="yellow">WARNING</span>: You are running out of turns!';
		break;
	}
}
$template->assign('TurnsMessage',$turnsMessage);

$protectionMessage = '';
if ($player->getNewbieTurns()) {
	if ($player->getNewbieTurns() < 25) {
		$protectionMessage = '<span class="blue">PROTECTION</span>: You are almost out of <span class="green">NEWBIE</span> protection.';
	}
	else
		$protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="green">NEWBIE</span> protection.';
}
elseif ($player->hasFederalProtection()) {
	$protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="blue">FEDERAL</span> protection.';
{'fraction_non_alphanumeric': 0.2673684210526316, 'fraction_numerical': 0.0009716599190283401, 'mean_word_length': 6.634116192830655, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6625247', 'n_tokens_mistral': 2095, 'n_tokens_neox': 2015, 'n_words': 356}