danhakhavro 42 Posted January 29, 2015 Share Posted January 29, 2015 Hello Mein2dev, I have item shop whit auto login, there work fine in game 34083 but in game 40250 their dont work. I have source with 40250 but dont know what is worng. I think the option auto login is must be enable in source but not sure. If somebody know and can help me please put the fix in the comment. Thanks for attention, Link to comment Share on other sites More sharing options...
danhakhavro 42 Posted January 30, 2015 Author Share Posted January 30, 2015 Bump Link to comment Share on other sites More sharing options...
.Devil. 28 Posted January 30, 2015 Share Posted January 30, 2015 For the auto login in your item-shop you've to receive to your PHP script the player id (pid) as GET request ([...]/ishop?pid=231). Check the received requests with: <?php exit(filter_input(INPUT_SERVER, 'REQUEST_URI')); // /ishop?pid=231[...] ?> and see how your item-shop do the login. 1 Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted January 30, 2015 Premium Share Posted January 30, 2015 snprintf(buf, sizeof(buf), "mall http://%s/ishop?pid=%u&c=%s&sid=%d&sas=%s", g_strWebMallURL.c_str(), ch->GetPlayerID(), country_code, g_server_id, sas); Code in source. This make you link like: http://%s/ishop/?pid=7&c=ro&sid=1&sas=0 1 Link to comment Share on other sites More sharing options...
danhakhavro 42 Posted January 30, 2015 Author Share Posted January 30, 2015 For the auto login in your item-shop you've to receive to your PHP script the player id (pid) as GET request ([...]/ishop?pid=231). Check the received requests with: <?php exit(filter_input(INPUT_SERVER, 'REQUEST_URI')); // /ishop?pid=231[...] ?> and see how your item-shop do the login. <?php session_start(); mysql_connect("localhost", "www", "XXXXXX"); $pid = $_GET['pid']; #$c = $_GET['c']; #$sid = $_GET['sid']; $sas = $_GET['sas']; function logar($sas, $playerID) { $IDCONTA = mysql_query("SELECT * FROM player.player WHERE id = '".$playerID."'"); $accountID2 = mysql_fetch_array($IDCONTA); $accountID = $accountID2['account_id']; if ($sas == md5($playerID . $accountID . "####X")) { $username = mysql_query("SELECT * FROM account.account where id = '".$accountID."'"); $dados = mysql_fetch_array($username); if ($dados['status'] == "N ACTIV") { echo "<center>A conta ainda não está activada.</center>"; Exit; } if ($dados['status'] == "BLOCK") { echo "<center>A conta está bloqueada.</center>"; Exit; } $_SESSION['user_login']=1; #$_SESSION['user_id']=$dados['id']; $_SESSION['user_id']=$dados['id']; $_SESSION['user_name']=$dados['login']; $_SESSION['user_mail']=$dados['email']; $_SESSION['user_coins']=$dados['cash']; $_SESSION['user_delcode']=$dados['social_id']; echo'<meta http-equiv="refresh" content="0; URL=ishop.php"> '; #echo "certo"; exit; } else { #return false; echo "<center>Error</center>"; } } logar($sas, $pid); #if(logar($sas, $pid) == true) { #} ?> snprintf(buf, sizeof(buf), "mall http://%s/ishop?pid=%u&c=%s&sid=%d&sas=%s", g_strWebMallURL.c_str(), ch->GetPlayerID(), country_code, g_server_id, sas); Code in source. This make you link like: http://%s/ishop/?pid=7&c=ro&sid=1&sas=0 In my source i have like that: snprintf(buf, sizeof(buf), "mall http://%s/ishop?pid=%u&c=%s&sid=%d&sas=%s", g_strWebMallURL.c_str(), ch->GetPlayerID(), country_code, g_server_id, sas); ch->ChatPacket(CHAT_TYPE_COMMAND, buf); } } My link is for example, www.metin2dev.org/ishop2 how i must put it there? Link to comment Share on other sites More sharing options...
.Devil. 28 Posted January 30, 2015 Share Posted January 30, 2015 It's ok, but if in the 34083 you've changed the sas_key the problem is that. In the source the sas_key is for default (if I don't wrong) GF9001. So, you've to edit this: if ($sas == md5($playerID . $accountID . "####X")) in if ($sas == md5($playerID . $accountID . "GF9001")) or change it in source. 1 Link to comment Share on other sites More sharing options...
danhakhavro 42 Posted January 30, 2015 Author Share Posted January 30, 2015 It's ok, but if in the 34083 you've changed the sas key the problem is that. In the source the sas key is for default (if I don't wrong) GF9001. So, you've to edit this: if ($sas == md5($playerID . $accountID . "####X")) to: if ($sas == md5($playerID . $accountID . "GF9001")) or change it in source. Yes, i put ### because it is password xD But yes i change it in source, when i open item shop in game they say: "Error". #return false; echo "<center>Error</center>"; In 34083 i put diff, now i dont have it and dont know if diff change only the "GF9001" or any else. Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted January 30, 2015 Premium Share Posted January 30, 2015 in config put in mall_url only http://metin2dev.org/you gamecore will edit like : http://metin2dev.org/ishop/?pid=7&c=ro&sid=1&sas=0 2 Link to comment Share on other sites More sharing options...
Solution .Devil. 28 Posted January 30, 2015 Solution Share Posted January 30, 2015 This because there is a mistake with sas, if you want I help you in private. 1 Link to comment Share on other sites More sharing options...
danhakhavro 42 Posted January 30, 2015 Author Share Posted January 30, 2015 Thanks for everybody ho want help me and special tanks to .Devil they solved my problem in private. Link to comment Share on other sites More sharing options...
koxesaurio 0 Posted March 26, 2015 Share Posted March 26, 2015 (edited) I don't know why the md5 string is different. I'm using vanilla 2.4.2 This is the php script: echo var_dump($_GET); echo "<br>"; echo md5($_GET["pid"].'1849'."GF9001"); // pid, account_id, crap help pliss >.< Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
birender 2 Posted April 2, 2015 Share Posted April 2, 2015 Can anyone post ready to use full php script of this autologin Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted April 2, 2015 Active Member Share Posted April 2, 2015 $password = md5($PID."2"."GF9001"); $PID -> player ID 2 -> account ID 1 Link to comment Share on other sites More sharing options...
birender 2 Posted April 3, 2015 Share Posted April 3, 2015 $password = md5($PID."2"."GF9001"); $PID -> player ID 2 -> account ID As I am not a PHP programmer I am finding difficult to inegrate this.Can u make a "php file" of this script so its possible to integrate with any website. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now