diff --git a/code/web/app/app_achievements_admin/class/AdmAchievement_class.php b/code/web/app/app_achievements_admin/class/AdmAchievement_class.php
index 747254953..5722457d2 100644
--- a/code/web/app/app_achievements_admin/class/AdmAchievement_class.php
+++ b/code/web/app/app_achievements_admin/class/AdmAchievement_class.php
@@ -124,18 +124,6 @@
$this->category = $c;
}
- function setTieRace($t) {
- $this->tie_race = $t;
- }
-
- function setTieCiv($t) {
- $this->tie_civ = $t;
- }
-
- function setTieCult($t) {
- $this->tie_cult = $t;
- }
-
function setImage($i) {
$this->image = $i;
}
diff --git a/code/web/app/app_achievements_admin/class/AdmTask_class.php b/code/web/app/app_achievements_admin/class/AdmTask_class.php
index 6f6f8856b..26d050740 100644
--- a/code/web/app/app_achievements_admin/class/AdmTask_class.php
+++ b/code/web/app/app_achievements_admin/class/AdmTask_class.php
@@ -96,6 +96,8 @@
$DBc->sqlQuery("DELETE FROM ach_task WHERE at_id='".$this->getID()."'");
$DBc->sqlQuery("DELETE FROM ach_player_task WHERE apt_task='".$this->getID()."'");
+ $DBc->sqlQuery("DELETE FROM ach_task_tie_align WHERE atta_task='".$this->getID()."'");
+ $DBc->sqlQuery("DELETE FROM ach_task_tie_race WHERE attr_task='".$this->getID()."'");
$iter = $this->getIterator();
while($iter->hasNext()) {
@@ -111,6 +113,17 @@
$DBc->sqlQuery("UPDATE ach_task SET at_parent=".mkn($this->getParentID()).",at_value='".$DBc->sqlEscape($this->getValue())."',at_condition='".$DBc->sqlEscape($this->getCondition())."',at_condition_value=".mkn($this->getConditionValue()).",at_dev='".$this->getDev()."',at_torder='".$this->torder."', at_inherit='".$this->inherit_obj."' WHERE at_id='".$this->getID()."'");
$DBc->sqlQuery("INSERT INTO ach_task_lang (atl_task,atl_lang,atl_name,atl_template) VALUES ('".$this->getID()."','en','".$DBc->sqlEscape($this->getName())."',".mkn($this->getTemplate()).") ON DUPLICATE KEY UPDATE atl_name='".$DBc->sqlEscape($this->getName())."',atl_template=".mkn($this->getTemplate())."");
+
+ $DBc->sqlQuery("DELETE FROM ach_task_tie_align WHERE atta_task='".$this->getID()."'");
+ $DBc->sqlQuery("DELETE FROM ach_task_tie_race WHERE attr_task='".$this->getID()."'");
+
+ foreach($this->tie_race as $elem) {
+ $DBc->sqlQuery("INSERT INTO ach_task_tie_race (attr_task,attr_race) VALUES ('".$this->getID()."','".$DBc->sqlEscape($elem)."')");
+ }
+
+ foreach($this->tie_align as $elem) {
+ $DBc->sqlQuery("INSERT INTO ach_task_tie_align (atta_task,atta_alignment) VALUES ('".$this->getID()."','".$DBc->sqlEscape($elem)."')");
+ }
}
function insert() {
@@ -123,6 +136,14 @@
$this->setID($id);
$DBc->sqlQuery("INSERT INTO ach_task_lang (atl_task,atl_lang,atl_name,atl_template) VALUES ('".$this->getID()."','en','".$DBc->sqlEscape($this->getName())."',".mkn($this->getTemplate()).")");
+
+ foreach($this->tie_race as $elem) {
+ $DBc->sqlQuery("INSERT INTO ach_task_tie_race (attr_task,attr_race) VALUES ('".$this->getID()."','".$DBc->sqlEscape($elem)."')");
+ }
+
+ foreach($this->tie_align as $elem) {
+ $DBc->sqlQuery("INSERT INTO ach_task_tie_align (atta_task,atta_alignment) VALUES ('".$this->getID()."','".$DBc->sqlEscape($elem)."')");
+ }
}
function setAchievement($a) {
@@ -141,6 +162,14 @@
$this->value = $v;
}
+ function setTieRace($t) {
+ $this->tie_race = $t;
+ }
+
+ function setTieAlign($t) {
+ $this->tie_align = $t;
+ }
+
function getCondition() {
return $this->condition;
}
@@ -198,5 +227,19 @@
}
}
}
+
+ function isTiedRace($r) {
+ if(sizeof($this->tie_race) == 0) {
+ return false;
+ }
+ return in_array($r,$this->tie_race);
+ }
+
+ function isTiedAlign($cult,$civ) {
+ if(sizeof($this->tie_align) == 0) {
+ return false;
+ }
+ return in_array(($cult.'|'.$civ),$this->tie_align);
+ }
}
?>
\ No newline at end of file
diff --git a/code/web/app/app_achievements_admin/conf.php b/code/web/app/app_achievements_admin/conf.php
index 7163ef95a..1f20ac5a7 100644
--- a/code/web/app/app_achievements_admin/conf.php
+++ b/code/web/app/app_achievements_admin/conf.php
@@ -12,10 +12,10 @@
$_CONF['enable_CSR'] = true;
$_CONF['enable_ADM'] = true;
- /*$_CONF['char_mysql_server'] = "localhost";
- $_CONF['char_mysql_user'] = "root";
- $_CONF['char_mysql_pass'] = "";
- $_CONF['char_mysql_database'] = "app_achievements";*/
+ $_CONF['char_mysql_server'] = RYAPI_NELDB_HOST;
+ $_CONF['char_mysql_user'] = RYAPI_NELDB_LOGIN;
+ $_CONF['char_mysql_pass'] = RYAPI_NELDB_PASS;
+ $_CONF['char_mysql_database'] = RYAPI_NELDB_RING;
$_CONF['langs'] = array('en','de','fr','es','ru');
?>
\ No newline at end of file
diff --git a/code/web/app/app_achievements_admin/include/adm_render_ach.php b/code/web/app/app_achievements_admin/include/adm_render_ach.php
index 9259842af..4b8c1a2d7 100644
--- a/code/web/app/app_achievements_admin/include/adm_render_ach.php
+++ b/code/web/app/app_achievements_admin/include/adm_render_ach.php
@@ -138,30 +138,6 @@
$html .= "
-
- cult: |
-
-
- |
-
-
- civilization: |
-
-
- |
-
image: |
|
@@ -199,6 +175,28 @@
condition value: |
|
+
+ allegiance: |
+
+
+ |
+
|
@@ -209,7 +207,7 @@
";
- if($cat->isTiedCultDev() || $cat->isTiedCivDev()) {
+ if($cat->hasTieAlignDev()) {
$html .= ach_render_tiebar($cat->getCurrentCult(),$cat->getCurrentCiv(),$cat);
}
@@ -218,13 +216,17 @@
while($iter->hasNext()) {
$curr = $iter->getNext();
- $html .= ach_render_achievement_open($curr);
+ if(!$curr->isTiedAlign_open($cat->getCurrentCult(),$cat->getCurrentCiv())) {
+ #continue;
+ }
+
+ $html .= ach_render_achievement_open($curr,$cat);
}
return $html;
}
- function ach_render_achievement_open(&$ach) {
+ function ach_render_achievement_open(&$ach,&$cat) {
global $_CONF,$menu;
$html = '
|
@@ -455,7 +455,7 @@
return $html;
}
- function ach_render_task_open(&$ach) {
+ function ach_render_task_open(&$ach,&$cat) {
global $metalist;
@@ -467,6 +467,10 @@
$task = $task_list->getNext();
+ if(!$task->isTiedAlign($cat->getCurrentCult(),$cat->getCurrentCiv())) {
+ #continue;
+ }
+
$html .= "
[task:]".$task->getDisplayName()." (".$task->getValue().") | ";
@@ -546,6 +550,28 @@
condition value: |
|
+
+ allegiance: |
+
+
+ |
+
|
@@ -908,7 +934,7 @@