Callback not called by mysql_tquery
#3

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Hi.

I'm currently working on my registering system.
I do a query to save the player data into the database and then showing him up a dialog to input his mail, but the dialog doesn't show up.

So I tried to my code and the "printf" which are into the callback (OnPlayerRegister) doesn't display.

Here's my code

PHP код:

// under OnDialogResponse
case DIALOG_REGISTER:
        {
            if(!
response)
            {
                
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD"Inscription""Vous devez avoir un compte crйй pour jouer. Entrez le mot de passe voulu dans le champ ci-dessous.""Ok""Retour");
                return 
1;
            }
            if(
strlen(inputtext) <= 3)
            {
                
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD"Inscription""Le mot de passe entrй est trop court ! Il doit faire au minimum 4 caractиres.""Ok""Retour");
                return 
1;
            }
            new 
salt[9], strc[80], ip[17], date[6];
            
printf("Begin : register");
            
random_string(8salt);
            
printf("Random salt created : %s"salt);
            
strcat(strcinputtext);
            
printf("Inputted password inserted into strc : %s"inputtext);
            
strcat(strc".");
            
printf("Dot inserted into strc, strc = %s"strc);
            
strcat(strcsalt);
            
printf("Salt inserted into strc, strc = %s"strc);
            
GetPlayerIP(playeridipsizeof(ip));
            
printf("IP Gotten : %s"ip);
            
getdate(date[0], date[1], date[2]);
            
gettime(date[3], date[4], date[5]);
            
printf("Date gotten : %d/%d/%d | %d-%d-%d"date[0], date[1], date[2], date[3], date[4], date[5]);
            
WP_Hash(PlayerInfo[playerid][pPass], 129strc);
            
printf("strc hashed : %s ----> %s"strcPlayerInfo[playerid][pPass]);
            
mysql_format(MySQLquerysizeof(query), "INSERT INTO Joueurs VALUES(NULL, '%s', '%s', NULL, '1', '0', '0', '0.0', '0.0', 0.0', '-1', '-1', '0.0', '0.0', '0.0', '0', '0', NULL, '%s', '%d-%d-%d %d:%d:%d', '%s')",
                
PlayerInfo[playerid][pName], PlayerInfo[playerid][pPass], saltdate[0], date[1], date[2], date[3], date[4], date[5], ip);
            
printf("Query formatted !");
            
mysql_tquery(MySQLquery"OnPlayerRegister""ii"playerid1);
            
printf("Query launched !");
            return 
1;
        }
// At the bottom of my script
public OnPlayerRegister(playeridstep)
{
    
printf("Called callback OnPlayerRegister");
    if(
step == 1)
    {
        
printf("Entering step 1");
        if(
cache_affected_rows() > 0printf("Showing dialog"), ShowPlayerDialog(playeridDIALOG_INPUTMAILDIALOG_STYLE_INPUT"E-mail""Votre enregistrement dans notre base de donnйes a йtй fait avec succиs. Veuillez maintenant renseigner votre adresse mail de contact. Elle\nrestera privйe et ne sera utilisйe qu'en cas de perte de votre compte InGame pour rйinitialiser votre mot de passe.""Ok""Retour");
        else 
KickWithMessage(playerid, -1"{FF0000}[Erreur]{FFFFFF} Il y a eu un problиme d'enregistrement dans notre base de donnйes. Vous avez йtй dйconnectй par mesure de sйcuritй. Veuillez vous reconnecter et rйessayer.""Ok""Retour");
    }
    else if(
step == 2)
    {
        
printf("Entering step 2");
        new 
dialog_display[256];
        
printf("Creating the dialog display");
        if(
cache_affected_rows() > 0printf("Successfuly registered e-mail !"), strcat(dialog_display"Votre adresse mail a йtй enregistrйe correctement dans la base de donnйes. Veuillez maintenant vous\nconnecter avec le mot de passe entrй prйcedemment.");
        else 
printf("Fail during registering the email"), strcat(dialog_display"Il y a eu un problиme avec l'enregistrement de votre adresse e-mail dans notre base de donnйes. Vous pouvez malgrй tout commencer а jouer.\nNous vous conseillons toutefois d'informer le staff de ce problиme, afin de ne pas perdre dйfinitivement votre compte en cas de soupзons de piratage.");
        
printf("Showing the dialog");
        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Connexion"dialog_display"Ok""Retour");
    }
    return 
1;

And here's my server_log :

Код:
[19:13:16] registering step
[19:13:27] Begin : register
[19:13:27] Random salt created : GfbNF6LS
[19:13:27] Inputted password inserted into strc : azsd
[19:13:27] Dot inserted into strc, strc = azsd.
[19:13:27] Salt inserted into strc, strc = azsd.GfbNF6LS
[19:13:27] IP Gotten : 25.76.71.74
[19:13:27] Date gotten bitch : 2014/6/12 | 19-13-27
[19:13:27] strc hashed : azsd.GfbNF6LS ----> 1272C0FAD08A6B931422870668437CD206F2A663B10EE1A06FAE1987A838233EE806CAAB3C29E4CFF2D33314847E40AF83FB65131F1D016AEED040B54A74614E
[19:13:27] Query formatted !
[19:13:27] Query launched !
Note that I use twice "OnPlayerRegister". The first time is when the player really registers. The other time is when the player inputs his e-mail.

Thanks in advance, because I really don't see what's wrong.
wht version of mysql u use
Reply


Messages In This Thread
Callback not called by mysql_tquery - by S4t3K - 12.06.2014, 16:59
Re : Callback not called by mysql_tquery - by S4t3K - 13.06.2014, 17:53
Re: Callback not called by mysql_tquery - by youssefehab500 - 13.06.2014, 22:27
Re : Callback not called by mysql_tquery - by S4t3K - 14.06.2014, 12:38
Re: Callback not called by mysql_tquery - by BroZeus - 14.06.2014, 12:43
Re : Callback not called by mysql_tquery - by S4t3K - 14.06.2014, 12:51
Re: Re : Callback not called by mysql_tquery - by youssefehab500 - 14.06.2014, 13:34
Re : Callback not called by mysql_tquery - by S4t3K - 14.06.2014, 14:24
Re: Re : Callback not called by mysql_tquery - by youssefehab500 - 14.06.2014, 14:54
Re: Callback not called by mysql_tquery - by RajatPawar - 14.06.2014, 15:00

Forum Jump:


Users browsing this thread: 1 Guest(s)