fix ally offer problem

This commit is contained in:
yi12345
2013-04-28 01:25:05 +03:00
parent bd352eb358
commit 3a7ee8083c
4 changed files with 15 additions and 442 deletions
+1 -1
View File
@@ -429,7 +429,7 @@
if($database->aExist($aName, "tag")) {
if($database->getAllianceID($aName) != $session->alliance) {
if($aType >= 1 and $aType <= 3) {
if(!$database->diplomacyInviteCheck($database->getAllianceID($aName), $session->alliance)) {
if(!$database->diplomacyInviteCheck2($session->alliance, $database->getAllianceID($aName))) {
$database->diplomacyInviteAdd($session->alliance, $database->getAllianceID($aName), $aType);
if($aType == 1){
$notice = "offer a confederation to";
+6
View File
@@ -1287,6 +1287,12 @@ class MYSQL_DB {
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function diplomacyInviteCheck2($ally1, $ally2) {
$q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli1 = $ally1 AND alli2 = $ally2 accepted = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getAllianceDipProfile($aid, $type){
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = '$aid' AND type = '$type' AND accepted = '1' OR alli2 = '$aid' AND type = '$type' AND accepted = '1'";
+8 -2
View File
@@ -1287,8 +1287,14 @@ class MYSQLi_DB {
function diplomacyInviteCheck($session_alliance) {
$q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli2 = $session_alliance AND accepted = 0";
$result = mysqli_query($this->connection, $q);
return $this->mysqli_fetch_all($result);
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function diplomacyInviteCheck2($ally1, $ally2) {
$q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli1 = $ally1 AND alli2 = $ally2 accepted = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getAllianceDipProfile($aid, $type){