simplement, j'ai récupérer un script php que je n'arrive a faire marcher en aucun cas.
En même temps je n'y connais rien en php: Ce code est un code pour modérer un jeu, il suffit juste d'y ajouter trois petits imputs pour qu'il fonctionne, du moin je pense.
Si quelqu'un veut bien y jeter un œil:
$acc_name = ""; // pseudo
$acc_pass = ""; // mot de pass
$persona = ""; // valeur a supprimer
$end = 0;
$ping = 0;
$namelen = strlen($persona);
$fp = stream_socket_client("tcp://pspmoh07.ea.com:11192", $errno, $errstr);
if(!$fp) {
echo "network error";
} else {
fwrite($fp, "addr\0\0\0\0\0\0\0\x28ADDR=192.168.1.1\nPORT=12345\n");
while($end == 0) {
$input = fgets($fp, 5);
$inchk = fgets($fp, 5);
$nthng = fgets($fp, 4);
$dsize = fgets($fp, 2);
$size = ord($dsize{0}) - 12;
for($tmp = 0; $tmp < $size; $tmp++) {
$nthng = fgets($fp, 2);
}
if($input == "~png" && $ping == 0) {
$ping = 1;
$authstring = "auth\0\0\0\0\0\0\0\x97VERS=PSP/MOH07\nSKU=MOHA\nSLUS=ULUS10141\nSDKVERS=4.7.0.0\nBUILDDATE=\"Jul 25 2006\"\nLANG=en\nMAC=$000101112134\nNAME=\"".$acc_name."\"\nENTL=1\nPASS=\"".$acc_pass."\"\n";
$authstring{11} = chr(140 + strlen($acc_name) + strlen($acc_pass));
fwrite($fp, $authstring);
}
if($input == "auth") {
if($inchk != "\0\0\0\0") {
$end = 2;
echo "failed to login as ".$acc_name;
} else {
$delstring = "dper\0\0\0\0\0\0\0\0PERS=\"".$persona."\""; // 12 + 7 + x
$delstring{11} = chr($namelen + 19);
fwrite($fp, $delstring);
}
}
if($input == "dper") {
$end = 1;
if($inchk != "\0\0\0\0") {
$end = 2;
echo "delete failed: ";
if($inchk == "logn") echo "player is in game now";
else if($inchk == "iper") echo "wrong name";
else "heh, i don't know why";
} else {
echo "'".$persona."' deleted";
}
}
}
fwrite($fp, "DISC\0\0\0\0\0\0\0\x0C");
fclose($fp);
}
Merci d'avance