Skip to content

Commit

Permalink
big update
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Sep 1, 2012
1 parent a566e25 commit 8c44bb4
Show file tree
Hide file tree
Showing 46 changed files with 1,465 additions and 993 deletions.
7 changes: 3 additions & 4 deletions Admin/admin.php
Expand Up @@ -93,7 +93,6 @@ function hideStuff(id) {
<a href="<?php echo HOMEPAGE; ?>">Server Homepage</a>
<a href="admin.php">Control Panel Home</a>
<a href="<?php echo SERVER; ?>dorf1.php">Return to the server</a>
<a href="?p=update"><font color="Red"><b>Server Update</font></b></a>
<br />
<a href="?action=logout">Logout</a>
<br />
Expand All @@ -103,8 +102,8 @@ function hideStuff(id) {
<a href="?p=notregistered">Players Not Activated</a>
<br />
<a href="#"><b>Search</b></a>
<a href="?p=search">General Search</a>
<a href="?p=message">Search IGMs/Reports</a>
<a href="?p=search">Search Players/Alliances/Villages/E-mails/IPs/Deleted Players</a>
<a href="?p=message">Search Messages/Battle Reports</a>
<br />
<a href="#"><b>Ban</b></a>
<a href="?p=ban">Ban/Unban Players</a>
Expand All @@ -130,7 +129,7 @@ function hideStuff(id) {
<br />
<a href="#"><b>Natars</b></a>
<a href="?p=natarend">Add WW Villages</a>
<a href="?p=natarbuildingplan">Add WW Building Plan Villages</a>
<a href="?p=natarbuildingplan">Add WW Buildingplan Villages</a>
<br />
<a href="#"><b>Admin:</b></a>
<a href="?p=admin_log"><font color="Red"><b>Admin Log</font></b></a>
Expand Down
1 change: 0 additions & 1 deletion GameEngine/Account.php
Expand Up @@ -114,7 +114,6 @@ private function Signup() {
if($uid) {
setcookie("COOKUSR",$_POST['name'],time()+COOKIE_EXPIRE,COOKIE_PATH);
setcookie("COOKEMAIL",$_POST['email'],time()+COOKIE_EXPIRE,COOKIE_PATH);

$database->updateUserField($uid,"act","",1);
$database->updateUserField($uid,"invited",$_POST['invited'],1);
$this->generateBase($_POST['kid'],$uid,$_POST['name']);
Expand Down
36 changes: 32 additions & 4 deletions GameEngine/Admin/database.php
Expand Up @@ -52,6 +52,7 @@ function recountPopUser($uid){
for ($i = 0; $i <= count($villages)-1; $i++) {
$vid = $villages[$i]['wref'];
$this->recountPop($vid);
$this->recountCP($vid);
}
}

Expand All @@ -60,15 +61,30 @@ function recountPop($vid){
$fdata = $database->getResourceLevel($vid);
$popTot = 0;
for ($i = 1; $i <= 40; $i++) {
$lvl = $fdata["f".$i];
$building = $fdata["f".$i."t"];
if($building){
$lvl = $fdata["f".$i];
$building = $fdata["f".$i."t"];
if($building){
$popTot += $this->buildingPOP($building,$lvl);
}
}
}
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
mysql_query($q, $this->connection);
}

function recountCP($vid){
global $database;
$fdata = $database->getResourceLevel($vid);
$popTot = 0;
for ($i = 1; $i <= 40; $i++) {
$lvl = $fdata["f".$i];
$building = $fdata["f".$i."t"];
if($building){
$popTot += $this->buildingCP($building,$lvl);
}
}
$q = "UPDATE ".TB_PREFIX."vdata set cp = $popTot where wref = $vid";
mysql_query($q, $this->connection);
}

function buildingPOP($f,$lvl){
$name = "bid".$f;
Expand All @@ -80,6 +96,18 @@ function buildingPOP($f,$lvl){
}
return $popT;
}

function buildingCP($f,$lvl){
$name = "bid".$f;
global $$name;
$popT = 0;
$dataarray = $$name;

for ($i = 0; $i <= $lvl; $i++) {
$popT += $dataarray[$i]['cp'];
}
return $popT;
}

function getWref($x,$y) {
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
Expand Down
9 changes: 8 additions & 1 deletion GameEngine/Alliance.php
Expand Up @@ -108,7 +108,7 @@ public function procAlliForm($post) {
public function sendInvite($post) {
global $form, $database, $session;
if($session->access != BANNED){
if(isset($post['a_name']) && $post['a_uid'] != ""){
if(isset($post['a_name']) or $post['a_uid'] == ""){
$UserData = $database->getUserArray($post['a_name'], 0);
if($this->userPermArray['opt4'] == 0) {
$form->addError("perm", NO_PERMISSION);
Expand Down Expand Up @@ -393,6 +393,13 @@ private function quitally($post) {
} elseif(md5($post['pw']) !== $session->userinfo['password']) {
$form->addError("pw2", PW_ERR);
} else {
if($database->isAllianceOwner($sessiom->uid)){
$newowner = $database->getAllMember2($session->alliance);
$newleader = $newowner['id'];
$q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$session->alliance."";
$database->query($q);
$database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1);
}
$database->updateUserField($session->uid, 'alliance', 0, 1);
$database->deleteAlliPermissions($session->uid);
// log the notice
Expand Down

4 comments on commit 8c44bb4

@BrainiacX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what really changed in battle.php and for what?

@yi12345
Copy link
Owner

@yi12345 yi12345 commented on 8c44bb4 Sep 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't remeber exactly, but i almost sure that is helpful.

@akshay9
Copy link
Contributor

@akshay9 akshay9 commented on 8c44bb4 Sep 5, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y12345 this is the old version you have updates
you just unchanged all the fixes you did so far.

@inblackhole
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i wanna say the exactly same thing.
My trail pull request is just rollbacked.

Please sign in to comment.