View Single Post
Old 22.11.2005, 21:58   #1
montejo1974
Архивный участник
 
Join Date: Aug 2005
Posts: 42
Default [SHARE] One way to get /escape

On the server you can introduce /escape command. It allows one to escape when trapped in terrain.

Well....maybe implementing this on the exe would be better, but htat's the way I get a solution. The user send a petition via web with the email, account name and char name. After we check that all information is correct.....BLIM!

I tried some random delta position and these are the best I got. If someone think about better delta...please tell me....maybe we'll discuss hehe.

As always....much people may think this is a piece of crap...but it solves my problem

Code:
<?php
function make_seed()
{
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
	$ip = "localhost";
	$port = "2009";
	$conn = mssql_connect ("127.0.0.1", "xxx", "yyy"); 
	$db  = mssql_select_db ("lin2db");
	$account=$_GET['account'];
	$char=$_GET['char'];
	$email=$_GET['email'];

  $sql = "select email from ssn where name='".$account."'";
  $result = mssql_query ($sql, $conn);
 	if (mssql_result($result, 0,0)!=$email)
  {
  	mail("<".$email.">", "Solicitud de desatrancar personaje de ##-Lineage2", "¡¡¡ATENCION!!! La Cuenta ".$account." no esta asociada al email ".$email, "From: Staff ##-Lineage2<".$dirmail.">\r\nReply-To: .$dirmail.\r\nReturn-Path: .$dirmail.\r\nErrors-To: .$dirmail.");
  }
	else
	{
		$db  = mssql_select_db ("lin2world");
	  $sql = "select account_name, xloc, yloc, zloc from user_data where char_name='".$char."'";
  	$result = mssql_query ($sql, $conn);
  	if (mssql_result($result, 0,0)!=$account)
  	{
	  	mail("<".$email.">", "Solicitud de desatrancar personaje de ##-Lineage2", "¡¡¡ATENCION!!! El personaje ".$char." no pertenece a la cuenta ".$account, "From: Staff ##-Lineage2<".$dirmail.">\r\nReply-To: .$dirmail.\r\nReturn-Path: .$dirmail.\r\nErrors-To: .$dirmail.");	
	  }
		else
  	{
			srand(make_seed());
  		$xloc=mssql_result($result, 0,1)+rand(0,500)-250;
  		$yloc=mssql_result($result, 0,2)+rand(0,500)-250;
  		$zloc=mssql_result($result, 0,3)+rand(0,250);
			$com="2;".$char.";1;".$xloc.";".$yloc.";".$zloc;
			sleep(120);
			$fp = fsockopen($ip, $port, $errno, $errstr);
			if ($fp)
			{
				$out = str_replace(";", "\t", $com)."\r\n";
				fwrite($fp, $out);
				stream_set_timeout($fp, 2);
				$answ = fgets($fp, 8);
				}
				fclose($fp);
			}  	
		}
	}
?>
montejo1974 is offline