if (parentZone != null)
{
AreaBase area = AreaBase.fromString((String) zoneData.get("area"));
if (area != null)
{
AreaZone zone = new AreaZone(parentZone, (String) zoneData.get("name"), area, (Integer) zoneData.get("id"));
zones.put(zone.getId(), zone);
}
}
}
// Apply group permissions
for (Map<String, Object> permData : groupPermissions)
{
Zone zone = zones.get(permData.get("zone_id"));
if (zone != null)
{
zone.setGroupPermissionProperty((String) permData.get("group"), (String) permData.get("permission"), (String) permData.get("value"));
}
}
// Apply user permissions
for (Map<String, Object> permData : userPermissions)
{
Zone zone = zones.get(permData.get("zone_id"));
if (zone != null)
{
zone.setPlayerPermissionProperty(new UserIdent((String) permData.get("user")), (String) permData.get("permission"),
(String) permData.get("value"));
}
}
// Load maxZoneId
try
{
serverZone.setMaxZoneId(Integer.parseInt(infoData.get(INFO_MAX_ZONE_ID)));
}
catch (NumberFormatException e)
{
}
// Make sure maxZoneId is valid
for (Zone zone : zones.values())
if (zone.getId() > serverZone.getMaxZoneID())
serverZone.setMaxZoneId(zone.getId());
// Add user to groups by fe.internal.player.groups permission
for (UserIdent ident : serverZone.getPlayerPermissions().keySet())
{
String groupList = serverZone.getPlayerPermission(ident, FEPermissions.PLAYER_GROUPS);