if ($key == 'nodeId') { $_GET[$key] = misc::clean($value, 'numeric'); } else { $_GET[$key] = misc::clean($value); } } switch ($_GET['action']) { case 'get': if (isset($_GET['nodeId'])) { $node = new node(); $status = $node->get('id', $_GET['nodeId']); if ($status == 'done') { if ($node->data['user'] == $_SESSION[$shortTitle . 'User']['id']) { $node->checkAll(time()); $node->getLocation(); $node->getQueue('build'); $node->getQueue('combat'); $buildQueue = array(); for ($i = 0; $i < $game['factions'][$node->data['faction']]['modules']; $i++) { $buildQueue[$i] = 0; } foreach ($node->queue['build'] as $item) { $buildQueue[$item['slot']] = 1; } } else { $message = $ui['accessDenied']; } } else { $message = $ui[$status]; } } else {
if ($status == 'done') { $node->checkAll(time()); $node->getLocation(); if ($node->data['user'] == $_SESSION[$shortTitle . 'User']['id']) { if (isset($node->modules[$_GET['slotId']])) { switch ($_GET['action']) { case 'get': $mid = $node->modules[$_GET['slotId']]['module']; $sid = $node->modules[$_GET['slotId']]['slot']; if ($mid > -1) { $module = $game['modules'][$node->data['faction']][$mid]; } if (isset($module)) { switch ($module['type']) { case 'research': $node->getQueue('research', 'technology', $game['modules'][$node->data['faction']][$mid]['technologies']); $totalIR = 0; foreach ($node->modules as $key => $item) { if ($item['module'] == $mid) { $totalIR += $item['input'] * $game['modules'][$node->data['faction']][$item['module']]['ratio']; } } break; case 'craft': $node->getQueue('craft', 'component', $game['modules'][$node->data['faction']][$mid]['components']); $totalIR = 0; foreach ($node->modules as $key => $item) { if ($item['module'] == $mid) { $totalIR += $item['input'] * $game['modules'][$node->data['faction']][$item['module']]['ratio']; } }