Should a database save every-time a player disconnects?
#1

Simple question, I've converted my script to use a database for player + vehicle data instead of INI files. Should the database be written to every-time a player disconnects?

Thanks in advance.
Reply
#2

Yes. cause you need to keep up with player data at all times of loses!
Reply
#3

Great thank you! I thought that but just needed verification.

How often would you recommend saving the vehicle data (Location, Mods etc)? Each time OnPlayerExitVehicle is called?
Reply
#4

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Yes. cause you need to keep up with player data at all times of loses!
No.. Saving all the data when a player quits is bad practice.


You send queries to the database when data changes. Not a big bundle of shit where half the values remain the same.

Does the player buy a skin? Update their skin variable in the database.
Do they bank some money? Update the bank money variable.

Nothing else.

You update the database when it changes in the game.
Reply
#5

Quote:
Originally Posted by Dignity
Посмотреть сообщение
No.. Saving all the data when a player quits is bad practice.


You send queries to the database when data changes. Not a big bundle of shit where half the values remain the same.

Does the player buy a skin? Update their skin variable in the database.
Do they bank some money? Update the bank money variable.

Nothing else.

You update the database when it changes in the game.
But you can do that also update during the game.
Reply
#6

You should only save things that update frequently (such as online time, etc) when the player disconnects, but update instantly things that don't update too often such as admin level, vehicle ownership, etc.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)