public function openPortal($village) { if ($village->equals($this->village)) { throw new Neuron_Core_Error('Can\'t open portal to own village.'); } $race = $village->getRace(); $building = Dolumar_Buildings_Portal::getBuilding(60, $race); $date = NOW + self::PORTAL_LIFESPAN_HOURES * 60 * 60 / GAME_SPEED_EFFECTS; $loc1 = $this->openPortalNearVillage($this->village, $building, $date); $loc2 = $this->openPortalNearVillage($village, $building, $date); $db = Neuron_DB_Database::getInstance(); $db->query("\n\t\t\tINSERT INTO\n\t\t\t\tmap_portals\n\t\t\tSET\n\t\t\t\tp_caster_v_id = {$this->village->getId()},\n\t\t\t\tp_target_v_id = {$village->getId()},\n\t\t\t\tp_caster_x = {$loc1[0]},\n\t\t\t\tp_caster_y = {$loc1[1]},\n\t\t\t\tp_target_x = {$loc2[0]},\n\t\t\t\tp_target_y = {$loc2[1]},\n\t\t\t\tp_caster_b_id = {$loc1[2]},\n\t\t\t\tp_target_b_id = {$loc2[2]},\n\t\t\t\tp_endDate = FROM_UNIXTIME({$date})\n\t\t"); $logs = Dolumar_Players_Logs::getInstance(); $logs->addOpenPortalLog($this->village, $village, $date); }
public function getMyContent($input, $original = false) { $action = isset($input['action']) ? $input['action'] : null; switch ($action) { case 'mission': return $this->getMissionOverview($input); break; } $out = $this->getMissionManager($input); // General content $out .= parent::getMyContent($input, true); return $out; }