Re: Launcher UPDATES Section
38 views no replies? D: Is everyone clue less or is it that you don't want to help me. :(
I was expecting some of the more active people to reply within the first hour of this post lol. I've been let down greatly. :/
Re: Launcher UPDATES Section
Write it in html, add a design and put it on your webhost then add a WebBrowser control to your form and make it connect to the URL where the html document is located. That's one way to do it. I think there's a WebBrowser control in Stu's Launcher Creator.
Re: Launcher UPDATES Section
Tried that. It kinda worked I guess. But I don't know I guess I was missing something. It just didn't look right? I guess I will have to look more deeply into that solution since it seems to work.
Re: Launcher UPDATES Section
I hope you know, the Launcher Creator doesn't support the new Odin files, just sayin.
But it looks good~
Re: Launcher UPDATES Section
Yeah I just realised. Ah that sucks. D:
I tried learning on my own how to use and make the new launcher for the new odin files like I did with this Launcher Creator (Rather Simple. Anyone could get it really) but I had no luck. :(
Tried searching for guides, tutorials and I only found a couple of hints by myself and someone also posted something here:
Quote:
Originally Posted by
NextIdea
Your getting it a bit wrong!
Launcher isn't going to generate the tokens, the Web server is going to.
Launcher asks, for User/Pass and sends it to Web server, which then validates it and generates the token and then saves it to DB, after that it sends token back to the launcher and it starts the Client with it.
When Client is started up it connects to the Login server which validates the token by asking the Web server (REST Server acts like it as default) and when its valid/notExpired it sends correct response back.
Still no luck though. I have no experience in Visual Basics. That kind of sucks. I would like to learn via a tutorial or something or on my own through trial and error but I can't since I am not running the server myself and I just want to make the launcher for the future if I ever do start a server.
So yeah any tips or hints or guides would definately be appreciated. I've tried many things. I first managed to find out that you have to enter the sql data into the Login.php and the Login.asp. I then continued to make a small login panel for the username and pass (just edited the example) and in the coding after the welcome message I did a bit of research and tried to make it open the client if it was correct (that failed). Did a bit more digging around the in examples coding but found nothing. So yeah if anyone can help me learn that would be awesome! :)
Re: Launcher UPDATES Section
There is enough info to get all the data needed to get it to run. Just some things have to be found out with some different methods.
Quote:
Originally Posted by NextIdea
Your getting it a bit wrong!
Launcher isn't going to generate the tokens, the Web server is going to.
Launcher asks, for User/Pass and sends it to Web server, which then validates it and generates the token and then saves it to DB, after that it sends token back to the launcher and it starts the Client with it.
When Client is started up it connects to the Login server which validates the token by asking the Web server (REST Server acts like it as default) and when its valid/notExpired it sends correct response back.
LPL - Launcher programming language. (VB, C, C++, C#, ...)
WSL - Web Server Language. (PHP, ASP, ...) |
|
| 1. Enter Username/Password to Launcher. |
Launcher asks, for User/Pass ... |
2. Send them to your web server: [LPL -> WSL]
"http://localhost/GetToken.php?username="+username+"&password="+password |
... and sends it to Web server, ... |
3. Web Server checks are they valid? [WSL]
($result = "SELECT [nEMID], [sUserpass] FROM [tAccounts]
WHERE [sUsername] = $username" ) == $password |
... which then validates it ... |
4. Generate a token: [WSL]
"$token = GenerateRandomToken();" |
... and generates the token ... |
5. Save it to Database: [WSL]
"INSERT INTO [tTokens]([nEMID],[sToken])
VALUES ($result[0],$token)" |
... then saves it to DB, ... |
6. Return it Launcher: [WSL -> LPL]
"echo $token." |
... after that it sends token back to the launcher ... |
7. And start the Client with correct parameters: [LPL]
Process.Start("Client.exe", "-osk_server 127.0.0.1 -osk_token "+tokenfromhttppage+" -osk_store YourGameStore") |
... and it starts the Client with it. |
| 8. Wait for Client Load. |
|
| 9. Client sends data to LoginService. |
When Client is started up it connects to the Login server ... |
10. LoginService sends data to Web Server: [C++ -> WSL]
"http://stubedore.t/user/v1/getInfo?realm=fiesta&token="+tokenfromlauncher+"&sig=LongHexString" Remap "stubedore.t" in hosts file. |
... which validates the token by asking the Web server (REST Server acts like it as default) ... |
11. Web Server validates token: [WSL]
($result = "SELECT [tAccounts].[nEMID], [tAccounts].[sUsername] FROM [tAccounts], [tTokens] WHERE [tAccounts].[nEMID] = [tTokens].[nEMID] and [tTokens].[sToken] = '$token';) == true |
... which validates the token by asking the Web server (REST Server acts like it as default) ... |
12. And sends result back: [WSL -> C++]
"echo '{"token_age":0,"user_id":'.$result[0].',"login":"'.$result[1].'","user_role":"user","blocked":false}';" |
... and when its valid/notExpired it sends correct response back. |
| 13. LoginService does whats necessary to get Client in game. |
|
If you don't know how to do specific step, Google it, as it is differs depending on the programming language.
Re: Launcher UPDATES Section
Quote:
Originally Posted by
NextIdea
There is enough info to get all the data needed to get it to run. Just some things have to be found out with some different methods.
LPL - Launcher programming language. (VB, C, C++, C#, ...)
WSL - Web Server Language. (PHP, ASP, ...) |
|
| 1. Enter Username/Password to Launcher. |
Launcher asks, for User/Pass ... |
2. Send them to your web server: [LPL -> WSL]
"http://localhost/GetToken.php?username="+username+"&password="+password |
... and sends it to Web server, ... |
3. Web Server checks are they valid? [WSL]
($result = "SELECT [nEMID], [sUserpass] FROM [tAccounts]
WHERE [sUsername] = $username" ) == $password |
... which then validates it ... |
4. Generate a token: [WSL]
"$token = GenerateRandomToken();" |
... and generates the token ... |
5. Save it to Database: [WSL]
"INSERT INTO [tTokens]([nEMID],[sToken])
VALUES ($result[0],$token)" |
... then saves it to DB, ... |
6. Return it Launcher: [WSL -> LPL]
"echo $token." |
... after that it sends token back to the launcher ... |
7. And start the Client with correct parameters: [LPL]
Process.Start("Client.exe", "-osk_server 127.0.0.1 -osk_token "+tokenfromhttppage+" -osk_store YourGameStore") |
... and it starts the Client with it. |
| 8. Wait for Client Load. |
|
| 9. Client sends data to LoginService. |
When Client is started up it connects to the Login server ... |
10. LoginService sends data to Web Server: [C++ -> WSL]
"http://stubedore.t/user/v1/getInfo?realm=fiesta&token="+tokenfromlauncher+"&sig=LongHexString" Remap "stubedore.t" in hosts file. |
... which validates the token by asking the Web server (REST Server acts like it as default) ... |
11. Web Server validates token: [WSL]
($result = "SELECT [tAccounts].[nEMID], [tAccounts].[sUsername] FROM [tAccounts], [tTokens] WHERE [tAccounts].[nEMID] = [tTokens].[nEMID] and [tTokens].[sToken] = '$token';) == true |
... which validates the token by asking the Web server (REST Server acts like it as default) ... |
12. And sends result back: [WSL -> C++]
"echo '{"token_age":0,"user_id":'.$result[0].',"login":"'.$result[1].'","user_role":"user","blocked":false}';" |
... and when its valid/notExpired it sends correct response back. |
| 13. LoginService does whats necessary to get Client in game. |
|
If you don't know how to do specific step, Google it, as it is differs depending on the programming language.
This brings back memorys from 2 years ago, haha
Re: Launcher UPDATES Section
^^ Wow everything is pretty much there! Thank you very much. I will see where I can get with this although it will be a struggle since I don't know php coding or visual basics but this will definitely help! Pretty much done it for me really. Just got to add it in now.
EDIT: Does the php script that Stu has provided in his utility have all the webserver part coded when I checked it and looked at what you've written nextidea it seemed like it was missing stuff like generating the random token and from there onwards.
Re: Launcher UPDATES Section
Quote:
Originally Posted by
Dragonluck4
^^ Wow everything is pretty much there! Thank you very much. I will see where I can get with this although it will be a struggle since I don't know php coding or visual basics but this will definitely help! Pretty much done it for me really. Just got to add it in now.
EDIT: Does the php script that Stu has provided in his utility have all the webserver part coded when I checked it and looked at what you've written nextidea it seemed like it was missing stuff like generating the random token and from there onwards.
probably since I think nothing was changed when it was released.
Re: Launcher UPDATES Section
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);
}
?>
Re: Launcher UPDATES Section
@Dragonluck4 EDIT 0,1:
If they use old version of the files then they don't have the token system and the username/password are passed directly to client which then checks them.
@Dragonluck4 EDIT 2,3:
Why you want to use MySQL rather than MSSQL, your Database is MSSQL why you want to use 2 different Databases?
@Dragonluck4 EDIT 4:
It replaces in $str, each substring found from $search array, with corresponding element from $replace.
@Dragonluck4 EDIT 5:
It was very rough code, you can't directly copy most of the things from there, it just gives the basic idea and some basic code needed. (Do you need more explaining, why? I hope not.)
Variable names are meant to be as close as to the data they hold, you can always change them as necessary.
@CODE:
VB: I'm not very good in VB, but the basic idea seems to be correct, except that when you login, server returns the token there, you don't ask it later with the "GetToken()". In your code the LoginResponse variable should get the token.
PHP: The code after "die('OK');" needs to be recoded. Read comment on "EDIT 5" again.
Re: Launcher UPDATES Section
Okay I think I got the launcher pretty much spot on unless there is a problem after I fix this problem, but for the life of me I can't figure out why I am getting this error on the login.php
Fatal error: Call to undefined function mssql_connect() in ..... line 11
I understand that it is an undefined function and that you need to define it but I thought it would be fine if the Login.php is placed on the webserver and then changing the
ES_LoginUtility("http://127.0.0.1/Login.php")
to your webserver where the Login.php is.
Did I place the Login.php file in the wrong place or is the php file code un-complete?
Thanks for all your help NextIdea and everyone else. I intend to put what I learn back into the community. :)
Re: Launcher UPDATES Section
Code:
Fatal error: Call to undefined function mssql_connect()
Nothing wrong with the script, your server doesn't have mssql_() installed. Bring it up with your host / install the module in PHP.
Re: Launcher UPDATES Section
Ah okay! That explained why it worked with mysql but gave me a different error lol. Thanks. Something so simple yet so hard. :|