aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-07-20 15:19:26 +0000
committerMelanie Thielker2008-07-20 15:19:26 +0000
commit8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e (patch)
tree33f604591d56737cd417975911612efa0fac3bd3
parentChange SQLite argument marker from the more standard '@' to the ':' supported (diff)
downloadopensim-SC_OLD-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.zip
opensim-SC_OLD-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.tar.gz
opensim-SC_OLD-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.tar.bz2
opensim-SC_OLD-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.tar.xz
Make the max sizes of physical and nonphysical prims configurable in OpenSim.ini
Defaulted to 65536 and 10, respectively
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs72
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs28
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs28
-rw-r--r--bin/OpenSim.ini.example4
5 files changed, 83 insertions, 65 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 0ab729d..f602e9f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -88,6 +88,8 @@ namespace OpenSim.Region.Environment.Scenes
88 /// Are we applying physics to any of the prims in this scene? 88 /// Are we applying physics to any of the prims in this scene?
89 /// </summary> 89 /// </summary>
90 public bool m_physicalPrim; 90 public bool m_physicalPrim;
91 public float m_maxNonphys = 65536;
92 public float m_maxPhys = 10;
91 93
92 public bool m_seeIntoRegionFromNeighbor; 94 public bool m_seeIntoRegionFromNeighbor;
93 public int MaxUndoCount = 5; 95 public int MaxUndoCount = 5;
@@ -308,6 +310,18 @@ namespace OpenSim.Region.Environment.Scenes
308 m_simulatorVersion = simulatorVersion 310 m_simulatorVersion = simulatorVersion
309 + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString() 311 + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
310 + " PhysPrim:" + m_physicalPrim.ToString(); 312 + " PhysPrim:" + m_physicalPrim.ToString();
313
314 try
315 {
316 IConfig startupConfig = m_config.Configs["Startup"];
317 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f);
318 m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f);
319 }
320 catch (Exception)
321 {
322 m_log.Warn("Failed to load StartupConfig");
323 }
324
311 } 325 }
312 326
313 #endregion 327 #endregion
@@ -1146,7 +1160,7 @@ namespace OpenSim.Region.Environment.Scenes
1146 } 1160 }
1147 catch (Exception) 1161 catch (Exception)
1148 { 1162 {
1149 m_log.Warn("Failed to load StarupConfg"); 1163 m_log.Warn("Failed to load StartupConfig");
1150 } 1164 }
1151 1165
1152 if (drawPrimVolume) 1166 if (drawPrimVolume)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 82e395d..c2ce9d8 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -2131,12 +2131,12 @@ namespace OpenSim.Region.Environment.Scenes
2131 /// <param name="localID"></param> 2131 /// <param name="localID"></param>
2132 public void Resize(LLVector3 scale, uint localID) 2132 public void Resize(LLVector3 scale, uint localID)
2133 { 2133 {
2134 if(scale.X > 65536.0f) 2134 if(scale.X > m_scene.m_maxNonphys)
2135 scale.X = 65536.0f; 2135 scale.X = m_scene.m_maxNonphys;
2136 if(scale.Y > 65536.0f) 2136 if(scale.Y > m_scene.m_maxNonphys)
2137 scale.Y = 65536.0f; 2137 scale.Y = m_scene.m_maxNonphys;
2138 if(scale.Z > 65536.0f) 2138 if(scale.Z > m_scene.m_maxNonphys)
2139 scale.Z = 65536.0f; 2139 scale.Z = m_scene.m_maxNonphys;
2140 2140
2141 SceneObjectPart part = GetChildPart(localID); 2141 SceneObjectPart part = GetChildPart(localID);
2142 if (part != null) 2142 if (part != null)
@@ -2146,12 +2146,12 @@ namespace OpenSim.Region.Environment.Scenes
2146 { 2146 {
2147 if(part.PhysActor.IsPhysical) 2147 if(part.PhysActor.IsPhysical)
2148 { 2148 {
2149 if(scale.X > 10.0f) 2149 if(scale.X > m_scene.m_maxPhys)
2150 scale.X = 10.0f; 2150 scale.X = m_scene.m_maxPhys;
2151 if(scale.Y > 10.0f) 2151 if(scale.Y > m_scene.m_maxPhys)
2152 scale.Y = 10.0f; 2152 scale.Y = m_scene.m_maxPhys;
2153 if(scale.Z > 10.0f) 2153 if(scale.Z > m_scene.m_maxPhys)
2154 scale.Z = 10.0f; 2154 scale.Z = m_scene.m_maxPhys;
2155 } 2155 }
2156 part.PhysActor.Size = 2156 part.PhysActor.Size =
2157 new PhysicsVector(scale.X, scale.Y, scale.Z); 2157 new PhysicsVector(scale.X, scale.Y, scale.Z);
@@ -2179,20 +2179,20 @@ namespace OpenSim.Region.Environment.Scenes
2179 SceneObjectPart part = GetChildPart(localID); 2179 SceneObjectPart part = GetChildPart(localID);
2180 if (part != null) 2180 if (part != null)
2181 { 2181 {
2182 if(scale.X > 65536.0f) 2182 if(scale.X > m_scene.m_maxNonphys)
2183 scale.X = 65536.0f; 2183 scale.X = m_scene.m_maxNonphys;
2184 if(scale.Y > 65536.0f) 2184 if(scale.Y > m_scene.m_maxNonphys)
2185 scale.Y = 65536.0f; 2185 scale.Y = m_scene.m_maxNonphys;
2186 if(scale.Z > 65536.0f) 2186 if(scale.Z > m_scene.m_maxNonphys)
2187 scale.Z = 65536.0f; 2187 scale.Z = m_scene.m_maxNonphys;
2188 if(part.PhysActor != null && part.PhysActor.IsPhysical) 2188 if(part.PhysActor != null && part.PhysActor.IsPhysical)
2189 { 2189 {
2190 if(scale.X > 10.0f) 2190 if(scale.X > m_scene.m_maxPhys)
2191 scale.X = 10.0f; 2191 scale.X = m_scene.m_maxPhys;
2192 if(scale.Y > 10.0f) 2192 if(scale.Y > m_scene.m_maxPhys)
2193 scale.Y = 10.0f; 2193 scale.Y = m_scene.m_maxPhys;
2194 if(scale.Z > 10.0f) 2194 if(scale.Z > m_scene.m_maxPhys)
2195 scale.Z = 10.0f; 2195 scale.Z = m_scene.m_maxPhys;
2196 } 2196 }
2197 float x = (scale.X / part.Scale.X); 2197 float x = (scale.X / part.Scale.X);
2198 float y = (scale.Y / part.Scale.Y); 2198 float y = (scale.Y / part.Scale.Y);
@@ -2213,25 +2213,25 @@ namespace OpenSim.Region.Environment.Scenes
2213 2213
2214 if(part.PhysActor != null && part.PhysActor.IsPhysical) 2214 if(part.PhysActor != null && part.PhysActor.IsPhysical)
2215 { 2215 {
2216 if(oldSize.X*x > 10.0f) 2216 if(oldSize.X*x > m_scene.m_maxPhys)
2217 { 2217 {
2218 f = 10.0f / oldSize.X; 2218 f = m_scene.m_maxPhys / oldSize.X;
2219 a = f / x; 2219 a = f / x;
2220 x *= a; 2220 x *= a;
2221 y *= a; 2221 y *= a;
2222 z *= a; 2222 z *= a;
2223 } 2223 }
2224 if(oldSize.Y*y > 10.0f) 2224 if(oldSize.Y*y > m_scene.m_maxPhys)
2225 { 2225 {
2226 f = 10.0f / oldSize.Y; 2226 f = m_scene.m_maxPhys / oldSize.Y;
2227 a = f / y; 2227 a = f / y;
2228 x *= a; 2228 x *= a;
2229 y *= a; 2229 y *= a;
2230 z *= a; 2230 z *= a;
2231 } 2231 }
2232 if(oldSize.Z*z > 10.0f) 2232 if(oldSize.Z*z > m_scene.m_maxPhys)
2233 { 2233 {
2234 f = 10.0f / oldSize.Z; 2234 f = m_scene.m_maxPhys / oldSize.Z;
2235 a = f / z; 2235 a = f / z;
2236 x *= a; 2236 x *= a;
2237 y *= a; 2237 y *= a;
@@ -2240,25 +2240,25 @@ namespace OpenSim.Region.Environment.Scenes
2240 } 2240 }
2241 else 2241 else
2242 { 2242 {
2243 if(oldSize.X*x > 65536.0f) 2243 if(oldSize.X*x > m_scene.m_maxNonphys)
2244 { 2244 {
2245 f = 65536.0f / oldSize.X; 2245 f = m_scene.m_maxNonphys / oldSize.X;
2246 a = f / x; 2246 a = f / x;
2247 x *= a; 2247 x *= a;
2248 y *= a; 2248 y *= a;
2249 z *= a; 2249 z *= a;
2250 } 2250 }
2251 if(oldSize.Y*y > 65536.0f) 2251 if(oldSize.Y*y > m_scene.m_maxNonphys)
2252 { 2252 {
2253 f = 65536.0f / oldSize.Y; 2253 f = m_scene.m_maxNonphys / oldSize.Y;
2254 a = f / y; 2254 a = f / y;
2255 x *= a; 2255 x *= a;
2256 y *= a; 2256 y *= a;
2257 z *= a; 2257 z *= a;
2258 } 2258 }
2259 if(oldSize.Z*z > 65536.0f) 2259 if(oldSize.Z*z > m_scene.m_maxNonphys)
2260 { 2260 {
2261 f = 65536.0f / oldSize.Z; 2261 f = m_scene.m_maxNonphys / oldSize.Z;
2262 a = f / z; 2262 a = f / z;
2263 x *= a; 2263 x *= a;
2264 y *= a; 2264 y *= a;
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 40e225d..7745d95 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -933,7 +933,7 @@ namespace OpenSim.Region.ScriptEngine.Common
933 bool allow = true; 933 bool allow = true;
934 foreach(SceneObjectPart part in group.Children.Values) 934 foreach(SceneObjectPart part in group.Children.Values)
935 { 935 {
936 if(part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) 936 if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
937 { 937 {
938 allow = false; 938 allow = false;
939 break; 939 break;
@@ -1066,19 +1066,19 @@ namespace OpenSim.Region.ScriptEngine.Common
1066 1066
1067 if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) 1067 if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
1068 { 1068 {
1069 if(scale.x > 10.0) 1069 if(scale.x > World.m_maxPhys)
1070 scale.x = 10.0; 1070 scale.x = World.m_maxPhys;
1071 if(scale.y > 10.0) 1071 if(scale.y > World.m_maxPhys)
1072 scale.y = 10.0; 1072 scale.y = World.m_maxPhys;
1073 if(scale.z > 10.0) 1073 if(scale.z > World.m_maxPhys)
1074 scale.z = 10.0; 1074 scale.z = World.m_maxPhys;
1075 } 1075 }
1076 if(scale.x > 65536.0) 1076 if(scale.x > World.m_maxNonphys)
1077 scale.x = 65536.0; 1077 scale.x = World.m_maxNonphys;
1078 if(scale.y > 65536.0) 1078 if(scale.y > World.m_maxNonphys)
1079 scale.y = 65536.0; 1079 scale.y = World.m_maxNonphys;
1080 if(scale.z > 65536.0) 1080 if(scale.z > World.m_maxNonphys)
1081 scale.z = 65536.0; 1081 scale.z = World.m_maxNonphys;
1082 LLVector3 tmp = part.Scale; 1082 LLVector3 tmp = part.Scale;
1083 tmp.X = (float)scale.x; 1083 tmp.X = (float)scale.x;
1084 tmp.Y = (float)scale.y; 1084 tmp.Y = (float)scale.y;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c597661..79bd6fe 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -775,7 +775,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
775 bool allow = true; 775 bool allow = true;
776 foreach(SceneObjectPart part in group.Children.Values) 776 foreach(SceneObjectPart part in group.Children.Values)
777 { 777 {
778 if(part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) 778 if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
779 { 779 {
780 allow = false; 780 allow = false;
781 break; 781 break;
@@ -922,19 +922,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
922 922
923 if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) 923 if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
924 { 924 {
925 if(scale.x > 10.0) 925 if(scale.x > World.m_maxPhys)
926 scale.x = 10.0; 926 scale.x = World.m_maxPhys;
927 if(scale.y > 10.0) 927 if(scale.y > World.m_maxPhys)
928 scale.y = 10.0; 928 scale.y = World.m_maxPhys;
929 if(scale.z > 10.0) 929 if(scale.z > World.m_maxPhys)
930 scale.z = 10.0; 930 scale.z = World.m_maxPhys;
931 } 931 }
932 if(scale.x > 65536.0) 932 if(scale.x > World.m_maxNonphys)
933 scale.x = 65536.0; 933 scale.x = World.m_maxNonphys;
934 if(scale.y > 65536.0) 934 if(scale.y > World.m_maxNonphys)
935 scale.y = 65536.0; 935 scale.y = World.m_maxNonphys;
936 if(scale.z > 65536.0) 936 if(scale.z > World.m_maxNonphys)
937 scale.z = 65536.0; 937 scale.z = World.m_maxNonphys;
938 LLVector3 tmp = part.Scale; 938 LLVector3 tmp = part.Scale;
939 tmp.X = (float)scale.x; 939 tmp.X = (float)scale.x;
940 tmp.Y = (float)scale.y; 940 tmp.Y = (float)scale.y;
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index afcb8ee..964a1f5 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -26,6 +26,10 @@ region_info_source = "filesystem"
26; objects, so you can turn it off here if you'd like. 26; objects, so you can turn it off here if you'd like.
27DrawPrimOnMapTile = true 27DrawPrimOnMapTile = true
28 28
29; Maximum total size, and maximum size where a prim can be physical
30NonPhysicalPrimMax = 65536
31PhysicalPrimMax = 10
32
29; ## 33; ##
30; ## STORAGE 34; ## STORAGE
31; ## 35; ##