Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 05.04.2007, 16:59   #15
Charis
Архивный участник
 
Join Date: Feb 2006
Posts: 39
Default

Does Someone checked 20 and 21 packets?
Enable and Disable Char?

I have written code below, but if Unban char seems to work (returns 1), BanChar returns 03 - wrong args o_O

Code:
function ansi2unicode($string) {
    $rs = ""; for($i = 0; $i < strlen($string); $i++) $rs .= $string[$i].chr(0);
    return($rs.chr(0).chr(0));
}

function l2_cached_push($buf){
$cached_ip = "127.0.0.1";
$cached_port = "2012";
$fp = fsockopen($cached_ip, $cached_port, $errno, $errstr, 5); $rs = ""; 
if(!$fp)return 0; 
else{ 
    fwrite($fp, pack("s", (strlen($buf)+2)).$buf);
    $len = unpack("v", fread($fp, 2)); $rid = unpack("c", fread($fp, 1));
    for ($i = 0; $i < (($len[1]-4) / 4); $i++) { $read = unpack("i", fread($fp, 4)); $rs .= 

$read[1]; }
    stream_set_timeout($fp, 2);
    $answ=$rs;
    fclose($fp);
    return "$answ";
  }
 }


function l2_banCharacter($webadmin, $char_id) {
    $cached_op = pack("c", 20); // 20 = DisableCharacterPacket();
    $cached_op .= pack("i", $char_id);
     $cached_op .= ansi2unicode ( $webadmin ); 
    $rs = l2_cached_push ($cached_op); 
    return ( $rs );
}

function l2_unbanCharacter($webadmin, $char_id) {
    $cached_op = pack("c", 21); // 21 = EnableCharacterPacket();
    $cached_op .= pack("i", $char_id);
    $cached_op .= ansi2unicode ( $webadmin ); 
    $rs = l2_cached_push ($cached_op); 
    return ( $rs );
}
Charis is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:16.