Some additional fixes

Some additional fixes
This commit is contained in:
novgorodschi catalin
2026-09-01 07:56:14 +03:00
parent 054fde6e66
commit 71e73dde95
13 changed files with 169 additions and 28 deletions
+7 -1
View File
@@ -27,7 +27,13 @@ $multiplier = (($session->tribe == 3) ? 2 : 1) * CRANNY_CAPACITY;
$actualLevel = (int)$village->resarray['f'.$id];
$level = min($actualLevel + 1 + $loopsame + $doublebuild + $master, 10);
$currentHidden = $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$actualLevel]['attri'] * $multiplier);
// FIX (PHP log): $bid23 e indexat de la nivel 1 (nu are cheia 0). Daca
// cranny e la nivel 0 (abia demolat/darat jos de catapulte, sau link
// deschis inainte ca nivelul curent sa fi fost incarcat), $bid23[0] nu
// exista -> "Undefined array key 0" + acces pe null pe linia urmatoare.
// La nivel 0 nu exista "attri" curent, deci tratam ca 0 unitati ascunse.
$currentAttri = $actualLevel > 0 ? $bid23[$actualLevel]['attri'] : 0;
$currentHidden = $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $currentAttri * $multiplier);
$nextHidden = $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$level]['attri'] * $multiplier);
?>
<div id="build" class="gid23">
+10 -1
View File
@@ -226,7 +226,16 @@ if($isOasis){
}
?>
</td></tr>
<?php } elseif($basearray['occupied'] && $basearray['wref']!= $_SESSION['wid']){
<?php
/**
* FIX (PHP log): $_SESSION['wid'] se seteaza doar in paginile care
* primesc newdid in query string. karte.php insa poate ajunge aici
* doar cu ?d=X&c=Y (popup sat pe harta, fara newdid) - daca sesiunea
* n-a trecut inca prin nicio pagina cu newdid (ex. sesiune noua),
* cheia lipseste -> "Undefined array key wid". Fallback 0 (nu poate
* fi egal cu niciun wref real).
*/
} elseif($basearray['occupied'] && $basearray['wref']!= ($_SESSION['wid'] ?? 0)){
$tbl = $isOasis? 'odata' : 'vdata';
$qr = $database->dblink->query('SELECT owner FROM `'.TB_PREFIX.$tbl.'` WHERE wref='.(int)$d);
$ownerId = $qr? $qr->fetch_assoc() : array('owner'=>0);
+5 -1
View File
@@ -37,11 +37,15 @@ if ($online_query) {
// ======================================================
$top_username = '-';
// BUG REPARAT: cu INCLUDE_ADMIN pornit nu exista deloc filtru pe access, iar cu
// INCLUDE_ADMIN oprit "access < 8" nu excludea conturile banate (access=0, 0 < 8
// e adevarat) - deci un jucator banat putea aparea ca "Top player" in sidebar.
// access > 0 exclude banul in ambele cazuri, pastrand comportamentul INCLUDE_ADMIN.
$top_query = mysqli_query(
$database->dblink,
"SELECT username
FROM " . TB_PREFIX . "users
WHERE " . (INCLUDE_ADMIN ? '' : 'access < 8 AND ') . "
WHERE " . (INCLUDE_ADMIN ? 'access > 0 AND ' : 'access > 0 AND access < 8 AND ') . "
id > 5
AND tribe IN (1,2,3,6,7,8,9)
AND tribe > 0
+11 -4
View File
@@ -41,7 +41,9 @@
$timeLeft = gmdate("H:i:s", $left % 86400);
// --- END MEDAL TIMER ---
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY ap DESC, id DESC Limit 10");
// BUG REPARAT: access<8/10 exclude Multihunter/Admin dar NU excludea conturile
// banate (access=0, 0 < 8 e adevarat), deci jucatori banati aparea in top 10.
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access>0 AND access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1">
@@ -149,7 +151,8 @@ setInterval(function(){
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY dp DESC, id DESC Limit 10");
// BUG REPARAT: vezi comentariul de la query-ul Top Attackers de mai sus.
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access>0 AND access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
@@ -203,7 +206,10 @@ setInterval(function(){
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY clp DESC, id DESC Limit 10");
// BUG REPARAT (semnalat de Catalin): vezi comentariul de la query-ul Top
// Attackers de mai sus - acesta e query-ul exact din poza cu "ASD" banat
// aparand pe locul 1 la Climbers of the week.
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access>0 AND access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
?>
<div class="clear"></div>
@@ -255,7 +261,8 @@ setInterval(function(){
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY RR DESC, id DESC Limit 10");
// BUG REPARAT: vezi comentariul de la query-ul Top Attackers de mai sus.
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access>0 AND access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe IN (1,2,3,6,7,8,9) ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">