PHP:
$Nickname = "bionicle12"; $itemType = 1; //id: small_sword $Enchant = 0; $L2ATL_socket = new COM("L2ATL.Socket"); $pszOut = ""; $pszMsg ="44\t".$Nickname."\t".$itemType."\t0\t0\t".$Enchant."\t0\t0\t0\t0\troot\n"; $L2ATL_Socket->Send("127.0.0.1:2009", $pszMsg, $pszOut); echo $pszOut; // 1 - OK
Код:
$cachedport = 2009; $cachedip = '127.0.0.1'; $Nickname = "NickName"; $itemType = 1; //id: small_sword $Enchant = 0; $pszMsg ="44\t".$Nickname."\t".$itemType."\t0\t0\t".$Enchant."\t0\t0\t0\t0\troot\n"; $cachedsocket = fsockopen($cachedip, $cachedport , $errno, $errstr, 5); fwrite($cachedsocket,$pszMsg); $read = fread($cachedsocket,1);
if($read != 1) echo "ERROR AddItem"; else echo "OK"; fclose($cachedsocket);