-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
63 lines (50 loc) · 1.77 KB
/
start.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
<?php
// Version
define('VERSION', 'v2.1a');
// Timezone
date_default_timezone_set('Europe/Amsterdam');
// Enable error reporting
ini_set('error_reporting', E_ALL);
ini_set('display_errors', true);
// Classes
require_once('interfaces/RawEvents.php');
require_once('interfaces/Modes.php');
require_once('interfaces/ColorCodes.php');
require_once('classes/singleton.class.php');
require_once('classes/log.class.php');
set_error_handler('Log::DebugHandler', E_ALL);
require_once('classes/privileges.class.php');
require_once('classes/rawcommands.class.php');
require_once('classes/misc.class.php');
require_once('classes/main.class.php');
require_once('classes/bot.class.php');
require_once('classes/socket.class.php');
require_once('classes/database.class.php');
require_once('classes/plugin.class.php');
require_once('classes/timer.class.php');
require_once('classes/commandhandler.class.php');
// Includes
include_once('parse.php');
if(version_compare(PHP_VERSION, '5.3.0') == -1)
die('>> mYsTeRy requires at least PHP version 5.3 (Your current version: '.PHP_VERSION.')');
// init various classes
Database::getInstance();
CommandHandler::getInstance();
Timer::getInstance();
echo 'Initializing mYsTeRy '.VERSION.' ...'. PHP_EOL;
$Settings = parse('configuration/general.ini', 'General', false);
$Bots = parse('configuration/bots/', 'Bot', true);
$Network = parse('configuration/networks/', 'Network', true, 'Name');
$iSleep = $Settings['Sleep'];
$Controller = Main::getInstance();
$Controller->_registerSettings($Settings);
$Controller->_registerNetwork($Network);
$Controller->_registerAdmins();
$Controller->_initBots($Bots);
$Controller->_initPlugins();
echo '>> Global settings have been registered. Bot(s) will connect now.' . PHP_EOL;
while(true) {
$Controller->_Run();
usleep($iSleep);
}
?>