예제 #1
0
require_once_model('Sector');
require_once_model('Building');
require_once_model('Technology');
require_once_model('Battle');
require_once_model('Player');
require_once_model('Message');
require_once_model('Resource');
session_start();
$staticData = $_SESSION['staticData'];
$allPlayers = $staticData->getPlayers();
$allBuildings = $staticData->getBuildings();
$sessionPlayer = $_SESSION['player'];
$playerConn = new PlayerDAO();
$sectorConn = new SectorDAO();
$newMessages = false;
$messagesArr = $playerConn->getMessages($sessionPlayer->getId(), true, 0);
if (count($messagesArr)) {
    $newMessages = true;
}
if ($_POST['height'] != 'undefined' && $_POST['width'] != 'undefined') {
    $height = $_POST['height'];
    $width = $_POST['width'];
} else {
    $lastMapViewArr = $playerConn->getLastMapView($sessionPlayer->getId());
    $coordinates = explode(",", $lastMapViewArr[0]);
    $originX = $coordinates[0];
    $originY = $coordinates[1];
    $height = $lastMapViewArr[1];
    $width = $height * 2;
}
$ratio = $MAP_HEIGHT / $height;