catching up (#4)

* fix: all languages added to installer

* fix: all languages added to installer and Admin

* fix: max crop/resources reset to level 1 value temporarily

This happened when level 1 granary / warehouse was built because of
a missing + sign in a formula.

#374

* chore: some more badges and thanks to JetBrains :)

* chore: one more badge :P

* chore: cleanup

* fix: Multihunter should have access to villages info

* fix: troops duplicate for certain tribes via raid lists

* fix: no need for WW Building Plan to start building a WW

#337

* fix: natar WW villages created without units

#392

* fix: sendunits.txt file could not be opened from Admin

* fix: WW villages created via Admin do not have any units

#392

* fix: WW building plans must be in player's village to start building WW

#337

* fix: hero training and revival misbehaving

* fix: spending hero points subtracts these from all player's heroes

#341

* fix: 2nd row of catapults firing when not allowed

#393

* fix: 2nd wave of catapults destroys targets and villages incorrectly

#393

* fix: adding new village via Admin generates incorrect fields

* chore: create default users with bcrypt enabled by default

* fix: in-game Support login fails

* fix: wrong password verify check allows for any login
This commit is contained in:
Martin Ambrus
2017-12-01 19:57:57 +01:00
committed by GitHub
parent 23c0f4f8f7
commit a321906d41
10 changed files with 166 additions and 126 deletions
+17 -18
View File
@@ -16,8 +16,7 @@ if (isset($_POST['name'])) {
$_POST['name'] = stripslashes($_POST['name']);
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".($database->escape($_POST['name']))."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
echo "".NAME_CHANGED."";
}
$hero_info = $units->Hero($session->uid);
}
?>
<table id="distribution" cellpadding="1" cellspacing="1">
@@ -172,12 +171,12 @@ if (isset($_POST['name'])) {
if($_GET['add'] == "reset") {
if($hero_info['level'] <= 3){
if($hero_info['attack'] != 0 OR $hero_info['defence'] != 0 OR $hero_info['attackbonus'] != 0 OR $hero_info['defencebonus'] != 0 OR $hero_info['regeneration'] != 0){
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `heroid` = " . $hero_info['heroid']);
header("Location: build.php?id=".$id."");
exit;
}
@@ -185,40 +184,40 @@ if (isset($_POST['name'])) {
}
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `heroid` = " . $hero_info['heroid']);
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
header("Location: build.php?id=".$id."");
exit;
}