Or better yet... save the modified sections every time they are changed.
If not your server will ALWAYS be exploitable and ALWAYS have rollbacks (of differing sizes)
This is wrong.
Saving every modified section every time it changes will not make your server less 'exploitable', neither will you have less rollbacks.
All that really matters is correctly handling the load of saving, things like safe-threading is important.
Unless your server 'forgets' data, saving it will not make a difference. It is already saved, its just not permanent, so make you sure you make it permanent at some time, and make sure your server does not close before this has happened.
This is wrong.
Saving every modified section every time it changes will not make your server less 'exploitable', neither will you have less rollbacks.
All that really matters is correctly handling the load of saving, things like safe-threading is important.
Unless your server 'forgets' data, saving it will not make a difference. It is already saved, its just not permanent, so make you sure you make it permanent at some time, and make sure your server does not close before this has happened.
Well yes it will reduce rollbacks, the idea behind saving every time something changes is that as soon as it changes its commited to the database, its impossible for there to be a rollback if its already commited to the database.
Well yes it will reduce rollbacks, the idea behind saving every time something changes is that as soon as it changes its commited to the database, its impossible for there to be a rollback if its already commited to the database.
Exactly. If you make it so that the variable itself updates the database every time something changes, there's no time to even have a roll back (I guess technically there is but you'd have to be a very very very very unlucky person to pick up a dragonball on the last millisecond that the server is online! xP)
But there's not really a way to save 0a single variable with Tanel's 5165 source.
You'd have to change everything.
I know. The main problem with why it wasn't saving though was that the "file was in use". I fixed it so that when the file was in use, it would activate a variable called "saving" and that way, a waiting line could be created using while statements to use the file. Flat Databases with Flat Accounts and Characters is just a terrible idea! rofl! xP It's impossible to have concurrent connections when the file is in use!
You would just need to change the character object so that it was full of Properties and not Fields, and then on the set; method have a call to the database to submit the data, then in the database make sure that all of the submits, updates, etc are threadsafe using monitor tryenter/exit.
You would just need to change the character object so that it was full of Properties and not Fields, and then on the set; method have a call to the database to submit the data, then in the database make sure that all of the submits, updates, etc are threadsafe using monitor tryenter/exit.
omg , 3pages of speaking and i didn't got what i want, i give you my source, and tell me what i have to do ,( do to ******.cs , seach ***** and add ****)
omg , 3pages of speaking and i didn't got what i want, i give you my source, and tell me what i have to do ,( do to ******.cs , seach ***** and add ****)
Arco's right. We're not going to download your source and make it for you. We have our own sources to work on. =\ You could try downloading that I wrote in my first month of coding... it's save system has a tiny fix on it that I'm sure you can copy into your source.
i will not use your source, icuz i worked on my source, and the source that i want to have is my source, i just want to know how to fix bug, i don't need advices or doing it for me, just tell me what i put in where
i will not use your source, icuz i worked on my source, and the source that i want to have is my source, i just want to know how to fix bug, i don't need advices or doing it for me, just tell me what i put in where
I'm not releasing something like that. I'm already shunned for that source release. Just download it and look at it. That's what good coders do- they look at other works and try and understand how they did it.
5165 Save or Load Character Problem. 07/29/2010 - CO2 Private Server - 5 Replies alright so IDK wtf I did 2 dis source dat now wen I login and log out my character doesnt save sumhow and like his/her gears are all fucked up wen u login again like...a necklace is where da armor should be at lol...and da armor is like da weapon...so on...only like 3 things save...
well I'm hoping I can get answers from dis...I'll post my SaveCharacter/LoadCharacter void here...
public static Game.Character LoadCharacter(string Name, ref string Account)
{
try
...
Roll Back or No Save Bug!! 5165 07/11/2010 - CO2 Private Server - 1 Replies Hi, i have a co pserver 5165, i'm getting a fucked bug
well i made a video to more understand
YouTube - mybug.wmv
please tell me what's the problem, or if it's possible help me to fix it
and if no one know how to fix, please give me a good 5165 source
5165 source Don't save 07/01/2010 - CO2 Private Server - 3 Replies hi i have a co pserver 5165
well the server don't save
for exemple some one was lvl 50 and had 50kcps
he dropped 1kkcps and leveled up to 137, well he disconnect, and after 5 ou 10mn he relog, and he find himself lvl 50 and has 50kcps only
so the server didin't saved, i have 2 or 3 players who have same problem
fix 100% code save characters lvl and all for 5165 03/09/2010 - CO2 PServer Guides & Releases - 6 Replies hello all this code for save lvl character and cps
open Database.cs
and search
return "Error: Character already exists!";
del this code and add this new code