mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-07 05:14:31 +00:00
Big Cleanup
1) Removed unnecessary files 2) Trailling spaces (no all though) 3) Some space to tab conversion
This commit is contained in:
+58
-58
@@ -10,31 +10,31 @@
|
||||
#################################################################################
|
||||
|
||||
class Generator {
|
||||
|
||||
|
||||
public function generateRandID(){
|
||||
return md5($this->generateRandStr(16));
|
||||
}
|
||||
|
||||
public function generateRandStr($length){
|
||||
$randstr = "";
|
||||
for($i=0; $i<$length; $i++){
|
||||
$randnum = mt_rand(0,61);
|
||||
if($randnum < 10){
|
||||
$randstr .= chr($randnum+48);
|
||||
}else if($randnum < 36){
|
||||
$randstr .= chr($randnum+55);
|
||||
}else{
|
||||
$randstr .= chr($randnum+61);
|
||||
}
|
||||
}
|
||||
return $randstr;
|
||||
$randstr = "";
|
||||
for($i=0; $i<$length; $i++){
|
||||
$randnum = mt_rand(0,61);
|
||||
if($randnum < 10){
|
||||
$randstr .= chr($randnum+48);
|
||||
}else if($randnum < 36){
|
||||
$randstr .= chr($randnum+55);
|
||||
}else{
|
||||
$randstr .= chr($randnum+61);
|
||||
}
|
||||
}
|
||||
return $randstr;
|
||||
}
|
||||
|
||||
|
||||
public function encodeStr($str,$length) {
|
||||
$encode = md5($str);
|
||||
return substr($encode,0,$length);
|
||||
}
|
||||
|
||||
|
||||
public function procDistanceTime($coor,$thiscoor,$ref,$mode) {
|
||||
global $bid28,$bid14,$building;
|
||||
$xdistance = ABS($thiscoor['x'] - $coor['x']);
|
||||
@@ -54,7 +54,7 @@ class Generator {
|
||||
$speed = 12;
|
||||
}
|
||||
else if($ref == 3) {
|
||||
$speed = 24;
|
||||
$speed = 24;
|
||||
}
|
||||
else if($ref == 300) {
|
||||
$speed = 5;
|
||||
@@ -75,7 +75,7 @@ class Generator {
|
||||
return round($distance * 3600 / INCREASE_SPEED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getTimeFormat($time) {
|
||||
$min = 0;
|
||||
$hr = 0;
|
||||
@@ -98,55 +98,55 @@ class Generator {
|
||||
}
|
||||
|
||||
public function procMtime($time, $pref = 3) {
|
||||
/*
|
||||
$timezone = 7;
|
||||
switch($timezone) {
|
||||
case 7:
|
||||
$time -= 3600;
|
||||
break;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
$timezone = 7;
|
||||
switch($timezone) {
|
||||
case 7:
|
||||
$time -= 3600;
|
||||
break;
|
||||
}
|
||||
*/
|
||||
- $time += 3600*0; //Edit this yourself
|
||||
+ $time += 0; //Edit this yourself
|
||||
|
||||
$today = date('d',time())-1;
|
||||
if (date('Ymd',time()) == date('Ymd',$time)) {
|
||||
$day = "today";
|
||||
}elseif($today == date('d',$time)){
|
||||
$day = "yesterday";
|
||||
}
|
||||
else {
|
||||
switch($pref) {
|
||||
case 1:
|
||||
$day = date("m/j/y",$time);
|
||||
break;
|
||||
case 2:
|
||||
$day = date("j/m/y",$time);
|
||||
break;
|
||||
case 3:
|
||||
$day = date("j.m.y",$time);
|
||||
break;
|
||||
default:
|
||||
$day = date("y/m/j",$time);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$new = date("H:i:s",$time);
|
||||
if ($pref=="9"||$pref==9)
|
||||
return $new;
|
||||
else
|
||||
return array($day,$new);
|
||||
}
|
||||
$today = date('d',time())-1;
|
||||
if (date('Ymd',time()) == date('Ymd',$time)) {
|
||||
$day = "today";
|
||||
}elseif($today == date('d',$time)){
|
||||
$day = "yesterday";
|
||||
}
|
||||
else {
|
||||
switch($pref) {
|
||||
case 1:
|
||||
$day = date("m/j/y",$time);
|
||||
break;
|
||||
case 2:
|
||||
$day = date("j/m/y",$time);
|
||||
break;
|
||||
case 3:
|
||||
$day = date("j.m.y",$time);
|
||||
break;
|
||||
default:
|
||||
$day = date("y/m/j",$time);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$new = date("H:i:s",$time);
|
||||
if ($pref=="9"||$pref==9)
|
||||
return $new;
|
||||
else
|
||||
return array($day,$new);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getBaseID($x,$y) {
|
||||
return ((WORLD_MAX-$y) * (WORLD_MAX*2+1)) + (WORLD_MAX +$x + 1);
|
||||
}
|
||||
|
||||
|
||||
public function getMapCheck($wref) {
|
||||
return substr(md5($wref),5,2);
|
||||
}
|
||||
|
||||
|
||||
public function pageLoadTimeStart() {
|
||||
$starttime = microtime();
|
||||
$startarray = explode(" ", $starttime);
|
||||
@@ -160,6 +160,6 @@ if (date('Ymd',time()) == date('Ymd',$time)) {
|
||||
//$endtime = $endarray[1] + $endarray[0];
|
||||
return $endarray[0];
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
$generator = new Generator;
|
||||
$generator = new Generator;
|
||||
Reference in New Issue
Block a user