03-07-2013, 07:54 AM
Without even looking, I'm guessing you're not doing cIniFile:Read() on the file first, before storing any data to the cIniFile object. This effectively means, you're asking MCServer to "create a new file, fill it with this data and dump it onto the disk" - ergo the overwrite.
That said, ini files are one of the poorest choices for this kind of database, especially performance-wise. In order to write such a file, MCServer needs first to read the entire file into memory. Bam, megabyte-eater born.
I'd recommend using a flat text file, and create a new one each time the server gets (re)started - that is, in the Initialize function of the plugin; base the file name on current time (is there enough API for that?) to avoid collisions. Lua should support file IO out of the box without any external API, so it should be possible to read and write normal text files without a problem.
That said, ini files are one of the poorest choices for this kind of database, especially performance-wise. In order to write such a file, MCServer needs first to read the entire file into memory. Bam, megabyte-eater born.
I'd recommend using a flat text file, and create a new one each time the server gets (re)started - that is, in the Initialize function of the plugin; base the file name on current time (is there enough API for that?) to avoid collisions. Lua should support file IO out of the box without any external API, so it should be possible to read and write normal text files without a problem.