[Need Tip] To save!

08/19/2011 23:42 smart_spammer#1
So my problem is to save chars and other saveable ojects.(MySql)

As much i know there is 2 way to save! but witch one is better?

1: timer based SaveAll();
- That would be massive usage for mysql since like sellers/afk ppl/others don't need to save.
- as long as its works its good? :rolleyes:
2: save on change like: save_money(Client);
- Its called when ever Client.Silver value is changed!
- Have to make loads of savefuntions.
- Does save_loc(client) would not overload mysql at 200+ jumps at same time?

If you have any tips how to save datas in "best way" please share :)
08/20/2011 07:39 killersub#2
MySQL Loading/Saving would be by far the best way to save/load data at it's fastest.(As I have heard around this forum) My Opinion.
08/20/2011 12:50 smart_spammer#3
Quote:
Originally Posted by killersub View Post
MySQL Loading/Saving would be by far the best way to save/load data at it's fastest.(As I have heard around this forum) My Opinion.
Yes i know. But there is many ways how to save. I would like to get a tip witch way i should go :/
08/20/2011 15:10 pro4never#4
I want to suggest a third option.


Only save when they log out or you shut down the server.

The issue with that is so many people do not code it properly and then they close out the server incorrectly or the server crashes and data gets lost (rollbacks). If the server is written correctly though this is the best option.


Personally what I do with my server is I save any 'critical' element as it's modified. Money/cp to avoid any exploits with that as well as modifications to items, etc. Then only save the bulk of my character data when they log out.


You can handle the console close event (clicking the X button) and cause it to save all characters on the server before it closes (google it, it's quite simple) and then if there's any errors with characters I save them before disconnecting.

I've yet to have any issues with rollbacks and it reduces pointless server strain from either of the previous options.
08/21/2011 01:42 smart_spammer#5
Quote:
Originally Posted by pro4never View Post
I want to suggest a third option.


Only save when they log out or you shut down the server.

The issue with that is so many people do not code it properly and then they close out the server incorrectly or the server crashes and data gets lost (rollbacks). If the server is written correctly though this is the best option.


Personally what I do with my server is I save any 'critical' element as it's modified. Money/cp to avoid any exploits with that as well as modifications to items, etc. Then only save the bulk of my character data when they log out.


You can handle the console close event (clicking the X button) and cause it to save all characters on the server before it closes (google it, it's quite simple) and then if there's any errors with characters I save them before disconnecting.

I've yet to have any issues with rollbacks and it reduces pointless server strain from either of the previous options.
Then im doing alright :) i tought that saving on value change isn't good idea(' for critical'). i just can't figure if exp is critical ... overkill for 200+ lvling at same time?

cheers :)