03-28-2014, 03:30 AM
I haven't looked much at the code until now, it's really bad. The proper way to do it is to iterate over all broken blocks at once using a single SQL prepared statement and executing a function for each row returned. Have a look at GalExport's function SQLite:ExecuteStatement ( https://github.com/madmaxoft/GalExport/b...#L148-L175 ) and its usage in any of the other SQLite functions there, for example the SQLite:GetApprovedAreasInGroup() ( https://github.com/madmaxoft/GalExport/b...#L280-L308 )
If you don't want to have a separate function for executing the SQL statement, you can do it similarly as the Gallery plugin in its function SQLite:LoadPlayerAreasInGallery ( https://github.com/mc-server/Gallery/blo...#L291-L326 ).
If you don't want to have a separate function for executing the SQL statement, you can do it similarly as the Gallery plugin in its function SQLite:LoadPlayerAreasInGallery ( https://github.com/mc-server/Gallery/blo...#L291-L326 ).