MySQL saving issue
#1

Hello!

I'm using BlueG's MySQL plugin and I want to save all of my game data in OnGameModeExit. The problem is that the gamemode exits before all data is saved. Any ideas on how I can fix this?
Reply
#2

I might be wrong but i don't think you can save data on OnGameModeExit.. if you have a command that restarts the server you can do a timer and save the data and after that timer finished restart it ..You can also do a 5-10 minute saving stats timer..
Reply
#3

If you use GMX or EXIT OnGameModeExit always get called, when your server crashes it perhaps doesn't.
So you should take a look at your code, perhaps something is wrong there, also take a look in your mysql_log.txt if there get any query called on ongamemodeexit, to enable mysql_log.txt put mysql_debug(1); in your ongamemodeinit.
Reply
#4

I found a much, much better way to do this. Thank you for your input anyway.
Quote:
Originally Posted by Adytza.
Посмотреть сообщение
I might be wrong but i don't think you can save data on OnGameModeExit.. if you have a command that restarts the server you can do a timer and save the data and after that timer finished restart it ..You can also do a 5-10 minute saving stats timer..
That's not going to work. That's how I used to do, but sometimes the MySQL server was slow and it didn't finish saving everything.
Quote:
Originally Posted by Roel
Посмотреть сообщение
If you use GMX or EXIT OnGameModeExit always get called, when your server crashes it perhaps doesn't.
So you should take a look at your code, perhaps something is wrong there, also take a look in your mysql_log.txt if there get any query called on ongamemodeexit, to enable mysql_log.txt put mysql_debug(1); in your ongamemodeinit.
My code is fine, is just a limitation of the MySQL plugin.
Reply
#5

Ow well, is your database hosted at the same spot as your server is hosted? If this is not, then it can be true that it is to slow, well yea then you should us a timer or something.
Reply
#6

Quote:
Originally Posted by Roel
Посмотреть сообщение
Ow well, is your database hosted at the same spot as your server is hosted? If this is not, then it can be true that it is to slow, well yea then you should us a timer or something.
The MySQL server and game server are hosted in the same LAN, but not on the same server.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)