Mirage Source
An idea.. - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: An idea.. (/showthread.php?tid=370)



An idea.. - Matt - 16-10-2006

It lags so much, when you see the "Saving all online players" message.

Is there a way to opt this?

I mean, there has to be a way, it seems like it goes through and saves alot of stuff that doesn't need to be saved..

I mean, there has to be a way to only make it save something that has been changed.

Actually, is it even really needed? I mean, everytime you do something, doesn't it save it to your account anyways? If so, what's really the point in this?


- William - 16-10-2006

Post your code, and we fix it.


- Matt - 16-10-2006

There is no code to post. It was a general idea, as to make MS better..

And also, to inform myself of something.


- William - 16-10-2006

Yes there is a code. The saving timer in the server. Do you use the default code for it?


- Spodi - 16-10-2006

Idealy, there should be one point when a player is saved - before they are unloaded from memory. But if you are worried about your server crashing, then I believe this is where this function comes in. Besides these two times, though, you shouldn't ever save any more since File I/O is very slow, especially when using Get/WritePrivateProfileString.

You CAN, if you want, store two arrays for users - one that holds the values loaded into memory from the user file, and one that holds the actual user. Before you save the user, you can just check every value to the second "untouched" array, and only write a value if it has changed.


- William - 16-10-2006

I suggest increasing the saving time to like 5 minutes. And using High_Index for it when its saved.. And makes sure to use binary, not ini.


- Matt - 16-10-2006

Well, from what I've seen, it automatically saves the player, without doing that. I can pick up an item, and before I log out or the save happens, I can check my account, and the item will be there.

That's why I ask if this is even needed.


- William - 16-10-2006

Hmm.. the items is stored in memory when picked up. It should not be written to a file directly =/

At least I don't think so. Well the saving part is still pretty much for crash purposes I think.


- Spodi - 16-10-2006

Problem with 4 is that if you can find the error, you can often fix it. For me, the only crashes I really get with vbGORE are the ones that shut down the server without any word - those are the hard ones to fix. :roll:


- William - 16-10-2006

Spodi Wrote:Problem with 4 is that if you can find the error, you can often fix it. For me, the only crashes I really get with vbGORE are the ones that shut down the server without any word - those are the hard ones to fix. :roll:

Search for:
Code:
end
They are dangerous Tongue


- Matt - 17-10-2006

Well, that's why I was posting. Does anyone have an idea as to how to speed it up?

William, you were wanting another optimization to create a tut for, why not this one?


- Spodi - 17-10-2006

Refer to my first post, Adv., that's the easiest and one of the best ways to go about it without changing from INI files.


- William - 17-10-2006

Advocate Wrote:Well, that's why I was posting. Does anyone have an idea as to how to speed it up?

William, you were wanting another optimization to create a tut for, why not this one?

Sure, I can make the Saving Part work better. I'll make a tut for it when I get home.


- Rian - 17-10-2006

http://ms.shannaracorp.com/forums/viewtopic.php?t=654

Not exactly what you asked for, but it should help.