$id = $DB->selectCell("SELECT `id` FROM `realmlist` ORDER BY `name`");
        $_GET['realm'] = $id;
    }
}
if ($_GET['realm']) {
    $realm_info = get_realm_byid($_GET['realm']);
    $pathway_info[] = array('title' => $realm_info['name'], '');
    $cc = 0;
    $rid = $realm_info['cloneid'] == -1 ? $realm_info['id'] : $realm_info['cloneid'];
    $rrealm_info = get_realm_byid($rid);
    AddMangosFields($rrealm_info['Version']);
    $charinfo_link = $rrealm_info['WowdCharInfoLink'];
    $faction_alliance = 0;
    $faction_horde = 0;
    $total = 0;
    if (check_port_status($rrealm_info['address'], $rrealm_info['port']) !== true) {
        output_message('alert', 'Realm <b>' . $rrealm_info['name'] . '</b> is offline <img src="images/downarrow2.gif" border="0" align="top">');
    } else {
        if (!$rrealm_info['CharacterDatabaseInfo']) {
            output_message('alert', 'Check field <u>CharacterDatabaseInfo</u> in table `realmlist` for realm id=' . $realm_info['id']);
        }
        $wsdb_info = parse_worlddb_info($rrealm_info['CharacterDatabaseInfo']);
        if ($DB) {
            $query = $DB->select("SELECT c.*, a.*   FROM " . $wsdb_info['db'] . ".`characters` as c, `account` as a \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE ((c.`online`='1') AND (c.`account`=a.`id`)) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY c.`name`");
        }
        $faction_alliance = 0;
        $faction_horde = 0;
        $total = 0;
        foreach ($query as $result) {
            if ($res_color == 1) {
                $res_color = 2;
Example #2
0
 $mangosALL = array('db_type' => 'mysql', 'db_host' => $realm_data_explode['3'], 'db_port' => $realm_data_explode['2'], 'db_username' => $realm_data_explode['0'], 'db_password' => $realm_data_explode['1'], 'db_name' => $realm_data_explode['4'], 'db_char' => $realm_data_explode['5'], 'db_encoding' => 'utf8');
 unset($realm_data_explode);
 if ((int) $MW->getConfig->generic->use_alternate_mangosdb_port) {
     $mangosALL['db_port'] = (int) $MW->getConfig->generic->use_alternate_mangosdb_port;
 }
 $CHDB_EXTRA = DbSimple_Generic::connect("" . $mangosALL['db_type'] . "://" . $mangosALL['db_username'] . ":" . $mangosALL['db_password'] . "@" . $mangosALL['db_host'] . ":" . $mangosALL['db_port'] . "/" . $mangosALL['db_char'] . "");
 if ($CHDB_EXTRA) {
     $CHDB_EXTRA->query("SET NAMES " . $mangosALL['db_encoding']);
 }
 unset($mangosALL);
 // Free up memory.
 $server = array();
 $server['name'] = $data['name'];
 if ((int) $MW->getConfig->components->server_information->realm_status) {
     $checkaddress = (int) $MW->getConfig->generic->use_local_ip_port_test ? '127.0.0.1' : $data['address'];
     $server['realm_status'] = check_port_status($checkaddress, $data['port']) === true ? true : false;
 }
 $changerealmtoparam = array("changerealm_to" => $realmnow_arr['id']);
 if ((int) $MW->getConfig->components->server_information->online) {
     $server['playersonline'] = $CHDB_EXTRA->selectCell("SELECT count(1) FROM `characters` WHERE online=1");
     $server['onlineurl'] = mw_url('server', 'playersonline', $changerealmtoparam);
 }
 if ((int) $MW->getConfig->components->left_section->Playermap) {
     $server['playermapurl'] = mw_url('server', 'playermap', $changerealmtoparam);
 }
 if ((int) $MW->getConfig->components->server_information->server_ip) {
     $server['server_ip'] = $data['address'];
 }
 if ((int) $MW->getConfig->components->server_information->type) {
     $server['type'] = $realm_type_def[$data['icon']];
 }
Example #3
0
<?php

if (INCLUDED !== true) {
    exit;
}
// ==================== //
$pathway_info[] = array('title' => 'GM Ticket Manager', 'link' => 'index.php?n=admin&sub=tickets');
// ==================== //
?>

<?php 
$MANG = new Mangos();
$query = array();
$realm_info_new = get_realm_byid($user['cur_selected_realmd']);
$cc = 0;
if (!check_port_status($realm_info_new['address'], $realm_info_new['port']) === true) {
    output_message('alert', 'Realm <b>' . $realm_info_new['name'] . '</b> is offline <img src="templates/offlike/images/downarrow2.gif" border="0" align="top">');
}
$action = array();
if ($project == "trinity") {
    $action = $CHDB->select("SELECT `guid`, `playerGuid`, `name`, `message`,`comment`, `assignedto` FROM `gm_tickets` WHERE `closed` = '0' ORDER BY `guid` ");
    $ticket = array();
    $cc1 = 0;
    $result1 = array();
    if (count($action) > 0) {
        foreach ($action as $result1) {
            if ($color == 1) {
                $color = 2;
            } else {
                $color = 1;
            }
 if ($WSDB_EXTRA) {
     $WSDB_EXTRA->query("SET NAMES " . $mangosALL['db_encoding']);
 }
 $CHDB_EXTRA = DbSimple_Generic::connect("" . $mangosALL['db_type'] . "://" . $mangosALL['db_username'] . ":" . $mangosALL['db_password'] . "@" . $mangosALL['db_host'] . ":" . $mangosALL['db_port'] . "/" . $mangosALL['db_char'] . "");
 if ($CHDB_EXTRA) {
     $CHDB_EXTRA->query("SET NAMES " . $mangosALL['db_encoding']);
 }
 $population = 0;
 if ($res_color == 1) {
     $res_color = 2;
 } else {
     $res_color = 1;
 }
 $realm_type = $realm_type_def[$result['icon']];
 $realm_num = $result['id'];
 if (check_port_status($result['address'], $result['port']) === true) {
     $res_img = './templates/WotLK/images/uparrow2.gif';
     if ($WSDB_EXTRA && $CHDB_EXTRA) {
         $population = $CHDB_EXTRA->selectCell("SELECT count(*) FROM `characters` WHERE online=1");
         $uptime = time() - $DB->selectCell("SELECT starttime FROM uptime WHERE `realmid`='{$realm_num}' ORDER BY `starttime` DESC LIMIT 1");
     }
 } else {
     $res_img = './templates/WotLK/images/downarrow2.gif';
     $population_str = 'n/a';
     $uptime = 0;
 }
 $items[$i]['res_color'] = $res_color;
 $items[$i]['img'] = $res_img;
 $items[$i]['name'] = $result['name'];
 $items[$i]['type'] = $realm_type;
 $items[$i]['pop'] = $population;
Example #5
0
 $CHDB = DbSimple_Generic::connect("" . $config['db_type'] . "://" . $CHDB_info['user'] . ":" . $CHDB_info['password'] . "@" . $CHDB_info['host'] . ":" . $CHDB_info['port'] . "/" . $CHDB_info['db'] . "");
 if ($CHDB) {
     $CHDB->setErrorHandler('databaseErrorHandler');
 }
 if ($CHDB) {
     $CHDB->query("SET NAMES " . $config['db_encoding']);
 }
 $error = false;
 $reason = 'You guilty';
 $bantime = '30d';
 $address = $realm_info['address'];
 $raport = $realm_info['raport'];
 if (check_port_status($realm_info['address'], $realm_info['port']) !== true) {
     // если сервер остановлен
 } else {
     if (check_port_status($address, $raport) !== true) {
         output_message('alert', ' Реалм <b>' . $realm_info['name'] . '</b> выключен либо не возможно соединится на порт RA <img src="images/downarrow2.gif" border="0" align="top">');
         $error = true;
     } else {
         $result = $_POST['result'];
         $myuser = $user['username'];
         $rurl = str_replace("&", "_and_", $_SERVER["REQUEST_URI"]);
         if ($result) {
             $resultmsg = $_POST['resultmsg'];
             $mypass = $_POST['mypass'];
             $action = $_POST['action'];
             $type = $_POST['type'];
             $typeval = $_POST['typeval'];
             $reason = $_POST['reason'];
             $bantime = $_POST['bantime'];
             //Logs
 // Establish the World DB connection
 $WDB_EXTRA = new Database($Realm_DB_Info['w_db_host'], $Realm_DB_Info['w_db_port'], $Realm_DB_Info['w_db_username'], $Realm_DB_Info['w_db_password'], $Realm_DB_Info['w_db_name']);
 // Free up memory
 unset($Realm_DB_Info);
 // $res_color is a template thing for blizzlike templates,
 // makes each row an offset color from the previous
 if ($res_color == 1) {
     $res_color = 2;
 } else {
     $res_color = 1;
 }
 // Define the realm type, and realm number
 $realm_type = $realm_type_def[$result['icon']];
 $realm_num = $result['id'];
 // Check the realm status using the check_port_status function
 if (check_port_status($result['address'], $result['port'], 2) == TRUE) {
     // res image is the up arrow pretty much
     $res_img = 'Online';
     // Get the server population
     $population = $CDB_EXTRA->count("SELECT COUNT(*) FROM `characters` WHERE online=1");
     // Get the server uptime
     $start_time = $DB->selectCell("SELECT `starttime` FROM `uptime` WHERE `realmid`='" . $realm_num . "' ORDER BY `starttime` DESC LIMIT 1");
     $uptime = time() - $start_time;
 } else {
     // Get the result image arrow
     $res_img = 'Offline';
     $population = 0;
     $uptime = 0;
 }
 // Convert uptime into a days / hours / minutes format
 if ($uptime != 0) {
function completeOrder()
{
    global $RA, $user, $DB, $WDB, $package, $lang;
    // Lets check to see if the realm is online before starting
    $realm = get_realm_byid($GLOBALS['cur_selected_realm']);
    if (!check_port_status($realm['address'], $realm['port'], 3)) {
        output_message('error', $lang['shop_realm_offline']);
        return FALSE;
    }
    // Second check to see if the user has enough points
    if ($package['wp_cost'] > $user['web_points']) {
        output_message('validation', $lang['not_enough_points']);
        return FALSE;
    }
    // Initiate the command array
    $command = array();
    // If there is an item number for the selected package
    if ($package['item_number'] != 0) {
        $item_array = '';
        $package_array = explode(',', $package['item_number']);
        foreach ($package_array as $a) {
            $item_array .= $a . ":" . $package['quanity'] . " ";
        }
        $command[] = "send items " . $_POST['char'] . " \"" . $lang["shop_mail_subject"] . "\" \"" . $lang["shop_mail_message"] . "\" " . $item_array;
    }
    // If there is an itemset for this package, we need to make a command for that as well
    if ($package['itemset'] != 0) {
        $qray = $WDB->select("SELECT `entry` FROM `item_template` WHERE `itemset`='" . $package['itemset'] . "'");
        $items = '';
        foreach ($qray as $d) {
            $items .= $d['entry'] . ":1 ";
        }
        $command[] = "send items " . $_POST['char'] . " \"" . $lang["shop_mail_subject"] . "\" \"" . $lang["shop_mail_message"] . "\" " . $items;
    }
    // If there is gold in this package, make a command for that
    if ($package['gold'] != 0) {
        $command[] = "send money " . $_POST['char'] . " \"" . $lang["shop_mail_subject"] . "\" \"" . $lang["shop_mail_message"] . "\" " . $package['gold'];
    }
    // === Send the command to the RA Class === //
    $send = $RA->send($command, $GLOBALS['cur_selected_realm']);
    // Catch the result of send. If its a 1 or 2, then the send wasnt successful
    if ($send == 1 || $send == 2) {
        output_message('error', $lang['shop_send_error']);
        return FALSE;
    } else {
        // Initiate our counts
        $success = 0;
        $total_commands = count($command);
        // Return will be in an array, so foreach array variable, we need the result
        foreach ($send as $report) {
            // If in the string, the characters name is listed, then its a success
            if (strpos($report, $_POST['char'])) {
                $success++;
            }
        }
        // If the success count is equal to the total amount of commands sent
        // Then all was successful
        if ($success == $total_commands) {
            output_message('success', 'Items Sent Successfully!');
            // Update the DB, subtracting the cost of the package
            $DB->query("UPDATE `mw_account_extend` SET\r\n\t\t\t\t`web_points`=(`web_points` - " . $package['wp_cost'] . "),  \r\n\t\t\t\t`points_spent`=(`points_spent` + " . $package['wp_cost'] . ")  \r\n\t\t\t   WHERE `account_id` = " . $user['id'] . " LIMIT 1");
        } else {
            output_message('validation', $lang['shop_error']);
        }
    }
}
include 'core/SDL/class.zone.php';
include 'core/SDL/class.character.php';
$Zone = new Zone();
$Character = new Character();
if (isset($_GET["page"])) {
    $pid = $_GET["page"];
} else {
    $pid = 1;
}
$limit = 100;
$limitstart = ($pid - 1) * $limit;
$res_info = array();
$query = array();
$realm_info = get_realm_byid($_COOKIE['cur_selected_realm']);
$cc = 0;
$Online_Check = check_port_status($realm_info['address'], $realm_info['port']);
if ($Online_Check == TRUE) {
    $Count = $Character->getOnlineCount();
    $numofpgs = $Count / $limit;
    if (gettype($Count / $limit) != "integer") {
        settype($numofpgs, "integer");
        $numofpgs++;
    }
    $query = $Character->getOnlineList(0, $limitstart, $limit);
} else {
    $numofpgs = 0;
}
foreach ($query as $result) {
    if ($res_color == 1) {
        $res_color = 2;
    } else {