![]() |
Server Saving Optimization - 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: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Server Saving Optimization (/showthread.php?tid=372) |
Server Saving Optimization - Rian - 17-10-2006 I'll get straight to the point. This tutorial doesn't cut down on useless information getting saved. Right now, the server saves every player every 10 minutes at the same time. What this tutorial will do, is make the server save each player individually. Just one player at a time. It makes a pretty big difference when you've got more than a dozen or so players online at once. Tutorial Difficulty: 1/5 Things to change: * frmServer and frmServer Code * modGlobals * modGeneral Lets begin in modGlobal. Add this code anywhere you please in modGlobal. Code: 'Player Saving Constants That was simple. Lets move on to frmServer. Start by adding a new timer. Name the timer PlayerTimer. Enable it to False, and set the interval to 10000. Were not finished with frmServer yet, but for now lets browse over to modGeneral. Find and replace this code: Code: Sub PlayerSaveTimer() With this code here: Code: Sub PlayerSaveTimer() Sub PlayerSaveTimer was saving every player more or less at the same time every 10 minutes. What we did, is change the sub to activate a new timer every 10 minutes. Look for If MinPassed >= 10 Then in the code because I recommend changing that 10 to a higher number such as 120. That would make our new timer activate every two hours. Anyways, were finished with modGeneral, and as I mentioned earlier, were gonna go back and finish frmServer now. Open up the frmServer code, and add this code at the bottom: Code: Private Sub PlayerTimer_Timer() If you remember, we set this timers interval to 10000, or 10 seconds. This new timer saves 1 player every 10 seconds until every player has been saved. This should greatly reduce stress caused by the player save. Credits go to PsychoBoy for original concept. - William - 20-10-2006 Didn't see this before I made my tutorial. This is another way that is very affective. ![]() - Xlithan - 18-01-2007 There's a timer called tmrPlayerSave which has a 60 second interval. It called Sub PlayerSaveTimer() Should I delete this? I also get this run-time (Subscript out of range) Code: IsPlaying = IsConnected(Index) And Player(Index).InGame |