Thread socket (6 answers)
Opened by sri at 2004-07-14 15:17

FraggeR
 2004-07-14 14:11
#37266 #37266
User since
2004-07-14
1 Artikel
BenutzerIn
[default_avatar]
Hallihallo, habe hier ein PHP Skript und brauche ein Skript in Perl, dass genau das gleiche bewirkt:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function contactGameserver ($Host, $GameID, $SaltString = "", $Debug = false)
{
$Port = 9003;
$DecryptedPass = "xxx";
$ErrNo = "";
$ErrStr = "";
$TCP = fsockopen ($Host, $Port, &$ErrNo, &$ErrStr, 10); // <-- 30 sek Timeout
if (!$TCP) {
if ($Debug) {
echo "$ErrStr ($ErrNo)<br />\n";
}
return false;
} else {
if ($SaltString != "") {
$EncryptedPass = crypt($DecryptedPass, $SaltString);
} else {
$EncryptedPass = crypt($DecryptedPass);
}
fwrite ($TCP, "$EncryptedPass:$GameID");
$Return = fread($TCP, 34);
list($retval, $dummy) = split(":", $Return, 2);
fclose($TCP);
return $retval;
}
}


hoffe mir kann jemand helfen ....\n\n

<!--EDIT|renee|1089804832-->

View full thread socket