DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • July 20, 2019, 05:19:43 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Resource Pages

Pages: [1]   Go Down
Author Topic: gold transfers get lost  (Read 3692 times)
0 Members and 1 Guest are viewing this topic.
« on: March 11, 2004, 10:48:19 AM »

I noticed a problem with synchronisation of session data with database after gold transfers, PvP and other things where other (online) players are involved.

Someone transfers 200 gold to another player who is fighting in the forest at the same time. The transfer is written directly into database at the very same moment the player killed his opponent and gained some gold (in his session data). With the next click of this player the database is updated with the new data in session and so the transfered gold is lost. The player gets the gold from the killed monster and the olde mail from a received gold transfer. But he doesn't get the transfered gold.

Till now I noticed that problem on big servers with lots of players online only (logd.de and nicegames.de).

Why is this and is there a way to prevent this from happening? Has this something to do with "lasthit" and the fact, that the accuracy of time ("lasthit"?) is 1 second? Or am I completely wrong with the above assumption of reason?
« Reply #1 on: March 11, 2004, 12:22:42 PM »

You are wrong in the reason.
The reason is that the entire database row in 0.9.7 is getting written back to the database every time though as a 'forced write'.  So if you have a race condition where the transfer occurs between the time that the user starts the page load/generation and the time that the generation finishes, then the forced database write at the end of page generation (to update things like hitpoints during a fight, etc) will overwrite that change.

This has been fixed in 0.9.8 where we only flush back to the database table rows which have changed.  Unless someone adds something which affects another users database rows (no plans for this currently -- gold was the oddball exception) this should be fixed.
Pages: [1]   Go Up
Jump to:  

DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
114 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search