Da ich momentan daran bin eine etwas abgewandelte Version von Raiguard in meinen Client zu implementieren(Nein die Licence vom ersteller will ich nicht entfernen)bin ich auf einen sehr komischen Fehler gestoßen und vielleicht kann einer der Lieben Python götter mir hier helfen.
Kurz zum System:
Wenn man sich einloggt wird eine abfrage an den Server gestellt zwecks des Status des Guards.
0 = Aus
1 = An
Das ganze läuft über eine Php seite ähnlich wie bei raiguard:
PHP Code:
$accountdb_ip = "xxxxxx"; //Accountserver-IP
$accountdb_login = "xxxxx"; //Accountserver-Loginname
$accountdb_pw = "xxxxxxxx"; //Accountserver-Passwort
$db_ip = "xxxxxxxx"; //DB-Server-IP
$db_login = "xxxxxx"; //DB-Server-Loginname
$db_pw = "xxxxxxx"; //DB-Server-Passwort
$con = mysql_connect($db_ip, $db_login, $db_pw);
$con_account = mysql_connect($accountdb_ip, $accountdb_login, $accountdb_pw);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$pcid = mysql_real_escape_string($_GET["pcid"], $con);
$login = mysql_real_escape_string($_GET["login"], $con);
if($login != "" ){
$result_id = mysql_query("SELECT * FROM account.account WHERE login='".$login."' LIMIT 1", $con);
$player_acc_id = mysql_result($result_id, 0, "id");
$result = mysql_query("SELECT * FROM account.account WHERE id='".$player_acc_id."'", $con);
$status = mysql_result($result, 0, "raiguard");
if($status == 0)
{echo "0";}
elseif($status == 1)
{echo "1";}
elseif($status == 2)
{echo "2";}
}
if($pcid != ""){
$result_id = mysql_query("SELECT * FROM account.account WHERE login='".$pcid."' LIMIT 1", $con);
$player_acc_id = mysql_result($result_id, 0, "id");
$result = mysql_query("SELECT * FROM account.account WHERE id='".$player_acc_id."'", $con);
$status = mysql_result($result, 0, "raiaccpin");
echo $status;
}
mysql_close($con);
mysql_close($con_account);
Sie gibt erfolgreich bei ?login=accname oder ?pcid= Den Status 0 oder 1 oder den Pin aus.
nun zum script:
PHP Code:
def __OnClickLoginButton(self):
id = self.idEditLine.GetText()
pwd = self.pwdEditLine.GetText()
logintest = str(id)
#dbg.LogBox(logintest)
protect = urllib2.urlopen(HOMEPAGE + "raiguardstatusig.php?login=" + logintest).read()
dbg.LogBox(protect)
if (protect == "1"):
if len(id)==0:
self.PopupNotifyMessage(localeInfo.LOGIN_INPUT_ID, self.SetIDEditLineFocus)
return
if len(pwd)==0:
self.PopupNotifyMessage(localeInfo.LOGIN_INPUT_PASSWORD, self.SetPasswordEditLineFocus)
return
self.Connect(id, pwd)
else:
dbg.LogBox("Schon wieder fail!")
Der Fehler ist aber obwohl ich es hier mit:
PHP Code:
if (protect == "1"):
PHP Code:
protect=1
PHP Code:
else:
dbg.LogBox("Schon wieder fail!")
PHP Code:
if (protect == "1"):
if (protect == '1'):
if (protect == 1):
if protect == "1"
if protect == '1':
if protect == 1:
Ich nehme an das er aus der Homepage zusätzlich ein leerzeichen/zeile mit nimmt.Jetzt ist meinen frage wie ich es hinbekomme das er hier nicht die If bedingung überspringt sprich das protect = clientvariable ist.
Danke für eure Hilfe im Vorfeld
Mfg Fabejan
PS:Rechtschreibfehler bitte schenken(außer sie sind im code);D






