| Mirage Source http://web.miragesource.net/forums/ |
|
| An idea.. http://web.miragesource.net/forums/viewtopic.php?f=201&t=648 |
Page 1 of 2 |
| Author: | Matt [ Mon Oct 16, 2006 7:52 pm ] |
| Post subject: | An idea.. |
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? |
|
| Author: | William [ Mon Oct 16, 2006 7:53 pm ] |
| Post subject: | |
Post your code, and we fix it. |
|
| Author: | Matt [ Mon Oct 16, 2006 7:55 pm ] |
| Post subject: | |
There is no code to post. It was a general idea, as to make MS better.. And also, to inform myself of something. |
|
| Author: | William [ Mon Oct 16, 2006 7:56 pm ] |
| Post subject: | |
Yes there is a code. The saving timer in the server. Do you use the default code for it? |
|
| Author: | Spodi [ Mon Oct 16, 2006 7:57 pm ] |
| Post subject: | |
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. |
|
| Author: | William [ Mon Oct 16, 2006 8:00 pm ] |
| Post subject: | |
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. |
|
| Author: | Matt [ Mon Oct 16, 2006 8:31 pm ] |
| Post subject: | |
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. |
|
| Author: | William [ Mon Oct 16, 2006 8:43 pm ] |
| Post subject: | |
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. |
|
| Author: | Lea [ Mon Oct 16, 2006 8:54 pm ] |
| Post subject: | |
Here's how it works: When you are playing, the server does Saving All Players... once every few minutes. When you log off, the server saves you. When the server is closed, it saves all players before terminating them. Therefore: The only reason Saving All Players is there is in case the server crashes. Solution: 1) Remove it. If your server is stable, it's not needed. 2) Speed it up. No reason it needs to take that long! 3) Start another thread to save. That way your server doesnt need to take time out to save all that crap, leave it to the second thread. 4) Check for errors, and save players and bail. Only save players when you need to. Probably the best choice... |
|
| Author: | Spodi [ Mon Oct 16, 2006 9:03 pm ] |
| Post subject: | |
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. |
|
| Author: | William [ Mon Oct 16, 2006 9:05 pm ] |
| Post subject: | |
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.
Search for: Code: end
They are dangerous |
|
| Author: | Matt [ Tue Oct 17, 2006 2:23 am ] |
| Post subject: | |
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? |
|
| Author: | Spodi [ Tue Oct 17, 2006 5:38 am ] |
| Post subject: | |
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. |
|
| Author: | William [ Tue Oct 17, 2006 9:07 am ] |
| Post subject: | |
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. |
|
| Author: | Rian [ Tue Oct 17, 2006 4:16 pm ] |
| Post subject: | |
http://ms.shannaracorp.com/forums/viewtopic.php?t=654 Not exactly what you asked for, but it should help. |
|
| Author: | Lea [ Tue Oct 17, 2006 8:14 pm ] |
| Post subject: | |
I would save in another thread. Check out the "CreateThread" API... it's a little iffy to use in Visual Basic though. |
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|