As of now, only players and cells still use the slower saving method, and only when disconnecting or being fully unloaded respectively.
Additionally, rename the Save() and Load() methods into SaveToDisk() and LoadFromDisk() to reduce ambiguity and prevent them from being used all the time by new scripters.
This prevents Lua pattern operators from having their special meaning in the values searched for, which was especially causing problems when removing certain spells from players.
Records are now split into 2 categories: permanent records and generated records.
Permanent records are kept forever once created and are sent to all players when they join the server.
Generated records are linked to players, cells or other records, are deleted once those links disappear, and are only sent to players who encounter them. For instance, if a player creates hundreds of potions in a house and then drops the potions there, those potion records will only be sent to players who enter that house. If the potions are drunk and there are no longer any instances of them, their associated records are deleted.
By default, permanent records are created by using the /createrecord command after specifically setting an ID for the record about to be created.
Generated records are created through regular gameplay or by using the /createrecord command without specifying an ID for the record.
Additionally, when setting details for an NPC record that is not based on an existing record, autoCalc now defaults to 1 temporarily instead of being set to 1 in the record's table, and a message is displayed about it.
A new RecordStore class has been implemented, used for saving and loading spell, potion, enchantment, creature, NPC, armor, book, clothing, miscellaneous and weapon record data, as well as accompanying magical effects (for spells, potions and enchantments), inventory items (for creatures and NPCs) and body parts (for armor and clothing). RecordStore data is kept in the new data/recordstore folder.
The OnRecordDynamic event has been implemented in eventHandler, with records received from players first being saved to their associated RecordStores, then being forwarded to players with their new server-set ids, and finally having their associated items added to the players they were received from.
Utility methods for getting and loading RecordStores have been added to logicHandler.
The commands /storerecord and /createrecord have been implemented for on-the-fly record creation.
The help menu has been expanded with examples for creating records.
All records are currently "global", i.e. when players join the server, they receive all the records created on it. This is a temporary, flawed approach that will be replaced with the correct approach in part 2.