mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-07 05:14:31 +00:00
fix ally offer problem
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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'";
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user