Jump to content

Problem whit auto login Item shop


Go to solution Solved by .Devil.,

Recommended Posts

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

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&atilde;o est&aacute; activada.</center>"; Exit; }
if ($dados['status'] == "BLOCK") { echo "<center>A conta est&aacute; 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

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

  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.