Hmm okay but, I still can't seem to get any where. I was wondering. Why do the username and password Terra/Rocks work without it checking with the server?
EDIT: Oh, is it because it connects to his website or something?
http://eslc.stubedore.com/login.php
EDIT2: In the Login.php provided by iStu it says "mssql_connect" shouldn't it be "mysql_connect"?
EDIT3: It should be mysql because I would not be using mssql
EDIT4: What does this mean?
Code:
$search=array("\\","\0","\n","\r","\x1a","'",'"');
$replace=array("","","","","","","");
return str_replace($search,$replace,$str);
EDIT5: Okay this is what I have for the launcher can you guys check it. Also I wasn't sure how to declare the "tokenfromhttppage" variable (not sure if it's a variable?) I also changed that to GetToken because I thought it was cleaner like that. :)
Code:
Imports ExtrinsicStudioLauncherUtility
Public Class Form1
Dim ES_ErrorHandle As New ESLUErrorHandler
Dim WithEvents ESWebUtil As New ES_WebUtility
Dim ESLoginUtil As New ES_LoginUtility("") //url for the login.php which is on your web server
Dim WithEvents ESRARUtil As New ES_RARUtility
Dim LoginResponse As String = ""
Dim iTotalFiles As Integer = 0
' ---------------- BEGIN LOGIN UTILITY EXAMPLE ----------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
LoginResponse = ESLoginUtil.Login(TextBox2.Text, TextBox3.Text, 1)
If ES_ErrorHandle.Fail Then MsgBox(ES_ErrorHandle.WhyFail)
If LoginResponse <> "OK" Then
MsgBox("ERROR: " & LoginResponse)
Else
MsgBox("Welcome!")
Process.Start("Client.exe", "-osk_server 127.0.0.1 -osk_token " + GetToken() + " -osk_store YourGameStore")
End If
End Sub
' ---------------- END LOGIN UTILITY EXAMPLE ----------------
Private Function GetToken() As String
Throw New NotImplementedException
End Function
End Class
And this is what I have for my Login.php file.
Code:
<?php
$conf['db_host'] = ".\SQLEXPRESS";
$conf['db_user'] = "";
$conf['db_pass'] = "";
$conf['db_name'] = "Account";
$user = sql_clean($_GET['Username']);
$passhash = sql_clean($_GET['Password']);
$con = mysql_connect($conf['db_host'],$conf['db_user'],$conf['db_pass']) or die('Database connect Fail.');
$db = mysql_select_db($conf['db_name'], $con) or die('Database Init Fail.');
$exec = mysql_query("SELECT sUserPW FROM tUser where sUserID = '$user'");
if($exec)
{
if(mysql_num_rows($exec) != 1)
{
die('Account Not Found.');
}
$AccountData = mysql_fetch_assoc($exec);
$PlaintxtPass = $AccountData['sUserPW'];
if (MD5($PlaintxtPass) == $passhash)
{
die('OK');
$token = GenerateRandomToken();
INSERT INTO [tTokens]([nEMID],[sToken])
VALUES ($result[0],$token)
echo $token.
($result = "SELECT [tAccounts].[nEMID], [tAccounts].[sUsername] FROM [tAccounts], [tTokens] WHERE [tAccounts].[nEMID] = [tTokens].[nEMID] and [tTokens].[sToken] = '$token';) == true
"echo '{"token_age":0,"user_id":'.$result[0].',"login":"'.$result[1].'","user_role":"user","blocked":false}';"
}
else
{
die('Wrong Password.');
}
}
else
{
die('Query Failed');
}
mysql_close();
function sql_clean($str)
{
$search=array("\\","\0","\n","\r","\x1a","'",'"');
$replace=array("","","","","","","");
return str_replace($search,$replace,$str);
}
?>