Post Pacific

Post Pacific (https://postpacific.mmorpg-game.online/index.php)
-   Lineage 2 General (https://postpacific.mmorpg-game.online/forumdisplay.php?f=31)
-   -   C4 CacheD, 2012 port commands (https://postpacific.mmorpg-game.online/showthread.php?t=5371)

scott 02.09.2006 09:51

Not work :(
You have original cached or patched "anti /block" ?

Kenjiro 04.09.2006 06:58

Quote:

Originally Posted by Haygor (Post 66188)
I have this exact same problem, I know for a fact the items are added to the table, pllus I have restarted cached several times, but still receiving a code 01 (item not in ItemData table). Any other ideas?

Try to generate itemcache.txt from your client itemname-e.txt and itemdata (quest/stacking flag) files and directly insert data to Itemdata table (in lin2world db) - remember to stop cached before db operations. Try to load generated itemcache. Then check db and restart cached. Should work.

P.S. Remember to have recent itemdata.txt in Your cachedscript directory.

Haygor 07.09.2006 23:59

Quote:

Originally Posted by Kenjiro (Post 66350)
Try to generate itemcache.txt from your client itemname-e.txt and itemdata (quest/stacking flag) files and directly insert data to Itemdata table (in lin2world db) - remember to stop cached before db operations. Try to load generated itemcache. Then check db and restart cached. Should work.

P.S. Remember to have recent itemdata.txt in Your cachedscript directory.

Well, the funny thing is I generated it off the itemdata on server side (so no descriptions) and inserted via the cached update script command. Might try inserting manually and restarting cached to see if this works. Will post results once I get a chance to do this.

hater 08.09.2006 12:43

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.

RumanticK 08.09.2006 13:33

char must be offline, afaik

hater 08.09.2006 13:56

Quote:

Originally Posted by RumanticK (Post 66794)
char must be offline, afaik

No-no, my char is offline..
This error doesn't connect with chars, imho.. <_<

Kenjiro 09.09.2006 18:11

Quote:

Originally Posted by hater (Post 66788)
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.

Haygor 10.09.2006 07:29

Quote:

Originally Posted by Kenjiro (Post 66350)
Try to generate itemcache.txt from your client itemname-e.txt and itemdata (quest/stacking flag) files and directly insert data to Itemdata table (in lin2world db) - remember to stop cached before db operations. Try to load generated itemcache. Then check db and restart cached. Should work.

P.S. Remember to have recent itemdata.txt in Your cachedscript directory.
Quote:

Originally Posted by Haygor (Post 66759)
Well, the funny thing is I generated it off the itemdata on server side (so no descriptions) and inserted via the cached update script command. Might try inserting manually and restarting cached to see if this works. Will post results once I get a chance to do this.


Still a no go for any item above 7838, any other ideas?

hater 18.09.2006 11:57

how I can add builder to player/acc from CacheD?..

FidoW 22.09.2006 03:24

-- Deleted --

Kenjiro 22.09.2006 06:20

Any lin2error.txt? Or anything in '/err' log?

FidoW 22.09.2006 13:49

-- Deleted --

dinesat4 11.10.2006 19:15

Any idea from Telnet?

Stazis 12.10.2006 10:51

CLog::Add -> CLog::AddV -> Log::AddV - vswprintf_s
hm - it could not make log record into console ...

Ollisso 22.10.2006 20:17

Does anybody know what is packet format for:
- change subjob ?
- move character to different account ?

Which data should I give to CacheD ?
(just order of them :)

Namenlos 25.10.2006 22:23

$buf .= tounicode("Web1"); //who


Please explain what is TOUNICODE function? Your own? If it is your own please share this code!

Also if anyone can help with PHP coding of commands CacheD... we neeeed it =)

m4rk 25.10.2006 22:36

it's in the first example post Namenlos...

Code:

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


Elsir 26.10.2006 06:50

Please help with adding a builder rights to a existing player account.
#3 SetBuilderCharacterPacket("ddS")
The third argument is any string in unicode?
Must I add '1' at the end of the packet as in the AddItem packet?

Mark20 26.10.2006 08:25

PHP Code:

<?
function SetBuilderCharacterPacket($char_id, $builder_level) {
    
$fp = fsockopen("127.0.0.1", "2012", $errno, $errstr, 5); $rs = "x";
    if (!
$fp) die("<script>alert('Error connecting to cached: $errstr
[server down??]')</script>"
);

    
$buf = pack("c", 3); // 3 = SetBuilderCharacterPacket();
    
$buf .= pack("i", $char_id);
    
$buf .= pack("i", $builder_level);

    
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);
}
?>


sct 27.10.2006 04:19

Gah, I can get EVERY function to work besides additem2... it isn't reporting any errors. I did the adminid thing... just no errors now. it connects to the cache and disconnects and no item is created.

Kenjiro 27.10.2006 07:09

Make sure You have working itemdata.txt in your CachedScript directory. My additem2 php code:

$cached_op = pack ( "cVVVVVVVVVV", 55, $char_id, $warehouse, $item_type, $amount, $enchant, $eroded, $bless, $ident, $wished, 1 );
$cached_op .= ansi2unicode ( "yourwebuserorwhatever" );
$ret_string = l2_cached_push ( pack ( "s", strlen ( $cached_op ) + 2 ) . $cached_op );

It works.

Majesty 27.10.2006 09:10

What about 67 AddSkillsPacket("dSd") ?
When trying to add all skills, nothing happens. Also, no errors in CacheD.
CacheD returns "1".

Code:

function cached_new($buf){
global $cached_ip,$cached_port;
$fp = fsockopen($cached_ip, $cached_port, $errno, $errstr, 5); $rs = "x";
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";
  }
 }

Code:

function set_skill_all_char($id,$char_name){
 
  kick_char($id);
 
  $buf = pack("c", 67); // 67 = AddSkillsPacket("dSd");
  $buf .= pack("i", $id); //char_id
        $buf .= tounicode ( "GM" );
        $buf .= pack("i", 0);
 
  $answ=cached_new($buf); 
  if($answ==="x1")return "<font class=log_number>$char_name</font> successfully got all skills.";
  else return "<font color=red>Error:</font><font class=log_text>$answ</font> giving all skills to <font class=log_number>$char_name</font>.";
}


sct 27.10.2006 14:49

Quote:

Originally Posted by Kenjiro (Post 70771)
Make sure You have working itemdata.txt in your CachedScript directory. My additem2 php code:

$cached_op = pack ( "cVVVVVVVVVV", 55, $char_id, $warehouse, $item_type, $amount, $enchant, $eroded, $bless, $ident, $wished, 1 );
$cached_op .= ansi2unicode ( "yourwebuserorwhatever" );
$ret_string = l2_cached_push ( pack ( "s", strlen ( $cached_op ) + 2 ) . $cached_op );

It works.

Yeah I am pretty confident there is nothing wrong with my code. It has to be something on the cache side but I cant figure out what. Cache still reports no error... so I dont know what to do xD

Kenster 27.10.2006 15:16

When trying the code, no error is reported but it doesn't work. Simply to load the itemdata just put in the folder and your good to go right? I have itemname-e.txt itemdata.txt and itemcache.txt all in there, but no item is loaded with the PHP your provided. I do get recognition of it attempting in the CACHE

Namenlos 28.10.2006 20:56

What about Char Ban?
This script can not do that. Please help!


Quote:

$name = "charname"; //charname
$hour = "24"; // ban hours
function ban_char($name, $hour) {
$fp = fsockopen("127.0.0.1", "2012", $errno, $errstr, 5); $rs = "x";
if (!$fp) die("<script>alert('Error connecting to cached: $errstr
[server down??]')</script>");

$buf = pack("c", 39);
$buf .= pack("i", $char_id);
$buf .= pack("i", $name);
$buf .= tounicode("GM1");

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);
}

hel 28.10.2006 21:49

Namenlos:
Your php-script invalid...

Where is a function calling?
-> echo (ban_char($name, $hour));

Where $char_id variable defined?
-> is there must be name or char_id?
-> if $name, then you must convert it to unicode tounicode($name);
-> if $char_id, then you have error in function arguments...

You have error in a packet data... Because you're using packet for ChangeCharNamePacket.
-> you must know right packet structure (with all parameters, which sended to cached)
-> function ban_char($name, $hour)
-> $buf = pack("c", 39);
-> $buf .= pack("i", $char_id);
-> $buf .= pack("i", $name);
-> $buf .= tounicode("GM1");
-> it's what you must edit... I can't help with structure, because I can't understand, which parameters used for that function...

Namenlos 28.10.2006 22:41

Quote:

Originally Posted by hel (Post 70890)
Where is a function calling?
-> echo (ban_char($name, $hour));

after this script. Didn't post it here.

Quote:

Originally Posted by hel (Post 70890)
Where $char_id variable defined?
-> is there must be name or char_id?
-> if $name, then you must convert it to unicode tounicode($name);
-> if $char_id, then you have error in function arguments...

I sent charname as $char_id variable. I try to convert. Its converted but still not work.
I POSTED WRONG CODE. I mean

$buf = pack("c", 39);
$name = tounicode($name);
$buf .= pack("i", $name);
$buf .= pack("i", $hour);


39 is the packet for BanChar, look at the first post. Changing name is 4th packet.

Namenlos 29.10.2006 02:03

I am sorry for my posts.
This is right code.

Code:


$hour = 48; //ban hour
$char_id = 123; // ID OF CHAR

function ban_char($char_id, $hour) {
$fp = fsockopen("127.0.0.1", "2012", $errno, $errstr, 5); $rs = "x";
if (!$fp) die("<script>alert('Error connecting to cached: $errstr
[server down??]')</script>");

    $buf = pack("c", 39); // packet for character ban
        $buf .= pack("i", $char_id); //char_id
        $buf .= pack("i", $hour); //hours of ban

    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);
}


Kenster 30.10.2006 04:34

For anyone reading this thread, AddItem2 doesn't work, so don't waste your time. Everything is ok, ban char check online status, ect.

Just wanted to make an update so you dont waste your time like I did.

Majesty 30.10.2006 04:42

Quote:

Originally Posted by Kenster (Post 70986)
For anyone reading this thread, AddItem2 doesn't work, so don't waste your time.

Why? Works good for me.

Quote:

function add_item_to_char($id,$item_type,$amount,$enchant,$ char_name){

kick_char($id);

$buf = pack("c", 55); // 55 = AddItem2Packet();
$buf .= pack("i", $id); //char_id
$buf .= pack("i", 0);
$buf .= pack("i", $item_type); //item_type
$buf .= pack("i", $amount); //item_amount
$buf .= pack("i", $enchant); //enchant
$buf .= pack("i", 0);
$buf .= pack("i", 0);
$buf .= pack("i", 0);
$buf .= pack("i", 1);
$buf .= tounicode ( "GM" );

$answ=cached_new($buf);

if($answ==="x1")return "<font class=log_number>$char_name</font> successfully got an item.";
else return "<font color=red>Error:</font><font class=log_text></font> giving item to <font class=log_number>$char_name</font>.";
}

Kenjiro 30.10.2006 08:05

Quote:

Originally Posted by Kenster (Post 70986)
For anyone reading this thread, AddItem2 doesn't work, so don't waste your time. Everything is ok, ban char check online status, ect.

Just wanted to make an update so you dont waste your time like I did.

Do not tell lies, it works as hell:
PHP Code:

function l2_additem2 ( $char_id, $warehouse, $item_type, $amount, $enchant, $eroded, $bless, $ident, $wished ) {
  
// 55 - AddItem2, char_id, warehouse, item_type, amount, enchant, eroded, bless, ident, wished
  
$cached_op = pack ( "cVVVVVVVVVV", 55, $char_id, $warehouse, $item_type, $amount, $enchant, $eroded, $bless, $ident, $wished, 1 );
  
$cached_op .= ansi2unicode ( "webadmin" );
  
$ret_string = l2_cached_push ( pack ( "s", strlen ( $cached_op ) + 2 ) . $cached_op );
  return ( 
$ret_string );
} 


AHTUKULLEP 30.10.2006 08:36

//ENG
PLZ help me, what the need packet for stopsay(BanChat) player???

//RUS
Какой пакет нужен чтобы банить чат у игрока ???

hel 30.10.2006 08:57

PunishCharPacket

AHTUKULLEP 30.10.2006 11:15

tnx
:)
//RUS
Большое спасибо!

Stinker 30.10.2006 12:25

help whis pakets to set_noobless and set_hero

#106 SetNoblessPacket("ddS")
#107 SetHeroPacket("ddS")
not work

AHTUKULLEP 30.10.2006 13:24

Deleted ^)

Kenster 30.10.2006 20:16

Half of the funcions you say you use you dont even put up here. Thats why it doesn't work I guess. l2_cached_push ect. Please include these funcions.

Code:


function additem($p0) {
    $fp = fsockopen("XXXXX", "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", 1); //item_type
$buf .= pack("i", 1); //item_amount
$buf .= pack("i", 0); //enchant
$buf .= pack("i", 0);
$buf .= pack("i", 0);
$buf .= pack("i", 0);
$buf .= pack("i", 1);
$buf .= tounicode("web1"); // remember to add function
            fwrite($fp, pack("s", (strlen($buf)+2)).$buf);
            $len = unpack("i", 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);
}

This doesnt work.

Namenlos 30.10.2006 20:50

Who can decode what means "ddddS" or ect? I mean NOT integer(4 bytes) or unicode format.
I mean:
Packet 39 - character ban ("ddS") - ddS its CHAR_ID, HOUR_BAN and NAME. What about other packets?

zekillers 30.10.2006 21:08

I also have additem2 working.

djvogans 30.10.2006 21:14

http://img58.imageshack.us/img58/859/afn8.th.jpghttp://img53.imageshack.us/img53/7979/bmi3.th.jpg


credits to russia :)


All times are GMT. The time now is 15:45.