Currently, the order in which e.g. plot resetting or merging happens is:
Waiting for the successful modification of the data in the database
Submitting an AsyncTask to the pool
Updating the chunks after it finishes
This is problematic since the database got already updated when the terrain modifications are not even calculated. This could be exploited if players would intentionally wait for server reboots. (Some servers restart their servers during the night to perform backups, etc.) If they would then merge two plots at the correct time, the server would restart after the database was queried, but before the AsyncTask finished running or updating the chunks. That way, the normal road would still be on the plot for the players to modify as they please, which is especially problematic if the road contains valuable or normally unobtainable blocks.
This could be fixed by changing the above-mentioned order:
Submitting an AsyncTask to the pool
When the task is finished, waiting for the successful modification of the data in the database
Updating the chunks
This would not entirely remove the possibility of the above-mentioned issue, but strongly reduce the time window in which this could be done.
But this is currently not easily implemented due to the design of the ChunkModifyingAsyncTask class, since it updates the chunks in the world before any callbacks are called.
Although especially plot merging takes a comparably long time due to its many queries, even on my test server merging only takes around 2 seconds.
So it is highly unlikely that this will actually happen to someone.
Currently, the order in which e.g. plot resetting or merging happens is:
AsyncTask
to the poolAsyncTask
finished running or updating the chunks. That way, the normal road would still be on the plot for the players to modify as they please, which is especially problematic if the road contains valuable or normally unobtainable blocks.This could be fixed by changing the above-mentioned order:
AsyncTask
to the poolChunkModifyingAsyncTask
class, since it updates the chunks in the world before any callbacks are called.Although especially plot merging takes a comparably long time due to its many queries, even on my test server merging only takes around 2 seconds. So it is highly unlikely that this will actually happen to someone.