Beispiel #1
0
     unset($vars[$function_name]);
     $vars[mb_strtolower($function_name, "UTF-8")] = $vars_list;
 }
 $vars_list = array();
 $socket_timer = date('r', time() + 10);
 sleep(1);
 if (!($socket_info = socket_read($socket, 2048))) {
     $multibotObject->addError($lang['multibot_mode']['instance_read_error'], true);
 } else {
     $multibotObject->addInfo($lang['multibot_mode']['instance_read_success']);
 }
 if (!empty($socket_info)) {
     $socket_info = preg_replace('/\\s+/', '', $socket_info);
     $socket_info = mb_strtolower($socket_info, "UTF-8");
     $functions = explode(",", $socket_info);
     $multibotObject->setName($functions[0]);
     $multibot_config = $multibotObject->getConfig("multibot");
     unset($functions[0]);
     $user_info = $tsAdmin->whoAmi();
     $nick = $user_info['data']['client_nickname'];
     foreach ($functions as $function_name) {
         $functions_to_start[mb_strtolower($function_name . "UTF-8")] = mb_strtolower($function_name, "UTF-8");
     }
     refreshVarsList();
     socket_write($socket, $nick, strlen($nick));
 }
 //**************************************************************************************
 //****************************** Function Object Creator *******************************
 //**************************************************************************************
 foreach ($functions_to_start as $function_name) {
     ${$function_name} = new $function_name($multibotObject);
Beispiel #2
0
    $multibotCore->addError($lang['internal_socket_bind_error'], false, true);
} else {
    $multibotCore->addInfo($lang['internal_socket_bind_success']);
}
$timeSocket = date('r', time() + 10);
while (true) {
    sleep(1);
    if (!($buffer = socket_read($socket, 2048))) {
        $multibotCore->addError($lang['internal_socket_read_error'], false, true);
    } else {
        $multibotCore->addInfo($lang['internal_socket_read_success']);
    }
    if (!empty($buffer)) {
        $buffer = preg_replace('/\\s+/', '', $buffer);
        $functions = explode(",", $buffer);
        $multibotCore->setName($functions[0]);
        $nick = $functions[0];
        unset($functions[0]);
        foreach ($multibotCore->config['multibotConfig'] as $value => $temp) {
            if (isset($temp['enable'])) {
                if (in_array($value, $functions)) {
                    $multibotCore->config['multibotConfig'][$value]['enable'] = true;
                    $startedFunctions[] = $value;
                } else {
                    $multibotCore->config['multibotConfig'][$value]['enable'] = false;
                }
            }
        }
        $return = $nick . ",";
        foreach ($multibotCore->config['multibotConfig'] as $value => $temp) {
            if (isset($temp['enable'])) {