-
Notifications
You must be signed in to change notification settings - Fork 1
/
AI.php
142 lines (107 loc) · 4.42 KB
/
AI.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
/*
Ядро для обработки данных.
Обработка поединков, обработка заявок, обработка ботов, обработка пещер, обработка турниров, обработка временных генераций
*/
if(isset($_GET['test'])) {
/*
define('GAME',true);
setlocale(LC_CTYPE ,"ru_RU.CP1251");
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
include('_incl_data/class/__user.php');
if($u->info['admin'] > 0) {
$sp = mysql_query('SELECT `id` FROM `users` WHERE `real` > 0 AND `banned` = 0 AND `level` > 3');
while( $pl = mysql_fetch_array($sp) ) {
$u->addItem(4532,$pl['id']);
}
}
*/
}
die('Отсутствует подключение к базе.');
function getIP() {
if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
return $_SERVER['REMOTE_ADDR'];
}
if(isset($_GET['robot'])) {
}elseif(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP() != '5.187.7.71') {
if( !isset($_GET['test'])) {
die(getIP().'<br>'.$_SERVER['SERVER_ADDR']);
}
}
define('GAME',true);
setlocale(LC_CTYPE ,"ru_RU.CP1251");
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
if(isset($_GET['mail'])) {
if(isset($_GET['ok'])) {
mysql_query('UPDATE `users_mail1` SET `login2` = "1" WHERE `login2` != "1" ORDER BY `online` DESC LIMIT 1');
header('location: /AI.php?robot&mail');
die();
}
$sp = mysql_query('SELECT * FROM `users_mail1` WHERE `login2` != "1" ORDER BY `online` DESC LIMIT 1');
while( $pl = mysql_fetch_array($sp)) {
echo 'E-mail:<br><br><b>'.$pl['mail'].'</b><br><br><br><a href="/AI.php?robot&mail&ok">СЛЕДУЮЩИЙ E-MAIL</a>';
}
$xx = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users_mail1` WHERE `login2` = 1 LIMIT 1'));
$xx = $xx[0];
$xx2 = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users_mail1` LIMIT 1'));
$xx2 = $xx2[0] + 7588;
echo '<Br><br>(Отправлено писем: '.$xx.' / '.$xx2.')';
}
include('_incl_data/class/__user.php');
include('_incl_data/class/bot.priem.php');
include('_incl_data/class/bot.logic.php');
function e($t) {
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' (Критическая ошибка): <b>'.mysql_real_escape_string($t).'</b>","capitalcity","LEL","6","1","-1")');
}
$count = array(
0,
0,
0,
0,
0,
0
);
function inuser_go_btl($id) {
if(isset($id['id'])) {
file_get_contents('http://xcombats.com/jx/battle/refresh.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass']);
}
}
$sp = mysql_query('SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "botforpeople" ORDER BY `s`.`nextAct` ASC LIMIT 100');
$btltest = array();
while($pl = mysql_fetch_array($sp)) {
$i++;
if( $pl['zv'] == 0 && ($pl['battle'] == 0 || !isset($btltest[$pl['battle']]) || $btltest[$pl['battle']] < 10)) {
$btltest[$pl['battle']]++;
if( $pl['timereg'] == 0 ) {
mysql_query('UPDATE `users` SET `timereg` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
}else{
mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
}
if( $pl['bot'] == 0 ) {
mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
}
mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
botLogic::start( $pl['id'] );
}else{
if( $pl['zv'] > 0 ) {
botLogic::start( $pl['id'] );
}
if( $pl['timereg'] == 0 ) {
mysql_query('UPDATE `users` SET `timereg` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
}else{
mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
}
if( $pl['bot'] == 0 ) {
mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
}
mysql_query('UPDATE `stats` SET `nextAct` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
echo '*';
}
echo '+';
echo '['.$pl['login'].'] -> Действие: '.$pl['ipreg'].' , ожидаем: '.($pl['timeMain']-time()).' сек., заявка: '.$pl['zv'].', поединок: '.$pl['battle'].'';
echo '<hr>';
}
?>