fixes2 crashing MySQL
#1

I want to be able to use fixes2 to increase the accuracy of the timer functions but whenever I run my server MySQL crashes and crashdetect prints this:

Код:
[debug] Run time error 4: "Array index out of bounds"
[debug] AMX backtrace:
[debug] #0 000425ec in ?? () at server.pwn:102
[debug] #1 000424f0 in Callback_Call (func[E_CALLBACK_DATA:5]=@00009d24, ... <32
 arguments>) at server.pwn:94
[debug] #2 000359c0 in Callback_Array (func[E_CALLBACK_DATA:5]=@00009d24, params
[]=@00012cc4 "", num=32) at C:\Users\USER\Desktop\server\pawno\in
clude\YSI\..\YSI_Coding\y_inline/impl.inc:608
[debug] #3 0003b9cc in public FJ37DH3JG_MYSQL_INTERNAL (... <1 argument>) at C:\
Users\USER\Desktop\server\pawno\include\a_mysql.inc:233
Here's line 94:
Код:
inline SQLOnAccountCheck()
and here's line 102: (this is inside the y_inline callback above)
Код:
pData[playerid][userid] = cache_get_row_int(0, 0, SQL);
(using MySQL R39-3 btw)
Would be a massive help if anyone knows what could be causing this n how I can fix it
Reply
#2

Hi, please post the whole callback.
And definition to pData[][] and the enum used in it.
Also, if you can, test MySQL R39 and report the results.
Reply
#3

Sure, here's the callback:
Код:
inline SQLOnAccountCheck()
{
	if(playerid != INVALID_PLAYER_ID)
	{
	    new rows, fields;
	    cache_get_data(rows, fields, SQL);
	    if(rows)
	    {
			pData[playerid][userid] = cache_get_row_int(0, 0, SQL);
			cache_get_row(0, 2, pData[playerid][password], SQL, 129);
			cache_get_row(0, 3, pData[playerid][salt], SQL, 257);

			LoginAttempts[playerid] = 0;
			new loginstring[70];
			format(loginstring, sizeof(loginstring), "Welcome %s\n\nPlease enter your password.\n\n", GetNameEx(playerid));
			Dialog_Show(playerid, d_Login, DIALOG_STYLE_PASSWORD, "Login", loginstring, "Login", "");
			LoginTimer[playerid] = SetTimerEx("OnTimedKick", 70000, 0, "d", playerid);
		}
	}
}
mysql_pquery_inline(SQL, query, using inline SQLOnAccountCheck, "");
Код:
enum e_UserData
{
	userid[8],
	password[129],
	salt[257]
};

new pData[MAX_PLAYERS][e_UserData];
Reply
#4

Change userid[8] to userid, so just remove the [8]
Reply
#5

Still getting the same errors
Reply
#6

awsomedude is correct about "userid" being an integer but I doubt that would gave a run time error.

Have you tried unloading fixes2 and execute the query? Does it do the same?

Also since you want better accuracy on timers, may suggest you a good one? I use this and it's been running good months now (just load the plugin, nothing else): https://sampforum.blast.hk/showthread.php?tid=435525
Reply
#7

Yeah I guess I just completely forgot when writing it that it was an integer and yep it all works perfectly without fixes2, it's really weird. I'll give that plugin a try instead, thanks.
Reply
#8

Post your file's header, ex:
PHP код:
#include <...>
#define ... ...
... 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)