Esempio n. 1
0
 /** __construct($multibotCore)
  *
  * Typ: Konstruktor
  *
  * Przypisuje referencje
  *
  */
 function __construct(multibotCore $multibotCore)
 {
     // Konstruktor jako argument przyjmuje obiekt multibotCore
     $multibotCore->refresh('clientList');
     // Wymuszenie załadowania licty użytkowników w celu przypisania ich do listy wysłanych po to aby aktualnie obecni użytkownicy przebywający serwerze w czasie uruchamiania bota nie dostali wiadokości powitalnej
     $this->tsAdmin = $multibotCore->getTsAdmin();
     $this->multibotCore = $multibotCore;
 }
 /** __construct($multibotCore)
  *
  * Typ: Konstruktor
  *
  * Przypisuje referencje
  *
  */
 function __construct(multibotCore $multibotCore)
 {
     // Konstruktor jako argument przyjmuje obiekt multibotCore
     $this->multibotCore = $multibotCore;
     // Przypisuje referencje multibotCore do $multibotCore
     $multibotCore->refresh('clientList');
     // Wymuszenie załadowania licty użytkowników w celu przypisania ich do listy wysłanych po to aby aktualnie obecni użytkownicy przebywający serwerze w czasie uruchamiania bota nie dostali wiadokości powitalnej
     if (empty($this->clientListSend)) {
         $this->clientListSend = $this->convertClientTable($multibotCore->clientList);
         // Konwertuje i zapisuje listę użytkowników obecnych na serwerze w momencie tworzenia obiektu
     }
 }
Esempio n. 3
0
        ${$function_name} = new $function_name($multibotObject);
    }
    //*************************************************************************************
    //*************************************** Loop ****************************************
    //*************************************************************************************
    while (true) {
        sleep(1);
        $buffer = socketRead($socket);
        if (!empty($buffer)) {
            $buffer = explode(" ", $buffer);
            commands();
            if ($break) {
                break;
            }
        }
        foreach ($vars_list as $vars_list_value => $vars_list_temp) {
            foreach ($vars_list_temp as $var_name => $var_refresh_time) {
                $multibotObject->refresh($var_name, $var_refresh_time);
            }
            $refresh_time = $multibot_config[$vars_list_value]['general_config']['refresh'];
            ${$vars_list_value}->start($refresh_time);
        }
    }
    //*************************************************************************************
    //************************************ Debug Mode *************************************
    //*************************************************************************************
} elseif ($start_options['startmode'] == "debug") {
    require $paths['files']['multibot-core'];
    $multibotObject = new multibotCore("commands");
    $multibotObject->getserverinfo();
}
Esempio n. 4
0
 /** __construct($multibotCore)
  *
  * Typ: Konstruktor
  *
  * Przypisuje referencje
  *
  */
 function __construct(multibotCore $multibotCore)
 {
     $this->multibotCore = $multibotCore;
     $this->poketimer = date('r');
     $config = $multibotCore->getConfig('multibot');
     $config = $config['pokebot']['pokebot'];
     $this->config = $config;
 }
Esempio n. 5
0
 *  obsługę socketu łączącego go bezpośredznio z kontrolerem całego multiota (v2)
 *  od tego momentu kontroler ten jest zależny od konrrolera całego bota ponieważ
 *  sam nie potrafi wyznaczyć jakie funkcje ma uruchomić.
 *
 *  Zasada działania.
 *  Kontorler całego multibota (commands-core.php) uruchamia proces multibota
 *  (multibot-core.php) następnie przesyła nazwy funkcji które mają być w nim
 *  uruchomione. Kontroler pojedyńczego procesu (Ten plik) uruchamia dane funkcje
 *  i następnie wysyła poprzez socket do głownego kontrolera (commands-core.php)
 *  nazwy fukncji które miał uruchomić co jest równoznaczne z potwierdzeniem odebrania
 *  poprawnych danych.
 *
 */
date_default_timezone_set('Europe/Berlin');
require "Core/multibot-core.class.php";
$multibotCore = new multibotCore();
$lang = $multibotCore->getLang();
$vars = array('clock' => array(), 'pokeBot' => array('clientList', 'channelList'), 'adminStatus' => array('serverGroupNames'), 'afkAutoMove' => array('clientList'), 'welcomeMessage' => array('clientList', 'serverInfo'), 'adminChannelStatus' => array('clientList'), 'channelChecker' => array('clientList', 'serverInfo', 'channelList'));
//socket
if (!($socket = socket_create(AF_INET, SOCK_STREAM, 0))) {
    $multibotCore->addError($lang['internal_socket_create_error'], false, true);
} else {
    $multibotCore->addInfo($lang['internal_socket_create_success']);
}
sleep(5);
if (!socket_connect($socket, 'localhost', 12345)) {
    $multibotCore->addError($lang['internal_socket_connect_error'], false, true);
} else {
    $multibotCore->addInfo($lang['internal_socket_connect_success']);
}
if (!socket_set_nonblock($socket)) {
Esempio n. 6
0
<?php

date_default_timezone_set('Europe/Berlin');
require "src/multibotCore.class.php";
//Kontroler
$multibotCore = new multibotCore('config.ini');
$vars = array('clock' => array(), 'pokeBot' => array('clientList', 'channelList'), 'adminStatus' => array('serverGroupNames'), 'afkAutoMove' => array('clientList'), 'welcomeMessage' => array('clientList', 'serverInfo'));
$varsList = array();
foreach ($multibotCore->config as $value => $temp) {
    if (isset($temp['enable'])) {
        if ($temp['enable']) {
            ${$value} = new $value($multibotCore);
            if (!empty($vars[$value])) {
                foreach ($vars[$value] as $valueTemp) {
                    if (isset($varsList[$valueTemp])) {
                        if ($varsList[$valueTemp] > $temp['refresh']) {
                            $varsList[$valueTemp] = $temp['refresh'];
                            continue;
                        }
                        continue;
                    }
                    $varsList[$valueTemp] = $temp['refresh'];
                }
            }
        }
    }
}
while (true) {
    foreach ($multibotCore->config as $value => $temp) {
        if (isset($temp['enable'])) {
            if ($temp['enable']) {
Esempio n. 7
0
 /** __construct($multibotCore)
  *
  * Typ: Konstruktor
  *
  * Przypisuje referencje
  *
  */
 function __construct(multibotCore $multibotCore)
 {
     // Konstruktor jako argument przyjmuje obiekt multibotCore
     $this->tsAdmin = $multibotCore->getTsAdmin();
     $this->multibotCore = $multibotCore;
 }