Esempio n. 1
0
 public static function removeSquad(Dolumar_Underworld_Models_Army $army, Dolumar_Players_Squad $squad)
 {
     $db = Neuron_DB_Database::getInstance();
     $db->query("\n\t\t\tDELETE FROM\n\t\t\t\tunderworld_armies_squads\n\t\t\tWHERE\n\t\t\t\tua_id = {$army->getId()} AND\n\t\t\t\ts_id = {$squad->getId()}\n\t\t");
 }
Esempio n. 2
0
 private function loadMovingSquads($villages)
 {
     $where = "s_end > FROM_UNIXTIME(" . NOW . ") AND (";
     foreach ($villages as $v) {
         $where .= "s_from = " . $v->getId() . " OR s_to = " . $v->getId() . " OR ";
     }
     $where = substr($where, 0, -4) . ")";
     // Load the messages
     $db = Neuron_DB_Database::__getInstance();
     $movements = $db->query("\n\t\t\tSELECT\n\t\t\t\ts_from,\n\t\t\t\ts_to,\n\t\t\t\ts_id,\n\t\t\t\tUNIX_TIMESTAMP(s_end) AS aankomst\n\t\t\tFROM\n\t\t\t\tsquad_commands\n\t\t\tWHERE\n\t\t\t\t{$where}\n\t\t\tGROUP BY\n\t\t\t\ts_id\n\t\t");
     $text = Neuron_Core_Text::getInstance();
     $text->setSection('status', 'statusbar');
     foreach ($movements as $v) {
         $target = Dolumar_Players_Village::getVillage($v['s_to']);
         $squad = new Dolumar_Players_Squad($v['s_id']);
         //$txt = 'Moving troops to '.$target->getName ();
         $txt = Neuron_Core_Tools::putIntoText($text->get('moveTroops'), array('target' => $this->getVillageName($target), 'squad' => $squad->getName()));
         $this->addCounter($v['aankomst'], Dolumar_Players_Village::getVillage($v['s_from']), $txt, 'moving');
     }
 }