diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-01-10 18:40:34 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-01-10 18:40:34 +0000 |
commit | 2a478fe03d97c97eeb189f90721724ec6d7fcad5 (patch) | |
tree | 1804878a902a5803e511d5ea68aa5bd7437b873e /EssentialsGroupManager/src | |
parent | 58057a771d4e8e971d8531e1ad208eb6bbb0df54 (diff) | |
download | Essentials-2a478fe03d97c97eeb189f90721724ec6d7fcad5.tar Essentials-2a478fe03d97c97eeb189f90721724ec6d7fcad5.tar.gz Essentials-2a478fe03d97c97eeb189f90721724ec6d7fcad5.tar.lz Essentials-2a478fe03d97c97eeb189f90721724ec6d7fcad5.tar.xz Essentials-2a478fe03d97c97eeb189f90721724ec6d7fcad5.zip |
Optimize fetching of Mirrored world data.
Diffstat (limited to 'EssentialsGroupManager/src')
3 files changed, 14 insertions, 11 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 6ac58e8ff..d9ac389cd 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -97,4 +97,5 @@ v 1.8: - Reload GlobalGroups when you perform a world load.
- Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading
- Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit.
- - Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time.
\ No newline at end of file + - Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time.
+ - Optimize fetching of Mirrored world data.
\ No newline at end of file diff --git a/EssentialsGroupManager/src/config.yml b/EssentialsGroupManager/src/config.yml index 17ffc5b6e..2847dfe0e 100644 --- a/EssentialsGroupManager/src/config.yml +++ b/EssentialsGroupManager/src/config.yml @@ -25,14 +25,14 @@ settings: level: INFO mirrors: - # Worlds listed here have their permissions mirrored in their children. + # Worlds listed here have their settings mirrored in their children. # the first element 'world' is the main worlds name - # subsequent elements '- world_nether' are worlds which will use the same - # user/groups permissions as the parent. + # subsequent elements 'world_nether' and 'world_the_end' are worlds which will use the same + # user/groups files as the parent. world: - world_nether - world_the_end - - world2 - - world3 + # - world2 + # - world3 # world4: # - world5
\ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index dbdd17f34..49205e4fb 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -270,11 +270,12 @@ public class WorldsHolder { */ public OverloadedWorldHolder getWorldData(String worldName) { String worldNameLowered = worldName.toLowerCase(); - OverloadedWorldHolder data = worldsData.get(worldNameLowered); + // If a mirror change to the real world to load. if (mirrors.containsKey(worldNameLowered)) { - String realOne = mirrors.get(worldNameLowered); - data = worldsData.get(realOne.toLowerCase()); - } + worldNameLowered = mirrors.get(worldNameLowered); + } + OverloadedWorldHolder data = worldsData.get(worldNameLowered); + if (data == null) { GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world..."); data = getDefaultWorld(); @@ -283,8 +284,9 @@ public class WorldsHolder { } /** - * Do a matching of playerName, if it s found only one player, do + * Do a matching of playerName, if its found only one player, do * getWorldData(player) + * * @param playerName * @return null if matching returned no player, or more than one. */ |