MySQL problem
#1

Hello!

I'm using MySQL R7 plugin and this is my problem: Whenever I call "rcon gmx" or "rcon exit" I have to save using MySQL all in-game data like factions, gang zones, players, vehicles and some other settings. But, if I do that in OnGameModeExit using the mysql_function_query function, it'll start another thread which will end later than the one in which OnGameModeExit is running, so the server will close before all queries are executed/data is saved.
Could you give me any idea about how I can work this out? I need to find a way to sleep the server thread while MySQL queries are executed.
I asked a few more guys and followed some other threads about this issue, but there was no solution that actually works. I've been trying to use a while (!...) { }, where ... was a function that would check if all queries have finished, but I found out that it freezes everything.

Thank you very much!
Reply
#2

Once it's called could you create a timer for 5seconds or what ever while it saves then closes?
Reply
#3

Quote:
Originally Posted by Deal-or-die
Посмотреть сообщение
Once it's called could you create a timer for 5seconds or what ever while it saves then closes?
I don't know what interval to set for that timer. I'm afraid if there are some lag spikes data might not be saved.
Reply
#4

You're not really in too much of a rush when GMXing or exiting, so I think 10-15 seconds should do the trick.
Reply
#5

"OnGameModeExit using the mysql_function_query function, it'll start another thread which will end later than the one in which OnGameModeExit is running, so the server will close before all queries are executed/data is saved. "

This problem I have too ... with Gang Zones / Teritories.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)