-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
68 lines (57 loc) · 1.82 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
64
65
66
67
68
<?php
define('REVISION', 'v2.0a');
// 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/channel_priv.class.php');
require_once('classes/commands.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/ini.class.php' );
require_once('classes/timer.class.php');
require_once('classes/commandhandler.class.php');
/*
// soon to uncomment
foreach(glob('classes/*.class.php') as $filename) {
require_once($filename);
}
*/
$pIni = Ini::getInstance();
CommandHandler::getInstance();
Database::getInstance();
Timer::getInstance();
$g_aConfig = array(
'General' => $pIni->_getConfig('configuration/general.ini', 'General'),
'Bots' => $pIni->_getArrayConfig('bots', 'Bot'),
'Networks' => $pIni->_getArrayConfig('networks', 'Network'),
);
$g_aNetworks = $g_aConfig['Networks'];
unset($g_aConfig['Networks']);
foreach($g_aNetworks as $key => $value) {
$g_aNetworks[$g_aNetworks[$key]['Name']] = $g_aNetworks[$key];
unset($g_aNetworks[$key]);
}
foreach($g_aConfig['General']['Admins'] as $sAdmin) {
if(!Privileges::AddBotAdmin($sAdmin))
Log::Error('>> Invalid ident format -> '.$sAdmin);
}
$gHandler = Main::getInstance($g_aConfig, $g_aNetworks);
$iSleep = $g_aConfig['General']['Sleep'];
while(true) {
$gHandler->_Run();
usleep($iSleep);
}
?>