Jump to content
  • 0

telnet socket error


BBanHammer

Question

hello!

 

i am trying to give item via l2j telnet.. the problem is that sometime it works, but other times it doesnt (allways same command)

 

i never actually worked with l2j before so i really don't see where the problem is, if some1 does, please tell me

 

function giveItem($player) {

global $CONFIG;
$usetelnet = fsockopen($CONFIG['telnet_ip'],$CONFIG['telnet_port'], $errno, $errstr, 30);

if($usetelnet) {

	$command = 'give '.$player.' '.$CONFIG['reward_item_id'].' '.$CONFIG['reward_item_count'];
	echo "<".$command."><br />";
	fputs($usetelnet, $CONFIG['telnet_pass']);
	fputs($usetelnet, "\r\n");
	fputs($usetelnet, $command);
	fputs($usetelnet, "\r\n");
	fputs($usetelnet, "exit\r\n");

	fclose($usetelnet);
	return true;
}
return false;

}

 

the code gives sometime SocketException.. from what i have read it's caused by misformed command line, anyone?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...