Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 08.09.2006, 12:43   #1
hater
Архивный участник
 
Join Date: Aug 2006
Posts: 28
Default

I am using the next php script:
Code:
<?
$char_id = 8;

printf("giving adena to ", $char_id, additem($char_id) == "x1" ? "ok" : "error");


function additem($p0) {
    $fp = fsockopen("127.0.0.1", "2012", $errno, $errstr, 5); $rs = "x";
    if (!$fp) die("Error connecting to cached: $errstr");

$buf = pack("c", 55); // 55 = AddItem2Packet();
$buf .= pack("i", $p0); //char_id
$buf .= pack("i", 0); 
$buf .= pack("i", 57); //item_type
$buf .= pack("i", 1000); //item_amount
$buf .= pack("i", 0); //enchant 
$buf .= pack("i", 0); 
$buf .= pack("i", 0); 
$buf .= pack("i", 0); 
$buf .= pack("i", 1);

    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]; }
    fclose($fp); return($rs);
}
?>
But it doesn't work =(

CacheD:
admin server create socket[127.0.0.1]
[.\adminsocket.cpp][3454] No Admin Id
admin server closed(127.0.0.1) error: 997


Please, help me.
hater is offline  
Old 09.09.2006, 18:11   #2
Kenjiro
Архивный участник
 
Join Date: Apr 2006
Posts: 120
Default

Quote:
Originally Posted by hater View Post
I am using the next php script:
Code:
<?
// cut before to shorten message
$buf .= pack("i", 0); //enchant 
$buf .= pack("i", 0); 
$buf .= pack("i", 0); 
$buf .= pack("i", 0); 
$buf .= pack("i", 1);

$buf .= tounicode ( "webadmin" ); // remember to add function

    fwrite($fp, pack("s", (strlen($buf)+2)).$buf);
// cut after to shorten message
?>
But it doesn't work =(

CacheD:
admin server create socket[127.0.0.1]
[.\adminsocket.cpp][3454] No Admin Id
^^^^^^^^^^^^^^^^^^^^^^^^^^
admin server closed(127.0.0.1) error: 997


Please, help me.
Try add admin name. Look above in Your corrected example.
Kenjiro 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 21:13.