Most visitors online was 12542 , on 28 Apr 2024
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!sorry... i found the mistake.. lol.. here's the fix..
replace functions with this
Code:<?php class Functions { function check_email_address($email) { $regexp="/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i"; if ( !preg_match($regexp, $email) ) { return false; } return true; } function getActivate($name,$pw,$start) { return substr(md5($name.$pw), $start, ($start+10)); } function getTimeFormat($time) { if ($time%10 < 5) { $time = $time-($time%10); } else { $time = $time + (10 - $time%10); } $min = 0; $hr = 0; while($time >= 60) : $time -= 60; $min += 1; endwhile; while ($min > 60) : $min -= 60; $hr += 1; endwhile; if ($min < 10) { $min = "0".$min; } if($time < 10) { $time = "0".$time; } return $hr.":".$min.":".$time; } function generateBase($sector) { global $database; switch($sector) { case 0: $q = "Select * from ".TB_PREFIX."WDATA where fieldtype = 3 and occupied = 0 LIMIT 200"; break; case 1: $q = "Select * from ".TB_PREFIX."WDATA where fieldtype = 3 and x < 0 and y > 0 and occupied = 0 LIMIT 200"; break; case 2: $q = "Select * from ".TB_PREFIX."WDATA where fieldtype = 3 and x > 0 and y > 0 and occupied = 0 LIMIT 200"; break; case 3: $q = "Select * from ".TB_PREFIX."WDATA where fieldtype = 3 and x < 0 and y < 0 and occupied = 0 LIMIT 200"; break; case 4: $q = "Select * from ".TB_PREFIX."WDATA where fieldtype = 3 and x > 0 and y < 0 and occupied = 0 LIMIT 200"; break; } if(CONNECT_TYPE) { $result = $database->query($q); $num_rows = mysqli_num_rows($result); $row = $result->fetch_all(MYSQLI_ASSOC); $base = rand(0, ($num_rows-1)); return $row[$base]['id']; } else { $result = $database->query($q); $num_rows = mysql_num_rows($result); $result = $database->mysql_fetch_all($result); $base = rand(0, ($num_rows-1)); return $result[$base]['id']; } } function processLogin($user,$pw) { global $database,$session; if(file_exists("Install/install.php")) { header("Location: login.php?e=1"); } else { if($user == "") { $_SESSION['ferror'] = 5; } else if($pw == "") { $_SESSION['tempu'] = $user; $_SESSION['ferror'] = 4; } else { if($session->login($user, $pw)) { $this->updateResLevel($session->baseinfo['wref']); $this->getUpgrading($session->baseinfo['wref']); header("Location: dorf1.php"); } else { if($database->checkExist($user)){ $_SESSION['tempu'] = $user; $_SESSION['ferror'] = 3; } else { $_SESSION['ferror'] = 2; $_SESSION['tempu'] = $user; $_SESSION['tempp'] = $pw; } } } header("Location: login.php"); } } function getUpgrading($vid) { global $database, $session; $database->getRunningResource($vid,0); if(isset($_SESSION['runres'])) { $type = ($_SESSION['runres'] >= 19)? $_SESSION['runtype'] : $this->procResType($_SESSION['runres'],$session->basetype,0); $this->getUstats($type,$_SESSION['runres'],1); $like = '%f'.$_SESSION['runres'].'%level '.($session->resarray['f'.$_SESSION['runres']]+1).'%'; $_SESSION['logid'] = $database->getRlog($vid,$like); } if(isset($_SESSION['runres2'])) { $type2 = ($_SESSION['runres2'] >= 19)? $_SESSION['runtype2'] : $this->procResType($_SESSION['runres2'],$session->basetype,0); $this->getUstats($type2,$_SESSION['runres2'],2); $like2 = '%f'.$_SESSION['runres2'].'%level '.($session->resarray[$_SESSION['runres2']]+1).'%'; $_SESSION['logid'] = $database->getRlog($vid,$like2); } } function getResLevel($vid) { global $database, $session; $levelarray = $database->getResourceLevel($vid); for ($i=1;$i<=18;$i++) { $oreslevel[$i] = $levelarray['f'.$i]; } return $oreslevel; } function getProduction($type,$resarray) { global $session; include("resdata.php"); switch($type) { case 1: $wood = $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f5']]['prod'] + $Cropland[$resarray['f4']]['prod'] + $Cropland[$resarray['f1']]['prod'] + $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 2: $wood = $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f5']]['prod'] + $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f1']]['prod'] + $Ironmine[$resarray['f4']]['prod'] + $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 3: $wood = $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f5']]['prod'] + $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f4']]['prod'] + $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 4: $wood = $Woodcutter[$resarray['f1']]['prod'] + $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f4']]['prod'] + $Claypit[$resarray['f5']]['prod'] + $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 5: $wood = $Woodcutter[$resarray['f1']]['prod'] + $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f5']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f4']]['prod'] + $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 6: $wood = $Woodcutter[$resarray['f3']]['prod']; $clay = $Claypit[$resarray['f16']]['prod']; $crop = $Cropland[$resarray['f5']]['prod'] + $Cropland[$resarray['f6']]['prod'] + $Cropland[$resarray['f3']]['prod'] + $Cropland[$resarray['f14']]['prod'] + $Cropland[$resarray['f17']]['prod'] + $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod'] + $Cropland[$resarray['f18']]['prod'] + $Cropland[$resarray['f7']]['prod'] + $Cropland[$resarray['f10']]['prod'] + $Cropland[$resarray['f11']]['prod']; $iron = $Ironmine[$resarray['f4']]['prod']; break; case 7: $wood = $Woodcutter[$resarray['f4']]['prod'] + $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f5']]['prod'] + $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f3']]['prod'] + $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 8: $wood = $Woodcutter[$resarray['f4']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f5']]['prod'] + $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f3']]['prod'] + $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f1']]['prod'] + $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 9: $wood = $Woodcutter[$resarray['f5']]['prod'] + $Woodcutter[$resarray['f4']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f3']]['prod'] + $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f1']]['prod'] + $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 10: $wood = $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f4']]['prod'] + $Claypit[$resarray['f5']]['prod'] + $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f1']]['prod'] + $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; case 11: $wood = $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f2']]['prod'] + $Woodcutter[$resarray['f5']]['prod'] + $Woodcutter[$resarray['f13']]['prod']; $clay = $Claypit[$resarray['f10']]['prod'] + $Claypit[$resarray['f11']]['prod'] + $Claypit[$resarray['f16']]['prod']; $crop = $Cropland[$resarray['f6']]['prod'] + $Cropland[$resarray['f7']]['prod'] + $Cropland[$resarray['f14']]['prod'] + $Cropland[$resarray['f15']]['prod'] + $Cropland[$resarray['f17']]['prod'] + $Cropland[$resarray['f18']]['prod']; $iron = $Ironmine[$resarray['f1']]['prod'] + $Ironmine[$resarray['f4']]['prod'] + $Ironmine[$resarray['f8']]['prod'] + $Ironmine[$resarray['f9']]['prod'] + $Ironmine[$resarray['f12']]['prod']; break; case 12: $wood = $Woodcutter[$resarray['f4']]['prod'] + $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f3']]['prod'] + $Woodcutter[$resarray['f14']]['prod'] + $Woodcutter[$resarray['f17']]['prod']; $clay = $Claypit[$resarray['f5']]['prod'] + $Claypit[$resarray['f6']]['prod'] + $Claypit[$resarray['f16']]['prod'] + $Claypit[$resarray['f18']]['prod']; $crop = $Cropland[$resarray['f2']]['prod'] + $Cropland[$resarray['f8']]['prod'] + $Cropland[$resarray['f9']]['prod'] + $Cropland[$resarray['f12']]['prod'] + $Cropland[$resarray['f13']]['prod'] + $Cropland[$resarray['f15']]['prod']; $iron = $Ironmine[$resarray['f7']]['prod'] + $Ironmine[$resarray['f10']]['prod'] + $Ironmine[$resarray['f11']]['prod']; break; } $_SESSION['prod'] = array('wood' => $wood, 'clay'=> $clay, 'crop'=> $crop, 'iron'=> $iron); return $_SESSION['prod']; } function procResType($field,$vtype,$switch) { global $session; switch($field) { case 1: switch($vtype) { case 1: case 6: return "Cropland"; break; case 2: case 8: case 9: case 10: case 11: return "Iron Mine"; break; case 3: case 4: case 5: case 7: case 12: return "Woodcutter"; break; } break; case 2: case 13: return ($vtype == 11)? "Woodcutter" : "Cropland"; break; case 3: return "Woodcutter"; break; case 4: switch($vtype) { case 1: return "Cropland"; break; case 2: case 3: case 5: case 6: case 11: return "Iron Mine"; break; case 4: case 10: return "Clay Pit"; break; case 7: case 8: case 9: case 12: return "Woodcutter"; break; } break; case 5: switch($vtype) { case 1: case 6: return "Cropland"; break; case 2: case 3: case 4: case 7: case 8: case 10: case 12: return "Clay Pit"; break; case 5: case 9: case 11: return "Woodcutter"; break; } break; case 6: case 18: return ($vtype == 11 || $vtype == 6)? "Cropland" : "Clay Pit"; break; case 7: return ($vtype == 11 || $vtype == 6)? "Cropland" : "Iron Mine"; break; case 8: case 9: case 12: return ($vtype == 11)? "Iron Mine" : "Cropland"; break; case 10: case 11: switch($vtype) { case 6: return "Cropland"; break; case 11: return "Clay Pit"; break; default: return "Iron Mine"; break; } break; case 14: case 17: return ($vtype == 11 || $vtype == 6)? "Cropland" : "Woodcutter"; break; case 15: return "Cropland"; break; case 16: return "Clay Pit"; break; default: switch($switch) { case 1: $buildingtype = isset($_SESSION['runtype']) ? $_SESSION['runtype'] : $session->resarray['f'.$field.'t']; break; case 2: $buildingtype = isset($_SESSION['runtype2']) ? $_SESSION['runtype2'] : $session->resarray['f'.$field.'t']; break; default: $buildingtype = $session->resarray['f'.$field.'t']; break; } switch($buildingtype) { case 10: return "Warehouse"; break; case 11: return "Granary"; break; case 15: return "Main Building"; break; case 18: return "Embassy"; break; case 23: return "Cranny"; break; case 31: return "City Wall"; break; case 33: return "Rally Point"; break; } break; } } function gainResource($prod,$baseinfo) { global $database; $timepast = time() - $baseinfo['lastupdate']; $awood = ($prod['wood'] / (3600/SPEED)) * $timepast; $aclay = ($prod['clay'] / (3600/SPEED)) * $timepast; $airon = ($prod['iron'] / (3600/SPEED)) * $timepast; $acrop = ($prod['crop'] / (3600/SPEED)) * $timepast; return $database->addResource($baseinfo['wref'],$awood,$aclay,$airon,$acrop); } function Upkeep($baseinfo) { global $database; $timepast = time() - $baseinfo['lastupdate']; $upkeep = ($baseinfo['pop'] / (3600/SPEED)) * $timepast; return $database->villageUpkeep($baseinfo['wref'],$upkeep); } function pruneResource($baseinfo) { global $session, $database; if($baseinfo['wood'] > $baseinfo['maxstore']) { $database->pruneResource($baseinfo['wref'],"wood"); } if($baseinfo['clay'] > $baseinfo['maxstore']) { $database->pruneResource($baseinfo['wref'],"clay"); } if($baseinfo['iron'] > $baseinfo['maxstore']) { $database->pruneResource($baseinfo['wref'],"iron"); } if($baseinfo['crop'] > $baseinfo['maxcrop']) { $database->pruneCrop($baseinfo['wref']); } } function startUpgrading($field,$switch) { global $database,$session; $type = ($field >= 19)? $session->resarray['f'.$field.'t'] : $this->procResType($field,$session->basetype,0); $uprequire = $this->getUstats($type,$field,$switch); $this->getUstats($type,$field,0); switch($switch) { case 1: $ustats = $_SESSION['ustats']; break; case 2: $ustats = $_SESSION['ustats2']; break; } $database->startResourceUpgrade($session->baseinfo['wref'], $field, $ustats['time'],0); $database->removeResource($session->baseinfo['wref'],$ustats['wood'],$ustats['clay'],$ustats['iron'],$ustats['crop']); $comment = "Started upgrade of f".$field." to level "; $comment .= $session->resarray['f'.$field]+1; if ($field >= 19) { $comment .= " type ".$session->resarray['f'.$field.'t']; } $database->addRlog($session->baseinfo['wref'], $comment); $session->refreshVillage($session->baseinfo['wref'],$session->uid); $session->checker = $session->getChecker(); } function startNewBuilding($field,$type,$switch) { global $database,$session; if($type == 16) { $field = 39; } else if($type == 31) { $field = 40; } $this->getUstats($type,$field,0); switch($switch) { case 1: $ustats = $_SESSION['ustats']; $_SESSION['runtype'] = $type; break; case 2: $ustats = $_SESSION['ustats2']; $_SESSION['runtype2'] = $type; break; } $database->startResourceUpgrade($session->baseinfo['wref'], $field, $ustats['time'],$type); $database->removeResource($session->baseinfo['wref'],$ustats['wood'],$ustats['clay'],$ustats['iron'],$ustats['crop']); $comment = "Started building of f".$field." to level "; $comment .= $session->resarray['f'.$field]+1; $comment .= " type ".$type; $database->addRlog($session->baseinfo['wref'], $comment); $session->refreshVillage($session->baseinfo['wref'],$session->uid); $session->checker = $session->getChecker(); } function finishBuilding() { global $database,$session; if($database->getRunningResource($session->baseinfo['wref'],1) <= 0) { $database->updateResourceFields($_SESSION['runres'], $session->baseinfo['wref'],1); if(isset($_SESSION['runtype'])) { $database->updateType($session->baseinfo['wref'], $_SESSION['runres'], $_SESSION['runtype']); } if($_SESSION['runres'] >= 19) { $attritype = isset($_SESSION['runtype'])? $_SESSION['runtype'] : $session->resarray['f'.$_SESSION['runres'].'t']; switch($attritype) { case 10: $database->putVillageStats("maxstore",$_SESSION['ustats']['attri'],$session->baseinfo['wref']); break; case 11: $database->putVillageStats("maxcrop",$_SESSION['ustats']['attri'],$session->baseinfo['wref']); break; } } unset($_SESSION['runres']); unset($_SESSION['runtype']); $session->resarray = $_SESSION['resarray'] = $database->getResourceLevel($session->baseinfo['wref']); $session->prod = $this->getProduction($session->basetype, $session->resarray); $database->addPop($session->baseinfo['wref'],$_SESSION['ustats']['pop']); $database->addUserCP($session->uid, $_SESSION['ustats']['cp']); $database->addBaseCP($session->baseinfo['wref'], $_SESSION['ustats']['cp']); unset($_SESSION['ustats']); $session->refreshVillage($session->baseinfo['wref'],$session->uid); if(isset($_SESSION['runres2'])) { $_SESSION['runres'] = $_SESSION['runres2']; $_SESSION['ustats'] = $_SESSION['ustats2']; $_SESSION['logid'] = $_SESSION['logid2']; if(isset($_SESSION['runtype2'])) { $_SESSION['runtype'] = $_SESSION['runtype2']; } $database->shiftUpgrading($session->baseinfo['wref']); unset($_SESSION['runres2']); unset($_SESSION['ustats2']); unset($_SESSION['logid2']); unset($_SESSION['runtype2']); } } if($database->getRunningResource($session->baseinfo['wref'],2) <= 0 && isset($_SESSION['runres2'])) { $database->updateResourceFields($_SESSION['runres2'], $session->baseinfo['wref'],2); if(isset($_SESSION['runtype2'])) { $database->updateType($session->baseinfo['wref'], $_SESSION['runres2'], $_SESSION['runtype2']); } if($_SESSION['runres2'] >= 19) { $attritype = isset($_SESSION['runtype2'])? $_SESSION['runtype2'] : $session->resarray['f'.$_SESSION['runres2'].'t']; switch($attritype) { case 10: $database->putVillageStats("maxstore",$_SESSION['ustats2']['attri'],$session->baseinfo['wref']); break; case 11: $database->putVillageStats("maxcrop",$_SESSION['ustats2']['attri'],$session->baseinfo['wref']); break; } } unset($_SESSION['runres2']); unset($_SESSION['runtype2']); $session->resarray = $_SESSION['resarray'] = $database->getResourceLevel($session->baseinfo['wref']); $session->prod = $this->getProduction($session->basetype, $session->resarray); $database->addPop($session->baseinfo['wref'],$_SESSION['ustats2']['pop']); $database->addUserCP($session->uid, $_SESSION['ustats2']['cp']); $database->addBaseCP($session->baseinfo['wref'], $_SESSION['ustats2']['cp']); unset($_SESSION['ustats2']); $session->refreshVillage($session->baseinfo['wref'],$session->uid); } } function cancelBuilding($logid) { global $database,$session; if($logid == $_SESSION['logid']) { unset($_SESSION['runres']); $database->cancelResourceUpgrade($session->baseinfo['wref'],1); $database->addResource($session->baseinfo['wref'],$_SESSION['ustats']['wood'],$_SESSION['ustats']['clay'],$_SESSION['ustats']['iron'],$_SESSION['ustats']['crop']); unset($_SESSION['ustats']); unset($_SESSION['logid']); unset($_SESSION['runtype']); if(isset($_SESSION['runres2'])) { $_SESSION['runres'] = $_SESSION['runres2']; $_SESSION['ustats'] = $_SESSION['ustats2']; $_SESSION['logid'] = $_SESSION['logid2']; if(isset($_SESSION['runtype2'])) { $_SESSION['runtype'] = $_SESSION['runtype2']; } $database->shiftUpgrading($session->baseinfo['wref']); unset($_SESSION['runres2']); unset($_SESSION['ustats2']); unset($_SESSION['logid2']); unset($_SESSION['runtype2']); } } else if ($logid == $_SESSION['logid2']) { unset($_SESSION['runres2']); $database->cancelResourceUpgrade($session->baseinfo['wref'],2); $database->addResource($session->baseinfo['wref'],$_SESSION['ustats2']['wood'],$_SESSION['ustats2']['clay'],$_SESSION['ustats2']['iron'],$_SESSION['ustats2']['crop']); unset($_SESSION['ustats2']); unset($_SESSION['logid2']); unset($_SESSION['runtype2']); } $database->removeRlog($logid); $session->refreshVillage($session->baseinfo['wref'],$session->uid); $session->checker = $session->getChecker(); } function getUstats($type,$id,$switch) { global $session; include("resdata.php"); include("buidata.php"); $building = 1; $main = 0; switch($type) { case "Woodcutter": $dataarray = $Woodcutter; $building = 0; break; case "Cropland": $dataarray = $Cropland; $building = 0; break; case "Clay Pit": $dataarray = $Claypit; $building = 0; break; case "Iron Mine": $dataarray = $Ironmine; $building = 0; break; case 10: $dataarray = $Warehouse; break; case 11: $dataarray = $Granary; break; case 15: $dataarray = $Mainbuilding; $main = 1; break; case 18: $dataarray = $Embassy; break; case 23: $dataarray = $Cranny; break; case 31: $dataarray = $Citywall; break; case 33: $dataarray = $Rallypoint; break; } $wood = $dataarray[$session->resarray['f'.$id]+1]['wood']; $clay = $dataarray[$session->resarray['f'.$id]+1]['clay']; $crop = $dataarray[$session->resarray['f'.$id]+1]['crop']; if ($main == 1) { $time = round($dataarray[$session->resarray['f'.$id]+1]['time'] / SPEED); } else { $time = round(round($dataarray[$session->resarray['f'.$id]+1]['time'] * $Mainbuilding[$session->resarray['f26']]['attri'] / 100) / SPEED); } $iron = $dataarray[$session->resarray['f'.$id]+1]['iron']; $pop = $dataarray[$session->resarray['f'.$id]+1]['pop']; $cp = $dataarray[$session->resarray['f'.$id]+1]['cp']; if($building == 1) { $attri = $dataarray[$session->resarray['f'.$id]+1]['attri']; } else { $attri = 0; } switch($switch) { case 1: $time += time(); $_SESSION['ustats'] = array('time'=>$time,'wood'=>$wood,'clay'=>$clay,'iron'=>$iron,'crop'=>$crop,'pop'=>$pop,'cp'=>$cp,'attri'=>$attri); break; case 2: $time += time(); $_SESSION['ustats2'] = array('time'=>$time,'wood'=>$wood,'clay'=>$clay,'iron'=>$iron,'crop'=>$crop,'pop'=>$pop,'cp'=>$cp,'attri'=>$attri); break; case 3: return array('time'=>$time,'wood'=>$wood,'clay'=>$clay,'iron'=>$iron,'crop'=>$crop,'pop'=>$pop,'cp'=>$cp,'attri'=>$attri); break; default: if(!isset($_SESSION['ustats'])) { $time += time(); $_SESSION['ustats'] = array('time'=>$time,'wood'=>$wood,'clay'=>$clay,'iron'=>$iron,'crop'=>$crop,'pop'=>$pop,'cp' =>$cp,'attri'=>$attri); } else { $time += time(); $_SESSION['ustats2'] = array('time'=>$time,'wood'=>$wood,'clay'=>$clay,'iron'=>$iron,'crop'=>$crop,'pop'=>$pop,'cp' =>$cp,'attri'=>$attri); } break; } } function getTypeLevel($tid) { global $session; $key = array_search($tid, $session->resarray); $number = preg_replace("/[^0-9]/", '', $key); if($number >= 19) { return $session->resarray['f'.$number]; } else { return false; } } function getMapCheck($wref) { return substr(md5($wref),5,2); } function getBaseID($x,$y) { return ((WORLD_MAX-$y) * (WORLD_MAX*2+1)) + (WORLD_MAX +$x + 1); } function procMtime($time) { if ((time()-$time) < 24*60*60) { $day = "today"; } else { $day = date("j.m.y",$time); } $time = date("H:i",$time); return array($day,$time); } function pageLoadTimeStart() { $starttime = microtime(); $startarray = explode(" ", $starttime); $starttime = $startarray[1] + $startarray[0]; return $starttime; } function pageLoadTimeEnd() { $endtime = microtime(); $endarray = explode(" ", $endtime); $endtime = $endarray[1] + $endarray[0]; return $endtime; } }; $functions = new Functions; ?>
This is for people who downloaded 3.2..
I am uploading 3.2.1 with the functions fixed.. =d
//new adds
define("SERV1SMALL", false);
define("SERV1BIG", true);
define("SERV2SMALL", false);
define("SERV2BIG", false);
define("SERV3SMALL", false);
define("SERV3BIG", false);
define("SERV4SMALL", false);
define("SERV4BIG", false);
define("SERV5SMALL", false);
define("SERV5BIG", false);
define("SERV6SMALL", false);
define("SERV6BIG", false);
define("SERV7SMALL", false);
define("SERV7BIG", false);
define("SERV8SMALL", false);
define("SERV8BIG", false);
define("SERV9SMALL", false);
define("SERV9BIG", false);
define("SERV10SMALL", false);
define("SERV10BIG", false);
define("SERV3XSMALL", false);
define("SERV3XBIG", false);
You want to download the following file:
http://rapidshare.com/files/339731703/Travian_Clone_Alpha_V3.2.1.rar | 5582 KB
Currently a lot of users are downloading files. Please try again in 2 minutes or become a Premium member
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 24, 2010 at 02:04 AM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `s1`
--
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%active`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%active` (
`username` varchar(15) NOT NULL,
`timestamp` int(11) unsigned NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%alidata`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%alidata` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`leader` int(10) unsigned NOT NULL,
`coor` int(10) unsigned NOT NULL,
`advisor` int(10) unsigned NOT NULL,
`recruiter` int(10) unsigned NOT NULL,
`notice` text NOT NULL,
`desc` text NOT NULL,
`max` tinyint(2) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%baselog`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%baselog` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`vid` int(10) unsigned NOT NULL,
`comment` text NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%fdata`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%fdata` (
`vref` int(10) unsigned NOT NULL,
`f1` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f2` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f3` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f4` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f5` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f6` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f7` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f8` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f9` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f10` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f11` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f12` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f13` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f14` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f15` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f16` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f17` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f18` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f19` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f19t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f20` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f20t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f21` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f21t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f22` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f22t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f23` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f23t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f24` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f24t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f25` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f25t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f26` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f26t` tinyint(2) unsigned NOT NULL,
`f27` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f27t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f28` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f28t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f29` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f29t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f30` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f30t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f31` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f31t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f32` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f32t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f33` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f33t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f34` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f34t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f35` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f35t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f36` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f36t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f37` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f37t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f38` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f38t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f39` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f39t` tinyint(2) unsigned NOT NULL,
`f40` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f40t` tinyint(2) unsigned NOT NULL,
`starttime` int(11) unsigned NOT NULL DEFAULT '0',
`endtime` int(11) unsigned NOT NULL DEFAULT '0',
`upgrading` tinyint(2) unsigned NOT NULL DEFAULT '0',
`utype` tinyint(2) unsigned NOT NULL DEFAULT '0',
`endtime2` int(11) unsigned NOT NULL DEFAULT '0',
`upgrading2` tinyint(2) unsigned NOT NULL DEFAULT '0',
`utype2` tinyint(2) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`vref`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%mdata`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%mdata` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sender` int(10) unsigned NOT NULL,
`recieve` int(10) unsigned NOT NULL,
`topic` varchar(45) NOT NULL,
`message` text NOT NULL,
`viewed` tinyint(1) unsigned NOT NULL,
`time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%users`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(15) NOT NULL,
`password` varchar(32) NOT NULL,
`access` tinyint(1) unsigned NOT NULL,
`email` varchar(50) NOT NULL,
`timestamp` int(11) unsigned NOT NULL DEFAULT '0',
`tribe` tinyint(1) unsigned NOT NULL,
`alliance` tinyint(3) unsigned NOT NULL,
`cp` int(10) unsigned NOT NULL,
`act` varchar(10) NOT NULL,
`sessid` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%vdata`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%vdata` (
`wref` int(10) unsigned NOT NULL,
`owner` int(10) unsigned NOT NULL,
`name` varchar(45) NOT NULL,
`capital` tinyint(1) unsigned NOT NULL,
`pop` int(10) unsigned NOT NULL,
`cp` int(10) unsigned NOT NULL,
`wood` float(12,2) NOT NULL,
`clay` float(12,2) NOT NULL,
`iron` float(12,2) NOT NULL,
`maxstore` int(10) unsigned NOT NULL,
`crop` float(12,2) NOT NULL,
`maxcrop` int(10) unsigned NOT NULL,
`lastupdate` int(11) unsigned NOT NULL,
PRIMARY KEY (`wref`),
KEY `wref` (`wref`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%wdata`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%wdata` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`fieldtype` tinyint(2) unsigned NOT NULL,
`oasistype` tinyint(2) unsigned NOT NULL,
`x` int(11) NOT NULL,
`y` int(11) NOT NULL,
`occupied` tinyint(1) unsigned NOT NULL,
`image` varchar(3) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;