Делем крону чуть лучше чем было.
This commit is contained in:
parent
905f017be6
commit
82ecc37f5e
@ -5,8 +5,8 @@
|
|||||||
* Project name: Battles-Game
|
* Project name: Battles-Game
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once "../config.php";
|
include_once '../config.php';
|
||||||
include_once "../functions.php";
|
include_once '../functions.php';
|
||||||
$tm = time();
|
$tm = time();
|
||||||
|
|
||||||
##########
|
##########
|
||||||
@ -536,5 +536,4 @@ if(date("z-H-i") == date("z-H-i", $turnirstart['value']))
|
|||||||
mysql_query("TRUNCATE TABLE `deztow_items`");
|
mysql_query("TRUNCATE TABLE `deztow_items`");
|
||||||
mysql_query("TRUNCATE TABLE `deztow_trap`");
|
mysql_query("TRUNCATE TABLE `deztow_trap`");
|
||||||
}
|
}
|
||||||
mysql_query('UNLOCK TABLES');
|
mysql_query('UNLOCK TABLES');
|
||||||
?>
|
|
@ -1,15 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
include('config.php');
|
/**
|
||||||
include('functions.php');
|
* Copyright (c) 2018.
|
||||||
|
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||||
|
* Project name: Battles-Game
|
||||||
|
*/
|
||||||
|
|
||||||
$r = mysql_query("SELECT `id`, `win` FROM `battle` WHERE `needbb` = 2 AND `win` = 3");
|
include_once '../config.php';
|
||||||
|
include_once '../functions.php';
|
||||||
|
|
||||||
|
|
||||||
|
$r = db::c()->query('SELECT `id`, `win` FROM `battle` WHERE `needbb` = 2 AND `win` = 3');
|
||||||
$r2 = mysql_query("SELECT `id`, `win` FROM `battle` WHERE `needbb` = 1 AND `win` = 3 AND (`timeout`*90+`to1` < ".time()." OR `timeout`*90+`to2` < ".time().")");
|
$r2 = mysql_query("SELECT `id`, `win` FROM `battle` WHERE `needbb` = 1 AND `win` = 3 AND (`timeout`*90+`to1` < ".time()." OR `timeout`*90+`to2` < ".time().")");
|
||||||
|
|
||||||
echo "SELECT `id`, `win` FROM `battle` WHERE `needbb` = 1 AND `win` = 3 AND (`timeout`*90+`to1` < ".time()." OR `timeout`*90+`to2` < ".time().")";
|
if($r->getNumRows() > 0 || mysql_num_rows($r2) > 0) { include_once '../fbattle.php'; }
|
||||||
|
|
||||||
if(mysql_num_rows($r) > 0 || mysql_num_rows($r2) > 0) { include('fbattle.php'); }
|
|
||||||
$battles = array();
|
$battles = array();
|
||||||
while($rec = mysql_fetch_assoc($r)) {
|
while($rec = $r->fetch_assoc()) {
|
||||||
$fbattles = new fbattle($rec['id']);
|
$fbattles = new fbattle($rec['id']);
|
||||||
foreach($fbattles->battle as $k => $v) {
|
foreach($fbattles->battle as $k => $v) {
|
||||||
if($k > _BOTSEPARATOR_) {
|
if($k > _BOTSEPARATOR_) {
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
* Project name: Battles-Game
|
* Project name: Battles-Game
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include('config.php');
|
include_once '../config.php';
|
||||||
include('functions.php');
|
include_once '../functions.php';
|
||||||
include('cave/cave_bots.php');
|
include_once '../cave/cave_bots.php' ;
|
||||||
$cavebots = $botnames;
|
$cavebots = $botnames;
|
||||||
|
|
||||||
function addlogs($id, $log) {
|
function addlogs($id, $log) {
|
||||||
@ -312,10 +312,6 @@ class fbattle {
|
|||||||
mysql_query('INSERT INTO `logs_arena` (`battle`, `user`, `uid`, `damage`, `team`) VALUES ("'.$this->battle_data['id'].'", "'.$this->t1[$k].'", "'.$v.'", "'.$this->damage[$v].'", "1")');
|
mysql_query('INSERT INTO `logs_arena` (`battle`, `user`, `uid`, `damage`, `team`) VALUES ("'.$this->battle_data['id'].'", "'.$this->t1[$k].'", "'.$v.'", "'.$this->damage[$v].'", "1")');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->user['in_tower'] > 0) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if($this->user['x'] != 0 || $this->user['y'] != 0 && $this->user['laba'] > 0) {
|
if($this->user['x'] != 0 || $this->user['y'] != 0 && $this->user['laba'] > 0) {
|
||||||
$lobj = mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `lib` = "'.$this->user['laba'].'" AND `x` = "'.$this->user['x'].'" AND `y` = "'.$this->user['y'].'" LIMIT 1'));
|
$lobj = mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `lib` = "'.$this->user['laba'].'" AND `x` = "'.$this->user['x'].'" AND `y` = "'.$this->user['y'].'" LIMIT 1'));
|
||||||
if(isset($lobj['id'])) {
|
if(isset($lobj['id'])) {
|
||||||
@ -1257,27 +1253,28 @@ class fbattle {
|
|||||||
} else {
|
} else {
|
||||||
return ($mid-$min)*(1-$diff)+$min;
|
return ($mid-$min)*(1-$diff)+$min;
|
||||||
}
|
}
|
||||||
$min = $min/100;
|
# До кода ниже невозможно достучаться. все варианты return перечислены выше.
|
||||||
$max = $max/100;
|
// $min = $min/100;
|
||||||
$diffup = (1/(1+(abs($mf-$antimf)/(($max-$mid)*100))));
|
// $max = $max/100;
|
||||||
$diffdown = (1/(1+(abs($mf-$antimf)/(($mid-$min)*100))));
|
// $diffup = (1/(1+(abs($mf-$antimf)/(($max-$mid)*100))));
|
||||||
$ret = $mid;
|
// $diffdown = (1/(1+(abs($mf-$antimf)/(($mid-$min)*100))));
|
||||||
if($mf > $antimf) {
|
// $ret = $mid;
|
||||||
$ret = $ret*(2-$diff);
|
// if($mf > $antimf) {
|
||||||
} else {
|
// $ret = $ret*(2-$diff);
|
||||||
$ret = $ret*$diff;
|
// } else {
|
||||||
}
|
// $ret = $ret*$diff;
|
||||||
if($ret < $min) {
|
// }
|
||||||
$ret = $min;
|
// if($ret < $min) {
|
||||||
}
|
// $ret = $min;
|
||||||
if($ret > $max) {
|
// }
|
||||||
$ret = $max;
|
// if($ret > $max) {
|
||||||
}
|
// $ret = $max;
|
||||||
return (int)round($ret*100);
|
// }
|
||||||
|
// return (int)round($ret*100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_bonus($uid) {
|
function check_bonus($uid) {
|
||||||
$us = mysql_fetch_array(mysql_query('SELECT `id`, `sila`, `lovk`, `inta`, `vinos` FROM `users` WHERE `id` = "'.mysql_real_escape_string($uid).'" LIMIT 1'));
|
$us = db::c()->query('SELECT `id`, `sila`, `lovk`, `inta`, `vinos` FROM `users` WHERE `id` = ?i', $uid)->fetch_assoc();
|
||||||
$i_uminu = 0;
|
$i_uminu = 0;
|
||||||
$i_fkrit = 0;
|
$i_fkrit = 0;
|
||||||
$i_fauvorot = 0;
|
$i_fauvorot = 0;
|
||||||
@ -1422,8 +1419,6 @@ class fbattle {
|
|||||||
$mfs['me']['udar'] = round($mfs['me']['udar']);
|
$mfs['me']['udar'] = round($mfs['me']['udar']);
|
||||||
if($mfs['me']['udar'] < 1) { $mfs['me']['udar'] = 1; }
|
if($mfs['me']['udar'] < 1) { $mfs['me']['udar'] = 1; }
|
||||||
|
|
||||||
#$this->AddToLog('{Id = '.$uid_1['id'].'| No_Koef = '.$mfs['me']['udars'].'| Finish = '.$mfs['me']['udar'].'| Koef = '.$he_koef_armor.'| Armor = '.$this->enemy_dress[5+$attack].' | Um = '.$uron_vlad_me.'| Weap = '.$this->GetWeaponType($uid_1['weap']).'| Function = '.$mfs['me']['udars'].'-'.($this->enemy_dress[5+$attack]*$he_koef_armor).'| Min = '.(floor($uid_1['sila']/3)+$b_u_1['minu']+1+$this->user_dress[0]).'| Max = '.(floor($uid_1['sila']/3)+$b_u_1['maxu']+4+$this->user_dress[1]).'}<BR>');
|
|
||||||
|
|
||||||
$mykrits = floor($this->enemy_dress[2]+($uid_2['inta']*2.95)+$b_u_2['fkrit']);
|
$mykrits = floor($this->enemy_dress[2]+($uid_2['inta']*2.95)+$b_u_2['fkrit']);
|
||||||
$heakrits = floor($this->user_dress[3]+($uid_1['inta']*2.75)+$b_u_1['fkrit']);
|
$heakrits = floor($this->user_dress[3]+($uid_1['inta']*2.75)+$b_u_1['fkrit']);
|
||||||
$myuvorots = floor($this->enemy_dress[4]+$uid_2['lovk']*5);
|
$myuvorots = floor($this->enemy_dress[4]+$uid_2['lovk']*5);
|
||||||
@ -1448,9 +1443,6 @@ class fbattle {
|
|||||||
case "mech": $uron_vlad_he += $uid_2['mec']; break;
|
case "mech": $uron_vlad_he += $uid_2['mec']; break;
|
||||||
}
|
}
|
||||||
$mfs['he']['udar'] += $uron_vlad_he;
|
$mfs['he']['udar'] += $uron_vlad_he;
|
||||||
|
|
||||||
#$this->AddToLog('{ Id = '.$uid_2['id'].'| URON_not_koef = '.$mfs['he']['udars'].'| Uron_finish = '.$mfs['he']['udar'].'| Koef_arm = '.$me_koef_armor.'| Armor = '.$this->user_dress[5+$this->battle[$user_2][$user_1][0]].' | Um = '.$uron_vlad_he.'| Weap = '.$this->GetWeaponType($uid_2['weap']).' }<BR>');
|
|
||||||
|
|
||||||
$mfs['he']['udar'] = round($mfs['he']['udar']);
|
$mfs['he']['udar'] = round($mfs['he']['udar']);
|
||||||
if($mfs['he']['udar'] < 1) { $mfs['he']['udar'] = 1; }
|
if($mfs['he']['udar'] < 1) { $mfs['he']['udar'] = 1; }
|
||||||
|
|
||||||
@ -1545,4 +1537,4 @@ while($rec = mysql_fetch_array($r)) {
|
|||||||
} else {
|
} else {
|
||||||
echo '{No bb Id = |'.$rec['id'].'|}';
|
echo '{No bb Id = |'.$rec['id'].'|}';
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
include('config.php');
|
/**
|
||||||
include('functions.php');
|
* Copyright (c) 2018.
|
||||||
|
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||||
|
* Project name: Battles-Game
|
||||||
|
*/
|
||||||
|
|
||||||
#phpinfo();
|
#include_once 'config.php';
|
||||||
file_get_contents('http://capitalcity.old-dark.ru/chats.php?id=6&user=10022');
|
#include_once 'functions.php';
|
||||||
?>
|
|
||||||
|
file_get_contents(GAMEDOMAIN.'/chats.php?id=6&user=10022');
|
||||||
|
Loading…
Reference in New Issue
Block a user