[Question] MySQL Saving
#1

Is it a bad idea to update players mysql stats with query every time their playerinfo variables change? Example - Updated money, skin.. ( Using MySQL R38 )

It's just cause I have a user control panel in PHP and it doesn't show their updated stats until they quit the server when their accounts save into the database.

Like..

/buyhouse (update players database row)
/givecash (update players database row)
Reply
#2

You can update all players account data every 10-15 min using timer.So in case of server crash players wan't lose all their progres.
Reply
#3

Quote:
Originally Posted by doreto
Посмотреть сообщение
You can update all players account data every 10-15 min using timer.So in case of server crash players wan't lose all their progres.
Yeah got it set up already, just would have liked it if a player buys a house, refreshes the user control panel on my website to see their new house displayed instead of having to quit the server for the variables to save into the database.
I'm guessing it would be a bad idea to do as I said then.
On Red County RP, if you like shut down your computer whilst ingame it saves your last position, but mine only saves the player information when quitting the server or getting kicked.
Reply
#4

Quote:
Originally Posted by AphexCCFC
Посмотреть сообщение
Yeah got it set up already, just would have liked it if a player buys a house, refreshes the user control panel on my website to see their new house displayed instead of having to quit the server for the variables to save into the database.
I'm guessing it would be a bad idea to do as I said then.
It's not bad idea at all. When player buys the house, update their data to database.Player wan't buy 100 houses at ones to affect server performance and even then server will handle it(all depend how you script it).

Quote:
Originally Posted by AphexCCFC
Посмотреть сообщение
On Red County RP, if you like shut down your computer whilst ingame it saves your last position, but mine only saves the player information when quitting the server or getting kicked.
When player disconnect you get and save(update to serve database) their pos and when they connect again you spawn then on previews pos.
Reply
#5

Quote:
Originally Posted by doreto
Посмотреть сообщение
It's not bad idea at all. When player buys the house, update their data to database.Player wan't buy 100 houses at ones to affect server performance and even then server will handle it(all depend how you script it).

When player disconnect you get and save(update to serve database) their pos and when they connect again you spawn then on previews pos.
Really? Why do I have this impression it'll end up lagging the server like a bitch if there's say 200+ players on all using /buy, /buyhouse, earning money often etc?

Thanks, this actually does work for me. Didn't know losing server connection is OnPlayerDisconnect
Reply
#6

Quote:
Originally Posted by AphexCCFC
Посмотреть сообщение
Really? Why do I have this impression it'll end up lagging the server like a bitch if there's say 200+ players on all using /buy, /buyhouse, earning money often etc?

Thanks, this actually does work for me. Didn't know losing server connection is OnPlayerDisconnect
As i said in previews comment all depend how did you(or someone else) scripted house system.200+ players aren't gonna buy house instantaneas to affect query, even their effect will be significant.Also you won’t update their data to database (that they have bought a house ) before you are sure they have enough money or they can have only one house
Reply
#7

So updating one or two variables into the database per command should be okay?
I've done it with the housing system because I know that'll be fine, but most of my commands change the players variables and just thinking that these commands will be used a lot and wanted as less lag as possible
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)