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)

Majesty 31.10.2006 05:17

Quote:

Originally Posted by djvogans (Post 71058)

I'm also started rewriting this :) My posts - functions for l2z.

Kenjiro 31.10.2006 10:30

Quote:

Originally Posted by Kenster (Post 71049)
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:

...cut code...
This doesnt work.

Code:

$cached_ip = "127.0.0.1";
$cached_port = 2012;

function ansi2unicode ( $ansi_str ) {
  $unicode_str = "";
  for ( $i = 0; $i < strlen ( $ansi_str ); $i++ )
    $unicode_str .= $ansi_str [ $i ] . chr ( 0 );
  return ( $unicode_str . chr ( 0 ) . chr ( 0 ) );
}

function l2_cached_push ( $cached_packet ) {
  // print ( "Unicode: " . wordwrap ( bin2hex ( $cached_packet ), 80, "<br />", 1 ) . "<br />" );
  $cached_fptr = @fsockopen ( $GLOBALS [ "cached_ip" ], $GLOBALS [ "cached_port" ], $errno, $errstr, 5 ) or die ( "Error connecting to cached: $errstr [server down??]\n" );
  fwrite ( $cached_fptr,  $cached_packet );
  $array_ret_length = unpack ( "v", fread ( $cached_fptr, 2 ) );
  $ret_id = unpack ( "c", fread ( $cached_fptr, 1 ) );
  $ret_string = "";
  for ( $i = 0; $i < ( ( $array_ret_length [ 1 ] - 4 ) / 4 ); $i++ ) {
    $array_read = unpack ( "i", fread ( $cached_fptr, 4 ) );
    $ret_string .= $array_read [ 1 ];
  }
  fclose ( $cached_fptr );
  return ( $ret_string );
}

It works.

P.S. L2Z... looks nice... o.O

luisfn 31.10.2006 20:07

And for a Permanent BAN? Only a very large value for "$hour" or a specific value?

Thanks

Nevyn 01.11.2006 00:02

m00
 
Quote:

Originally Posted by Kenster (Post 71052)
Yeah and I have full C5 with a gold bar and unlimited hershy kisses. anyone can make up bull shit without any proof.

Kenster, You can try http://deo-lan.se/cachedscript.rar if you did not succeed with your code yet.
In general it contains a php script allthough its adepted to be executed from a php shellscript.

You can check the php script if you expect malware, aswell as get your own php.exe and php.ini and php5s.dll if you dont trust them.

In general you only need to press the exec.bat

And it will ask you what charid you want to target (I guess you know how to look up charids ;P)
After that it will ask what itemid (Try 600 since thats avadon boots)
After that it will ask for amount.

If it returns a 1x. It should "most" likly have worked.

Hopefully it will work for ya :P

lordchaos 01.11.2006 14:20

Quote:

Originally Posted by Nevyn (Post 71179)
Kenster, You can try http://deo-lan.se/cachedscript.rar if you did not succeed with your code yet.
In general it contains a php script allthough its adepted to be executed from a php shellscript.

You can check the php script if you expect malware, aswell as get your own php.exe and php.ini and php5s.dll if you dont trust them.

In general you only need to press the exec.bat

And it will ask you what charid you want to target (I guess you know how to look up charids ;P)
After that it will ask what itemid (Try 600 since thats avadon boots)
After that it will ask for amount.

If it returns a 1x. It should "most" likly have worked.

Hopefully it will work for ya :P

Looks familiar to me ;)

Nevyn 02.11.2006 10:10

Quote:

Originally Posted by lordchaos (Post 71229)
Looks familiar to me ;)

How strange :P

Ollisso 03.11.2006 09:19

Can anybody help me in this situation:

I want to give SubJob's to players.
like he had subjob's 10 15 -1 -1 (just example)
and after that he will get:
20 15 -1 -1 (also, only example)

If I use: ChangeSubJobPacket it only changes current profession. (like from subjob #1 to #2 )
If I modify subjobs via database - cache does not reload data from db next time players login. (only if I restart server).

Any idea how to chage it ? :)

May be there is some sort of "delete character from cache" packet ?

hel 03.11.2006 09:22

Share ChangeSubJobPacket structure...

barabashka 03.11.2006 12:34

Hel, i give it to you yesterday. Take it again: #89 ChangeSubJob("ddS; ID char; Subjob ID ;") , where Subjob ID from 0 to 3

Also some other functions:

#15 ModCharPacket("dddddddS; ID char; Set SP; Set EXP; Set Karma; Set PK; Set PK pardon; Set Duel; ;")

#16 ModCharPacket2("dddddddS;ID char;gender;rase;class;face;hair_shape;hair_color; ;")

#29 ModCharPacket3("dddddddS; ID char ; Add SP; Add Exp; Add Karma; Add PK; Add PK pardon; Add duel; ;")

2hel: вчера был занят сильно, неуспел записать все пакеты в таком формате. постучи мне в асю завтра.

barabashka 03.11.2006 12:39

For add subjob to player need to use #96 AddSubjobsPacket("dSd"; ID char; String; id"), but for this moment i don't know what means String and last parameter.

hel 03.11.2006 13:02

Thanks. :)

Ollisso 05.11.2006 18:50

hel
My structure is same as of barabashka:
#89 ChangeSubJob($char_id,$sub_job_id)
but it only changes active subjob :(

barabashka
Have you found anything about AddSubjobsPacket ?

PS: Is there any "reload information about char packet" ?

Kenjiro 07.11.2006 23:00

Has someone know about PledgeDeletePacket, how it works? I use this:
Code:

function l2_pledgedelete ( $pledge_id ) {
  // 38 - PledgeDelete, pledge_id
  $cached_op = pack ( "cV", 38, $pledge_id );
  $cached_op .= ansi2unicode ( "webadmin" );
  $ret_string = l2_cached_push ( pack ( "s", strlen ( $cached_op ) + 2 ) . $cached_op );
  return ( $ret_string );
}

Command correctly return "1", but some 'test' clan has not been deleted, and i don't know where is the problem. Disband in-game command works ok.

djtincho 08.11.2006 20:12

add subjob
 
any news about addsubjobpacket?
it suposted to be something like addsubjobpacket($charid, $packetnumber, $class) but it doesn´t work :(

Ollisso 18.11.2006 00:44

I tried to use this one:
#96 AddSubjobsPacket("dSd")
with list of parametres:
$char_id,$new_class,$f['hp'],$f['mp'],$f['sp'],$f['exp'],$f['level'],$subjob_id, $f['henna_1'],$f['henna_2'],$f['henna_3']

but no success :(

khelben 16.03.2007 14:57

How about the StopChar packet? Anyone know the variables for this one? I would imagine one is the character ID, and the other?

Nevermind it's 90;<charid>;<min to freeze>

Character must be offline

Drag 16.03.2007 20:35

Quote:

Originally Posted by Ollisso (Post 72612)
I tried to use this one:
#96 AddSubjobsPacket("dSd")
with list of parametres:
$char_id,$new_class,$f['hp'],$f['mp'],$f['sp'],$f['exp'],$f['level'],$subjob_id, $f['henna_1'],$f['henna_2'],$f['henna_3']

but no success :(

Ollisso as You see on description... u need data such int,string,int... 3 vars... how many did u listed? xD sry for eng - tired...

Stazis 18.03.2007 17:13

does anyone have ChangePledgeOwner packet works?

FidoW 18.03.2007 17:24

Quote:

Originally Posted by Stazis (Post 81631)
does anyone have ChangePledgeOwner packet works?

I try everything... and cant get it working... i have most of the packets working but that or give error or give 01 but nothing happen... I try with pledge owner online.. offline.. new leader offline.. online... all combinations has been tested unsuscesfully.

Charis 05.04.2007 16:59

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


khelben 06.04.2007 17:15

Ban

UPDATE user_account SET block_flag = 1,block_flag2 = 1 WHERE account='dumbass'

Unban

UPDATE user_account SET block_flag = 0,block_flag2 = 0 WHERE account='dumbass'

if you really really want to use cacheD commands try your cacheD command for 0 min. That's the only way i can get it to unban other than modifying the sql table.

FidoW 06.04.2007 17:35

That works for me

PHP Code:

#20 DisableCharacterPacket("ddS")
function DisableCharacterPacket($char_id) {
    
$buf = pack("c", 20);
    
$buf .= pack("i", $char_id);
    
$buf .= pack("i", 1);
    return 
CacheDInteractive($buf);
}

#21 EnableCharacterPacket("ddS")
function EnableCharacterPacket($char_id, $account_id) {
    
$buf = pack("c", 21);
    
$buf .= pack("i", $char_id);
    
$buf .= pack("i", $account_id);
    return 
CacheDInteractive($buf);
} 


FidoW 06.04.2007 17:37

My function CacheDInteractive... is better than try to connect to the server in each function...

PHP Code:

function CacheDInteractive($buf) {
    
$fp = fsockopen("127.0.0.1", "2012", $errno, $errstr, 5); 
    
$rs = "x";
    if (!
$fp) die("Error conectando con CacheD: [Server OFF?]");
    
    
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);
} 


SilverCloud 06.04.2007 21:41

These commands are only available when the character is offline right? If so, thats too bad.. I was about to create an auction site (php). Second, is it possible to check if a char is online?

FidoW 06.04.2007 21:58

Quote:

Originally Posted by SilverCloud (Post 83106)
These commands are only available when the character is offline right? If so, thats too bad.. I was about to create an auction site (php). Second, is it possible to check if a char is online?

You can check if player is online with this function...
PHP Code:

#1 CheckCharacterPacket("dS")
function CheckCharacterPacket($char_id) {
    
$buf = pack("c", 1);
    
$buf .= pack("i", $char_id);
    return 
CacheDInteractive($buf);
} 


But always you can kick him first and problem solved.
PHP Code:

#5 KickCharacterPacket("dS")
function KickCharacterPacket($char_id) {
    
$buf = pack("c", 5);
    
$buf .= pack("i", $char_id);
    return 
CacheDInteractive($buf);
} 


scrap512 12.04.2007 19:33

Can't get additem2 to work even. itemdata and cache are both in the cached script folder :-/ any other suggestions?

zabr 23.04.2007 11:56

has anybody make php function to add skill to char?

adriahu 23.04.2007 12:39

Quote:

Originally Posted by zabr (Post 84496)
has anybody make php function to add skill to char?

function fragment :)
PHP Code:

$buf=pack("cVVV",6,$char_id,$skill_id,$skill_level).tounicode("admin");
$cachedsocket=@fsockopen($cached_ip,$cached_port,$errno,$errstr,1) or die("error");
fwrite($cachedsocket,pack("s",(strlen($buf)+2)).$buf);
$len=unpack("v",fread($cachedsocket,2));$rid=unpack("c",fread($cachedsocket,1));
for(
$i=0;$i<(($len[1]-4)/4);$i++){$read=unpack("i",fread($cachedsocket,4));$rs.=$read[1];}
fclose($cachedsocket); 


zabr 24.04.2007 04:34

tnx will try :)

Charis 15.05.2007 09:24

Quote:

Originally Posted by FidoW (Post 83095)
That works for me

PHP Code:

#21 EnableCharacterPacket("ddS")
function EnableCharacterPacket($char_id, $account_id) {
    
$buf = pack("c", 21);
    
$buf .= pack("i", $char_id);
    
$buf .= pack("i", $account_id);
    return 
CacheDInteractive($buf);
} 


Does EnableCharacter works correct for you?
I have the same one, but it places in account_id unsigned -2 (somesing like 65K o_O).

What is wrong????

l2russia 17.06.2007 15:36

ChangePledgeOwnerPacket
37 clan_id char_id unicode(admin)
выдает 1 при подходящих данных, при неверных 024
но абсолютно ничего не происходит.

FidoW 17.06.2007 15:45

Quote:

Originally Posted by l2russia (Post 88881)
ChangePledgeOwnerPacket
37 clan_id char_id unicode(admin)
выдает 1 при подходящих данных, при неверных 024
но абсолютно ничего не происходит.

Estoy de acuerdo (?)

Guaresnay 19.06.2007 22:35

Quote:

Originally Posted by FidoW (Post 88883)
Estoy de acuerdo (?)

claro es la unica forma (?)

xly99168 22.06.2007 21:30

what is format ?
#2 SetCharacterLocationPacket("dddddS")

char_id, location_X, location_Y, Location_Z, ???????, admin

who can help ????

Write sample please...

Kenjiro 23.06.2007 12:19

Try: SetCharacterLocationPacket, char_id, 1, x, y, z, unicode(admin)

P.S. Look in cached 'system' and 'err' logs, it usually shows you what is wrong.

xly99168 28.06.2007 16:52

test success.....

very THX!

xly99168 02.07.2007 00:35

about #50 ManAnnouncePacket("ddSS")????

Why arsy-varsy code after I write chinese on announce? But english is well.....

english 2byte = chinese 1byte

xly99168 10.07.2007 18:36

about ChangePledgeOwnerPacket
37 clan_id char_id unicode(admin) ????

37 to_char_id pledge_id is error....
37 pledge_id to_char_id is error too....

then ..... ?

xly99168 10.07.2007 18:37

cached 'system' and 'err' logs, it not shows me what is wrong.

Kenjiro 23.07.2007 13:00

ChangePledgeOwnerPacket is not working through cached :/


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