Input Dialog Freezes
#1

My account system seems like it should be working 100%. It does register players and log them in how it's supposed to, but when a player is in game and the server is restarted, the dialog freezes when the player reconnects (meaning no text can be entered and you have to ctrl+alt+del to exit). Additionally, if the server has been sitting for a while, the dialog does not show up at all. If you connect normally when the server is fresh, it works just as it should.

pawn Код:
public OnPlayerConnect(playerid)
{
    new query[256];
    format(query, sizeof(query), "SELECT `user` FROM `playerdata` WHERE user = '%s'", GetPName(playerid));
    mysql_query(query);
    mysql_store_result();
    new rows = mysql_num_rows();
    mysql_free_result();
   
    if(rows != 0)
    {
       
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""Blue"Please log-in", ""White"Welcome back to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to log-in!\n\n"White"Please insert "Red"your"White" password below:", "Login", "Cancel");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""Blue"Please register",""White"Welcome to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to register!\n\n"White"Please insert a password below:", "Register", "Cancel");
    }
    return 1;
}
Reply
#2

Have you tried it without these color words (for example "Blue") ?
Reply
#3

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Have you tried it without these color words (for example "Blue") ?
I was thinking that could be it but I don't see how that would freeze it. I can try it without them.

EDIT: It wasn't the problem.
Reply
#4

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Restarted as gmx? or a crash?
if as for gmx

i suggest kicking all player under OnGameModeExit...
That's a way to avoid the problem. I'm trying to fix it.
Reply
#5

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Well i know, but i believe the problem isn't with the dialog!
Its with loading mysql data from OnGameModeInt... then calling OnPlayerConnect as for fetching the information at the same moment when the player connects... which will cause the player to freeze/crash...

Try delaying the dialog display time, or displaying the dialog under OnPlayerRequestClass to give time for the information to load.
I'm not sure that's the issue because when I rescripted it on a test script it didn't do this. The problem with that is I don't know what the difference is between the two scripts.

EDIT: something has to be conflicting with it. I put a fully working one in and it does the same thing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)