PDA

View Full Version : [SHARE] One way to get /escape


montejo1974
22.11.2005, 21:58
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 ;)

<?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);
}
}
}
?>

Metalmurphy
22.11.2005, 23:35
Hum how about making a skill like return with a use delay of 5mins like off? :p

montejo1974
23.11.2005, 08:35
I heard of it, and prove it. But the skill solution only have one problem...lineage players usually are very clever. Players with return overuse the skill for other purposes different to "get escaped", and i want my server continue selling scrolls of escape ;) at the shops

iamrend
23.11.2005, 09:57
Hum how about making a skill like return with a use delay of 5mins like off? :p
Yes, is better i think :P

Metalmurphy
23.11.2005, 13:04
With a skill that takes 5 mins to use (thats the time it takes in retail with /unstuck too) ppl will still use scrolls of escape :p

top-gear
23.11.2005, 13:11
I have made the skill return with less than 5 mins escape time, but they use it rarely.

top-gear
23.11.2005, 13:12
btw,have you found any petition server that actually works?:)

PiTaGoRaS
23.11.2005, 15:34
Did you ever hear about SQL injection? You should make at least some basic checks on $char, $account and $email vars to avoid BIG security problems :)

montejo1974
23.11.2005, 16:02
Hehe, well....then we'll discuss it.

When a player is on Anthara's Lair, and get trapped, you let him use the skill and.....voila....he/she is at Giran.....wow....30 minutes later he/she is again at Lair, and oohhhh shit get trapped again....grgrgrg heheheh :P

With this system, we teleport the player to a very close location.

Pitagoras thx for the advise, but I only put the piece of code that solve the problem....we have other ways to prevent sql injection an other posible attacks to the server. Gracias por tu interés de todas formas, y a ver si nos animamos por estos lares y compartimos más información para mejorar nuestros servers ;), que hay poquitos españoles.