Ir para conteúdo

Website Bug Quando Cria 2 Char Na Acc!


hedo

Posts Recomendados

Seguinte, quando eu crio 2 players na mesma conta buga.. Quando você tenta entrar aparece que sua senha esta errada...

Fui ver na conta e o Site salvou o novo player assim:

 

<?xml version="1.0"?>

<character name="daeaseas" />

<account pass="159789" type="1" premDays="0" lastsaveday="150"><characters><character name="dasease"/></characters></account>

=/

 

O script do Site para salvar a acc (Savanewchar) esta assim:

 

 

<?

if(empty($HTTP_COOKIE_VARS["sessao3"])) {

$file = fopen("countp.txt","r+");

$contador = fread($file, filesize("countp.txt"));

fclose($file);

$contador +=1;

$file = fopen("countp.txt","w+");

fputs($file, $contador);

fclose($file);

setcookie("sessao",$contador);

}else{

$file = fopen("countp.txt","r+");

$contador = fread($file, filesize("countp.txt"));

fclose($file);

}

?>

<?

session_start();

 

include("config.php");

 

$errors = 0;

 

$acc = "";

$pass = "";

$acc = $_SESSION['account'];

$pass = $_SESSION['password'];

 

if ($acc != "" && $acc != null && $pass != "" && $pass != null) {

 

$namein = "";

$vocin = "";

$sexin = "";

 

$namein = $_POST['name'];

$vocin = $_POST['voc'];

$sexin = $_POST['sex'];

 

if ($namein != "" && $vocin != "" && $sexin != "" && !file_exists($folderplayer . $namein . ".xml")) {

 

$temp = strspn("$namein", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCV BNM -");

 

if ($temp != strlen($namein)) {

header("Location: create_character.php?result=char_failed&error=malf ormed_name");

$errors++;

}

if (strlen($namein) < 2 || strlen($namein) > 20) {

header("Location: create_character.php?result=char_failed&error=wron g_length");

$errors++;

}

 

if ($errors == 0) {

$file = $folderaccount . $acc . ".xml";

 

if (file_exists($file)) {

$contents = file("$file");

$shallbreak = false;

$row;

for($i = 0; $contents[$i];$i++) {

$endchar = strstr($contents[$i], "</characters>");

if($endchar) {

$row = $i;

}

}

 

if(isset($row) && $row != "" && $row != null) {

$f = fopen("$file","w");

for($i = 0; ($contents[$i] || $contents[$i-1]);$i++) {

if ($i<$row)

fwrite($f, "$contents[$i]");

if ($i==$row)

fwrite($f, "<character name=\"$namein\" />

");

if ($i>$row)

fwrite($f, $contents[$i-1]);

 

}

fclose($f);

include("makeplayerxml/" . $vocin . ".php");

$playerfile = $folderplayer . $namein . ".xml";

$f2 = fopen("$playerfile","w");

fwrite($f2, $output);

 

} else {

header("Location: account_home.php");

$errors++;

}

 

if(file_exists($folderplayer."players.xml")) {

$xml = simplexml_load_string(file_get_contents($folderpla yer."players.xml"));

foreach($xml->player as $player) {

$guid = $player['guid'];

}

$guid = $guid + 1;

$fgc = file_get_contents($folderplayer."players.xml");

$file = str_replace('</players>', ' <player guid="'.$guid.'" name="'.$namein.'"/>

</players>', $fgc);

$fp = fopen($folderplayer."players.xml", "w");

fwrite($fp, $file);

fclose($fp);

} else {

$fp = fopen($folderplayer."players.xml", "w");

fwrite($fp, '<players>

<player guid="1" name="'.$namein.'"/>

</players>');

fclose($fp);

}

 

} else {

header("Location: account_home.php");

$errors++;

}

}

 

}

} else {

header("Location: create_character.php?result=char_failed&error=exis ts");

$errors++;

}

if($errors == 0) {

header("Location: account_home.php");

}

?>

 

Se puder ajudem por favor (: Agradeço desde Ja!

Editado por hedo
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...