Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 22.09.2006, 06:20   #51
Kenjiro
Архивный участник
 
Join Date: Apr 2006
Posts: 120
Default

Any lin2error.txt? Or anything in '/err' log?
Kenjiro is offline  
Old 22.09.2006, 13:49   #52
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

-- Deleted --
FidoW is offline  
Old 11.10.2006, 19:15   #53
dinesat4
Архивный участник
 
Join Date: Jul 2005
Posts: 123
Default

Any idea from Telnet?
dinesat4 is offline  
Old 12.10.2006, 10:51   #54
Stazis
Архивный участник
 
Join Date: Feb 2005
Posts: 200
Default

CLog::Add -> CLog::AddV -> Log::AddV - vswprintf_s
hm - it could not make log record into console ...
Stazis is offline  
Old 22.10.2006, 20:17   #55
Ollisso
Архивный участник
 
Join Date: Oct 2006
Posts: 8
Default

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
Ollisso is offline  
Old 25.10.2006, 22:23   #56
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default

$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 =)
Namenlos is offline  
Old 25.10.2006, 22:36   #57
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

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));
}
m4rk is offline  
Old 26.10.2006, 06:50   #58
Elsir
Архивный участник
 
Join Date: Oct 2006
Posts: 3
Default

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?
Elsir is offline  
Old 26.10.2006, 08:25   #59
Mark20
Архивный участник
 
Join Date: Jan 2006
Posts: 54
Default

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);
}
?>
Mark20 is offline  
Old 27.10.2006, 04:19   #60
sct
Архивный участник
 
Join Date: Nov 2005
Posts: 70
Default

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.
sct is offline  
Old 27.10.2006, 07:09   #61
Kenjiro
Архивный участник
 
Join Date: Apr 2006
Posts: 120
Default

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.
Kenjiro is offline  
Old 27.10.2006, 09:10   #62
Majesty
Архивный участник
 
Join Date: Mar 2006
Posts: 22
Default

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>.";
}
Majesty is offline  
Old 27.10.2006, 14:49   #63
sct
Архивный участник
 
Join Date: Nov 2005
Posts: 70
Default

Quote:
Originally Posted by Kenjiro View Post
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
sct is offline  
Old 27.10.2006, 15:16   #64
Kenster
Архивный участник
 
Join Date: Sep 2005
Posts: 455
Default

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
Kenster is offline  
Old 28.10.2006, 20:56   #65
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default

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);
}
Namenlos is offline  
Old 28.10.2006, 21:49   #66
hel
Архивный участник
 
Join Date: Apr 2006
Posts: 729
Default

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...
hel is offline  
Old 28.10.2006, 22:41   #67
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default

Quote:
Originally Posted by hel View Post
Where is a function calling?
-> echo (ban_char($name, $hour));
after this script. Didn't post it here.

Quote:
Originally Posted by hel View Post
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 is offline  
Old 29.10.2006, 02:03   #68
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default

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);
}
Namenlos is offline  
Old 30.10.2006, 04:34   #69
Kenster
Архивный участник
 
Join Date: Sep 2005
Posts: 455
Default

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.
Kenster is offline  
Old 30.10.2006, 04:42   #70
Majesty
Архивный участник
 
Join Date: Mar 2006
Posts: 22
Default

Quote:
Originally Posted by Kenster View Post
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>.";
}
Majesty is offline  
Old 30.10.2006, 08:05   #71
Kenjiro
Архивный участник
 
Join Date: Apr 2006
Posts: 120
Default

Quote:
Originally Posted by Kenster View Post
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 );
} 
Kenjiro is offline  
Old 30.10.2006, 08:36   #72
AHTUKULLEP
Архивный участник
 
Join Date: Feb 2006
Posts: 57
Default

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

//RUS
Какой пакет нужен чтобы банить чат у игрока ???
AHTUKULLEP is offline  
Old 30.10.2006, 08:57   #73
hel
Архивный участник
 
Join Date: Apr 2006
Posts: 729
Default

PunishCharPacket
hel is offline  
Old 30.10.2006, 11:15   #74
AHTUKULLEP
Архивный участник
 
Join Date: Feb 2006
Posts: 57
Default

tnx

//RUS
Большое спасибо!
AHTUKULLEP is offline  
Old 30.10.2006, 12:25   #75
Stinker
Архивный участник
 
Join Date: May 2006
Posts: 43
Default

help whis pakets to set_noobless and set_hero

#106 SetNoblessPacket("ddS")
#107 SetHeroPacket("ddS")
not work
Stinker is offline  
 


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:42.