2022-08-25 11:23:36 +00:00
< ? php
# Admin Only Area
const GAME = true ;
2022-06-06 21:30:34 +00:00
include ( '_incl_data/__config.php' );
include ( '_incl_data/class/__db_connect.php' );
2024-01-08 01:33:20 +00:00
require_once $_SERVER [ 'DOCUMENT_ROOT' ] . '/_incl_data/autoload.php' ;
2022-08-25 11:23:36 +00:00
$u = User :: start ();
2022-06-06 21:30:34 +00:00
2022-08-25 11:23:36 +00:00
if ( ! $u -> info [ 'admin' ]) {
2023-03-31 18:30:14 +00:00
header ( 'location: /' );
2022-08-25 11:23:36 +00:00
die ();
2022-06-06 21:30:34 +00:00
}
$i = 0 ;
2022-08-25 11:23:36 +00:00
while ( $i < 100 ) {
if ( ! isset ( $c [ 'battle_cfg' ][ $i ])) {
$c [ 'battle_cfg' ][ $i ] = 0 ;
}
$i ++ ;
2022-06-06 21:30:34 +00:00
}
?>
<! DOCTYPE html >
2024-01-08 01:33:20 +00:00
< html lang = " ru " >
2022-06-06 21:30:34 +00:00
< head >
2023-08-14 15:15:05 +00:00
2023-01-10 16:29:32 +00:00
< title > Тестирование ботов </ title >
2023-03-31 18:30:14 +00:00
< script src = " //img.new-combats.tech/js/Lite/gameEngine.js " type = " text/javascript " ></ script >
2024-01-08 01:33:20 +00:00
< script src = " /js/jquery-1.11.3.min.js " ></ script >
< script src = " /js/ion.rangeSlider.js " ></ script >
< script type = " text/javascript " src = " /js/title.js " ></ script >
2023-03-31 18:30:14 +00:00
< link href = " //img.new-combats.tech/css/main.css " rel = " stylesheet " type = " text/css " >
2024-01-08 01:33:20 +00:00
< link rel = " stylesheet " href = " /css/normalize.css " />
< link rel = " stylesheet " href = " /css/ion.rangeSlider.css " />
< link rel = " stylesheet " href = " /css/ion.rangeSlider.skinFlat.css " />
2022-08-25 11:23:36 +00:00
< style type = " text/css " >
h3 {
text - align : center ;
}
. CSSteam {
font - weight : bold ;
cursor : pointer ;
}
. CSSteam0 {
font - weight : bold ;
cursor : pointer ;
}
. CSSteam1 {
font - weight : bold ;
color : #6666CC;
cursor : pointer ;
}
. CSSteam2 {
font - weight : bold ;
color : #B06A00;
cursor : pointer ;
}
. CSSteam3 {
font - weight : bold ;
color : #269088;
cursor : pointer ;
}
. CSSteam4 {
font - weight : bold ;
color : #A0AF20;
cursor : pointer ;
}
. CSSteam5 {
font - weight : bold ;
color : #0F79D3;
cursor : pointer ;
}
. CSSteam6 {
font - weight : bold ;
color : #D85E23;
cursor : pointer ;
}
. CSSteam7 {
font - weight : bold ;
color : #5C832F;
cursor : pointer ;
}
. CSSteam8 {
font - weight : bold ;
color : #842B61;
cursor : pointer ;
}
. CSSteam9 {
font - weight : bold ;
color : navy ;
cursor : pointer ;
}
. CSSvs {
font - weight : bold ;
}
. nprsl0 {
cursor : pointer ;
filter : progid : DXImageTransform . Microsoft . BasicImage ( grayscale = 1 );
filter : progid : DXImageTransform . Microsoft . Alpha ( opacity = 30 );
opacity : 0.30 ;
filter : alpha ( opacity = 30 );
}
. nprsl0 : hover {
cursor : pointer ;
filter : progid : DXImageTransform . Microsoft . Alpha ( opacity = 90 );
opacity : 0.90 ;
filter : alpha ( opacity = 90 );
}
. nprsl1 {
cursor : pointer ;
filter : progid : DXImageTransform . Microsoft . Alpha ( opacity = 100 );
opacity : 1.00 ;
filter : alpha ( opacity = 100 );
}
. ttl_css {
position : absolute ;
padding - left : 3 px ;
padding - right : 3 px ;
padding - top : 2 px ;
padding - bottom : 2 px ;
background - color : #ffffcc;
border : 1 px solid #6F6B5E;
}
</ style >
2023-03-31 18:30:14 +00:00
< link href = " //img.new-combats.tech/css/main.css " rel = " stylesheet " type = " text/css " >
2024-01-08 01:33:20 +00:00
< script type = " text/javascript " src = " /js/jquery.js " ></ script >
2022-08-25 11:23:36 +00:00
< script >
function eff ( user , id ) {
if ( $ ( '#e' + user + '_' + id ) . attr ( 'class' ) == 'nprsl0' ) {
$ ( '#e' + user + '_' + id ) . attr ({ 'class' : 'nprsl1' });
$ ( '#eu' + user + '_' + id ) . attr ({ 'value' : '1' });
} else {
$ ( '#e' + user + '_' + id ) . attr ({ 'class' : 'nprsl0' });
$ ( '#eu' + user + '_' + id ) . attr ({ 'value' : '0' });
}
}
</ script >
2022-06-06 21:30:34 +00:00
</ head >
< body bgcolor = " #E2E0E0 " >
2024-01-08 01:33:20 +00:00
< div id = " ttl " class = " ttl_css " style = " display:none;z-index:1111; " ></ div >
2022-06-06 21:30:34 +00:00
< div id = " gi " class = " gifin " style = " display:none; " ></ div >
2023-11-02 13:57:39 +00:00
< H3 > Создать тестовый бой </ H3 >
2022-06-06 21:30:34 +00:00
< br >
< br >
< center >
2022-08-25 11:23:36 +00:00
< form method = " post " action = " testing.php " >
2023-03-31 18:42:06 +00:00
< ? php
2022-08-25 11:23:36 +00:00
//
if ( isset ( $_POST [ 'botadminatack2' ])) {
$error = '' ;
$user1 = mysql_fetch_array (
mysql_query (
'SELECT `a`.*,`b`.* FROM `users` AS `a` LEFT JOIN `stats` AS `b` ON `a`.`id` = `b`.`id` WHERE `a`.`id` = "' . mysql_real_escape_string (
$_POST [ 'botadminatack1' ]
) . '" LIMIT 1'
)
);
$user2 = mysql_fetch_array (
mysql_query (
'SELECT `a`.*,`b`.* FROM `users` AS `a` LEFT JOIN `stats` AS `b` ON `a`.`id` = `b`.`id` WHERE `a`.`id` = "' . mysql_real_escape_string (
$_POST [ 'botadminatack2' ]
) . '" LIMIT 1'
)
);
if ( isset ( $user1 [ 'id' ], $user2 [ 'id' ])) {
$user1 [ 'loclon' ] = 1 ;
$user2 [ 'loclon' ] = 1 ;
$user1 [ 'loclon555' ] = 1 ;
$user2 [ 'loclon555' ] = 1 ;
//
mysql_query (
' INSERT INTO `battle` ( `start1` , `city` , `time_start` , `timeout` , `type` ) VALUES (
" ' . time() . ' " , " capitalcity " , " ' . time() . ' " , " 60 " , " 329 "
) '
);
$logid = mysql_insert_id ();
//
2023-01-10 16:29:32 +00:00
$user1 [ 'login' ] = $user1 [ 'login' ] . ' (Бот для боя ' . $logid . ')' ;
$user2 [ 'login' ] = $user2 [ 'login' ] . ' (Бот для боя ' . $logid . ')' ;
2022-08-25 11:23:36 +00:00
//
$bot1 = $u -> addNewbot ( 0 , null , $user1 , false , false );
$bot2 = $u -> addNewbot ( 0 , null , $user2 , false , false );
mysql_query ( 'UPDATE `users` SET `battle` = "' . $logid . '" WHERE `id` = "' . $bot1 . '" LIMIT 1' );
mysql_query ( 'UPDATE `users` SET `battle` = "' . $logid . '" WHERE `id` = "' . $bot2 . '" LIMIT 1' );
mysql_query (
'UPDATE `stats` SET `hpNow` = 100000000 , `bot` = 2 , `team` = "1" WHERE `id` = "' . $bot1 . '" LIMIT 1'
);
mysql_query (
'UPDATE `stats` SET `hpNow` = 100000000 , `bot` = 2 , `team` = "2" WHERE `id` = "' . $bot2 . '" LIMIT 1'
);
//
mysql_query (
2024-01-08 01:33:20 +00:00
'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`type`,`text`) VALUES ("' . time () . '","' . $logid . '","1","1","Часы показывали <b>' . date ( 'd.m.Y H:i:s' ) . '</b>, когда <b>' . $user1 [ 'login' ] . '</b> и <b>' . $user2 [ 'login' ] . '</b> бросили вызов друг другу.")'
2022-08-25 11:23:36 +00:00
);
//
2023-01-10 16:29:32 +00:00
//Эффекты
2022-08-25 11:23:36 +00:00
$i = 0 ;
while ( $i < 1000 ) {
//
2024-01-08 01:33:20 +00:00
$efs = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `eff_main` WHERE `id2` = "' . $i . '" LIMIT 1' ));
2022-08-25 11:23:36 +00:00
if ( $_POST [ 'eu1_' . $efs [ 'id2' ]] == 1 ) {
mysql_query (
2024-01-08 01:33:20 +00:00
' INSERT INTO `eff_users` ( `id_eff` , `uid` , `name` , `data` , `timeUse` )
VALUES ( " ' . $efs['id2'] . ' " , " ' . $bot1 . ' " , " ' . $efs['mname'] . ' " , " ' . $efs['mdata'] . ' " , " ' . time() . ' " ) '
2022-08-25 11:23:36 +00:00
);
}
if ( $_POST [ 'eu2_' . $efs [ 'id2' ]] == 1 ) {
mysql_query (
2024-01-08 01:33:20 +00:00
' INSERT INTO `eff_users` ( `id_eff` , `uid` , `name` , `data` , `timeUse` )
VALUES ( " ' . $efs['id2'] . ' " , " ' . $bot2 . ' " , " ' . $efs['mname'] . ' " , " ' . $efs['mdata'] . ' " , " ' . time() . ' " ) '
2022-08-25 11:23:36 +00:00
);
}
2024-01-08 01:33:20 +00:00
2022-08-25 11:23:36 +00:00
$i ++ ;
}
2024-01-08 01:33:20 +00:00
2022-08-25 11:23:36 +00:00
function inuser_go_btl ( $id )
{
if ( isset ( $id [ 'id' ])) {
file_get_contents (
2024-01-08 01:33:20 +00:00
'/jx/battle/refresh1.php?uid=' . $id [ 'id' ] . '&cron_core=' . md5 ( $id [ 'id' ] . '_brfCOreW@!_' . $id [ 'pass' ]) . '&pass=' . $id [ 'pass' ]
2022-08-25 11:23:36 +00:00
);
}
}
2022-06-06 21:30:34 +00:00
2022-08-25 11:23:36 +00:00
$sp = mysql_query (
2024-01-08 01:33:20 +00:00
'SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = -1 AND `time_over` = 0 AND `type` = 329 LIMIT 100'
2022-08-25 11:23:36 +00:00
);
while ( $pl = mysql_fetch_array ( $sp )) {
$user1 = mysql_fetch_array (
mysql_query ( 'SELECT * FROM `users` WHERE `battle` = "' . $pl [ 'id' ] . '" LIMIT 1' )
);
inuser_go_btl ( $user1 );
}
//
2023-03-31 18:30:14 +00:00
$error = 'Бой между <u>' . $user1 [ 'login' ] . '</u> [' . $user1 [ 'level' ] . '] <a target="_blank" href="/inf.php?' . $bot1 . '"><img src="//img.new-combats.tech/i/inf_capitalcity.gif"></a> и <u>' . $user2 [ 'login' ] . '</u> [' . $user2 [ 'level' ] . '] <a href="/inf.php?' . $bot2 . '" target="_blank"><img src="//img.new-combats.tech/i/inf_capitalcity.gif"></a> начался! <a href="/logs.php?log=' . $logid . '" target="_blank">Лог боя</a>' ;
2022-08-25 11:23:36 +00:00
} else {
2023-01-10 16:29:32 +00:00
$error = 'Один из персонажей не найден в базе.' ;
2022-08-25 11:23:36 +00:00
}
echo '<div style="color:red"><b>' . $error . '</b></div>' ;
}
//
$ef1 = '' ;
$ef2 = '' ;
2024-01-08 01:33:20 +00:00
$sp = mysql_query ( 'SELECT * FROM `eff_main` WHERE `mdata` != \'\' AND `actionTime` > 0 ORDER BY `mname` ' );
2022-08-25 11:23:36 +00:00
$i = 0 ;
while ( $pl = mysql_fetch_array ( $sp )) {
$i ++ ;
//
2023-01-10 16:29:32 +00:00
//Действие эффекта
2022-08-25 11:23:36 +00:00
$ei = '' ;
$tr = '' ;
$x = 0 ;
2023-08-14 15:15:05 +00:00
$ed = Helper\Conversion :: dataStringToArray ( $pl [ 'mdata' ]);
2024-01-08 01:33:20 +00:00
while ( $x < count ( $this -> statnames -> sysBonusNames )) {
$n = $this -> statnames -> sysBonusNames [ $x ];
2022-08-25 11:23:36 +00:00
if ( isset ( $ed [ 'add_' . $n ], $u -> is [ $n ])) {
$z = '' ;
if ( $ed [ 'add_' . $n ] > 0 ) {
$z = '+' ;
}
2024-01-08 01:33:20 +00:00
$tr .= '<br>' . $this -> statnames -> bonusNames [ $n ] . ': ' . $z . $ed [ 'add_' . $n ];
2022-08-25 11:23:36 +00:00
}
$x ++ ;
}
if ( $tr != '' ) {
$ei .= $tr ;
}
if ( $e [ 'info' ] != '' ) {
2023-01-10 16:29:32 +00:00
$ei .= '<br><i>Информация:</i><br>' . $e [ 'info' ];
2022-08-25 11:23:36 +00:00
}
//
2023-03-31 18:30:14 +00:00
$ef = '<img onmouseover="hi(this,\'<b>' . $pl [ 'mname' ] . '</b>' . $ei . '\',event,3,1,1,1,\'\');" onMouseOut="hic();" onMouseDown="hic();" src="//img.new-combats.tech/i/eff/' . $pl [ 'img' ] . '" width="40" height="25">' ;
2023-11-02 13:57:39 +00:00
$ef1 .= '<input id="eu1_' . $pl [ 'id2' ] . '" name="eu1_' . $pl [ 'id2' ] . '" value="0" type="hidden"><span class="nprsl0" id="e1_' . $pl [ 'id2' ] . '" onclick="eff(1,' . $pl [ 'id2' ] . ')">' . $ef . '</span>' ;
$ef2 .= '<input id="eu2_' . $pl [ 'id2' ] . '" name="eu2_' . $pl [ 'id2' ] . '" value="0" type="hidden"><span class="nprsl0" id="e2_' . $pl [ 'id2' ] . '" onclick="eff(2,' . $pl [ 'id2' ] . ')">' . $ef . '</span>' ;
2022-08-25 11:23:36 +00:00
}
//
$dv = '' ;
$da = '' ;
2023-01-10 16:29:32 +00:00
$dv .= '<select style="font-size:12px;" name="botadminatack2"><option value="0">------ Выберите клона из списка ------</option>' ;
2022-08-25 11:23:36 +00:00
$dv .= '</select>' ;
2023-01-10 16:29:32 +00:00
$da = '<select style="font-size:12px;" name="botadminatack1"><option value="0">------ Выберите клона из списка ------</option>' . $da . '</select>' ;
2022-08-25 11:23:36 +00:00
?>
< table width = " 700 " border = " 0 " cellpadding = " 10 " cellspacing = " 10 " >
< tr >
< td width = " 350 " align = " center " valign = " middle " >& nbsp ;
< p >
< ? = $da ?>
& nbsp ; </ p >
< p >& nbsp ; </ p ></ td >
2023-01-10 16:29:32 +00:00
< td align = " center " valign = " middle " >& nbsp ; < b > против </ b > & nbsp ; </ td >
2022-08-25 11:23:36 +00:00
< td width = " 350 " align = " center " valign = " middle " >& nbsp ;
< p >
< ? = $dv ?>
& nbsp ; </ p >
< p >& nbsp ; </ p ></ td >
</ tr >
< tr >
< td align = " center " valign = " middle " >< ? = $ef1 ?> </td>
2023-01-10 16:29:32 +00:00
< td align = " center " valign = " middle " >& nbsp ; < b style = " color:#03C " > эффекты < br ></ b >& nbsp ; </ td >
2022-08-25 11:23:36 +00:00
< td align = " center " valign = " middle " >< ? = $ef2 ?> </td>
</ tr >
< tr >
< td align = " center " valign = " middle " >& nbsp ; </ td >
2023-01-10 16:29:32 +00:00
< td align = " center " valign = " middle " >< br >< br >< input class = " btnnew " type = " submit " value = " Начать! " ></ td >
2022-08-25 11:23:36 +00:00
< td align = " center " valign = " middle " >& nbsp ; </ td >
</ tr >
</ table >
< br >
</ form >
2022-06-06 21:30:34 +00:00
</ center >
</ body >
</ html >