aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/RegionInfo.cs')
-rw-r--r--OpenSim/Framework/RegionInfo.cs267
1 files changed, 6 insertions, 261 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 44d05b7..6b3adcc 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -102,7 +102,6 @@ namespace OpenSim.Framework
102 private static readonly string LogHeader = "[REGION INFO]"; 102 private static readonly string LogHeader = "[REGION INFO]";
103 103
104 public bool commFailTF = false; 104 public bool commFailTF = false;
105 public ConfigurationMember configMember;
106 public string RegionFile = String.Empty; 105 public string RegionFile = String.Empty;
107 public bool isSandbox = false; 106 public bool isSandbox = false;
108 public bool Persistent = true; 107 public bool Persistent = true;
@@ -204,7 +203,6 @@ namespace OpenSim.Framework
204 try 203 try
205 { 204 {
206 // This will throw if it's not legal Nini XML format 205 // This will throw if it's not legal Nini XML format
207 // and thereby toss it to the legacy loader
208 // 206 //
209 IConfigSource xmlsource = new XmlConfigSource(filename); 207 IConfigSource xmlsource = new XmlConfigSource(filename);
210 208
@@ -217,21 +215,18 @@ namespace OpenSim.Framework
217 catch (Exception) 215 catch (Exception)
218 { 216 {
219 } 217 }
220
221 configMember =
222 new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
223 configMember.performConfigurationRetrieve();
224 RegionFile = filename;
225 } 218 }
226 219
227 // The web loader uses this 220 // The web loader uses this
228 // 221 //
229 public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig, IConfigSource configSource) 222 public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig, IConfigSource configSource)
230 { 223 {
231 // m_configSource = configSource; 224 XmlElement elem = (XmlElement)xmlNode;
232 configMember = 225 string name = elem.GetAttribute("Name");
233 new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); 226 string xmlstr = "<Nini>" + xmlNode.OuterXml + "</Nini>";
234 configMember.performConfigurationRetrieve(); 227 XmlConfigSource source = new XmlConfigSource(XmlReader.Create(new StringReader(xmlstr)));
228 ReadNiniConfig(source, name);
229
235 m_serverURI = string.Empty; 230 m_serverURI = string.Empty;
236 } 231 }
237 232
@@ -889,264 +884,14 @@ namespace OpenSim.Framework
889 884
890 return; 885 return;
891 } 886 }
892 else if (filename.ToLower().EndsWith(".xml"))
893 {
894 configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
895 ignoreIncomingConfiguration, false);
896 configMember.performConfigurationRetrieve();
897 RegionFile = filename;
898 }
899 else 887 else
900 throw new Exception("Invalid file type for region persistence."); 888 throw new Exception("Invalid file type for region persistence.");
901 } 889 }
902 890
903 public void loadConfigurationOptionsFromMe()
904 {
905 configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE,
906 "UUID of Region (Default is recommended, random UUID)",
907 RegionID.ToString(), true);
908 configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
909 "Region Name", RegionName, true);
910
911 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
912 "Grid Location (X Axis)", RegionLocX.ToString(), true);
913 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
914 "Grid Location (Y Axis)", RegionLocY.ToString(), true);
915 configMember.addConfigurationOption("sim_size_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
916 "Size of region in X dimension", RegionSizeX.ToString(), true);
917 configMember.addConfigurationOption("sim_size_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
918 "Size of region in Y dimension", RegionSizeY.ToString(), true);
919 configMember.addConfigurationOption("sim_size_z", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
920 "Size of region in Z dimension", RegionSizeZ.ToString(), true);
921
922 //m_configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
923 configMember.addConfigurationOption("internal_ip_address",
924 ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
925 "Internal IP Address for incoming UDP client connections",
926 m_internalEndPoint.Address.ToString(),
927 true);
928 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
929 "Internal IP Port for incoming UDP client connections",
930 m_internalEndPoint.Port.ToString(), true);
931 configMember.addConfigurationOption("allow_alternate_ports",
932 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
933 "Allow sim to find alternate UDP ports when ports are in use?",
934 m_allow_alternate_ports.ToString(), true);
935 configMember.addConfigurationOption("external_host_name",
936 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
937 "External Host Name", m_externalHostName, true);
938 configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
939 "Last Map UUID", lastMapUUID.ToString(), true);
940 configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
941 "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
942
943 configMember.addConfigurationOption("nonphysical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
944 "Minimum size for nonphysical prims", m_nonphysPrimMin.ToString(), true);
945
946 configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
947 "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true);
948
949 configMember.addConfigurationOption("physical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
950 "Minimum size for nonphysical prims", m_physPrimMin.ToString(), true);
951
952 configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
953 "Maximum size for physical prims", m_physPrimMax.ToString(), true);
954
955 configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
956 "Clamp prims to max size", m_clampPrimSize.ToString(), true);
957
958 configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
959 "Max objects this sim will hold", m_objectCapacity.ToString(), true);
960
961 configMember.addConfigurationOption("prims_per_user", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
962 "Max objects one user may rez", m_maxPrimsPerUser.ToString(), true);
963
964 configMember.addConfigurationOption("linkset_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
965 "Max prims an object will hold", m_linksetCapacity.ToString(), true);
966
967 configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
968 "Max avatars this sim will hold", m_agentCapacity.ToString(), true);
969
970 configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
971 "Scope ID for this region", ScopeID.ToString(), true);
972
973 configMember.addConfigurationOption("region_type", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
974 "Free form string describing the type of region", String.Empty, true);
975
976 configMember.addConfigurationOption("region_static_maptile", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
977 "UUID of a texture to use as the map for this region", m_maptileStaticUUID.ToString(), true);
978
979 configMember.addConfigurationOption("region_static_mapfile", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
980 "Filename of a texture to use as the map for this region", MaptileStaticFile, true);
981 }
982
983 public void loadConfigurationOptions()
984 {
985 configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
986 "UUID of Region (Default is recommended, random UUID)",
987 UUID.Random().ToString(), true);
988 configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
989 "Region Name", "OpenSim Test", false);
990
991 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
992 "Grid Location (X Axis)", "1000", false);
993 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
994 "Grid Location (Y Axis)", "1000", false);
995 configMember.addConfigurationOption("sim_size_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
996 "Size of region in X dimension", Constants.RegionSize.ToString(), false);
997 configMember.addConfigurationOption("sim_size_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
998 "Size of region in Y dimension", Constants.RegionSize.ToString(), false);
999 configMember.addConfigurationOption("sim_size_z", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
1000 "Size of region in Z dimension", Constants.RegionHeight.ToString(), false);
1001
1002 //m_configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
1003 configMember.addConfigurationOption("internal_ip_address",
1004 ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
1005 "Internal IP Address for incoming UDP client connections", "0.0.0.0",
1006 false);
1007 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1008 "Internal IP Port for incoming UDP client connections",
1009 ConfigSettings.DefaultRegionHttpPort.ToString(), false);
1010 configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
1011 "Allow sim to find alternate UDP ports when ports are in use?",
1012 "false", true);
1013 configMember.addConfigurationOption("external_host_name",
1014 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
1015 "External Host Name", "127.0.0.1", false);
1016 configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
1017 "Last Map UUID", lastMapUUID.ToString(), true);
1018
1019 configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
1020 "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
1021
1022 configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1023 "Maximum size for nonphysical prims", "0", true);
1024
1025 configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1026 "Maximum size for physical prims", "0", true);
1027
1028 configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
1029 "Clamp prims to max size", "false", true);
1030
1031 configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1032 "Max objects this sim will hold", "15000", true);
1033
1034 configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1035 "Max avatars this sim will hold", "100", true);
1036
1037 configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
1038 "Scope ID for this region", UUID.Zero.ToString(), true);
1039
1040 configMember.addConfigurationOption("region_type", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
1041 "Region Type", String.Empty, true);
1042
1043 configMember.addConfigurationOption("region_static_maptile", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
1044 "UUID of a texture to use as the map for this region", String.Empty, true);
1045
1046 configMember.addConfigurationOption("region_static_mapfile", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
1047 "Filename of a texture to use as the map for this region", String.Empty, true);
1048 }
1049
1050 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
1051 {
1052 switch (configuration_key)
1053 {
1054 case "sim_UUID":
1055 RegionID = (UUID) configuration_result;
1056 originRegionID = (UUID) configuration_result;
1057 break;
1058 case "sim_name":
1059 RegionName = (string) configuration_result;
1060 break;
1061 case "sim_location_x":
1062 RegionLocX = (uint) configuration_result;
1063 break;
1064 case "sim_location_y":
1065 RegionLocY = (uint) configuration_result;
1066 break;
1067 case "sim_size_x":
1068 RegionSizeX = (uint) configuration_result;
1069 break;
1070 case "sim_size_y":
1071 RegionSizeY = (uint) configuration_result;
1072 break;
1073 case "sim_size_z":
1074 RegionSizeZ = (uint) configuration_result;
1075 break;
1076 case "internal_ip_address":
1077 IPAddress address = (IPAddress) configuration_result;
1078 m_internalEndPoint = new IPEndPoint(address, 0);
1079 break;
1080 case "internal_ip_port":
1081 m_internalEndPoint.Port = (int) configuration_result;
1082 break;
1083 case "allow_alternate_ports":
1084 m_allow_alternate_ports = (bool) configuration_result;
1085 break;
1086 case "external_host_name":
1087 if ((string) configuration_result != "SYSTEMIP")
1088 {
1089 m_externalHostName = (string) configuration_result;
1090 }
1091 else
1092 {
1093 m_externalHostName = Util.GetLocalHost().ToString();
1094 }
1095 break;
1096 case "lastmap_uuid":
1097 lastMapUUID = (UUID)configuration_result;
1098 break;
1099 case "lastmap_refresh":
1100 lastMapRefresh = (string)configuration_result;
1101 break;
1102 case "nonphysical_prim_max":
1103 m_nonphysPrimMax = (int)configuration_result;
1104 break;
1105 case "physical_prim_max":
1106 m_physPrimMax = (int)configuration_result;
1107 break;
1108 case "clamp_prim_size":
1109 m_clampPrimSize = (bool)configuration_result;
1110 break;
1111 case "object_capacity":
1112 m_objectCapacity = (int)configuration_result;
1113 break;
1114 case "prims_per_user":
1115 m_maxPrimsPerUser = (int)configuration_result;
1116 break;
1117 case "linkset_capacity":
1118 m_linksetCapacity = (int)configuration_result;
1119 break;
1120 case "agent_capacity":
1121 m_agentCapacity = (int)configuration_result;
1122 break;
1123 case "scope_id":
1124 ScopeID = (UUID)configuration_result;
1125 break;
1126 case "region_type":
1127 m_regionType = (string)configuration_result;
1128 break;
1129 case "region_static_maptile":
1130 m_maptileStaticUUID = (UUID)configuration_result;
1131 break;
1132 case "region_static_mapfile":
1133 MaptileStaticFile = (string)configuration_result;
1134 break;
1135 }
1136
1137 return true;
1138 }
1139
1140 public void SaveLastMapUUID(UUID mapUUID) 891 public void SaveLastMapUUID(UUID mapUUID)
1141 { 892 {
1142 lastMapUUID = mapUUID; 893 lastMapUUID = mapUUID;
1143 lastMapRefresh = Util.UnixTimeSinceEpoch().ToString(); 894 lastMapRefresh = Util.UnixTimeSinceEpoch().ToString();
1144
1145 if (configMember == null)
1146 return;
1147
1148 configMember.forceSetConfigurationOption("lastmap_uuid", mapUUID.ToString());
1149 configMember.forceSetConfigurationOption("lastmap_refresh", lastMapRefresh);
1150 } 895 }
1151 896
1152 public OSDMap PackRegionInfoData() 897 public OSDMap PackRegionInfoData()