Exemplo n.º 1
0
 public static function setScore(Dolumar_Underworld_Models_Mission $mission, Dolumar_Underworld_Models_Side $side, $score)
 {
     $db = Neuron_DB_Database::getInstance();
     $chk = $db->query("\n\t\t\tSELECT\n\t\t\t\tus_id\n\t\t\tFROM\n\t\t\t\tunderworld_score\n\t\t\tWHERE\n\t\t\t\tum_id = {$mission->getId()} AND\n\t\t\t\tus_side = {$side->getId()}\n\t\t");
     if (count($chk) === 0) {
         $db->query("\n\t\t\t\tINSERT INTO\n\t\t\t\t\tunderworld_score\n\t\t\t\tSET\n\t\t\t\t\tum_id = {$mission->getId()},\n\t\t\t\t\tus_side = {$side->getId()},\n\t\t\t\t\tus_score = '{$db->escape($score)}'\n\t\t\t");
     } else {
         $db->query("\n\t\t\t\tUPDATE\n\t\t\t\t\tunderworld_score\n\t\t\t\tSET\n\t\t\t\t\tus_score = '{$db->escape($score)}'\n\t\t\t\tWHERE\n\t\t\t\t\tum_id = {$mission->getId()} AND\n\t\t\t\t\tus_side = {$side->getId()}\n\t\t\t");
     }
 }
Exemplo n.º 2
0
 public static function addClan(Dolumar_Underworld_Models_Mission $mission, Dolumar_Players_Clan $clan, Dolumar_Underworld_Models_Side $side)
 {
     if (!self::hasClan($mission, $clan)) {
         $db = Neuron_DB_Database::getInstance();
         $db->query("\n\t\t\t\tINSERT INTO\n\t\t\t\t\tunderworld_missions_clans\n\t\t\t\tSET\n\t\t\t\t\tum_id = {$mission->getId()},\n\t\t\t\t\tc_id = {$clan->getId()},\n\t\t\t\t\tumc_side = {$side->getId()}\n\t\t\t");
     }
 }
Exemplo n.º 3
0
 public function isSide(Dolumar_Underworld_Models_Side $side)
 {
     if ($side->getId() == $this->group->getId()) {
         return true;
     }
     return false;
 }
Exemplo n.º 4
0
 public static function getFromArmy(Dolumar_Underworld_Models_Mission $mission, Dolumar_Underworld_Models_Side $side, Dolumar_Underworld_Models_Army $army)
 {
     $db = Neuron_DB_Database::getInstance();
     $data = $db->query("\n\t\t\tSELECT\n\t\t\t\tuat_id,\n\t\t\t\tuat_attacker,\n\t\t\t\tuat_defender,\n\t\t\t\tUNIX_TIMESTAMP(uat_startdate) AS startdate,\n\t\t\t\tUNIX_TIMESTAMP(uat_enddate) AS enddate,\n\t\t\t\tuat_fightlog,\n\t\t\t\tuat_from_x,\n\t\t\t\tuat_from_y,\n\t\t\t\tuat_to_x,\n\t\t\t\tuat_to_y,\n\t\t\t\tuat_attacker_side,\n\t\t\t\tuat_defender_side\n\t\t\tFROM \n\t\t\t\tunderworld_log_battles\n\t\t\tWHERE\n\t\t\t\tum_id = {$mission->getId()} AND\n\t\t\t\t(\n\t\t\t\t\tuat_attacker = {$side->getId()} OR\n\t\t\t\t\tuat_defender = {$side->getId()}\n\t\t\t\t) AND\n\t\t\t\t(\n\t\t\t\t\tuat_attacker_side = {$side->getId()} OR\n\t\t\t\t\tuat_defender_side = {$side->getId()}\n\t\t\t\t)\n\t\t\tORDER BY\n\t\t\t\tuat_startdate DESC\n\t\t");
     return self::getModelsFromReader($data);
 }
Exemplo n.º 5
0
 public static function win(Dolumar_Underworld_Models_Mission $mission, Dolumar_Underworld_Models_Side $side)
 {
     $db = Neuron_DB_Database::getInstance();
     $missionId = self::getMissionId($mission);
     $sql = "\n\t\t\tINSERT INTO\n\t\t\t\tunderworld_log_event\n\t\t\tSET\n\t\t\t\tul_m_id = '{$missionId}',\n\t\t\t\tul_e_action = 'WIN',\n\t\t\t\tul_e_date = NOW(),\n\t\t\t\tul_side = {$side->getId()}\n\t\t";
     $db->query($sql);
 }