Jump to content
  • 0

How to send packet to Vanganth C6 cacheD


Question

Posted (edited)

Hi All!

Hoping someone with more experience than me can help out 🙂

 

Using vanganth's C6 pack I am trying to change a characters location using the "SetCharacterLocationPacket" packet and sending it to the cacheD server with PHP script. I'm stuck trying to figure out how to properly build the packet/checksum. I did find some helpful posts with samples and I verified that the packet format matches my servers but I'm stuck with this checksum error and having a hard time figuring it out.

 

Error:
 

error. Packet checksum is different. protocol[2], len[31], check[-2]

 

Using the following code to send the packet:


 

# #2 SetCharacterLocationPacket("dddddS")

$cached_op = pack ( "cVVVVV", 2, $char_id, 1, $x, $y, $z );
$cached_op .= ansi2unicode($account);
$ret_string = l2_cached_push(pack("s", strlen($cached_op) + 2) . $cached_op);

function l2_cached_push ( $cached_packet ) {
  $cached_fptr = l2_cached_open();
  if ( !is_resource($cached_fptr) ) {
    return ( "Error connecting to cached: " . $cached_fptr . " [server down??]" );
  }
  fwrite($cached_fptr, $cached_packet);
  $response = fread ($cached_fptr, 2);
  $array_ret_length = unpack("v", $response);
  $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 ];
  }
  return ( $ret_string );
}

function ansi2unicode($ansi_str) {
  return (iconv('CP1252', 'UCS-2LE', $ansi_str).chr(0).chr(0));
}

 

Thanks for taking a look! Hopefully someone has the answer and this post can help others too.

 

Edited by Zugzug
grammar

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock