Page 1 of 1
Task 1333: (Lokked) SaveCharacter Timers (ER)
Posted: Wed Jan 21, 2015 7:37 pm
by BugTracker
Bug ID : 67 - SaveCharacter Timers (Enhancement)
Bug Date : 2015/01/03 10:58:09
Assigned To : Lokked
Priority : Low
Category : WorldServer
Sub-Category :
Severity : Standard
Reproducible : Every time
Details:
Not exactly a bug, but an enhancement request; Change how the SaveCharacter timer functions. Right now, every single online character gets saved on the same 5 minute timer. What has to happen is each character gets their OWN timer when they connect so 100 players online are not beating the hell out of the database every 5 minutes with massive updates, but spread out into small, individual upserts.
Originated From Forum: via BugTracker
Re: Bug 67: (Lokked) SaveCharacter Timers (Enhancement)
Posted: Wed Jan 21, 2015 7:43 pm
by John Adams
[quote]
Entered on Jan 03, 2015 16:01 by Lokked
Is it common to incrementally save? Ideally, assuming the World will never crash, characters would be saved upon chunking and logout.[/quote]
Yes, staggered updates is always preferred unless you are preparing bulk inserts/updates, which makes no sense in this application.
What happens when a player disconnects? Does a SaveCharacter not fire manually? Does it fire just for that 1 character? Or does it blow through every character performing a save? (I think there's a difference between SaveCharacter directly and timer-initiated SaveAllCharacters?) I'm curious if this spam-save happened because of a disconnect and force-save happened at the same time the Timer triggered, which is why it hasn't been seen again.
The real reason to do it is because I asked for it but tell me the technical reasons this cannot (or should not) be done on a player-owned timer.
Changing this BUG into an Enhancement:
http://vgoemulator.net/index.php?p=projman&id=1333 for later.
Re: Task 1333: (Lokked) SaveCharacter Timers (ER)
Posted: Wed Jan 21, 2015 9:48 pm
by Lokked
When a character camps or is otherwise disconnected, ONLY their character is saved. There are 2 functions, SaveCharacter() and SaveAllCharacters().
SaveCharacter is the WorldDatabase function that actually runs the query. SaveAllCharacters iterated through all characters that meet certain criteria and runs SaveCharacter for each one.