Marauroa Database Structure: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
No edit summary
Line 119: Line 119:


You have to write the code to load all the database objects into RPWorld, and this action must be written at gameRPWorld.
You have to write the code to load all the database objects into RPWorld, and this action must be written at gameRPWorld.

== How objects are identified? ==
It is important to notice that RPObject.ID is only valid while the object is online. So there is no warranties that any new object won't have that RPObject.ID.

To solve this problem we store in each object a hidden attribute called '''#db_id''' that gives an unique id to each object.

When the object is loaded into the game again, it will have assigned a new valid RPObject.ID, but that object still have a valid unique persisten #db_id. So when we need to store the object we can update the existing copy at database