Mysql race_check?
#1

I have some problem with function gracecheck, could someone actually explain what does this code do, expect only reseting queries if player is disconnected?

Due to this code it crashed, lol

if(race_check != g_MysqlRaceCheck[playerid])
return Kick(playerid);

[14:02:23] [debug] Server crashed while executing sa-rp.amx
[14:02:23] [debug] AMX backtrace:
[14:02:23] [debug] #0 native Kick () from samp03svr
[14:02:23] [debug] #1 001bd334 in public OnPlayerDataLoad (playerid=48, race_check=21) at E:\Ostalo\Deity\NEDIRAJ\gamemodes\sa-rp.pwn:17519
[14:02:23] [debug] Native backtrace:
[14:02:23] [debug] #0 b62c7e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[14:02:23] [debug] #1 b62c0bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[14:02:23] [debug] #2 b62c1dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[14:02:23] [debug] #3 b62c2226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[14:02:23] [debug] #4 b62c7adc in ?? () from plugins/crashdetect.so
[14:02:23] [debug] #5 b7751600 in ?? ()
[14:02:23] [debug] #6 080945fc in ?? () from ./samp03svr
[14:02:23] [debug] #7 0809473d in ?? () from ./samp03svr
[14:02:23] [debug] #8 b621b7c6 in ?? () from plugins/streamer.so
[14:02:23] [debug] #9 080a06e9 in ?? () from ./samp03svr
[14:02:23] [debug] #10 080ce8f0 in ?? () from ./samp03svr
[14:02:23] [debug] #11 080acf1b in ?? () from ./samp03svr
[14:02:23] [debug] #12 080d4f3e in ?? () from ./samp03svr
[14:02:23] [debug] #13 08094054 in ?? () from ./samp03svr
[14:02:23] [debug] #14 b621b6e4 in ?? () from plugins/streamer.so
[14:02:23] [debug] #15 b62c394b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[14:02:23] [debug] #16 b62c68f8 in ?? () from plugins/crashdetect.so
[14:02:23] [debug] #17 b62ca916 in amx_Exec () from plugins/crashdetect.so
[14:02:23] [debug] #18 b62c2be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[14:02:23] [debug] #19 b62c6659 in ?? () from plugins/crashdetect.so
[14:02:23] [debug] #20 b621c370 in ?? () from plugins/streamer.so
[14:02:23] [debug] #21 b7165991 in amx_Exec () from plugins/mysql_static.so
[14:02:23] [debug] #22 b713f893 in _ZN9CCallback16ProcessCallbacksEv () from plugins/mysql_static.so
[14:02:23] [debug] #23 b7166942 in ProcessTick () from plugins/mysql_static.so
Reply
#2

Do u need that lines

SRB:
Trebaju li ti te 2 linije i ovo nissta ne znaci + stavljaj to u [ code ] [/code]
Reply
#3

Probably cous of nonrp name check?
Reply
#4

Hmm why u need this? If u have OnPlayerConnect Name Checker u don't need it in yre "Event system" :/
Reply
#5

This is used to check that the player who initiated the original query is still connected so the retrieved data doesn't get assigned to another player that just connected with the same playerid. But the chance of that occurring for standard queries* is abysmally small so usually it's not needed and it will only complicate things.

* Certain complex queries which involve large tables and multiple joins can take a few seconds, so in that case it can be useful.

http://en.wikipedia.org/wiki/Race_condition
Reply
#6

Oh thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)