![]() |
[Improvement] Player Update - 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: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +----- Thread: [Improvement] Player Update (/showthread.php?tid=2720) |
[Improvement] Player Update - Jacob - 10-04-2009 Currently updating vitals and saving players is all done at the same time for all players. Some code to change that. Private Type TempPlayerRec Add the following to the UDT Code: LastUpdateVitals As Long modServerLoop Change your ServerLoop to the following: Code: Public Sub ServerLoop() modPlayer- JoinGame Add the following before "End Sub" Code: TempPlayer(Index).LastUpdateVitals = GetTickCount + 10000 modPlayer Add the following sub Code: ''*************************************** So when a player logs in they are set to their own timers. This really helps in saving, not all players being saved at once. This also helps later on for more advanced features. I've added spell buffs and i use the OnUpdate sub to check if the buff duration is over. Thoughts / Comments ? I think I'll modify this for a future version of MS. (Waiting on something from DFA before I start) Re: [Improvement] Player Update - Dragoons Master - 10-04-2009 You should not make this. It's not fair. The players "backup" should be saved for everybody at the same time. Re: [Improvement] Player Update - Jacob - 10-04-2009 If you have proper error handling, saving the players at different times shouldn't matter. By proper error handling, I mean on all code it will catch and error then try to handle it. If it can't be handled it should shut down the server, in the shut down process it should save all players. Re: [Improvement] Player Update - Tony - 10-04-2009 Yeah, shouldn't saving at different times be less stressful for the server? Re: [Improvement] Player Update - GIAKEN - 10-04-2009 Items need to have their own respawn timers, too. Re: [Improvement] Player Update - Labmonkey - 10-04-2009 It would seem better to just save players when they level up. That way you never loose levels due to server crashes (the most complained about part of server crashes) Re: [Improvement] Player Update - Cruzn - 10-04-2009 Labmonkey Wrote:It would seem better to just save players when they level up. That way you never loose levels due to server crashes (the most complained about part of server crashes)That's fine until you have higher level players whose levels are few and far between. By doing that, you are forcing one portion of a playerbase to log out and log back in again to force the server to save them. Re: [Improvement] Player Update - Labmonkey - 10-04-2009 ok Re: [Improvement] Player Update - Dragoons Master - 10-04-2009 You can't be 100% sure that you can even handle every bug. Lets just say you don't have a no-break and then light goes out. IMO the server does not need to save game state every x time. I'm backing up the db every 24h, on the server restart. If a "unhandleble" error occurs just restore the last day. 24 hours is acceptable. Re: [Improvement] Player Update - Joost - 10-04-2009 Saving players based on whether the dice rolls 6 or not? Sounds fucked up. Instead of saving them ALL at once, or or all unique, just process the first 10% of the indexes online every minute. Re: [Improvement] Player Update - GIAKEN - 10-04-2009 Are you thinking when you post? Saving players on a RANDOM CHANCE? Might as well tell them "You only have a chance you will keep your hard-work safe from server crashes, but eventually you will get more luckier." Please just think and shitty suggestions won't happen anymore hopefully. Re: [Improvement] Player Update - Jacob - 10-04-2009 GIAKEN Wrote:Are you thinking when you post? Saving players on a RANDOM CHANCE? Might as well tell them "You only have a chance you will keep your hard-work safe from server crashes, but eventually you will get more luckier." If you're going to provide criticism, don't be a dick about it. Re: [Improvement] Player Update - Labmonkey - 10-04-2009 the method up top. |