aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJeff Ames2008-06-13 00:21:53 +0000
committerJeff Ames2008-06-13 00:21:53 +0000
commit64f01ade04863dbe7b392ea8f0fc4dcc8e32bd94 (patch)
tree74c4e8fdc25dc28da7c63cbc9d97141c0f344938
parentlook mom, migrations in action. This adds a couple of indexes (diff)
downloadopensim-SC_OLD-64f01ade04863dbe7b392ea8f0fc4dcc8e32bd94.zip
opensim-SC_OLD-64f01ade04863dbe7b392ea8f0fc4dcc8e32bd94.tar.gz
opensim-SC_OLD-64f01ade04863dbe7b392ea8f0fc4dcc8e32bd94.tar.bz2
opensim-SC_OLD-64f01ade04863dbe7b392ea8f0fc4dcc8e32bd94.tar.xz
Update svn properties, clean up formatting, refactor out duplicate hard-coded port numbers.
-rw-r--r--OpenSim/Data/Migration.cs23
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs2
-rw-r--r--OpenSim/Framework/MessageServerConfig.cs4
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs22
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs46
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs25
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs26
11 files changed, 74 insertions, 94 deletions
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs
index 54d4970..d23200c 100644
--- a/OpenSim/Data/Migration.cs
+++ b/OpenSim/Data/Migration.cs
@@ -129,9 +129,12 @@ namespace OpenSim.Data
129 cmd.CommandText = kvp.Value; 129 cmd.CommandText = kvp.Value;
130 cmd.ExecuteNonQuery(); 130 cmd.ExecuteNonQuery();
131 131
132 if (version == 0) { 132 if (version == 0)
133 {
133 InsertVersion(_type, newversion); 134 InsertVersion(_type, newversion);
134 } else { 135 }
136 else
137 {
135 UpdateVersion(_type, newversion); 138 UpdateVersion(_type, newversion);
136 } 139 }
137 version = newversion; 140 version = newversion;
@@ -149,7 +152,7 @@ namespace OpenSim.Data
149 if (m.Success) 152 if (m.Success)
150 { 153 {
151 int MigrationVersion = int.Parse(m.Groups[1].ToString()); 154 int MigrationVersion = int.Parse(m.Groups[1].ToString());
152 if ( MigrationVersion > max ) 155 if (MigrationVersion > max)
153 max = MigrationVersion; 156 max = MigrationVersion;
154 } 157 }
155 } 158 }
@@ -160,9 +163,12 @@ namespace OpenSim.Data
160 { 163 {
161 get { return FindVersion(_type); } 164 get { return FindVersion(_type); }
162 set { 165 set {
163 if (Version < 1) { 166 if (Version < 1)
167 {
164 InsertVersion(_type, value); 168 InsertVersion(_type, value);
165 } else { 169 }
170 else
171 {
166 UpdateVersion(_type, value); 172 UpdateVersion(_type, value);
167 } 173 }
168 } 174 }
@@ -172,7 +178,8 @@ namespace OpenSim.Data
172 { 178 {
173 int version = 0; 179 int version = 0;
174 DbCommand cmd = _conn.CreateCommand(); 180 DbCommand cmd = _conn.CreateCommand();
175 try { 181 try
182 {
176 cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; 183 cmd.CommandText = "select version from migrations where name='" + type + "' limit 1";
177 using (IDataReader reader = cmd.ExecuteReader()) 184 using (IDataReader reader = cmd.ExecuteReader())
178 { 185 {
@@ -182,7 +189,9 @@ namespace OpenSim.Data
182 } 189 }
183 reader.Close(); 190 reader.Close();
184 } 191 }
185 } catch { 192 }
193 catch
194 {
186 // Something went wrong, so we're version 0 195 // Something went wrong, so we're version 0
187 } 196 }
188 return version; 197 return version;
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 780b96f..de0826f 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -132,7 +132,7 @@ namespace OpenSim.Data.MySQL
132 132
133 // if there are no tables, get out of here and let 133 // if there are no tables, get out of here and let
134 // migrations do their job 134 // migrations do their job
135 if( 135 if (
136 tableList["inventoryfolders"] == null && 136 tableList["inventoryfolders"] == null &&
137 tableList["inventoryitems"] == null 137 tableList["inventoryitems"] == null
138 ) 138 )
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 279ff71..05874f8 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -138,7 +138,7 @@ namespace OpenSim.Data.MySQL
138 138
139 // if there are no tables, get out of here and let 139 // if there are no tables, get out of here and let
140 // migrations do their job 140 // migrations do their job
141 if( 141 if (
142 tableList[m_agentsTableName] == null && 142 tableList[m_agentsTableName] == null &&
143 tableList[m_usersTableName] == null && 143 tableList[m_usersTableName] == null &&
144 tableList[m_userFriendsTableName] == null && 144 tableList[m_userFriendsTableName] == null &&
diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs
index b7a51bc..5e1daee 100644
--- a/OpenSim/Framework/MessageServerConfig.cs
+++ b/OpenSim/Framework/MessageServerConfig.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Framework
63 configMember.addConfigurationOption("default_user_server", 63 configMember.addConfigurationOption("default_user_server",
64 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 64 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
65 "Default User Server URI", 65 "Default User Server URI",
66 "http://127.0.0.1:8002" + "/", false); 66 "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false);
67 configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 67 configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
68 "Key to send to user server", "null", false); 68 "Key to send to user server", "null", false);
69 configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 69 configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
@@ -71,7 +71,7 @@ namespace OpenSim.Framework
71 configMember.addConfigurationOption("default_grid_server", 71 configMember.addConfigurationOption("default_grid_server",
72 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 72 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
73 "Default Grid Server URI", 73 "Default Grid Server URI",
74 "http://127.0.0.1:8001/", false); 74 "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/", false);
75 configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 75 configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
76 "Key to send to grid server", "null", false); 76 "Key to send to grid server", "null", false);
77 configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 77 configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index a273676..433b040 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -47,14 +47,14 @@ namespace OpenSim.Framework.Servers
47 /// server. 47 /// server.
48 /// </summary> 48 /// </summary>
49 private Timer m_periodicLogStatsTimer = new Timer(60 * 60 * 1000); 49 private Timer m_periodicLogStatsTimer = new Timer(60 * 60 * 1000);
50 50
51 protected ConsoleBase m_console; 51 protected ConsoleBase m_console;
52 52
53 /// <summary> 53 /// <summary>
54 /// Time at which this server was started 54 /// Time at which this server was started
55 /// </summary> 55 /// </summary>
56 protected DateTime m_startuptime; 56 protected DateTime m_startuptime;
57 57
58 /// <summary> 58 /// <summary>
59 /// Record the initial startup directory for info purposes 59 /// Record the initial startup directory for info purposes
60 /// </summary> 60 /// </summary>
@@ -80,11 +80,11 @@ namespace OpenSim.Framework.Servers
80 { 80 {
81 m_startuptime = DateTime.Now; 81 m_startuptime = DateTime.Now;
82 m_version = VersionInfo.Version; 82 m_version = VersionInfo.Version;
83 83
84 m_periodicLogStatsTimer.Elapsed += new ElapsedEventHandler(LogStats); 84 m_periodicLogStatsTimer.Elapsed += new ElapsedEventHandler(LogStats);
85 m_periodicLogStatsTimer.Enabled = true; 85 m_periodicLogStatsTimer.Enabled = true;
86 } 86 }
87 87
88 /// <summary> 88 /// <summary>
89 /// Print statistics to the logfile, if they are active 89 /// Print statistics to the logfile, if they are active
90 /// </summary> 90 /// </summary>
@@ -93,7 +93,7 @@ namespace OpenSim.Framework.Servers
93 if (m_stats != null) 93 if (m_stats != null)
94 { 94 {
95 m_log.Info(m_stats.Report()); 95 m_log.Info(m_stats.Report());
96 } 96 }
97 } 97 }
98 98
99 /// <summary> 99 /// <summary>
@@ -131,10 +131,10 @@ namespace OpenSim.Framework.Servers
131 Notice("quit - equivalent to shutdown."); 131 Notice("quit - equivalent to shutdown.");
132 132
133 Notice("show info - show server information (e.g. startup path)."); 133 Notice("show info - show server information (e.g. startup path).");
134 134
135 if (m_stats != null) 135 if (m_stats != null)
136 Notice("show stats - show statistical information for this server"); 136 Notice("show stats - show statistical information for this server");
137 137
138 Notice("show uptime - show server startup time and uptime."); 138 Notice("show uptime - show server startup time and uptime.");
139 Notice("show version - show server version."); 139 Notice("show version - show server version.");
140 Notice("shutdown - shutdown the server.\n"); 140 Notice("shutdown - shutdown the server.\n");
@@ -165,9 +165,9 @@ namespace OpenSim.Framework.Servers
165 { 165 {
166 case "info": 166 case "info":
167 Notice("Version: " + m_version ); 167 Notice("Version: " + m_version );
168 Notice("Startup directory: " + m_startupDirectory); 168 Notice("Startup directory: " + m_startupDirectory);
169 break; 169 break;
170 170
171 case "stats": 171 case "stats":
172 if (m_stats != null) 172 if (m_stats != null)
173 { 173 {
@@ -255,7 +255,7 @@ namespace OpenSim.Framework.Servers
255 { 255 {
256 OSString = Util.ReadEtcIssue(); 256 OSString = Util.ReadEtcIssue();
257 } 257 }
258 258
259 if (OSString.Length > 45) 259 if (OSString.Length > 45)
260 { 260 {
261 OSString = OSString.Substring(0, 45); 261 OSString = OSString.Substring(0, 45);
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index 54538d8..69f1902 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -193,8 +193,8 @@ namespace OpenSim.Region.Environment.Scenes
193 /// <param name="xmlData"></param> 193 /// <param name="xmlData"></param>
194 protected static void CreatePrimFromXml2(Scene scene, string xmlData) 194 protected static void CreatePrimFromXml2(Scene scene, string xmlData)
195 { 195 {
196 SceneObjectGroup obj = new SceneObjectGroup(xmlData); 196 SceneObjectGroup obj = new SceneObjectGroup(xmlData);
197 197
198 LLVector3 receivedVelocity = obj.RootPart.Velocity; 198 LLVector3 receivedVelocity = obj.RootPart.Velocity;
199 //System.Console.WriteLine(obj.RootPart.Velocity.ToString()); 199 //System.Console.WriteLine(obj.RootPart.Velocity.ToString());
200 scene.AddSceneObjectFromStorage(obj); 200 scene.AddSceneObjectFromStorage(obj);
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
index 041af2b..ebcb440 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
136 { 136 {
137 bool lookup = false; 137 bool lookup = false;
138 138
139 lock(cachedMapBlocks) 139 lock (cachedMapBlocks)
140 { 140 {
141 if (cachedMapBlocks.Count > 0 && ((cachedTime + 1800) > Util.UnixTimeSinceEpoch())) 141 if (cachedMapBlocks.Count > 0 && ((cachedTime + 1800) > Util.UnixTimeSinceEpoch()))
142 { 142 {
@@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
157 mapBlocks = m_scene.CommsManager.GridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); 157 mapBlocks = m_scene.CommsManager.GridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8);
158 avatarPresence.ControllingClient.SendMapBlock(mapBlocks); 158 avatarPresence.ControllingClient.SendMapBlock(mapBlocks);
159 159
160 lock(cachedMapBlocks) 160 lock (cachedMapBlocks)
161 cachedMapBlocks = mapBlocks; 161 cachedMapBlocks = mapBlocks;
162 162
163 cachedTime = Util.UnixTimeSinceEpoch(); 163 cachedTime = Util.UnixTimeSinceEpoch();
@@ -236,4 +236,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
236 remoteClient.SendMapBlock(mapBlocks); 236 remoteClient.SendMapBlock(mapBlocks);
237 } 237 }
238 } 238 }
239} \ No newline at end of file 239}
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index d09efd8..9bbfc3d 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -193,7 +193,7 @@ namespace OpenSim.Region.Environment.Scenes
193 { 193 {
194 sceneObject.RegionHandle = m_regInfo.RegionHandle; 194 sceneObject.RegionHandle = m_regInfo.RegionHandle;
195 sceneObject.SetScene(m_parentScene); 195 sceneObject.SetScene(m_parentScene);
196 196
197 foreach (SceneObjectPart part in sceneObject.Children.Values) 197 foreach (SceneObjectPart part in sceneObject.Children.Values)
198 { 198 {
199 part.LocalId = m_parentScene.PrimIDAllocate(); 199 part.LocalId = m_parentScene.PrimIDAllocate();
@@ -209,7 +209,7 @@ namespace OpenSim.Region.Environment.Scenes
209 /// </summary> 209 /// </summary>
210 /// <param name="sceneObject"></param> 210 /// <param name="sceneObject"></param>
211 /// <param name="attachToBackup"> 211 /// <param name="attachToBackup">
212 /// If true, the object is made persistent into the scene. 212 /// If true, the object is made persistent into the scene.
213 /// If false, the object will not persist over server restarts 213 /// If false, the object will not persist over server restarts
214 /// </param> 214 /// </param>
215 /// <returns>true if the object was added, false if an object with the same uuid was already in the scene 215 /// <returns>true if the object was added, false if an object with the same uuid was already in the scene
@@ -223,9 +223,9 @@ namespace OpenSim.Region.Environment.Scenes
223 // QuadTree.AddSceneObject(sceneObject); 223 // QuadTree.AddSceneObject(sceneObject);
224 Entities.Add(sceneObject.UUID, sceneObject); 224 Entities.Add(sceneObject.UUID, sceneObject);
225 m_numPrim += sceneObject.Children.Count; 225 m_numPrim += sceneObject.Children.Count;
226 226
227 if (attachToBackup) 227 if (attachToBackup)
228 sceneObject.AttachToBackup(); 228 sceneObject.AttachToBackup();
229 229
230 return true; 230 return true;
231 } 231 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 95d6f1f..e70fbe2 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -998,7 +998,7 @@ namespace OpenSim.Region.Environment.Scenes
998 // Cannot create a map for a nonexistant heightmap yet. 998 // Cannot create a map for a nonexistant heightmap yet.
999 if (Heightmap == null) 999 if (Heightmap == null)
1000 return; 1000 return;
1001 1001
1002 if (terrain == null) 1002 if (terrain == null)
1003 { 1003 {
1004 int tc = System.Environment.TickCount; 1004 int tc = System.Environment.TickCount;
@@ -1122,12 +1122,9 @@ namespace OpenSim.Region.Environment.Scenes
1122 mapbmp.SetPixel(x, (256 - y) - 1, black); 1122 mapbmp.SetPixel(x, (256 - y) - 1, black);
1123 } 1123 }
1124 } 1124 }
1125
1126 } 1125 }
1127 //} 1126 //}
1128 1127
1129
1130
1131 //tc = System.Environment.TickCount - tc; 1128 //tc = System.Environment.TickCount - tc;
1132 //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms"); 1129 //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms");
1133 } 1130 }
@@ -1135,7 +1132,6 @@ namespace OpenSim.Region.Environment.Scenes
1135 1132
1136 bool drawPrimVolume = true; 1133 bool drawPrimVolume = true;
1137 1134
1138
1139 try 1135 try
1140 { 1136 {
1141 IConfig startupConfig = m_config.Configs["Startup"]; 1137 IConfig startupConfig = m_config.Configs["Startup"];
@@ -1145,7 +1141,6 @@ namespace OpenSim.Region.Environment.Scenes
1145 { 1141 {
1146 m_log.Warn("Failed to load StarupConfg"); 1142 m_log.Warn("Failed to load StarupConfg");
1147 } 1143 }
1148
1149 1144
1150 if (drawPrimVolume) 1145 if (drawPrimVolume)
1151 { 1146 {
@@ -1168,8 +1163,8 @@ namespace OpenSim.Region.Environment.Scenes
1168 // Draw if the object is at least 1 meter wide in any direction 1163 // Draw if the object is at least 1 meter wide in any direction
1169 if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f) 1164 if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f)
1170 { 1165 {
1171 // Try to get the RGBA of the default texture entry.. 1166 // Try to get the RGBA of the default texture entry..
1172 // 1167 //
1173 try 1168 try
1174 { 1169 {
1175 LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; 1170 LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA;
@@ -1177,9 +1172,7 @@ namespace OpenSim.Region.Environment.Scenes
1177 int colorg = 255 - (int)(texcolor.G * 255f); 1172 int colorg = 255 - (int)(texcolor.G * 255f);
1178 int colorb = 255 - (int)(texcolor.B * 255f); 1173 int colorb = 255 - (int)(texcolor.B * 255f);
1179 1174
1180 if (colorr == 255 && colorg == 255 && colorb == 255) 1175 if (!(colorr == 255 && colorg == 255 && colorb == 255))
1181 { }
1182 else
1183 { 1176 {
1184 //Try to set the map spot color 1177 //Try to set the map spot color
1185 try 1178 try
@@ -1248,10 +1241,9 @@ namespace OpenSim.Region.Environment.Scenes
1248 || mapdrawendY > 255) 1241 || mapdrawendY > 255)
1249 continue; 1242 continue;
1250 1243
1251
1252 int wy = 0; 1244 int wy = 0;
1253 1245
1254 bool breakYN = false; // If we run into an error drawing, break out of the 1246 bool breakYN = false; // If we run into an error drawing, break out of the
1255 // loop so we don't lag to death on error handling 1247 // loop so we don't lag to death on error handling
1256 for (int wx = mapdrawstartX; wx < mapdrawendX; wx++) 1248 for (int wx = mapdrawstartX; wx < mapdrawendX; wx++)
1257 { 1249 {
@@ -1274,7 +1266,7 @@ namespace OpenSim.Region.Environment.Scenes
1274 1266
1275 if (breakYN) 1267 if (breakYN)
1276 break; 1268 break;
1277 } 1269 }
1278 } // Object is within 256m Z of terrain 1270 } // Object is within 256m Z of terrain
1279 } // object is at least a meter wide 1271 } // object is at least a meter wide
1280 } // loop over group children 1272 } // loop over group children
@@ -1304,7 +1296,6 @@ namespace OpenSim.Region.Environment.Scenes
1304 asset.Type = 0; 1296 asset.Type = 0;
1305 asset.Temporary = temporary; 1297 asset.Temporary = temporary;
1306 AssetCache.AddAsset(asset); 1298 AssetCache.AddAsset(asset);
1307
1308 } 1299 }
1309 else 1300 else
1310 { 1301 {
@@ -1322,7 +1313,6 @@ namespace OpenSim.Region.Environment.Scenes
1322 AssetCache.AddAsset(asset); 1313 AssetCache.AddAsset(asset);
1323 } 1314 }
1324 } 1315 }
1325
1326 } 1316 }
1327 1317
1328 #endregion 1318 #endregion
@@ -1442,10 +1432,8 @@ namespace OpenSim.Region.Environment.Scenes
1442 1432
1443 // Un-offset the prim (it gets offset later by the consumer method) 1433 // Un-offset the prim (it gets offset later by the consumer method)
1444 pos.Z -= 0.25F; 1434 pos.Z -= 0.25F;
1445
1446 } 1435 }
1447 1436
1448
1449 return pos; 1437 return pos;
1450 } 1438 }
1451 else 1439 else
@@ -1523,7 +1511,7 @@ namespace OpenSim.Region.Environment.Scenes
1523 // case... other tree types 1511 // case... other tree types
1524 // tree.Scale = new LLVector3(?, ?, ?); 1512 // tree.Scale = new LLVector3(?, ?, ?);
1525 // break; 1513 // break;
1526 1514
1527 default: 1515 default:
1528 tree.Scale = new LLVector3(4, 4, 4); 1516 tree.Scale = new LLVector3(4, 4, 4);
1529 break; 1517 break;
@@ -1557,7 +1545,7 @@ namespace OpenSim.Region.Environment.Scenes
1557 /// </summary> 1545 /// </summary>
1558 /// <param name="sceneObject"></param> 1546 /// <param name="sceneObject"></param>
1559 /// <param name="attachToBackup"> 1547 /// <param name="attachToBackup">
1560 /// If true, the object is made persistent into the scene. 1548 /// If true, the object is made persistent into the scene.
1561 /// If false, the object will not persist over server restarts 1549 /// If false, the object will not persist over server restarts
1562 /// </param> 1550 /// </param>
1563 public void AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) 1551 public void AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
@@ -1889,11 +1877,9 @@ namespace OpenSim.Region.Environment.Scenes
1889 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; 1877 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay;
1890 client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags; 1878 client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags;
1891 client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily; 1879 client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily;
1892
1893 client.OnRequestGodlikePowers += handleRequestGodlikePowers; 1880 client.OnRequestGodlikePowers += handleRequestGodlikePowers;
1894 client.OnGodKickUser += HandleGodlikeKickUser; 1881 client.OnGodKickUser += HandleGodlikeKickUser;
1895 client.OnObjectPermissions += HandleObjectPermissionsUpdate; 1882 client.OnObjectPermissions += HandleObjectPermissionsUpdate;
1896
1897 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 1883 client.OnCreateNewInventoryItem += CreateNewInventoryItem;
1898 client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder; 1884 client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder;
1899 client.OnUpdateInventoryFolder += CommsManager.UserProfileCacheService.HandleUpdateInventoryFolder; 1885 client.OnUpdateInventoryFolder += CommsManager.UserProfileCacheService.HandleUpdateInventoryFolder;
@@ -1907,29 +1893,23 @@ namespace OpenSim.Region.Environment.Scenes
1907 client.OnRemoveInventoryItem += RemoveInventoryItem; 1893 client.OnRemoveInventoryItem += RemoveInventoryItem;
1908 client.OnRemoveInventoryFolder += RemoveInventoryFolder; 1894 client.OnRemoveInventoryFolder += RemoveInventoryFolder;
1909 client.OnRezScript += RezScript; 1895 client.OnRezScript += RezScript;
1910
1911 client.OnRequestTaskInventory += RequestTaskInventory; 1896 client.OnRequestTaskInventory += RequestTaskInventory;
1912 client.OnRemoveTaskItem += RemoveTaskInventory; 1897 client.OnRemoveTaskItem += RemoveTaskInventory;
1913 client.OnUpdateTaskInventory += UpdateTaskInventory; 1898 client.OnUpdateTaskInventory += UpdateTaskInventory;
1914 client.OnMoveTaskItem += MoveTaskInventoryItem; 1899 client.OnMoveTaskItem += MoveTaskInventoryItem;
1915
1916 client.OnGrabObject += ProcessObjectGrab; 1900 client.OnGrabObject += ProcessObjectGrab;
1917 client.OnDeGrabObject += ProcessObjectDeGrab; 1901 client.OnDeGrabObject += ProcessObjectDeGrab;
1918 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; 1902 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
1919 client.OnParcelBuy += ProcessParcelBuy; 1903 client.OnParcelBuy += ProcessParcelBuy;
1920 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; 1904 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
1921 client.OnPacketStats += AddPacketStats; 1905 client.OnPacketStats += AddPacketStats;
1922
1923 client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable; 1906 client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable;
1924
1925 client.OnTeleportHomeRequest += TeleportClientHome; 1907 client.OnTeleportHomeRequest += TeleportClientHome;
1926
1927 client.OnSetStartLocationRequest += SetHomeRezPoint; 1908 client.OnSetStartLocationRequest += SetHomeRezPoint;
1928 client.OnUndo += m_innerScene.HandleUndo; 1909 client.OnUndo += m_innerScene.HandleUndo;
1929 client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; 1910 client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
1930 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; 1911 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
1931 client.OnScriptReset += ProcessScriptReset; 1912 client.OnScriptReset += ProcessScriptReset;
1932
1933 1913
1934 // EventManager.TriggerOnNewClient(client); 1914 // EventManager.TriggerOnNewClient(client);
1935 } 1915 }
@@ -1947,8 +1927,8 @@ namespace OpenSim.Region.Environment.Scenes
1947 } 1927 }
1948 1928
1949 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, 1929 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID,
1950 LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, 1930 LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart,
1951 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) 1931 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
1952 { 1932 {
1953 LLVector3 pos; 1933 LLVector3 pos;
1954 const bool frontFacesOnly = true; 1934 const bool frontFacesOnly = true;
@@ -1958,7 +1938,6 @@ namespace OpenSim.Region.Environment.Scenes
1958 1938
1959 if (target != null && target2 != null) 1939 if (target != null && target2 != null)
1960 { 1940 {
1961
1962 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); 1941 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart);
1963 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 1942 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
1964 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 1943 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
@@ -1991,10 +1970,9 @@ namespace OpenSim.Region.Environment.Scenes
1991 ScaleOffset = Math.Abs(ScaleOffset); 1970 ScaleOffset = Math.Abs(ScaleOffset);
1992 LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); 1971 LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z);
1993 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); 1972 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z);
1994 LLVector3 offset = (normal * (ScaleOffset / 2f)); 1973 LLVector3 offset = normal * (ScaleOffset / 2f);
1995 pos = (intersectionpoint + offset); 1974 pos = intersectionpoint + offset;
1996 1975
1997
1998 // stick in offset format from the original prim 1976 // stick in offset format from the original prim
1999 pos = pos - target.ParentGroup.AbsolutePosition; 1977 pos = pos - target.ParentGroup.AbsolutePosition;
2000 if (CopyRotates) 1978 if (CopyRotates)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 2774a45..f6dc8a2 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -418,7 +418,7 @@ namespace OpenSim.Region.Environment.Scenes
418 RegisterToEvents(); 418 RegisterToEvents();
419 SetDirectionVectors(); 419 SetDirectionVectors();
420 420
421 421
422 } 422 }
423 423
424 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, 424 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams,
@@ -481,8 +481,6 @@ namespace OpenSim.Region.Environment.Scenes
481 // } 481 // }
482 } 482 }
483 483
484
485
486 public uint GenerateClientFlags(LLUUID ObjectID) 484 public uint GenerateClientFlags(LLUUID ObjectID)
487 { 485 {
488 return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID); 486 return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID);
@@ -590,27 +588,27 @@ namespace OpenSim.Region.Environment.Scenes
590// m_log.DebugFormat( 588// m_log.DebugFormat(
591// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}", 589// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}",
592// Name, UUID, m_scene.RegionInfo.RegionName, pos); 590// Name, UUID, m_scene.RegionInfo.RegionName, pos);
593 591
594 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0) 592 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0)
595 { 593 {
596 LLVector3 emergencyPos = new LLVector3(128, 128, 128); 594 LLVector3 emergencyPos = new LLVector3(128, 128, 128);
597 595
598 m_log.WarnFormat( 596 m_log.WarnFormat(
599 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 597 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
600 pos, Name, UUID, emergencyPos); 598 pos, Name, UUID, emergencyPos);
601 599
602 pos = emergencyPos; 600 pos = emergencyPos;
603 } 601 }
604 602
605 m_isChildAgent = false; 603 m_isChildAgent = false;
606 604
607 float localAVHeight = 1.56f; 605 float localAVHeight = 1.56f;
608 if (m_avHeight != 127.0f) 606 if (m_avHeight != 127.0f)
609 { 607 {
610 localAVHeight = m_avHeight; 608 localAVHeight = m_avHeight;
611 } 609 }
612 610
613 float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); 611 float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y);
614 float newPosZ = posZLimit + localAVHeight; 612 float newPosZ = posZLimit + localAVHeight;
615 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 613 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
616 { 614 {
@@ -789,7 +787,7 @@ namespace OpenSim.Region.Environment.Scenes
789 // Must check for standing up even when PhysicsActor is null, 787 // Must check for standing up even when PhysicsActor is null,
790 // since sitting currently removes avatar from physical scene 788 // since sitting currently removes avatar from physical scene
791 //m_log.Debug("agentPos:" + AbsolutePosition.ToString()); 789 //m_log.Debug("agentPos:" + AbsolutePosition.ToString());
792 790
793 // This is irritating. Really. 791 // This is irritating. Really.
794 if (!AbsolutePosition.IsFinite()) 792 if (!AbsolutePosition.IsFinite())
795 { 793 {
@@ -969,8 +967,6 @@ namespace OpenSim.Region.Environment.Scenes
969 } 967 }
970 } 968 }
971 969
972
973
974 m_scene.EventManager.TriggerOnClientMovement(this); 970 m_scene.EventManager.TriggerOnClientMovement(this);
975 971
976 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 972 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
@@ -1006,7 +1002,6 @@ namespace OpenSim.Region.Environment.Scenes
1006 //m_log.Debug("[AUTOPILOT]: " + Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget).ToString()); 1002 //m_log.Debug("[AUTOPILOT]: " + Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget).ToString());
1007 if (Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget) <= 1.5) 1003 if (Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget) <= 1.5)
1008 { 1004 {
1009
1010 if (m_sitAtAutoTarget) 1005 if (m_sitAtAutoTarget)
1011 { 1006 {
1012 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetUUID); 1007 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetUUID);
@@ -2140,7 +2135,6 @@ namespace OpenSim.Region.Environment.Scenes
2140 m_log.Info("[CLIENT]: Couldn't save attachments. :("); 2135 m_log.Info("[CLIENT]: Couldn't save attachments. :(");
2141 } 2136 }
2142 m_attachments.Clear(); 2137 m_attachments.Clear();
2143
2144 } 2138 }
2145 } 2139 }
2146 lock (m_knownPrimUUID) 2140 lock (m_knownPrimUUID)
@@ -2204,7 +2198,6 @@ namespace OpenSim.Region.Environment.Scenes
2204 m_attachmentsTransported = true; 2198 m_attachmentsTransported = true;
2205 lock (m_attachments) 2199 lock (m_attachments)
2206 { 2200 {
2207
2208 foreach (SceneObjectGroup gobj in m_attachments) 2201 foreach (SceneObjectGroup gobj in m_attachments)
2209 { 2202 {
2210 // If the prim group is null then something must have happened to it! 2203 // If the prim group is null then something must have happened to it!
diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
index b18c867..d901c21 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
112 public void llSay(int channelID, string text) 112 public void llSay(int channelID, string text)
113 { 113 {
114 m_host.AddScriptLPS(1); 114 m_host.AddScriptLPS(1);
115 115
116 if (text.Length > 1023) 116 if (text.Length > 1023)
117 text = text.Substring(0, 1023); 117 text = text.Substring(0, 1023);
118 118
@@ -176,7 +176,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
176 176
177 177
178 /// <summary> 178 /// <summary>
179 /// accepts a valid LLUUID, -or- a name of an inventory item. 179 /// accepts a valid LLUUID, -or- a name of an inventory item.
180 /// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found 180 /// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found
181 /// in prim inventory. 181 /// in prim inventory.
182 /// </summary> 182 /// </summary>
@@ -430,7 +430,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
430 public void llWhisper(int channelID, string text) 430 public void llWhisper(int channelID, string text)
431 { 431 {
432 m_host.AddScriptLPS(1); 432 m_host.AddScriptLPS(1);
433 433
434 if (text.Length > 1023) 434 if (text.Length > 1023)
435 text = text.Substring(0, 1023); 435 text = text.Substring(0, 1023);
436 436
@@ -444,7 +444,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
444 public void llShout(int channelID, string text) 444 public void llShout(int channelID, string text)
445 { 445 {
446 m_host.AddScriptLPS(1); 446 m_host.AddScriptLPS(1);
447 447
448 if (text.Length > 1023) 448 if (text.Length > 1023)
449 text = text.Substring(0, 1023); 449 text = text.Substring(0, 1023);
450 450
@@ -920,7 +920,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
920 } 920 }
921 } 921 }
922 922
923 private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, 923 private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
924 float wind, float tension, LSL_Types.Vector3 Force) 924 float wind, float tension, LSL_Types.Vector3 Force)
925 { 925 {
926 if (part == null) 926 if (part == null)
@@ -933,7 +933,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
933 { 933 {
934 needs_fakedelete = true; 934 needs_fakedelete = true;
935 } 935 }
936 part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do 936 part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
937 // work once the prim is already flexi 937 // work once the prim is already flexi
938 part.Shape.FlexiSoftness = softness; 938 part.Shape.FlexiSoftness = softness;
939 part.Shape.FlexiGravity = gravity; 939 part.Shape.FlexiGravity = gravity;
@@ -1482,7 +1482,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1482 m_host.Sound = LLUUID.Zero; 1482 m_host.Sound = LLUUID.Zero;
1483 m_host.SoundGain = 0; 1483 m_host.SoundGain = 0;
1484 m_host.SoundFlags = 0; 1484 m_host.SoundFlags = 0;
1485 m_host.SoundRadius = 0; 1485 m_host.SoundRadius = 0;
1486 1486
1487 m_host.ScheduleFullUpdate(); 1487 m_host.ScheduleFullUpdate();
1488 m_host.SendFullUpdateToAllClients(); 1488 m_host.SendFullUpdateToAllClients();
@@ -4542,7 +4542,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4542 4542
4543 v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); 4543 v=new LSL_Types.Vector3(rules.Data[idx++].ToString());
4544 SetScale(part, v); 4544 SetScale(part, v);
4545 4545
4546 break; 4546 break;
4547 case 8: // PRIM_ROTATION 4547 case 8: // PRIM_ROTATION
4548 if (remain < 1) 4548 if (remain < 1)
@@ -4605,7 +4605,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4605 float intensity = (float)Convert.ToDouble(rules.Data[idx++]); 4605 float intensity = (float)Convert.ToDouble(rules.Data[idx++]);
4606 float radius = (float)Convert.ToDouble(rules.Data[idx++]); 4606 float radius = (float)Convert.ToDouble(rules.Data[idx++]);
4607 float falloff = (float)Convert.ToDouble(rules.Data[idx++]); 4607 float falloff = (float)Convert.ToDouble(rules.Data[idx++]);
4608 4608
4609 SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); 4609 SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff);
4610 4610
4611 break; 4611 break;
@@ -5514,7 +5514,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5514 IConfigSource config = new IniConfigSource(Application.iniFilePath); 5514 IConfigSource config = new IniConfigSource(Application.iniFilePath);
5515 if (config.Configs["XEngine"] == null) 5515 if (config.Configs["XEngine"] == null)
5516 config.AddConfig("XEngine"); 5516 config.AddConfig("XEngine");
5517 5517
5518 if (config.Configs["XEngine"].GetBoolean("AllowGodFunctions", false)) 5518 if (config.Configs["XEngine"].GetBoolean("AllowGodFunctions", false))
5519 { 5519 {
5520 if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) 5520 if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID))
@@ -5576,7 +5576,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5576 { 5576 {
5577 m_host.AddScriptLPS(1); 5577 m_host.AddScriptLPS(1);
5578 NotImplemented("llSetInventoryPermMask"); 5578 NotImplemented("llSetInventoryPermMask");
5579 } 5579 }
5580 5580
5581 public string llGetInventoryCreator(string item) 5581 public string llGetInventoryCreator(string item)
5582 { 5582 {
@@ -6451,7 +6451,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6451 6451
6452 private static Dictionary<LLUUID, Notecard> m_Notecards = 6452 private static Dictionary<LLUUID, Notecard> m_Notecards =
6453 new Dictionary<LLUUID, Notecard>(); 6453 new Dictionary<LLUUID, Notecard>();
6454 6454
6455 public static void Cache(LLUUID assetID, string text) 6455 public static void Cache(LLUUID assetID, string text)
6456 { 6456 {
6457 CacheCheck(); 6457 CacheCheck();
@@ -6523,7 +6523,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6523 count += ln.Length + 1; 6523 count += ln.Length + 1;
6524 idx++; 6524 idx++;
6525 } 6525 }
6526 6526
6527 return output.ToArray(); 6527 return output.ToArray();
6528 } 6528 }
6529 break; 6529 break;