I've converted the entire player data system on Maloria from using .ini files to SQLite.
Quite easy to query all items from an account, and a lot faster and less demanding then constant loading of files.
SELECT * FROM items WHERE account = '" @ player.account @ "'"
In the
items table, I have the variables
account, entryIndex, item_id, item_data where
account shows who owns the item (d'uh),
entryIndex is an auto increasing variable for registry index,
item_id the actual item's id (more on that
here) and finally,
item_data is an array containing all the data for the particular item.
However, when I finished the code, I got the brilliant idea to loop through 3500+ files and convert them to SQLite, instead of dealing with each individual player when he/she logs on, and got this - think it's a new record!
PHP Code:
Top 10 of npcs taken most CPU time:
1. 803.54333169 % SQLDebug (in level onlinestartlocal.nw at pos (30.5, 30))