Marauroa Database Structure: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>StephenIerodiaconou
mNo edit summary
Line 125: Line 125:
To solve this problem we store a hidden attribute in each object called '''#db_id''' which gives a unique id to each object regardless of whether the object is online at a particular point in time or not.
To solve this problem we store a hidden attribute in each object called '''#db_id''' which gives a unique id to each object regardless of whether the object is online at a particular point in time or not.


When an object is loaded in to the game again, it will be assigned a new valid RPObject.ID. However, the object will still have a valid and unique persisten #db_id which can be used when we need to store the object again. We can simply update the existing copy already on the database.
When an object is loaded in to the game again, it will be assigned a new valid RPObject.ID. However, the object will still have a valid and unique persistent #db_id which can be used when we need to store the object again. We can simply update the existing copy already on the database.

== How objects are stored ==
There is a problem right now in Marauroa: storing an object involves two steps, remove the previous stored object and insert the new one.
This is a very complex operation and it could be ''simplified'' to update just the fields that has changed. May you want to do it?