Open xiebozhi opened 11 years ago
How are sub regions linked to a town?
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
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
Still having trouble with saves. Pushing to second alpha release
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
Upon town deletion, make the command delete all the town's sub regions as well.