xiebozhi / Muni

A town management plugin for Bukkit servers
http://dev.bukkit.org/bukkit-plugins/muni/
3 stars 2 forks source link

Delete all sub regions #28

Open xiebozhi opened 11 years ago

xiebozhi commented 11 years ago

Upon town deletion, make the command delete all the town's sub regions as well.

LordFransie commented 11 years ago

How are sub regions linked to a town?

xiebozhi commented 11 years ago

Upon creation of the subregion, we make a database entry storing the name of the world, the name of the region (need both to pull from world guard region manager), and an additional field named type that is a reference for the subregion type (muni specific). There is a new class that can load this data into itself- will make a link when I'm at my desk in a bit

xiebozhi commented 11 years ago

Quick and dirty datagram Muni WG Region: https://github.com/xiebozhi/Muni/blob/master/src/com/teamglokk/muni/utilities/MuniWGRegion.java

This is the DB table definition for the subregions. https://github.com/xiebozhi/Muni/blob/master/src/com/teamglokk/muni/utilities/dbWrapper.java#L751

From this line down are the subregion DB methods: https://github.com/xiebozhi/Muni/blob/master/src/com/teamglokk/muni/utilities/dbWrapper.java#L589

xiebozhi commented 11 years ago

Still having trouble with saves. Pushing to second alpha release

xiebozhi commented 11 years ago

Each subregion now adds itself to the subregions table upon creation. On town deletion, the database is referenced for all the regions and deletes individually. Not working properl yet