Ignore:
Timestamp:
Aug 13, 2007, 9:05:34 PM (17 years ago)
Author:
george
Message:

Aktualizace MaNGOS Minimanageru na verzi 0.1.4a.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/pomm_public/pomm_run.php

    r5 r19  
    1414$JsHttpRequest =& new JsHttpRequest($site_encoding);
    1515
    16 $mysql = new MySQL;
    17 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     16$sql = new SQL;
     17$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1818
    1919if( !$user_lvl && !$server[$realm_id]['both_factions']){
    20         $result = $mysql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
    21         if ($mysql->num_rows($result)){
    22                 $order_side = (in_array($mysql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
     20        $result = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
     21        if ($sql->num_rows($result)){
     22                $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
    2323                " AND race IN (2,5,6,8,10) " : " AND race IN (1,3,4,7,11) ";
    2424        } else $order_side = "";
    2525} else $order_side = "";
    2626
    27 $result = $mysql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1),
    28                 SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1)
     27$result = $sql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1),
     28                SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1),zone
    2929                FROM `character` WHERE `online`= 1 $order_side");
    3030
    3131$i = 0;
    32 while($char = $mysql->fetch_row($result)){
     32while($char = $sql->fetch_row($result)){
    3333        $char_gender = str_pad(dechex($char[7]),8, 0, STR_PAD_LEFT);
    3434
    35         $pos = get_player_position($char[3],$char[4],$char[5]);
     35        $pos = get_player_position($char[3],$char[4],$char[5],$char[8]);
    3636        $arr[$i]['x'] = $pos['x'];
    3737        $arr[$i]['y'] = $pos['y'];
    3838        $arr[$i]['name'] = $char[0];
    39         if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[5], $char[3], $char[4]));
     39        if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[8]));
    4040                else $arr[$i]['zone'] = ereg_replace("'", "`", get_map_name($char[5]));
    4141        $arr[$i]['cl'] = $char[2];
     
    4646        }
    4747
    48 $mysql->close();
     48$sql->close();
    4949
    5050$_RESULT =$arr;
Note: See TracChangeset for help on using the changeset viewer.