diff options
author | UbitUmarov | 2016-10-08 01:27:02 +0100 |
---|---|---|
committer | UbitUmarov | 2016-10-08 01:27:02 +0100 |
commit | 9843e3776ed4a613fb5682112e9e6b618cb14f9f (patch) | |
tree | e6198111f4a331e331643ef00ddc29cc007d9af0 | |
parent | recover regions main http server ssl suport. Using a PKCS12 cert file, and no... (diff) | |
parent | remove attachment to event OnPreAgentUpdate that is doing nothing (diff) | |
download | opensim-SC-9843e3776ed4a613fb5682112e9e6b618cb14f9f.zip opensim-SC-9843e3776ed4a613fb5682112e9e6b618cb14f9f.tar.gz opensim-SC-9843e3776ed4a613fb5682112e9e6b618cb14f9f.tar.bz2 opensim-SC-9843e3776ed4a613fb5682112e9e6b618cb14f9f.tar.xz |
Merge branch 'master' into httptests
28 files changed, 665 insertions, 489 deletions
diff --git a/OpenSim/Data/MySQL/MySQLFSAssetData.cs b/OpenSim/Data/MySQL/MySQLFSAssetData.cs index ce40c03..4ed2de6 100644 --- a/OpenSim/Data/MySQL/MySQLFSAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLFSAssetData.cs | |||
@@ -221,7 +221,8 @@ namespace OpenSim.Data.MySQL | |||
221 | cmd.Parameters.AddWithValue("?id", meta.ID); | 221 | cmd.Parameters.AddWithValue("?id", meta.ID); |
222 | cmd.Parameters.AddWithValue("?name", meta.Name); | 222 | cmd.Parameters.AddWithValue("?name", meta.Name); |
223 | cmd.Parameters.AddWithValue("?description", meta.Description); | 223 | cmd.Parameters.AddWithValue("?description", meta.Description); |
224 | cmd.Parameters.AddWithValue("?type", meta.Type.ToString()); | 224 | // cmd.Parameters.AddWithValue("?type", meta.Type.ToString()); |
225 | cmd.Parameters.AddWithValue("?type", meta.Type); | ||
225 | cmd.Parameters.AddWithValue("?hash", hash); | 226 | cmd.Parameters.AddWithValue("?hash", hash); |
226 | cmd.Parameters.AddWithValue("?asset_flags", meta.Flags); | 227 | cmd.Parameters.AddWithValue("?asset_flags", meta.Flags); |
227 | 228 | ||
@@ -239,7 +240,12 @@ namespace OpenSim.Data.MySQL | |||
239 | //ExecuteNonQuery(cmd); | 240 | //ExecuteNonQuery(cmd); |
240 | 241 | ||
241 | } | 242 | } |
242 | return false; | 243 | |
244 | // return false; | ||
245 | // if the asset already exits | ||
246 | // assume it was already correctly stored | ||
247 | // or regions will keep retry. | ||
248 | return true; | ||
243 | } | 249 | } |
244 | catch(Exception e) | 250 | catch(Exception e) |
245 | { | 251 | { |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index cafbd1f..f1290b9 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -1142,8 +1142,8 @@ namespace OpenSim.Framework | |||
1142 | void SendLayerData(float[] map); | 1142 | void SendLayerData(float[] map); |
1143 | void SendLayerData(int px, int py, float[] map); | 1143 | void SendLayerData(int px, int py, float[] map); |
1144 | 1144 | ||
1145 | void SendWindData(Vector2[] windSpeeds); | 1145 | void SendWindData(int version, Vector2[] windSpeeds); |
1146 | void SendCloudData(float[] cloudCover); | 1146 | void SendCloudData(int version, float[] cloudCover); |
1147 | 1147 | ||
1148 | /// <summary> | 1148 | /// <summary> |
1149 | /// Sent when an agent completes its movement into a region. | 1149 | /// Sent when an agent completes its movement into a region. |
diff --git a/OpenSim/Framework/ISceneAgent.cs b/OpenSim/Framework/ISceneAgent.cs index 1848b17..c8424e3 100644 --- a/OpenSim/Framework/ISceneAgent.cs +++ b/OpenSim/Framework/ISceneAgent.cs | |||
@@ -55,6 +55,9 @@ namespace OpenSim.Framework | |||
55 | /// </summary> | 55 | /// </summary> |
56 | bool IsChildAgent { get; } | 56 | bool IsChildAgent { get; } |
57 | 57 | ||
58 | bool IsInTransit { get; } | ||
59 | bool isNPC { get;} | ||
60 | |||
58 | bool Invulnerable { get; set; } | 61 | bool Invulnerable { get; set; } |
59 | /// <summary> | 62 | /// <summary> |
60 | /// Avatar appearance data. | 63 | /// Avatar appearance data. |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 2d337f1..2650be4 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -909,7 +909,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
909 | public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) | 909 | public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) |
910 | { | 910 | { |
911 | m_thisAgentUpdateArgs.CameraAtAxis.X = float.MinValue; | 911 | m_thisAgentUpdateArgs.CameraAtAxis.X = float.MinValue; |
912 | m_thisAgentUpdateArgs.ControlFlags = uint.MaxValue; | 912 | // m_thisAgentUpdateArgs.ControlFlags = uint.MaxValue; |
913 | m_thisAgentUpdateArgs.ControlFlags = 0; | ||
913 | 914 | ||
914 | AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); | 915 | AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); |
915 | mov.SimData.ChannelVersion = m_channelVersion; | 916 | mov.SimData.ChannelVersion = m_channelVersion; |
@@ -1375,73 +1376,125 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1375 | } | 1376 | } |
1376 | } | 1377 | } |
1377 | 1378 | ||
1379 | |||
1380 | // wind caching | ||
1381 | private static Dictionary<ulong,int> lastWindVersion = new Dictionary<ulong,int>(); | ||
1382 | private static Dictionary<ulong,List<LayerDataPacket>> lastWindPackets = | ||
1383 | new Dictionary<ulong,List<LayerDataPacket>>(); | ||
1384 | |||
1385 | |||
1378 | /// <summary> | 1386 | /// <summary> |
1379 | /// Send the wind matrix to the client | 1387 | /// Send the wind matrix to the client |
1380 | /// </summary> | 1388 | /// </summary> |
1381 | /// <param name="windSpeeds">16x16 array of wind speeds</param> | 1389 | /// <param name="windSpeeds">16x16 array of wind speeds</param> |
1382 | public virtual void SendWindData(Vector2[] windSpeeds) | 1390 | public virtual void SendWindData(int version, Vector2[] windSpeeds) |
1383 | { | 1391 | { |
1384 | Util.FireAndForget(DoSendWindData, windSpeeds, "LLClientView.SendWindData"); | 1392 | // Vector2[] windSpeeds = (Vector2[])o; |
1385 | } | 1393 | |
1394 | ulong handle = this.Scene.RegionInfo.RegionHandle; | ||
1395 | bool isNewData; | ||
1396 | lock(lastWindPackets) | ||
1397 | { | ||
1398 | if(!lastWindVersion.ContainsKey(handle) || | ||
1399 | !lastWindPackets.ContainsKey(handle)) | ||
1400 | { | ||
1401 | lastWindVersion[handle] = 0; | ||
1402 | lastWindPackets[handle] = new List<LayerDataPacket>(); | ||
1403 | isNewData = true; | ||
1404 | } | ||
1405 | else | ||
1406 | isNewData = lastWindVersion[handle] != version; | ||
1407 | } | ||
1386 | 1408 | ||
1387 | /// <summary> | 1409 | if(isNewData) |
1388 | /// Send the cloud matrix to the client | 1410 | { |
1389 | /// </summary> | 1411 | TerrainPatch[] patches = new TerrainPatch[2]; |
1390 | /// <param name="windSpeeds">16x16 array of cloud densities</param> | 1412 | patches[0] = new TerrainPatch { Data = new float[16 * 16] }; |
1391 | public virtual void SendCloudData(float[] cloudDensity) | 1413 | patches[1] = new TerrainPatch { Data = new float[16 * 16] }; |
1392 | { | ||
1393 | Util.FireAndForget(DoSendCloudData, cloudDensity, "LLClientView.SendCloudData"); | ||
1394 | } | ||
1395 | 1414 | ||
1396 | /// <summary> | 1415 | for (int x = 0; x < 16 * 16; x++) |
1397 | /// Send wind layer information to the client. | 1416 | { |
1398 | /// </summary> | 1417 | patches[0].Data[x] = windSpeeds[x].X; |
1399 | /// <param name="o"></param> | 1418 | patches[1].Data[x] = windSpeeds[x].Y; |
1400 | private void DoSendWindData(object o) | 1419 | } |
1401 | { | ||
1402 | Vector2[] windSpeeds = (Vector2[])o; | ||
1403 | TerrainPatch[] patches = new TerrainPatch[2]; | ||
1404 | patches[0] = new TerrainPatch { Data = new float[16 * 16] }; | ||
1405 | patches[1] = new TerrainPatch { Data = new float[16 * 16] }; | ||
1406 | 1420 | ||
1407 | for (int x = 0; x < 16 * 16; x++) | 1421 | // neither we or viewers have extended wind |
1408 | { | 1422 | byte layerType = (byte)TerrainPatch.LayerType.Wind; |
1409 | patches[0].Data[x] = windSpeeds[x].X; | ||
1410 | patches[1].Data[x] = windSpeeds[x].Y; | ||
1411 | } | ||
1412 | 1423 | ||
1413 | // neither we or viewers have extended wind | 1424 | LayerDataPacket layerpack = |
1414 | byte layerType = (byte)TerrainPatch.LayerType.Wind; | 1425 | OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize( |
1426 | patches, layerType); | ||
1427 | layerpack.Header.Zerocoded = true; | ||
1428 | lock(lastWindPackets) | ||
1429 | { | ||
1430 | lastWindPackets[handle].Clear(); | ||
1431 | lastWindPackets[handle].Add(layerpack); | ||
1432 | lastWindVersion[handle] = version; | ||
1433 | } | ||
1434 | } | ||
1415 | 1435 | ||
1416 | LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize(patches, layerType); | 1436 | lock(lastWindPackets) |
1417 | layerpack.Header.Zerocoded = true; | 1437 | foreach(LayerDataPacket pkt in lastWindPackets[handle]) |
1418 | OutPacket(layerpack, ThrottleOutPacketType.Wind); | 1438 | OutPacket(pkt, ThrottleOutPacketType.Wind); |
1419 | } | 1439 | } |
1420 | 1440 | ||
1441 | // cloud caching | ||
1442 | private static Dictionary<ulong,int> lastCloudVersion = new Dictionary<ulong,int>(); | ||
1443 | private static Dictionary<ulong,List<LayerDataPacket>> lastCloudPackets = | ||
1444 | new Dictionary<ulong,List<LayerDataPacket>>(); | ||
1445 | |||
1421 | /// <summary> | 1446 | /// <summary> |
1422 | /// Send cloud layer information to the client. | 1447 | /// Send the cloud matrix to the client |
1423 | /// </summary> | 1448 | /// </summary> |
1424 | /// <param name="o"></param> | 1449 | /// <param name="windSpeeds">16x16 array of cloud densities</param> |
1425 | private void DoSendCloudData(object o) | 1450 | public virtual void SendCloudData(int version, float[] cloudDensity) |
1426 | { | 1451 | { |
1427 | float[] cloudCover = (float[])o; | 1452 | ulong handle = this.Scene.RegionInfo.RegionHandle; |
1428 | TerrainPatch[] patches = new TerrainPatch[1]; | 1453 | bool isNewData; |
1429 | patches[0] = new TerrainPatch(); | 1454 | lock(lastWindPackets) |
1430 | patches[0].Data = new float[16 * 16]; | 1455 | { |
1456 | if(!lastCloudVersion.ContainsKey(handle) || | ||
1457 | !lastCloudPackets.ContainsKey(handle)) | ||
1458 | { | ||
1459 | lastCloudVersion[handle] = 0; | ||
1460 | lastCloudPackets[handle] = new List<LayerDataPacket>(); | ||
1461 | isNewData = true; | ||
1462 | } | ||
1463 | else | ||
1464 | isNewData = lastCloudVersion[handle] != version; | ||
1465 | } | ||
1431 | 1466 | ||
1432 | for (int y = 0; y < 16; y++) | 1467 | if(isNewData) |
1433 | { | 1468 | { |
1434 | for (int x = 0; x < 16; x++) | 1469 | TerrainPatch[] patches = new TerrainPatch[1]; |
1470 | patches[0] = new TerrainPatch(); | ||
1471 | patches[0].Data = new float[16 * 16]; | ||
1472 | |||
1473 | for (int y = 0; y < 16; y++) | ||
1474 | { | ||
1475 | for (int x = 0; x < 16; x++) | ||
1476 | { | ||
1477 | patches[0].Data[y * 16 + x] = cloudDensity[y * 16 + x]; | ||
1478 | } | ||
1479 | } | ||
1480 | // neither we or viewers have extended clouds | ||
1481 | byte layerType = (byte)TerrainPatch.LayerType.Cloud; | ||
1482 | |||
1483 | LayerDataPacket layerpack = | ||
1484 | OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize( | ||
1485 | patches, layerType); | ||
1486 | layerpack.Header.Zerocoded = true; | ||
1487 | lock(lastCloudPackets) | ||
1435 | { | 1488 | { |
1436 | patches[0].Data[y * 16 + x] = cloudCover[y * 16 + x]; | 1489 | lastCloudPackets[handle].Clear(); |
1490 | lastCloudPackets[handle].Add(layerpack); | ||
1491 | lastCloudVersion[handle] = version; | ||
1437 | } | 1492 | } |
1438 | } | 1493 | } |
1439 | // neither we or viewers have extended clouds | ||
1440 | byte layerType = (byte)TerrainPatch.LayerType.Cloud; | ||
1441 | 1494 | ||
1442 | LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize(patches, layerType); | 1495 | lock(lastCloudPackets) |
1443 | layerpack.Header.Zerocoded = true; | 1496 | foreach(LayerDataPacket pkt in lastCloudPackets[handle]) |
1444 | OutPacket(layerpack, ThrottleOutPacketType.Cloud); | 1497 | OutPacket(pkt, ThrottleOutPacketType.Cloud); |
1445 | } | 1498 | } |
1446 | 1499 | ||
1447 | /// <summary> | 1500 | /// <summary> |
@@ -6144,27 +6197,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6144 | /// <param name='x'></param> | 6197 | /// <param name='x'></param> |
6145 | private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) | 6198 | private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) |
6146 | { | 6199 | { |
6147 | float qdelta1 = Math.Abs(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation)); | 6200 | if( |
6148 | //qdelta2 = Math.Abs(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation)); | ||
6149 | |||
6150 | bool movementSignificant = | ||
6151 | (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed | 6201 | (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed |
6152 | || (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE) // significant if user supplying any movement update commands | 6202 | || ((x.ControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0 && |
6203 | (x.ControlFlags & 0x3f8dfff) != 0) // we need to rotate the av on fly | ||
6153 | || (x.Flags != m_thisAgentUpdateArgs.Flags) // significant if Flags changed | 6204 | || (x.Flags != m_thisAgentUpdateArgs.Flags) // significant if Flags changed |
6154 | || (x.State != m_thisAgentUpdateArgs.State) // significant if Stats changed | 6205 | || (x.State != m_thisAgentUpdateArgs.State) // significant if Stats changed |
6155 | || (qdelta1 < QDELTABody) // significant if body rotation above(below cos) threshold | ||
6156 | // Ignoring head rotation altogether, because it's not being used for anything interesting up the stack | ||
6157 | // || (qdelta2 < QDELTAHead) // significant if head rotation above(below cos) threshold | ||
6158 | || (Math.Abs(x.Far - m_thisAgentUpdateArgs.Far) >= 32) // significant if far distance changed | 6206 | || (Math.Abs(x.Far - m_thisAgentUpdateArgs.Far) >= 32) // significant if far distance changed |
6159 | ; | 6207 | ) |
6160 | //if (movementSignificant) | 6208 | return true; |
6161 | //{ | 6209 | |
6162 | //m_log.DebugFormat("[LLCLIENTVIEW]: Bod {0} {1}", | 6210 | float qdelta1 = Math.Abs(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation)); |
6163 | // qdelta1, qdelta2); | 6211 | //qdelta2 = Math.Abs(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation)); |
6164 | //m_log.DebugFormat("[LLCLIENTVIEW]: St {0} {1} {2} {3}", | 6212 | |
6165 | // x.ControlFlags, x.Flags, x.Far, x.State); | 6213 | if( |
6166 | //} | 6214 | qdelta1 < QDELTABody // significant if body rotation above(below cos) threshold |
6167 | return movementSignificant; | 6215 | // Ignoring head rotation altogether, because it's not being used for anything interesting up the stack |
6216 | // || qdelta2 < QDELTAHead // significant if head rotation above(below cos) threshold | ||
6217 | ) | ||
6218 | return true; | ||
6219 | |||
6220 | return false; | ||
6168 | } | 6221 | } |
6169 | 6222 | ||
6170 | /// <summary> | 6223 | /// <summary> |
@@ -6175,33 +6228,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6175 | /// <param name='x'></param> | 6228 | /// <param name='x'></param> |
6176 | private bool CheckAgentCameraUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) | 6229 | private bool CheckAgentCameraUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) |
6177 | { | 6230 | { |
6178 | float vdelta1 = Vector3.Distance(x.CameraAtAxis, m_thisAgentUpdateArgs.CameraAtAxis); | 6231 | float vdelta = Vector3.Distance(x.CameraAtAxis, m_thisAgentUpdateArgs.CameraAtAxis); |
6179 | float vdelta2 = Vector3.Distance(x.CameraCenter, m_thisAgentUpdateArgs.CameraCenter); | 6232 | if((vdelta > VDELTA)) |
6180 | float vdelta3 = Vector3.Distance(x.CameraLeftAxis, m_thisAgentUpdateArgs.CameraLeftAxis); | 6233 | return true; |
6181 | float vdelta4 = Vector3.Distance(x.CameraUpAxis, m_thisAgentUpdateArgs.CameraUpAxis); | 6234 | |
6235 | vdelta = Vector3.Distance(x.CameraCenter, m_thisAgentUpdateArgs.CameraCenter); | ||
6236 | if((vdelta > VDELTA)) | ||
6237 | return true; | ||
6182 | 6238 | ||
6183 | bool cameraSignificant = | 6239 | vdelta = Vector3.Distance(x.CameraLeftAxis, m_thisAgentUpdateArgs.CameraLeftAxis); |
6184 | (vdelta1 > VDELTA) || | 6240 | if((vdelta > VDELTA)) |
6185 | (vdelta2 > VDELTA) || | 6241 | return true; |
6186 | (vdelta3 > VDELTA) || | ||
6187 | (vdelta4 > VDELTA) | ||
6188 | ; | ||
6189 | 6242 | ||
6190 | //if (cameraSignificant) | 6243 | vdelta = Vector3.Distance(x.CameraUpAxis, m_thisAgentUpdateArgs.CameraUpAxis); |
6191 | //{ | 6244 | if((vdelta > VDELTA)) |
6192 | //m_log.DebugFormat("[LLCLIENTVIEW]: Cam1 {0} {1}", | 6245 | return true; |
6193 | // x.CameraAtAxis, x.CameraCenter); | ||
6194 | //m_log.DebugFormat("[LLCLIENTVIEW]: Cam2 {0} {1}", | ||
6195 | // x.CameraLeftAxis, x.CameraUpAxis); | ||
6196 | //} | ||
6197 | 6246 | ||
6198 | return cameraSignificant; | 6247 | return false; |
6199 | } | 6248 | } |
6200 | 6249 | ||
6201 | private bool HandleAgentUpdate(IClientAPI sender, Packet packet) | 6250 | private bool HandleAgentUpdate(IClientAPI sender, Packet packet) |
6202 | { | 6251 | { |
6203 | // We got here, which means that something in agent update was significant | ||
6204 | |||
6205 | AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet; | 6252 | AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet; |
6206 | AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData; | 6253 | AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData; |
6207 | 6254 | ||
@@ -6212,10 +6259,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6212 | } | 6259 | } |
6213 | 6260 | ||
6214 | TotalAgentUpdates++; | 6261 | TotalAgentUpdates++; |
6262 | // dont let ignored updates pollute this throttles | ||
6263 | if(SceneAgent == null || SceneAgent.IsChildAgent || SceneAgent.IsInTransit) | ||
6264 | { | ||
6265 | // throttle reset is done at MoveAgentIntoRegion() | ||
6266 | // called by scenepresence on completemovement | ||
6267 | PacketPool.Instance.ReturnPacket(packet); | ||
6268 | return true; | ||
6269 | } | ||
6215 | 6270 | ||
6216 | bool movement = CheckAgentMovementUpdateSignificance(x); | 6271 | bool movement = CheckAgentMovementUpdateSignificance(x); |
6217 | bool camera = CheckAgentCameraUpdateSignificance(x); | 6272 | bool camera = CheckAgentCameraUpdateSignificance(x); |
6218 | 6273 | ||
6219 | // Was there a significant movement/state change? | 6274 | // Was there a significant movement/state change? |
6220 | if (movement) | 6275 | if (movement) |
6221 | { | 6276 | { |
@@ -6224,7 +6279,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6224 | m_thisAgentUpdateArgs.Far = x.Far; | 6279 | m_thisAgentUpdateArgs.Far = x.Far; |
6225 | m_thisAgentUpdateArgs.Flags = x.Flags; | 6280 | m_thisAgentUpdateArgs.Flags = x.Flags; |
6226 | m_thisAgentUpdateArgs.HeadRotation = x.HeadRotation; | 6281 | m_thisAgentUpdateArgs.HeadRotation = x.HeadRotation; |
6227 | // m_thisAgentUpdateArgs.SessionID = x.SessionID; | ||
6228 | m_thisAgentUpdateArgs.State = x.State; | 6282 | m_thisAgentUpdateArgs.State = x.State; |
6229 | 6283 | ||
6230 | UpdateAgent handlerAgentUpdate = OnAgentUpdate; | 6284 | UpdateAgent handlerAgentUpdate = OnAgentUpdate; |
@@ -6235,9 +6289,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6235 | 6289 | ||
6236 | if (handlerAgentUpdate != null) | 6290 | if (handlerAgentUpdate != null) |
6237 | OnAgentUpdate(this, m_thisAgentUpdateArgs); | 6291 | OnAgentUpdate(this, m_thisAgentUpdateArgs); |
6238 | 6292 | ||
6239 | handlerAgentUpdate = null; | ||
6240 | handlerPreAgentUpdate = null; | ||
6241 | } | 6293 | } |
6242 | 6294 | ||
6243 | // Was there a significant camera(s) change? | 6295 | // Was there a significant camera(s) change? |
@@ -6253,7 +6305,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6253 | if (handlerAgentCameraUpdate != null) | 6305 | if (handlerAgentCameraUpdate != null) |
6254 | handlerAgentCameraUpdate(this, m_thisAgentUpdateArgs); | 6306 | handlerAgentCameraUpdate(this, m_thisAgentUpdateArgs); |
6255 | 6307 | ||
6256 | handlerAgentCameraUpdate = null; | ||
6257 | } | 6308 | } |
6258 | 6309 | ||
6259 | PacketPool.Instance.ReturnPacket(packet); | 6310 | PacketPool.Instance.ReturnPacket(packet); |
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 483c25f..e1c0cd7 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -374,9 +374,11 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
374 | if (channel == DEBUG_CHANNEL) | 374 | if (channel == DEBUG_CHANNEL) |
375 | return; | 375 | return; |
376 | 376 | ||
377 | // Is id an avatar? | 377 | if(target == UUID.Zero) |
378 | ScenePresence sp = m_scene.GetScenePresence(target); | 378 | return; |
379 | 379 | ||
380 | // Is target an avatar? | ||
381 | ScenePresence sp = m_scene.GetScenePresence(target); | ||
380 | if (sp != null) | 382 | if (sp != null) |
381 | { | 383 | { |
382 | // Send message to avatar | 384 | // Send message to avatar |
@@ -401,19 +403,22 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
401 | foreach (SceneObjectGroup sog in attachments) | 403 | foreach (SceneObjectGroup sog in attachments) |
402 | { | 404 | { |
403 | if (!sog.IsDeleted) | 405 | if (!sog.IsDeleted) |
404 | targets.Add(sog.UUID); | 406 | { |
407 | SceneObjectPart[] parts = sog.Parts; | ||
408 | foreach(SceneObjectPart p in parts) | ||
409 | targets.Add(p.UUID); | ||
410 | } | ||
405 | } | 411 | } |
406 | 412 | ||
407 | // Need to check each attachment | ||
408 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) | 413 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) |
409 | { | 414 | { |
410 | if (li.GetHostID().Equals(id)) | 415 | UUID liHostID = li.GetHostID(); |
416 | if (liHostID.Equals(id)) | ||
411 | continue; | 417 | continue; |
412 | 418 | if (m_scene.GetSceneObjectPart(liHostID) == null) | |
413 | if (m_scene.GetSceneObjectPart(li.GetHostID()) == null) | ||
414 | continue; | 419 | continue; |
415 | 420 | ||
416 | if (targets.Contains(li.GetHostID())) | 421 | if (targets.Contains(liHostID)) |
417 | QueueMessage(new ListenerInfo(li, name, id, msg)); | 422 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
418 | } | 423 | } |
419 | 424 | ||
@@ -426,16 +431,15 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
426 | 431 | ||
427 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) | 432 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) |
428 | { | 433 | { |
434 | UUID liHostID = li.GetHostID(); | ||
429 | // Dont process if this message is from yourself! | 435 | // Dont process if this message is from yourself! |
430 | if (li.GetHostID().Equals(id)) | 436 | if (liHostID.Equals(id)) |
431 | continue; | 437 | continue; |
432 | 438 | ||
433 | SceneObjectPart sPart = m_scene.GetSceneObjectPart( | 439 | if (m_scene.GetSceneObjectPart(liHostID) == null) |
434 | li.GetHostID()); | ||
435 | if (sPart == null) | ||
436 | continue; | 440 | continue; |
437 | 441 | ||
438 | if (li.GetHostID().Equals(target)) | 442 | if (liHostID.Equals(target)) |
439 | { | 443 | { |
440 | QueueMessage(new ListenerInfo(li, name, id, msg)); | 444 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
441 | break; | 445 | break; |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 2d590fc..f523af1 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -227,8 +227,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
227 | if (boOption != m_boundingOrigin) | 227 | if (boOption != m_boundingOrigin) |
228 | { | 228 | { |
229 | m_boundingOrigin = boOption; | 229 | m_boundingOrigin = boOption; |
230 | m_boundingBox = true; | ||
231 | } | 230 | } |
231 | m_boundingBox = true; | ||
232 | } | 232 | } |
233 | 233 | ||
234 | if (options.ContainsKey("bounding-size")) | 234 | if (options.ContainsKey("bounding-size")) |
@@ -936,14 +936,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
936 | 936 | ||
937 | if (m_assetService.GetMetadata(uuid) != null) | 937 | if (m_assetService.GetMetadata(uuid) != null) |
938 | { | 938 | { |
939 | sbyte asype = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | ||
940 | if(asype == -2) | ||
941 | { | ||
942 | |||
943 | } | ||
944 | |||
939 | // m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid); | 945 | // m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid); |
940 | return true; | 946 | return true; |
941 | } | 947 | } |
942 | 948 | ||
943 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) | 949 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) |
944 | { | 950 | { |
945 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 951 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
946 | 952 | ||
953 | if(assetType == -2) | ||
954 | { | ||
955 | |||
956 | } | ||
947 | if (assetType == (sbyte)AssetType.Unknown) | 957 | if (assetType == (sbyte)AssetType.Unknown) |
948 | { | 958 | { |
949 | m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); | 959 | m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 895b55d..1526b1c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -285,10 +285,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
285 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) | 285 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) |
286 | { | 286 | { |
287 | m_requestState = RequestState.Completed; | 287 | m_requestState = RequestState.Completed; |
288 | 288 | if(m_notFoundAssetUuids.Count == 0) | |
289 | m_log.DebugFormat( | 289 | m_log.DebugFormat( |
290 | "[ARCHIVER]: Successfully added {0} assets ({1} assets not found but these may be expected invalid references)", | 290 | "[ARCHIVER]: Successfully added {0} assets", |
291 | m_foundAssetUuids.Count); | ||
292 | else | ||
293 | m_log.DebugFormat( | ||
294 | "[ARCHIVER]: Successfully added {0} assets ({1} assets not found but these may be expected invalid references)", | ||
291 | m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); | 295 | m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); |
296 | |||
292 | 297 | ||
293 | // We want to stop using the asset cache thread asap | 298 | // We want to stop using the asset cache thread asap |
294 | // as we now need to do the work of producing the rest of the archive | 299 | // as we now need to do the work of producing the rest of the archive |
diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index d217f36..617c348 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Threading; | ||
30 | using Mono.Addins; | 31 | using Mono.Addins; |
31 | using Nini.Config; | 32 | using Nini.Config; |
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
@@ -43,12 +44,16 @@ namespace OpenSim.Region.CoreModules.World | |||
43 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 44 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
44 | private uint m_frame = 0; | 45 | private uint m_frame = 0; |
45 | private int m_frameUpdateRate = 1000; | 46 | private int m_frameUpdateRate = 1000; |
46 | private Random m_rndnums = new Random(Environment.TickCount); | 47 | private Random m_rndnums; |
47 | private Scene m_scene = null; | 48 | private Scene m_scene = null; |
48 | private bool m_ready = false; | 49 | private bool m_ready = false; |
49 | private bool m_enabled = false; | 50 | private bool m_enabled = false; |
50 | private float m_cloudDensity = 1.0F; | 51 | private float m_cloudDensity = 1.0F; |
51 | private float[] cloudCover = new float[16 * 16]; | 52 | private float[] cloudCover = new float[16 * 16]; |
53 | private int m_dataVersion; | ||
54 | private bool m_busy; | ||
55 | private object cloudlock = new object(); | ||
56 | |||
52 | 57 | ||
53 | public void Initialise(IConfigSource config) | 58 | public void Initialise(IConfigSource config) |
54 | { | 59 | { |
@@ -70,11 +75,17 @@ namespace OpenSim.Region.CoreModules.World | |||
70 | 75 | ||
71 | m_scene = scene; | 76 | m_scene = scene; |
72 | 77 | ||
73 | scene.EventManager.OnNewClient += CloudsToClient; | ||
74 | scene.RegisterModuleInterface<ICloudModule>(this); | 78 | scene.RegisterModuleInterface<ICloudModule>(this); |
75 | scene.EventManager.OnFrame += CloudUpdate; | 79 | int seed = Environment.TickCount; |
80 | seed += (int)(scene.RegionInfo.RegionLocX << 16); | ||
81 | seed += (int)(scene.RegionInfo.RegionLocY); | ||
82 | m_rndnums = new Random(seed); | ||
76 | 83 | ||
77 | GenerateCloudCover(); | 84 | GenerateCloudCover(); |
85 | m_dataVersion = (int)m_scene.AllocateLocalId(); | ||
86 | |||
87 | scene.EventManager.OnNewClient += CloudsToClient; | ||
88 | scene.EventManager.OnFrame += CloudUpdate; | ||
78 | 89 | ||
79 | m_ready = true; | 90 | m_ready = true; |
80 | } | 91 | } |
@@ -89,7 +100,6 @@ namespace OpenSim.Region.CoreModules.World | |||
89 | m_scene.EventManager.OnNewClient -= CloudsToClient; | 100 | m_scene.EventManager.OnNewClient -= CloudsToClient; |
90 | m_scene.EventManager.OnFrame -= CloudUpdate; | 101 | m_scene.EventManager.OnFrame -= CloudUpdate; |
91 | m_scene.UnregisterModuleInterface<ICloudModule>(this); | 102 | m_scene.UnregisterModuleInterface<ICloudModule>(this); |
92 | |||
93 | m_scene = null; | 103 | m_scene = null; |
94 | } | 104 | } |
95 | 105 | ||
@@ -127,7 +137,8 @@ namespace OpenSim.Region.CoreModules.World | |||
127 | 137 | ||
128 | if (cloudCover != null) | 138 | if (cloudCover != null) |
129 | { | 139 | { |
130 | cover = cloudCover[y * 16 + x]; | 140 | lock(cloudlock) |
141 | cover = cloudCover[y * 16 + x]; | ||
131 | } | 142 | } |
132 | 143 | ||
133 | return cover; | 144 | return cover; |
@@ -188,22 +199,47 @@ namespace OpenSim.Region.CoreModules.World | |||
188 | } | 199 | } |
189 | } | 200 | } |
190 | Array.Copy(newCover, cloudCover, 16 * 16); | 201 | Array.Copy(newCover, cloudCover, 16 * 16); |
202 | m_dataVersion++; | ||
191 | } | 203 | } |
192 | 204 | ||
193 | private void CloudUpdate() | 205 | private void CloudUpdate() |
194 | { | 206 | { |
195 | if (((m_frame++ % m_frameUpdateRate) != 0) || !m_ready || (m_cloudDensity == 0)) | 207 | if ((!m_ready || m_busy || m_cloudDensity == 0 || |
196 | { | 208 | (m_frame++ % m_frameUpdateRate) != 0)) |
197 | return; | 209 | return; |
198 | } | 210 | |
199 | UpdateCloudCover(); | 211 | if(Monitor.TryEnter(cloudlock)) |
212 | { | ||
213 | m_busy = true; | ||
214 | Util.FireAndForget(delegate | ||
215 | { | ||
216 | try | ||
217 | { | ||
218 | lock(cloudlock) | ||
219 | { | ||
220 | UpdateCloudCover(); | ||
221 | m_scene.ForEachClient(delegate(IClientAPI client) | ||
222 | { | ||
223 | client.SendCloudData(m_dataVersion, cloudCover); | ||
224 | }); | ||
225 | } | ||
226 | } | ||
227 | finally | ||
228 | { | ||
229 | m_busy = false; | ||
230 | } | ||
231 | }, | ||
232 | null, "CloudModuleUpdate"); | ||
233 | Monitor.Exit(cloudlock); | ||
234 | } | ||
200 | } | 235 | } |
201 | 236 | ||
202 | public void CloudsToClient(IClientAPI client) | 237 | public void CloudsToClient(IClientAPI client) |
203 | { | 238 | { |
204 | if (m_ready) | 239 | if (m_ready) |
205 | { | 240 | { |
206 | client.SendCloudData(cloudCover); | 241 | lock(cloudlock) |
242 | client.SendCloudData(m_dataVersion, cloudCover); | ||
207 | } | 243 | } |
208 | } | 244 | } |
209 | 245 | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 425562f..87fb0db 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -1360,7 +1360,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1360 | 1360 | ||
1361 | public void sendRegionInfoPacketToAll() | 1361 | public void sendRegionInfoPacketToAll() |
1362 | { | 1362 | { |
1363 | Scene.ForEachRootClient(delegate(IClientAPI client) | 1363 | // Scene.ForEachRootClient(delegate(IClientAPI client) |
1364 | Scene.ForEachClient(delegate(IClientAPI client) | ||
1364 | { | 1365 | { |
1365 | HandleRegionInfoRequest(client); | 1366 | HandleRegionInfoRequest(client); |
1366 | }); | 1367 | }); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs index ec5af2b..1dcaed3 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
63 | sr.Close(); | 63 | sr.Close(); |
64 | body = body.Trim(); | 64 | body = body.Trim(); |
65 | 65 | ||
66 | m_log.DebugFormat("[XESTATE HANDLER]: query String: {0}", body); | 66 | // m_log.DebugFormat("[XESTATE HANDLER]: query String: {0}", body); |
67 | 67 | ||
68 | try | 68 | try |
69 | { | 69 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 68c9c97..11a6d9f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -212,7 +212,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
212 | client.OnParcelReclaim += ClientOnParcelReclaim; | 212 | client.OnParcelReclaim += ClientOnParcelReclaim; |
213 | client.OnParcelInfoRequest += ClientOnParcelInfoRequest; | 213 | client.OnParcelInfoRequest += ClientOnParcelInfoRequest; |
214 | client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; | 214 | client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; |
215 | client.OnPreAgentUpdate += ClientOnPreAgentUpdate; | ||
216 | client.OnParcelEjectUser += ClientOnParcelEjectUser; | 215 | client.OnParcelEjectUser += ClientOnParcelEjectUser; |
217 | client.OnParcelFreezeUser += ClientOnParcelFreezeUser; | 216 | client.OnParcelFreezeUser += ClientOnParcelFreezeUser; |
218 | client.OnSetStartLocationRequest += ClientOnSetHome; | 217 | client.OnSetStartLocationRequest += ClientOnSetHome; |
@@ -223,10 +222,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
223 | avatar.currentParcelUUID = UUID.Zero; | 222 | avatar.currentParcelUUID = UUID.Zero; |
224 | } | 223 | } |
225 | 224 | ||
226 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | ||
227 | { | ||
228 | } | ||
229 | |||
230 | public void Close() | 225 | public void Close() |
231 | { | 226 | { |
232 | } | 227 | } |
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs index 6af4050..65691fe 100644 --- a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs +++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs | |||
@@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | public void WindUpdate(uint frame) | 106 | public bool WindUpdate(uint frame) |
107 | { | 107 | { |
108 | double avgAng = m_avgDirection * (Math.PI/180.0f); | 108 | double avgAng = m_avgDirection * (Math.PI/180.0f); |
109 | double varDir = m_varDirection * (Math.PI/180.0f); | 109 | double varDir = m_varDirection * (Math.PI/180.0f); |
@@ -125,10 +125,8 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
125 | offset = Math.Sin(theta) * Math.Sin(theta*4) + (Math.Sin(theta*13) / 3); | 125 | offset = Math.Sin(theta) * Math.Sin(theta*4) + (Math.Sin(theta*13) / 3); |
126 | double windSpeed = m_avgStrength + (m_varStrength * offset); | 126 | double windSpeed = m_avgStrength + (m_varStrength * offset); |
127 | 127 | ||
128 | if (windSpeed<0) | 128 | if (windSpeed < 0) |
129 | windSpeed=0; | 129 | windSpeed = -windSpeed; |
130 | |||
131 | |||
132 | 130 | ||
133 | m_curPredominateWind.X = (float)Math.Cos(windDir); | 131 | m_curPredominateWind.X = (float)Math.Cos(windDir); |
134 | m_curPredominateWind.Y = (float)Math.Sin(windDir); | 132 | m_curPredominateWind.Y = (float)Math.Sin(windDir); |
@@ -144,6 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
144 | m_windSpeeds[y * 16 + x] = m_curPredominateWind; | 142 | m_windSpeeds[y * 16 + x] = m_curPredominateWind; |
145 | } | 143 | } |
146 | } | 144 | } |
145 | return true; | ||
147 | } | 146 | } |
148 | 147 | ||
149 | public Vector3 WindSpeed(float fX, float fY, float fZ) | 148 | public Vector3 WindSpeed(float fX, float fY, float fZ) |
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs index fcb0c10..d2ff7b3 100644 --- a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs +++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs | |||
@@ -82,22 +82,23 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | public void WindUpdate(uint frame) | 85 | public bool WindUpdate(uint frame) |
86 | { | 86 | { |
87 | //Make sure our object is valid (we haven't been disposed of yet) | 87 | //Make sure our object is valid (we haven't been disposed of yet) |
88 | if (m_windSpeeds != null) | 88 | if (m_windSpeeds == null) |
89 | return false; | ||
90 | |||
91 | for (int y = 0; y < 16; y++) | ||
89 | { | 92 | { |
90 | for (int y = 0; y < 16; y++) | 93 | for (int x = 0; x < 16; x++) |
91 | { | 94 | { |
92 | for (int x = 0; x < 16; x++) | 95 | m_windSpeeds[y * 16 + x].X = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 |
93 | { | 96 | m_windSpeeds[y * 16 + x].Y = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 |
94 | m_windSpeeds[y * 16 + x].X = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 | 97 | m_windSpeeds[y * 16 + x].X *= m_strength; |
95 | m_windSpeeds[y * 16 + x].Y = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 | 98 | m_windSpeeds[y * 16 + x].Y *= m_strength; |
96 | m_windSpeeds[y * 16 + x].X *= m_strength; | ||
97 | m_windSpeeds[y * 16 + x].Y *= m_strength; | ||
98 | } | ||
99 | } | 99 | } |
100 | } | 100 | } |
101 | return true; | ||
101 | } | 102 | } |
102 | 103 | ||
103 | public Vector3 WindSpeed(float fX, float fY, float fZ) | 104 | public Vector3 WindSpeed(float fX, float fY, float fZ) |
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 35014f5..95cf57d 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs | |||
@@ -46,11 +46,13 @@ namespace OpenSim.Region.CoreModules | |||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private uint m_frame = 0; | 48 | private uint m_frame = 0; |
49 | private uint m_frameLastUpdateClientArray = 0; | 49 | private int m_dataVersion = 0; |
50 | private int m_regionID = 0; | ||
50 | private int m_frameUpdateRate = 150; | 51 | private int m_frameUpdateRate = 150; |
51 | //private Random m_rndnums = new Random(Environment.TickCount); | 52 | //private Random m_rndnums = new Random(Environment.TickCount); |
52 | private Scene m_scene = null; | 53 | private Scene m_scene = null; |
53 | private bool m_ready = false; | 54 | private bool m_ready = false; |
55 | private bool m_inUpdate = false; | ||
54 | 56 | ||
55 | private bool m_enabled = false; | 57 | private bool m_enabled = false; |
56 | private IConfig m_windConfig; | 58 | private IConfig m_windConfig; |
@@ -96,7 +98,6 @@ namespace OpenSim.Region.CoreModules | |||
96 | 98 | ||
97 | m_scene = scene; | 99 | m_scene = scene; |
98 | m_frame = 0; | 100 | m_frame = 0; |
99 | |||
100 | // Register all the Wind Model Plug-ins | 101 | // Register all the Wind Model Plug-ins |
101 | foreach (IWindModelPlugin windPlugin in AddinManager.GetExtensionObjects("/OpenSim/WindModule", false)) | 102 | foreach (IWindModelPlugin windPlugin in AddinManager.GetExtensionObjects("/OpenSim/WindModule", false)) |
102 | { | 103 | { |
@@ -118,7 +119,6 @@ namespace OpenSim.Region.CoreModules | |||
118 | } | 119 | } |
119 | } | 120 | } |
120 | 121 | ||
121 | |||
122 | // if the plug-in wasn't found, default to no wind. | 122 | // if the plug-in wasn't found, default to no wind. |
123 | if (m_activeWindPlugin == null) | 123 | if (m_activeWindPlugin == null) |
124 | { | 124 | { |
@@ -154,14 +154,14 @@ namespace OpenSim.Region.CoreModules | |||
154 | 154 | ||
155 | // Register event handlers for when Avatars enter the region, and frame ticks | 155 | // Register event handlers for when Avatars enter the region, and frame ticks |
156 | m_scene.EventManager.OnFrame += WindUpdate; | 156 | m_scene.EventManager.OnFrame += WindUpdate; |
157 | m_scene.EventManager.OnMakeRootAgent += OnAgentEnteredRegion; | ||
158 | 157 | ||
159 | // Register the wind module | 158 | // Register the wind module |
160 | m_scene.RegisterModuleInterface<IWindModule>(this); | 159 | m_scene.RegisterModuleInterface<IWindModule>(this); |
161 | 160 | ||
162 | // Generate initial wind values | 161 | // Generate initial wind values |
163 | GenWindPos(); | 162 | GenWind(); |
164 | 163 | // hopefully this will not be the same for all regions on same instance | |
164 | m_dataVersion = (int)m_scene.AllocateLocalId(); | ||
165 | // Mark Module Ready for duty | 165 | // Mark Module Ready for duty |
166 | m_ready = true; | 166 | m_ready = true; |
167 | } | 167 | } |
@@ -184,7 +184,7 @@ namespace OpenSim.Region.CoreModules | |||
184 | 184 | ||
185 | // Remove our hooks | 185 | // Remove our hooks |
186 | m_scene.EventManager.OnFrame -= WindUpdate; | 186 | m_scene.EventManager.OnFrame -= WindUpdate; |
187 | m_scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion; | 187 | // m_scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion; |
188 | 188 | ||
189 | } | 189 | } |
190 | 190 | ||
@@ -416,67 +416,43 @@ namespace OpenSim.Region.CoreModules | |||
416 | /// </summary> | 416 | /// </summary> |
417 | public void WindUpdate() | 417 | public void WindUpdate() |
418 | { | 418 | { |
419 | if (((m_frame++ % m_frameUpdateRate) != 0) || !m_ready) | 419 | if ((!m_ready || m_inUpdate || (m_frame++ % m_frameUpdateRate) != 0)) |
420 | { | ||
421 | return; | 420 | return; |
422 | } | ||
423 | |||
424 | GenWindPos(); | ||
425 | |||
426 | SendWindAllClients(); | ||
427 | } | ||
428 | 421 | ||
429 | public void OnAgentEnteredRegion(ScenePresence avatar) | 422 | m_inUpdate = true; |
430 | { | 423 | Util.FireAndForget(delegate |
431 | if (m_ready) | ||
432 | { | 424 | { |
433 | if (m_activeWindPlugin != null) | 425 | try |
434 | { | 426 | { |
435 | // Ask wind plugin to generate a LL wind array to be cached locally | 427 | GenWind(); |
436 | // Try not to update this too often, as it may involve array copies | 428 | m_scene.ForEachClient(delegate(IClientAPI client) |
437 | if (m_frame >= (m_frameLastUpdateClientArray + m_frameUpdateRate)) | ||
438 | { | 429 | { |
439 | windSpeeds = m_activeWindPlugin.WindLLClientArray(); | 430 | client.SendWindData(m_dataVersion, windSpeeds); |
440 | m_frameLastUpdateClientArray = m_frame; | 431 | }); |
441 | } | 432 | |
442 | } | 433 | } |
443 | 434 | finally | |
444 | avatar.ControllingClient.SendWindData(windSpeeds); | ||
445 | } | ||
446 | } | ||
447 | |||
448 | private void SendWindAllClients() | ||
449 | { | ||
450 | if (m_ready) | ||
451 | { | ||
452 | if (m_scene.GetRootAgentCount() > 0) | ||
453 | { | 435 | { |
454 | // Ask wind plugin to generate a LL wind array to be cached locally | 436 | m_inUpdate = false; |
455 | // Try not to update this too often, as it may involve array copies | ||
456 | if (m_frame >= (m_frameLastUpdateClientArray + m_frameUpdateRate)) | ||
457 | { | ||
458 | windSpeeds = m_activeWindPlugin.WindLLClientArray(); | ||
459 | m_frameLastUpdateClientArray = m_frame; | ||
460 | } | ||
461 | |||
462 | m_scene.ForEachRootClient(delegate(IClientAPI client) | ||
463 | { | ||
464 | client.SendWindData(windSpeeds); | ||
465 | }); | ||
466 | } | 437 | } |
467 | } | 438 | }, |
439 | null, "WindModuleUpdate"); | ||
468 | } | 440 | } |
441 | |||
469 | /// <summary> | 442 | /// <summary> |
470 | /// Calculate the sun's orbital position and its velocity. | 443 | /// Calculate new wind |
444 | /// returns false if no change | ||
471 | /// </summary> | 445 | /// </summary> |
472 | 446 | ||
473 | private void GenWindPos() | 447 | private bool GenWind() |
474 | { | 448 | { |
475 | if (m_activeWindPlugin != null) | 449 | if (m_activeWindPlugin != null && m_activeWindPlugin.WindUpdate(m_frame)) |
476 | { | 450 | { |
477 | // Tell Wind Plugin to update it's wind data | 451 | windSpeeds = m_activeWindPlugin.WindLLClientArray(); |
478 | m_activeWindPlugin.WindUpdate(m_frame); | 452 | m_dataVersion++; |
453 | return true; | ||
479 | } | 454 | } |
455 | return false; | ||
480 | } | 456 | } |
481 | } | 457 | } |
482 | } | 458 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IWindModelPlugin.cs b/OpenSim/Region/Framework/Interfaces/IWindModelPlugin.cs index 16b6024..b4bc15c 100644 --- a/OpenSim/Region/Framework/Interfaces/IWindModelPlugin.cs +++ b/OpenSim/Region/Framework/Interfaces/IWindModelPlugin.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Update wind. | 54 | /// Update wind. |
55 | /// </summary> | 55 | /// </summary> |
56 | void WindUpdate(uint frame); | 56 | bool WindUpdate(uint frame); |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Returns the wind vector at the given local region coordinates. | 59 | /// Returns the wind vector at the given local region coordinates. |
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 5669c43..97009a0 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -274,50 +274,46 @@ namespace OpenSim.Region.Framework.Scenes | |||
274 | 274 | ||
275 | private uint GetPriorityByAngularDistance(IClientAPI client, ISceneEntity entity) | 275 | private uint GetPriorityByAngularDistance(IClientAPI client, ISceneEntity entity) |
276 | { | 276 | { |
277 | uint pqueue = 2; // keep compiler happy | ||
278 | |||
279 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); | 277 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); |
280 | if (presence == null) | 278 | if (presence == null) |
281 | return PriorityQueue.NumberOfQueues - 1; | 279 | return PriorityQueue.NumberOfQueues - 1; |
282 | 280 | ||
283 | // All avatars other than our own go into pqueue 1 | 281 | uint pqueue = ComputeAngleDistancePriority(presence, entity); |
284 | if (entity is ScenePresence) | ||
285 | return 1; | ||
286 | |||
287 | if (entity is SceneObjectPart) | ||
288 | { | ||
289 | // Attachments are high priority, | ||
290 | if (((SceneObjectPart)entity).ParentGroup.IsAttachment) | ||
291 | return 2; | ||
292 | |||
293 | pqueue = ComputeAngleDistancePriority(presence, entity); | ||
294 | |||
295 | // Non physical prims are lower priority than physical prims | ||
296 | PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor; | ||
297 | if (physActor == null || !physActor.IsPhysical) | ||
298 | pqueue++; | ||
299 | } | ||
300 | |||
301 | return pqueue; | 282 | return pqueue; |
302 | } | 283 | } |
303 | 284 | ||
304 | private uint ComputeAngleDistancePriority(ScenePresence presence, ISceneEntity entity) | 285 | private uint ComputeAngleDistancePriority(ScenePresence presence, ISceneEntity entity) |
305 | { | 286 | { |
306 | double distance; | ||
307 | |||
308 | Vector3 presencePos = presence.AbsolutePosition; | ||
309 | |||
310 | SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup; | ||
311 | float bradius = group.GetBoundsRadius(); | ||
312 | Vector3 grppos = group.AbsolutePosition + group.getBoundsCenter(); | ||
313 | distance = Vector3.Distance(presencePos, grppos); | ||
314 | distance -= bradius; | ||
315 | distance *= group.getAreaFactor(); | ||
316 | |||
317 | // And convert the distance to a priority queue, this computation gives queues | 287 | // And convert the distance to a priority queue, this computation gives queues |
318 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m | 288 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m |
319 | uint pqueue = PriorityQueue.NumberOfImmediateQueues + 1; // reserve attachments queue | 289 | // uint minpqueue = PriorityQueue.NumberOfImmediateQueues; |
320 | uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; | 290 | uint maxqueue = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues -1; |
291 | // uint pqueue = minpqueue; | ||
292 | uint pqueue = PriorityQueue.NumberOfImmediateQueues; | ||
293 | float distance; | ||
294 | |||
295 | Vector3 presencePos = presence.AbsolutePosition; | ||
296 | if(entity is ScenePresence) | ||
297 | { | ||
298 | ScenePresence sp = entity as ScenePresence; | ||
299 | distance = Vector3.Distance(presencePos, sp.AbsolutePosition); | ||
300 | distance *= 0.5f; | ||
301 | } | ||
302 | else | ||
303 | { | ||
304 | SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup; | ||
305 | float bradius = group.GetBoundsRadius(); | ||
306 | Vector3 grppos = group.AbsolutePosition + group.getBoundsCenter(); | ||
307 | distance = Vector3.Distance(presencePos, grppos); | ||
308 | distance -= bradius; | ||
309 | distance *= group.getAreaFactor(); | ||
310 | if(group.IsAttachment) | ||
311 | distance *= 0.5f; | ||
312 | else if(group.UsesPhysics) | ||
313 | distance *= 0.6f; | ||
314 | else if(group.GetSittingAvatarsCount() > 0) | ||
315 | distance *= 0.5f; | ||
316 | } | ||
321 | 317 | ||
322 | if (distance > 10f) | 318 | if (distance > 10f) |
323 | { | 319 | { |
@@ -328,8 +324,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
328 | // 2st constant makes it be log2(distance/10) | 324 | // 2st constant makes it be log2(distance/10) |
329 | 325 | ||
330 | pqueue += (uint)tmp; | 326 | pqueue += (uint)tmp; |
331 | if (pqueue > queues - 1) | 327 | if (pqueue > maxqueue) |
332 | pqueue = queues - 1; | 328 | pqueue = maxqueue; |
333 | } | 329 | } |
334 | 330 | ||
335 | return pqueue; | 331 | return pqueue; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 77c66b6..238ec8e 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1865,7 +1865,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1865 | 1865 | ||
1866 | // this is here so physics gets updated! | 1866 | // this is here so physics gets updated! |
1867 | // Don't remove! Bad juju! Stay away! or fix physics! | 1867 | // Don't remove! Bad juju! Stay away! or fix physics! |
1868 | child.AbsolutePosition = child.AbsolutePosition; | 1868 | // already done in LinkToGroup |
1869 | // child.AbsolutePosition = child.AbsolutePosition; | ||
1869 | } | 1870 | } |
1870 | } | 1871 | } |
1871 | 1872 | ||
@@ -1912,31 +1913,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
1912 | // | 1913 | // |
1913 | foreach (SceneObjectPart part in prims) | 1914 | foreach (SceneObjectPart part in prims) |
1914 | { | 1915 | { |
1915 | if (part != null) | 1916 | if(part == null) |
1917 | continue; | ||
1918 | SceneObjectGroup parentSOG = part.ParentGroup; | ||
1919 | if(parentSOG == null || | ||
1920 | parentSOG.IsDeleted || | ||
1921 | parentSOG.inTransit || | ||
1922 | parentSOG.PrimCount == 1) | ||
1923 | continue; | ||
1924 | |||
1925 | if (!affectedGroups.Contains(parentSOG)) | ||
1916 | { | 1926 | { |
1917 | if (part.KeyframeMotion != null) | 1927 | affectedGroups.Add(parentSOG); |
1918 | { | 1928 | if(parentSOG.RootPart.PhysActor != null) |
1919 | part.KeyframeMotion.Stop(); | 1929 | parentSOG.RootPart.PhysActor.Building = true; |
1920 | part.KeyframeMotion = null; | 1930 | } |
1921 | } | ||
1922 | if (part.ParentGroup.PrimCount != 1) // Skip single | ||
1923 | { | ||
1924 | if (part.LinkNum < 2) // Root | ||
1925 | { | ||
1926 | rootParts.Add(part); | ||
1927 | } | ||
1928 | else | ||
1929 | { | ||
1930 | part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID; | ||
1931 | childParts.Add(part); | ||
1932 | } | ||
1933 | 1931 | ||
1934 | SceneObjectGroup group = part.ParentGroup; | 1932 | if (part.KeyframeMotion != null) |
1935 | if (!affectedGroups.Contains(group)) | 1933 | { |
1936 | { | 1934 | part.KeyframeMotion.Stop(); |
1937 | affectedGroups.Add(group); | 1935 | part.KeyframeMotion = null; |
1938 | } | 1936 | } |
1939 | } | 1937 | |
1938 | if (part.LinkNum < 2) // Root | ||
1939 | { | ||
1940 | rootParts.Add(part); | ||
1941 | } | ||
1942 | else | ||
1943 | { | ||
1944 | part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID; | ||
1945 | childParts.Add(part); | ||
1940 | } | 1946 | } |
1941 | } | 1947 | } |
1942 | 1948 | ||
@@ -1945,8 +1951,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1945 | foreach (SceneObjectPart child in childParts) | 1951 | foreach (SceneObjectPart child in childParts) |
1946 | { | 1952 | { |
1947 | // Unlink all child parts from their groups | 1953 | // Unlink all child parts from their groups |
1948 | // | ||
1949 | child.ParentGroup.DelinkFromGroup(child, true); | 1954 | child.ParentGroup.DelinkFromGroup(child, true); |
1955 | //child.ParentGroup is now other | ||
1950 | child.ParentGroup.HasGroupChanged = true; | 1956 | child.ParentGroup.HasGroupChanged = true; |
1951 | child.ParentGroup.ScheduleGroupForFullUpdate(); | 1957 | child.ParentGroup.ScheduleGroupForFullUpdate(); |
1952 | } | 1958 | } |
@@ -1959,74 +1965,51 @@ namespace OpenSim.Region.Framework.Scenes | |||
1959 | // However, editing linked parts and unlinking may be different | 1965 | // However, editing linked parts and unlinking may be different |
1960 | // | 1966 | // |
1961 | SceneObjectGroup group = root.ParentGroup; | 1967 | SceneObjectGroup group = root.ParentGroup; |
1962 | 1968 | ||
1963 | List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts); | 1969 | List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts); |
1964 | int numChildren = newSet.Count; | ||
1965 | 1970 | ||
1966 | if (numChildren == 1) | 1971 | newSet.Remove(root); |
1972 | int numChildren = newSet.Count; | ||
1973 | if(numChildren == 0) | ||
1967 | break; | 1974 | break; |
1968 | 1975 | ||
1969 | // If there are prims left in a link set, but the root is | ||
1970 | // slated for unlink, we need to do this | ||
1971 | // Unlink the remaining set | ||
1972 | // | ||
1973 | bool sendEventsToRemainder = false; | ||
1974 | if (numChildren == 2) // only one child prim no re-link needed | ||
1975 | sendEventsToRemainder = true; | ||
1976 | |||
1977 | foreach (SceneObjectPart p in newSet) | 1976 | foreach (SceneObjectPart p in newSet) |
1978 | { | 1977 | group.DelinkFromGroup(p, false); |
1979 | if (p != group.RootPart) | ||
1980 | { | ||
1981 | group.DelinkFromGroup(p, sendEventsToRemainder); | ||
1982 | if (sendEventsToRemainder) // finish single child prim now | ||
1983 | { | ||
1984 | p.ParentGroup.HasGroupChanged = true; | ||
1985 | p.ParentGroup.ScheduleGroupForFullUpdate(); | ||
1986 | } | ||
1987 | } | ||
1988 | } | ||
1989 | 1978 | ||
1979 | SceneObjectPart newRoot = newSet[0]; | ||
1980 | |||
1990 | // If there is more than one prim remaining, we | 1981 | // If there is more than one prim remaining, we |
1991 | // need to re-link | 1982 | // need to re-link |
1992 | // | 1983 | // |
1993 | if (numChildren > 2) | 1984 | if (numChildren > 1) |
1994 | { | 1985 | { |
1995 | // Remove old root | ||
1996 | // | ||
1997 | if (newSet.Contains(root)) | ||
1998 | newSet.Remove(root); | ||
1999 | |||
2000 | // Preserve link ordering | ||
2001 | // | ||
2002 | newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b) | ||
2003 | { | ||
2004 | return a.LinkNum.CompareTo(b.LinkNum); | ||
2005 | }); | ||
2006 | |||
2007 | // Determine new root | 1986 | // Determine new root |
2008 | // | 1987 | // |
2009 | SceneObjectPart newRoot = newSet[0]; | ||
2010 | newSet.RemoveAt(0); | 1988 | newSet.RemoveAt(0); |
2011 | 1989 | foreach (SceneObjectPart newChild in newSet) | |
2012 | foreach (SceneObjectPart newChild in newSet) | 1990 | newChild.ClearUpdateSchedule(); |
2013 | newChild.ClearUpdateSchedule(); | ||
2014 | 1991 | ||
2015 | LinkObjects(newRoot, newSet); | 1992 | LinkObjects(newRoot, newSet); |
2016 | // if (!affectedGroups.Contains(newRoot.ParentGroup)) | 1993 | } |
2017 | // affectedGroups.Add(newRoot.ParentGroup); | 1994 | else |
1995 | { | ||
1996 | newRoot.TriggerScriptChangedEvent(Changed.LINK); | ||
1997 | newRoot.ParentGroup.HasGroupChanged = true; | ||
1998 | newRoot.ParentGroup.ScheduleGroupForFullUpdate(); | ||
2018 | } | 1999 | } |
2019 | } | 2000 | } |
2020 | 2001 | ||
2021 | // Finally, trigger events in the roots | 2002 | // trigger events in the roots |
2022 | // | 2003 | // |
2023 | foreach (SceneObjectGroup g in affectedGroups) | 2004 | foreach (SceneObjectGroup g in affectedGroups) |
2024 | { | 2005 | { |
2006 | if(g.RootPart.PhysActor != null) | ||
2007 | g.RootPart.PhysActor.Building = false; | ||
2008 | g.AdjustChildPrimPermissions(false); | ||
2025 | // Child prims that have been unlinked and deleted will | 2009 | // Child prims that have been unlinked and deleted will |
2026 | // return unless the root is deleted. This will remove them | 2010 | // return unless the root is deleted. This will remove them |
2027 | // from the database. They will be rewritten immediately, | 2011 | // from the database. They will be rewritten immediately, |
2028 | // minus the rows for the unlinked child prims. | 2012 | // minus the rows for the unlinked child prims. |
2029 | g.AdjustChildPrimPermissions(false); | ||
2030 | m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID); | 2013 | m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID); |
2031 | g.TriggerScriptChangedEvent(Changed.LINK); | 2014 | g.TriggerScriptChangedEvent(Changed.LINK); |
2032 | g.HasGroupChanged = true; // Persist | 2015 | g.HasGroupChanged = true; // Persist |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 17dfb85..53a9441 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3168,10 +3168,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3168 | if (insert) | 3168 | if (insert) |
3169 | { | 3169 | { |
3170 | linkNum = 2; | 3170 | linkNum = 2; |
3171 | int insertSize = objectGroup.PrimCount; | ||
3171 | foreach (SceneObjectPart part in Parts) | 3172 | foreach (SceneObjectPart part in Parts) |
3172 | { | 3173 | { |
3173 | if (part.LinkNum > 1) | 3174 | if (part.LinkNum > 1) |
3174 | part.LinkNum++; | 3175 | part.LinkNum += insertSize; |
3175 | } | 3176 | } |
3176 | } | 3177 | } |
3177 | else | 3178 | else |
@@ -3200,14 +3201,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3200 | linkPart.LinkNum = linkNum++; | 3201 | linkPart.LinkNum = linkNum++; |
3201 | linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false); | 3202 | linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false); |
3202 | 3203 | ||
3203 | // Get a list of the SOP's in the old group in order of their linknum's. | 3204 | // Get a list of the SOP's in the source group in order of their linknum's. |
3204 | SceneObjectPart[] ogParts = objectGroup.Parts; | 3205 | SceneObjectPart[] ogParts = objectGroup.Parts; |
3205 | Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b) | 3206 | Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b) |
3206 | { | 3207 | { |
3207 | return a.LinkNum - b.LinkNum; | 3208 | return a.LinkNum - b.LinkNum; |
3208 | }); | 3209 | }); |
3209 | 3210 | ||
3210 | // Add each of the SOP's from the old linkset to our linkset | 3211 | // Add each of the SOP's from the source linkset to our linkset |
3211 | for (int i = 0; i < ogParts.Length; i++) | 3212 | for (int i = 0; i < ogParts.Length; i++) |
3212 | { | 3213 | { |
3213 | SceneObjectPart part = ogParts[i]; | 3214 | SceneObjectPart part = ogParts[i]; |
@@ -3415,6 +3416,110 @@ namespace OpenSim.Region.Framework.Scenes | |||
3415 | return objectGroup; | 3416 | return objectGroup; |
3416 | } | 3417 | } |
3417 | 3418 | ||
3419 | /* working on it | ||
3420 | public void DelinkFromGroup(List<SceneObjectPart> linkParts, bool sendEvents) | ||
3421 | { | ||
3422 | // m_log.DebugFormat( | ||
3423 | // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", | ||
3424 | // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); | ||
3425 | |||
3426 | if(PrimCount == 1) | ||
3427 | return; | ||
3428 | |||
3429 | if (m_rootPart.PhysActor != null) | ||
3430 | m_rootPart.PhysActor.Building = true; | ||
3431 | |||
3432 | bool unlinkroot = false; | ||
3433 | foreach(SceneObjectPart linkPart in linkParts) | ||
3434 | { | ||
3435 | // first we only remove child parts | ||
3436 | if(linkPart.LocalId == m_rootPart.LocalId) | ||
3437 | { | ||
3438 | unlinkroot = true; | ||
3439 | continue; | ||
3440 | } | ||
3441 | |||
3442 | lock (m_parts.SyncRoot) | ||
3443 | if(!m_parts.Remove(linkPart.UUID)) | ||
3444 | continue; | ||
3445 | |||
3446 | linkPart.ClearUndoState(); | ||
3447 | |||
3448 | Vector3 worldPos = linkPart.GetWorldPosition(); | ||
3449 | Quaternion worldRot = linkPart.GetWorldRotation(); | ||
3450 | |||
3451 | linkPart.ParentID = 0; | ||
3452 | linkPart.LinkNum = 0; | ||
3453 | |||
3454 | PhysicsActor linkPartPa = linkPart.PhysActor; | ||
3455 | |||
3456 | // Remove the SOP from the physical scene. | ||
3457 | // If the new SOG is physical, it is re-created later. | ||
3458 | // (There is a problem here in that we have not yet told the physics | ||
3459 | // engine about the delink. Someday, linksets should be made first | ||
3460 | // class objects in the physics engine interface). | ||
3461 | if (linkPartPa != null) | ||
3462 | { | ||
3463 | m_scene.PhysicsScene.RemovePrim(linkPartPa); | ||
3464 | linkPart.PhysActor = null; | ||
3465 | } | ||
3466 | |||
3467 | linkPart.setGroupPosition(worldPos); | ||
3468 | linkPart.setOffsetPosition(Vector3.Zero); | ||
3469 | linkPart.setRotationOffset(worldRot); | ||
3470 | |||
3471 | // Create a new SOG to go around this unlinked and unattached SOP | ||
3472 | SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart); | ||
3473 | |||
3474 | m_scene.AddNewSceneObject(objectGroup, true); | ||
3475 | |||
3476 | linkPart.Rezzed = RootPart.Rezzed; | ||
3477 | |||
3478 | // this is as it seems to be in sl now | ||
3479 | if(linkPart.PhysicsShapeType == (byte)PhysShapeType.none) | ||
3480 | linkPart.PhysicsShapeType = linkPart.DefaultPhysicsShapeType(); // root prims can't have type none for now | ||
3481 | |||
3482 | objectGroup.HasGroupChangedDueToDelink = true; | ||
3483 | if (sendEvents) | ||
3484 | linkPart.TriggerScriptChangedEvent(Changed.LINK); | ||
3485 | } | ||
3486 | |||
3487 | if(unlinkroot) | ||
3488 | { | ||
3489 | //TODO | ||
3490 | } | ||
3491 | |||
3492 | lock (m_parts.SyncRoot) | ||
3493 | { | ||
3494 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
3495 | if (parts.Length == 1) | ||
3496 | { | ||
3497 | // Single prim left | ||
3498 | m_rootPart.LinkNum = 0; | ||
3499 | } | ||
3500 | else | ||
3501 | { | ||
3502 | m_rootPart.LinkNum = 1; | ||
3503 | int linknum = 2; | ||
3504 | for (int i = 1; i < parts.Length; i++) | ||
3505 | parts[i].LinkNum = linknum++; | ||
3506 | } | ||
3507 | } | ||
3508 | |||
3509 | InvalidBoundsRadius(); | ||
3510 | |||
3511 | if (m_rootPart.PhysActor != null) | ||
3512 | m_rootPart.PhysActor.Building = false; | ||
3513 | |||
3514 | // When we delete a group, we currently have to force persist to the database if the object id has changed | ||
3515 | // (since delete works by deleting all rows which have a given object id) | ||
3516 | |||
3517 | Scene.SimulationDataService.RemoveObject(UUID, Scene.RegionInfo.RegionID); | ||
3518 | HasGroupChangedDueToDelink = true; | ||
3519 | TriggerScriptChangedEvent(Changed.LINK); | ||
3520 | return; | ||
3521 | } | ||
3522 | */ | ||
3418 | /// <summary> | 3523 | /// <summary> |
3419 | /// Stop this object from being persisted over server restarts. | 3524 | /// Stop this object from being persisted over server restarts. |
3420 | /// </summary> | 3525 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bb6e89b..6f4d6c3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -281,7 +281,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
281 | 281 | ||
282 | private bool m_followCamAuto = false; | 282 | private bool m_followCamAuto = false; |
283 | 283 | ||
284 | private Vector3? m_forceToApply; | 284 | // private object m_forceToApplyLock = new object(); |
285 | // private bool m_forceToApplyValid; | ||
286 | // private Vector3 m_forceToApply; | ||
285 | private int m_userFlags; | 287 | private int m_userFlags; |
286 | public int UserFlags | 288 | public int UserFlags |
287 | { | 289 | { |
@@ -582,11 +584,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
582 | { | 584 | { |
583 | get | 585 | get |
584 | { | 586 | { |
585 | return m_drawDistance; | 587 | return m_drawDistance; |
586 | } | 588 | } |
587 | set | 589 | set |
588 | { | 590 | { |
589 | m_drawDistance = Util.Clamp(value, 32f, m_scene.MaxDrawDistance); | 591 | m_drawDistance = Util.Clamp(value, 32f, m_scene.MaxDrawDistance); |
590 | } | 592 | } |
591 | } | 593 | } |
592 | 594 | ||
@@ -594,7 +596,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
594 | { | 596 | { |
595 | get | 597 | get |
596 | { | 598 | { |
597 | return Util.Clamp(m_drawDistance, 32f, m_scene.MaxRegionViewDistance); | 599 | return Util.Clamp(m_drawDistance, 32f, m_scene.MaxRegionViewDistance); |
598 | } | 600 | } |
599 | } | 601 | } |
600 | 602 | ||
@@ -2120,6 +2122,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2120 | if (haveAnims) | 2122 | if (haveAnims) |
2121 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); | 2123 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); |
2122 | 2124 | ||
2125 | |||
2123 | // we should be able to receive updates, etc | 2126 | // we should be able to receive updates, etc |
2124 | // so release them | 2127 | // so release them |
2125 | m_inTransit = false; | 2128 | m_inTransit = false; |
@@ -2238,6 +2241,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2238 | } | 2241 | } |
2239 | finally | 2242 | finally |
2240 | { | 2243 | { |
2244 | haveGroupInformation = false; | ||
2245 | gotCrossUpdate = false; | ||
2246 | crossingFlags = 0; | ||
2241 | m_inTransit = false; | 2247 | m_inTransit = false; |
2242 | } | 2248 | } |
2243 | // if hide force a check | 2249 | // if hide force a check |
@@ -2247,9 +2253,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2247 | // m_currentParcelHide = newhide; | 2253 | // m_currentParcelHide = newhide; |
2248 | // } | 2254 | // } |
2249 | 2255 | ||
2250 | haveGroupInformation = false; | ||
2251 | gotCrossUpdate = false; | ||
2252 | crossingFlags = 0; | ||
2253 | 2256 | ||
2254 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; | 2257 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; |
2255 | 2258 | ||
@@ -3006,7 +3009,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3006 | 3009 | ||
3007 | MovingToTarget = false; | 3010 | MovingToTarget = false; |
3008 | // MoveToPositionTarget = Vector3.Zero; | 3011 | // MoveToPositionTarget = Vector3.Zero; |
3009 | m_forceToApply = null; // cancel possible last action | 3012 | // lock(m_forceToApplyLock) |
3013 | // m_forceToApplyValid = false; // cancel possible last action | ||
3010 | 3014 | ||
3011 | // We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct | 3015 | // We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct |
3012 | // resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag. | 3016 | // resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag. |
@@ -3638,8 +3642,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3638 | } | 3642 | } |
3639 | 3643 | ||
3640 | // m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name); | 3644 | // m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name); |
3641 | 3645 | /* | |
3642 | m_forceToApply = direc; | 3646 | lock(m_forceToApplyLock) |
3647 | { | ||
3648 | m_forceToApply = direc; | ||
3649 | m_forceToApplyValid = true; | ||
3650 | } | ||
3651 | */ | ||
3652 | Velocity = direc; | ||
3643 | Animator.UpdateMovementAnimations(); | 3653 | Animator.UpdateMovementAnimations(); |
3644 | } | 3654 | } |
3645 | 3655 | ||
@@ -4734,17 +4744,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
4734 | /// </summary> | 4744 | /// </summary> |
4735 | public void UpdateMovement() | 4745 | public void UpdateMovement() |
4736 | { | 4746 | { |
4747 | /* | ||
4737 | if (IsInTransit) | 4748 | if (IsInTransit) |
4738 | return; | 4749 | return; |
4739 | if (m_forceToApply.HasValue) | ||
4740 | { | ||
4741 | Vector3 force = m_forceToApply.Value; | ||
4742 | 4750 | ||
4743 | Velocity = force; | 4751 | lock(m_forceToApplyLock) |
4752 | { | ||
4753 | if (m_forceToApplyValid) | ||
4754 | { | ||
4755 | Velocity = m_forceToApply; | ||
4744 | 4756 | ||
4745 | m_forceToApply = null; | 4757 | m_forceToApplyValid = false; |
4746 | TriggerScenePresenceUpdated(); | 4758 | TriggerScenePresenceUpdated(); |
4759 | } | ||
4747 | } | 4760 | } |
4761 | */ | ||
4748 | } | 4762 | } |
4749 | 4763 | ||
4750 | /// <summary> | 4764 | /// <summary> |
@@ -4767,6 +4781,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4767 | // Appearance.SetHeight(); | 4781 | // Appearance.SetHeight(); |
4768 | Appearance.SetSize(new Vector3(0.45f,0.6f,1.9f)); | 4782 | Appearance.SetSize(new Vector3(0.45f,0.6f,1.9f)); |
4769 | 4783 | ||
4784 | // lock(m_forceToApplyLock) | ||
4785 | // m_forceToApplyValid = false; | ||
4786 | |||
4770 | PhysicsScene scene = m_scene.PhysicsScene; | 4787 | PhysicsScene scene = m_scene.PhysicsScene; |
4771 | Vector3 pVec = AbsolutePosition; | 4788 | Vector3 pVec = AbsolutePosition; |
4772 | 4789 | ||
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index d8928ee..37b91d3 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -178,8 +178,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
178 | if (part.Shape.ProjectionTextureUUID != UUID.Zero) | 178 | if (part.Shape.ProjectionTextureUUID != UUID.Zero) |
179 | GatheredUuids[part.Shape.ProjectionTextureUUID] = (sbyte)AssetType.Texture; | 179 | GatheredUuids[part.Shape.ProjectionTextureUUID] = (sbyte)AssetType.Texture; |
180 | 180 | ||
181 | if (part.CollisionSound != UUID.Zero) | 181 | UUID collisionSound = part.CollisionSound; |
182 | GatheredUuids[part.CollisionSound] = (sbyte)AssetType.Sound; | 182 | if ( collisionSound != UUID.Zero && |
183 | collisionSound != part.invalidCollisionSoundUUID) | ||
184 | GatheredUuids[collisionSound] = (sbyte)AssetType.Sound; | ||
183 | 185 | ||
184 | if (part.ParticleSystem.Length > 0) | 186 | if (part.ParticleSystem.Length > 0) |
185 | { | 187 | { |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 427b48e..15d31bd 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1023,12 +1023,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1023 | 1023 | ||
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | public void SendWindData(Vector2[] windSpeeds) | 1026 | public void SendWindData(int version, Vector2[] windSpeeds) |
1027 | { | 1027 | { |
1028 | 1028 | ||
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | public void SendCloudData(float[] cloudCover) | 1031 | public void SendCloudData(int version, float[] cloudCover) |
1032 | { | 1032 | { |
1033 | 1033 | ||
1034 | } | 1034 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 07413cf..1ad71ba 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -724,9 +724,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
724 | { | 724 | { |
725 | } | 725 | } |
726 | 726 | ||
727 | public virtual void SendWindData(Vector2[] windSpeeds) { } | 727 | public virtual void SendWindData(int version, Vector2[] windSpeeds) { } |
728 | 728 | ||
729 | public virtual void SendCloudData(float[] cloudCover) { } | 729 | public virtual void SendCloudData(int version, float[] cloudCover) { } |
730 | 730 | ||
731 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) | 731 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) |
732 | { | 732 | { |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 5ad2136..757f06c 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | |||
@@ -52,7 +52,6 @@ public sealed class BSCharacter : BSPhysObject | |||
52 | private bool _setAlwaysRun; | 52 | private bool _setAlwaysRun; |
53 | private bool _throttleUpdates; | 53 | private bool _throttleUpdates; |
54 | private bool _floatOnWater; | 54 | private bool _floatOnWater; |
55 | private OMV.Vector3 _rotationalVelocity; | ||
56 | private bool _kinematic; | 55 | private bool _kinematic; |
57 | private float _buoyancy; | 56 | private float _buoyancy; |
58 | 57 | ||
@@ -291,7 +290,7 @@ public sealed class BSCharacter : BSPhysObject | |||
291 | { | 290 | { |
292 | RawVelocity = OMV.Vector3.Zero; | 291 | RawVelocity = OMV.Vector3.Zero; |
293 | _acceleration = OMV.Vector3.Zero; | 292 | _acceleration = OMV.Vector3.Zero; |
294 | _rotationalVelocity = OMV.Vector3.Zero; | 293 | RawRotationalVelocity = OMV.Vector3.Zero; |
295 | 294 | ||
296 | // Zero some other properties directly into the physics engine | 295 | // Zero some other properties directly into the physics engine |
297 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSCharacter.ZeroMotion", delegate() | 296 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSCharacter.ZeroMotion", delegate() |
@@ -303,7 +302,7 @@ public sealed class BSCharacter : BSPhysObject | |||
303 | 302 | ||
304 | public override void ZeroAngularMotion(bool inTaintTime) | 303 | public override void ZeroAngularMotion(bool inTaintTime) |
305 | { | 304 | { |
306 | _rotationalVelocity = OMV.Vector3.Zero; | 305 | RawRotationalVelocity = OMV.Vector3.Zero; |
307 | 306 | ||
308 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSCharacter.ZeroMotion", delegate() | 307 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSCharacter.ZeroMotion", delegate() |
309 | { | 308 | { |
@@ -351,7 +350,6 @@ public sealed class BSCharacter : BSPhysObject | |||
351 | } | 350 | } |
352 | } | 351 | } |
353 | 352 | ||
354 | |||
355 | // Check that the current position is sane and, if not, modify the position to make it so. | 353 | // Check that the current position is sane and, if not, modify the position to make it so. |
356 | // Check for being below terrain or on water. | 354 | // Check for being below terrain or on water. |
357 | // Returns 'true' of the position was made sane by some action. | 355 | // Returns 'true' of the position was made sane by some action. |
@@ -503,6 +501,17 @@ public sealed class BSCharacter : BSPhysObject | |||
503 | } | 501 | } |
504 | } | 502 | } |
505 | 503 | ||
504 | // SetMomentum just sets the velocity without a target. We need to stop the movement actor if a character. | ||
505 | public override void SetMomentum(OMV.Vector3 momentum) | ||
506 | { | ||
507 | if (m_moveActor != null) | ||
508 | { | ||
509 | m_moveActor.SetVelocityAndTarget(OMV.Vector3.Zero, OMV.Vector3.Zero, false /* inTaintTime */); | ||
510 | } | ||
511 | base.SetMomentum(momentum); | ||
512 | } | ||
513 | |||
514 | |||
506 | public override OMV.Vector3 Torque { | 515 | public override OMV.Vector3 Torque { |
507 | get { return RawTorque; } | 516 | get { return RawTorque; } |
508 | set { RawTorque = value; | 517 | set { RawTorque = value; |
@@ -618,14 +627,6 @@ public sealed class BSCharacter : BSPhysObject | |||
618 | }); | 627 | }); |
619 | } | 628 | } |
620 | } | 629 | } |
621 | public override OMV.Vector3 RotationalVelocity { | ||
622 | get { return _rotationalVelocity; } | ||
623 | set { _rotationalVelocity = value; } | ||
624 | } | ||
625 | public override OMV.Vector3 ForceRotationalVelocity { | ||
626 | get { return _rotationalVelocity; } | ||
627 | set { _rotationalVelocity = value; } | ||
628 | } | ||
629 | public override bool Kinematic { | 630 | public override bool Kinematic { |
630 | get { return _kinematic; } | 631 | get { return _kinematic; } |
631 | set { _kinematic = value; } | 632 | set { _kinematic = value; } |
@@ -716,8 +717,6 @@ public sealed class BSCharacter : BSPhysObject | |||
716 | 717 | ||
717 | public override void AddAngularForce(bool inTaintTime, OMV.Vector3 force) { | 718 | public override void AddAngularForce(bool inTaintTime, OMV.Vector3 force) { |
718 | } | 719 | } |
719 | public override void SetMomentum(OMV.Vector3 momentum) { | ||
720 | } | ||
721 | 720 | ||
722 | // The avatar's physical shape (whether capsule or cube) is unit sized. BulletSim sets | 721 | // The avatar's physical shape (whether capsule or cube) is unit sized. BulletSim sets |
723 | // the scale of that unit shape to create the avatars full size. | 722 | // the scale of that unit shape to create the avatars full size. |
@@ -841,7 +840,7 @@ public sealed class BSCharacter : BSPhysObject | |||
841 | RawVelocity = entprop.Velocity; | 840 | RawVelocity = entprop.Velocity; |
842 | 841 | ||
843 | _acceleration = entprop.Acceleration; | 842 | _acceleration = entprop.Acceleration; |
844 | _rotationalVelocity = entprop.RotationalVelocity; | 843 | RawRotationalVelocity = entprop.RotationalVelocity; |
845 | 844 | ||
846 | // Do some sanity checking for the avatar. Make sure it's above ground and inbounds. | 845 | // Do some sanity checking for the avatar. Make sure it's above ground and inbounds. |
847 | if (PositionSanityCheck(true)) | 846 | if (PositionSanityCheck(true)) |
@@ -861,7 +860,7 @@ public sealed class BSCharacter : BSPhysObject | |||
861 | // PhysScene.PostUpdate(this); | 860 | // PhysScene.PostUpdate(this); |
862 | 861 | ||
863 | DetailLog("{0},BSCharacter.UpdateProperties,call,pos={1},orient={2},vel={3},accel={4},rotVel={5}", | 862 | DetailLog("{0},BSCharacter.UpdateProperties,call,pos={1},orient={2},vel={3},accel={4},rotVel={5}", |
864 | LocalID, RawPosition, RawOrientation, RawVelocity, _acceleration, _rotationalVelocity); | 863 | LocalID, RawPosition, RawOrientation, RawVelocity, _acceleration, RawRotationalVelocity); |
865 | } | 864 | } |
866 | } | 865 | } |
867 | } | 866 | } |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index bb21f0c..3682455 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | |||
@@ -239,6 +239,8 @@ public abstract class BSPhysObject : PhysicsActor | |||
239 | public virtual OMV.Vector3 RawVelocity { get; set; } | 239 | public virtual OMV.Vector3 RawVelocity { get; set; } |
240 | public abstract OMV.Vector3 ForceVelocity { get; set; } | 240 | public abstract OMV.Vector3 ForceVelocity { get; set; } |
241 | 241 | ||
242 | public OMV.Vector3 RawRotationalVelocity { get; set; } | ||
243 | |||
242 | // RawForce is a constant force applied to object (see Force { set; } ) | 244 | // RawForce is a constant force applied to object (see Force { set; } ) |
243 | public OMV.Vector3 RawForce { get; set; } | 245 | public OMV.Vector3 RawForce { get; set; } |
244 | public OMV.Vector3 RawTorque { get; set; } | 246 | public OMV.Vector3 RawTorque { get; set; } |
@@ -250,7 +252,48 @@ public abstract class BSPhysObject : PhysicsActor | |||
250 | public abstract void AddAngularForce(bool inTaintTime, OMV.Vector3 force); | 252 | public abstract void AddAngularForce(bool inTaintTime, OMV.Vector3 force); |
251 | public abstract void AddForce(bool inTaintTime, OMV.Vector3 force); | 253 | public abstract void AddForce(bool inTaintTime, OMV.Vector3 force); |
252 | 254 | ||
253 | public abstract OMV.Vector3 ForceRotationalVelocity { get; set; } | 255 | // PhysicsActor.SetMomentum |
256 | // All the physics engined use this as a way of forcing the velocity to something. | ||
257 | public override void SetMomentum(OMV.Vector3 momentum) | ||
258 | { | ||
259 | // This doesn't just set Velocity=momentum because velocity is ramped up to (see MoveActor) | ||
260 | RawVelocity = momentum; | ||
261 | PhysScene.TaintedObject(LocalID, TypeName + ".SetMomentum", delegate() | ||
262 | { | ||
263 | // DetailLog("{0},BSPrim.SetMomentum,taint,vel={1}", LocalID, RawVelocity); | ||
264 | ForceVelocity = RawVelocity; | ||
265 | }); | ||
266 | } | ||
267 | |||
268 | public override OMV.Vector3 RotationalVelocity { | ||
269 | get { | ||
270 | return RawRotationalVelocity; | ||
271 | } | ||
272 | set { | ||
273 | RawRotationalVelocity = value; | ||
274 | Util.ClampV(RawRotationalVelocity, BSParam.MaxAngularVelocity); | ||
275 | // m_log.DebugFormat("{0}: RotationalVelocity={1}", LogHeader, _rotationalVelocity); | ||
276 | PhysScene.TaintedObject(LocalID, TypeName + ".setRotationalVelocity", delegate() | ||
277 | { | ||
278 | ForceRotationalVelocity = RawRotationalVelocity; | ||
279 | }); | ||
280 | } | ||
281 | } | ||
282 | public OMV.Vector3 ForceRotationalVelocity { | ||
283 | get { | ||
284 | return RawRotationalVelocity; | ||
285 | } | ||
286 | set { | ||
287 | RawRotationalVelocity = Util.ClampV(value, BSParam.MaxAngularVelocity); | ||
288 | if (PhysBody.HasPhysicalBody) | ||
289 | { | ||
290 | DetailLog("{0},{1}.ForceRotationalVel,taint,rotvel={2}", LocalID, TypeName, RawRotationalVelocity); | ||
291 | PhysScene.PE.SetAngularVelocity(PhysBody, RawRotationalVelocity); | ||
292 | // PhysicsScene.PE.SetInterpolationAngularVelocity(PhysBody, _rotationalVelocity); | ||
293 | ActivateIfPhysical(false); | ||
294 | } | ||
295 | } | ||
296 | } | ||
254 | 297 | ||
255 | public abstract float ForceBuoyancy { get; set; } | 298 | public abstract float ForceBuoyancy { get; set; } |
256 | 299 | ||
@@ -582,7 +625,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
582 | { | 625 | { |
583 | CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 626 | CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); |
584 | DetailLog("{0},{1}.SubscribeEvents,setting collision. ms={2}, collisionFlags={3:x}", | 627 | DetailLog("{0},{1}.SubscribeEvents,setting collision. ms={2}, collisionFlags={3:x}", |
585 | LocalID, TypeName, ms, CurrentCollisionFlags); | 628 | LocalID, TypeName, SubscribedEventsMs, CurrentCollisionFlags); |
586 | } | 629 | } |
587 | }); | 630 | }); |
588 | } | 631 | } |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs index fd9b834..78a617d 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs | |||
@@ -59,7 +59,6 @@ public class BSPrim : BSPhysObject | |||
59 | private bool _setAlwaysRun; | 59 | private bool _setAlwaysRun; |
60 | private bool _throttleUpdates; | 60 | private bool _throttleUpdates; |
61 | private bool _floatOnWater; | 61 | private bool _floatOnWater; |
62 | private OMV.Vector3 _rotationalVelocity; | ||
63 | private bool _kinematic; | 62 | private bool _kinematic; |
64 | private float _buoyancy; | 63 | private float _buoyancy; |
65 | 64 | ||
@@ -90,7 +89,7 @@ public class BSPrim : BSPhysObject | |||
90 | RawOrientation = rotation; | 89 | RawOrientation = rotation; |
91 | _buoyancy = 0f; | 90 | _buoyancy = 0f; |
92 | RawVelocity = OMV.Vector3.Zero; | 91 | RawVelocity = OMV.Vector3.Zero; |
93 | _rotationalVelocity = OMV.Vector3.Zero; | 92 | RawRotationalVelocity = OMV.Vector3.Zero; |
94 | BaseShape = pbs; | 93 | BaseShape = pbs; |
95 | _isPhysical = pisPhysical; | 94 | _isPhysical = pisPhysical; |
96 | _isVolumeDetect = false; | 95 | _isVolumeDetect = false; |
@@ -256,7 +255,7 @@ public class BSPrim : BSPhysObject | |||
256 | { | 255 | { |
257 | RawVelocity = OMV.Vector3.Zero; | 256 | RawVelocity = OMV.Vector3.Zero; |
258 | _acceleration = OMV.Vector3.Zero; | 257 | _acceleration = OMV.Vector3.Zero; |
259 | _rotationalVelocity = OMV.Vector3.Zero; | 258 | RawRotationalVelocity = OMV.Vector3.Zero; |
260 | 259 | ||
261 | // Zero some other properties in the physics engine | 260 | // Zero some other properties in the physics engine |
262 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.ZeroMotion", delegate() | 261 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.ZeroMotion", delegate() |
@@ -267,15 +266,15 @@ public class BSPrim : BSPhysObject | |||
267 | } | 266 | } |
268 | public override void ZeroAngularMotion(bool inTaintTime) | 267 | public override void ZeroAngularMotion(bool inTaintTime) |
269 | { | 268 | { |
270 | _rotationalVelocity = OMV.Vector3.Zero; | 269 | RawRotationalVelocity = OMV.Vector3.Zero; |
271 | // Zero some other properties in the physics engine | 270 | // Zero some other properties in the physics engine |
272 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.ZeroMotion", delegate() | 271 | PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.ZeroMotion", delegate() |
273 | { | 272 | { |
274 | // DetailLog("{0},BSPrim.ZeroAngularMotion,call,rotVel={1}", LocalID, _rotationalVelocity); | 273 | // DetailLog("{0},BSPrim.ZeroAngularMotion,call,rotVel={1}", LocalID, _rotationalVelocity); |
275 | if (PhysBody.HasPhysicalBody) | 274 | if (PhysBody.HasPhysicalBody) |
276 | { | 275 | { |
277 | PhysScene.PE.SetInterpolationAngularVelocity(PhysBody, _rotationalVelocity); | 276 | PhysScene.PE.SetInterpolationAngularVelocity(PhysBody, RawRotationalVelocity); |
278 | PhysScene.PE.SetAngularVelocity(PhysBody, _rotationalVelocity); | 277 | PhysScene.PE.SetAngularVelocity(PhysBody, RawRotationalVelocity); |
279 | } | 278 | } |
280 | }); | 279 | }); |
281 | } | 280 | } |
@@ -426,9 +425,9 @@ public class BSPrim : BSPhysObject | |||
426 | RawVelocity = Util.ClampV(RawVelocity, BSParam.MaxLinearVelocity); | 425 | RawVelocity = Util.ClampV(RawVelocity, BSParam.MaxLinearVelocity); |
427 | ret = true; | 426 | ret = true; |
428 | } | 427 | } |
429 | if (_rotationalVelocity.LengthSquared() > BSParam.MaxAngularVelocitySquared) | 428 | if (RawRotationalVelocity.LengthSquared() > BSParam.MaxAngularVelocitySquared) |
430 | { | 429 | { |
431 | _rotationalVelocity = Util.ClampV(_rotationalVelocity, BSParam.MaxAngularVelocity); | 430 | RawRotationalVelocity = Util.ClampV(RawRotationalVelocity, BSParam.MaxAngularVelocity); |
432 | ret = true; | 431 | ret = true; |
433 | } | 432 | } |
434 | 433 | ||
@@ -1008,7 +1007,7 @@ public class BSPrim : BSPhysObject | |||
1008 | // For good measure, make sure the transform is set through to the motion state | 1007 | // For good measure, make sure the transform is set through to the motion state |
1009 | ForcePosition = RawPosition; | 1008 | ForcePosition = RawPosition; |
1010 | ForceVelocity = RawVelocity; | 1009 | ForceVelocity = RawVelocity; |
1011 | ForceRotationalVelocity = _rotationalVelocity; | 1010 | ForceRotationalVelocity = RawRotationalVelocity; |
1012 | 1011 | ||
1013 | // A dynamic object has mass | 1012 | // A dynamic object has mass |
1014 | UpdatePhysicalMassProperties(RawMass, false); | 1013 | UpdatePhysicalMassProperties(RawMass, false); |
@@ -1128,35 +1127,6 @@ public class BSPrim : BSPhysObject | |||
1128 | }); | 1127 | }); |
1129 | } | 1128 | } |
1130 | } | 1129 | } |
1131 | public override OMV.Vector3 RotationalVelocity { | ||
1132 | get { | ||
1133 | return _rotationalVelocity; | ||
1134 | } | ||
1135 | set { | ||
1136 | _rotationalVelocity = value; | ||
1137 | Util.ClampV(_rotationalVelocity, BSParam.MaxAngularVelocity); | ||
1138 | // m_log.DebugFormat("{0}: RotationalVelocity={1}", LogHeader, _rotationalVelocity); | ||
1139 | PhysScene.TaintedObject(LocalID, "BSPrim.setRotationalVelocity", delegate() | ||
1140 | { | ||
1141 | ForceRotationalVelocity = _rotationalVelocity; | ||
1142 | }); | ||
1143 | } | ||
1144 | } | ||
1145 | public override OMV.Vector3 ForceRotationalVelocity { | ||
1146 | get { | ||
1147 | return _rotationalVelocity; | ||
1148 | } | ||
1149 | set { | ||
1150 | _rotationalVelocity = Util.ClampV(value, BSParam.MaxAngularVelocity); | ||
1151 | if (PhysBody.HasPhysicalBody) | ||
1152 | { | ||
1153 | DetailLog("{0},BSPrim.ForceRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity); | ||
1154 | PhysScene.PE.SetAngularVelocity(PhysBody, _rotationalVelocity); | ||
1155 | // PhysicsScene.PE.SetInterpolationAngularVelocity(PhysBody, _rotationalVelocity); | ||
1156 | ActivateIfPhysical(false); | ||
1157 | } | ||
1158 | } | ||
1159 | } | ||
1160 | public override bool Kinematic { | 1130 | public override bool Kinematic { |
1161 | get { return _kinematic; } | 1131 | get { return _kinematic; } |
1162 | set { _kinematic = value; | 1132 | set { _kinematic = value; |
@@ -1358,9 +1328,6 @@ public class BSPrim : BSPhysObject | |||
1358 | }); | 1328 | }); |
1359 | } | 1329 | } |
1360 | 1330 | ||
1361 | public override void SetMomentum(OMV.Vector3 momentum) { | ||
1362 | // DetailLog("{0},BSPrim.SetMomentum,call,mom={1}", LocalID, momentum); | ||
1363 | } | ||
1364 | #region Mass Calculation | 1331 | #region Mass Calculation |
1365 | 1332 | ||
1366 | private float CalculateMass() | 1333 | private float CalculateMass() |
@@ -1930,7 +1897,7 @@ public class BSPrim : BSPhysObject | |||
1930 | if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(RawVelocity, BSParam.UpdateVelocityChangeThreshold)) | 1897 | if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(RawVelocity, BSParam.UpdateVelocityChangeThreshold)) |
1931 | RawVelocity = entprop.Velocity; | 1898 | RawVelocity = entprop.Velocity; |
1932 | _acceleration = entprop.Acceleration; | 1899 | _acceleration = entprop.Acceleration; |
1933 | _rotationalVelocity = entprop.RotationalVelocity; | 1900 | RawRotationalVelocity = entprop.RotationalVelocity; |
1934 | 1901 | ||
1935 | // DetailLog("{0},BSPrim.UpdateProperties,afterAssign,entprop={1}", LocalID, entprop); // DEBUG DEBUG | 1902 | // DetailLog("{0},BSPrim.UpdateProperties,afterAssign,entprop={1}", LocalID, entprop); // DEBUG DEBUG |
1936 | 1903 | ||
@@ -1939,7 +1906,7 @@ public class BSPrim : BSPhysObject | |||
1939 | { | 1906 | { |
1940 | entprop.Position = RawPosition; | 1907 | entprop.Position = RawPosition; |
1941 | entprop.Velocity = RawVelocity; | 1908 | entprop.Velocity = RawVelocity; |
1942 | entprop.RotationalVelocity = _rotationalVelocity; | 1909 | entprop.RotationalVelocity = RawRotationalVelocity; |
1943 | entprop.Acceleration = _acceleration; | 1910 | entprop.Acceleration = _acceleration; |
1944 | } | 1911 | } |
1945 | 1912 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 4af4339..57bff6e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2664,13 +2664,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2664 | private LSL_Key NpcCreate( | 2664 | private LSL_Key NpcCreate( |
2665 | string firstname, string lastname, LSL_Vector position, string notecard, bool owned, bool senseAsAgent, bool hostGroupID) | 2665 | string firstname, string lastname, LSL_Vector position, string notecard, bool owned, bool senseAsAgent, bool hostGroupID) |
2666 | { | 2666 | { |
2667 | |||
2668 | if (!World.Permissions.CanRezObject(1, m_host.OwnerID, new Vector3((float)position.x, (float)position.y, (float)position.z))) | 2667 | if (!World.Permissions.CanRezObject(1, m_host.OwnerID, new Vector3((float)position.x, (float)position.y, (float)position.z))) |
2668 | { | ||
2669 | OSSLError("no permission to rez NPC at requested location"); | ||
2669 | return new LSL_Key(UUID.Zero.ToString()); | 2670 | return new LSL_Key(UUID.Zero.ToString()); |
2671 | } | ||
2670 | 2672 | ||
2671 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2673 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
2672 | if(module == null) | 2674 | if(module == null) |
2673 | new LSL_Key(UUID.Zero.ToString()); | 2675 | { |
2676 | OSSLError("NPC module not enabled"); | ||
2677 | return new LSL_Key(UUID.Zero.ToString()); | ||
2678 | } | ||
2674 | 2679 | ||
2675 | string groupTitle = String.Empty; | 2680 | string groupTitle = String.Empty; |
2676 | UUID groupID = UUID.Zero; | 2681 | UUID groupID = UUID.Zero; |
@@ -3878,11 +3883,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3878 | m_host.AddScriptLPS(1); | 3883 | m_host.AddScriptLPS(1); |
3879 | 3884 | ||
3880 | UUID targetUUID; | 3885 | UUID targetUUID; |
3886 | if(!UUID.TryParse(avatar.ToString(), out targetUUID)) | ||
3887 | return; | ||
3888 | |||
3889 | if(targetUUID == UUID.Zero) | ||
3890 | return; | ||
3891 | |||
3881 | ScenePresence target; | 3892 | ScenePresence target; |
3893 | if(!World.TryGetScenePresence(targetUUID, out target)) | ||
3894 | return; | ||
3882 | 3895 | ||
3883 | if (attachmentPoints.Length >= 1 && UUID.TryParse(avatar.ToString(), out targetUUID) && World.TryGetScenePresence(targetUUID, out target)) | 3896 | if(target.IsDeleted || target.IsInTransit) |
3897 | return; | ||
3898 | |||
3899 | List<int> aps = new List<int>(); | ||
3900 | if(attachmentPoints.Length != 0) | ||
3884 | { | 3901 | { |
3885 | List<int> aps = new List<int>(); | ||
3886 | foreach (object point in attachmentPoints.Data) | 3902 | foreach (object point in attachmentPoints.Data) |
3887 | { | 3903 | { |
3888 | int ipoint; | 3904 | int ipoint; |
@@ -3891,115 +3907,76 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3891 | aps.Add(ipoint); | 3907 | aps.Add(ipoint); |
3892 | } | 3908 | } |
3893 | } | 3909 | } |
3910 | // parsing failed | ||
3911 | if(aps.Count != attachmentPoints.Length) | ||
3912 | return; | ||
3913 | } | ||
3894 | 3914 | ||
3895 | List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(); | 3915 | List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(); |
3896 | 3916 | ||
3897 | bool msgAll = aps.Contains(ScriptBaseClass.OS_ATTACH_MSG_ALL); | 3917 | bool msgAll; |
3898 | bool invertPoints = (options & ScriptBaseClass.OS_ATTACH_MSG_INVERT_POINTS) != 0; | 3918 | bool invertPoints = (options & ScriptBaseClass.OS_ATTACH_MSG_INVERT_POINTS) != 0; |
3899 | 3919 | ||
3900 | if (msgAll && invertPoints) | 3920 | if(aps.Count == 0) |
3901 | { | 3921 | { |
3902 | return; | 3922 | if(!invertPoints) |
3903 | } | ||
3904 | else if (msgAll || invertPoints) | ||
3905 | { | ||
3906 | attachments = target.GetAttachments(); | ||
3907 | } | ||
3908 | else | ||
3909 | { | ||
3910 | foreach (int point in aps) | ||
3911 | { | ||
3912 | if (point > 0) | ||
3913 | { | ||
3914 | attachments.AddRange(target.GetAttachments((uint)point)); | ||
3915 | } | ||
3916 | } | ||
3917 | } | ||
3918 | |||
3919 | // if we have no attachments at this point, exit now | ||
3920 | if (attachments.Count == 0) | ||
3921 | { | ||
3922 | return; | 3923 | return; |
3923 | } | 3924 | msgAll = true; |
3925 | invertPoints = false; | ||
3926 | } | ||
3927 | else | ||
3928 | msgAll = aps.Contains(ScriptBaseClass.OS_ATTACH_MSG_ALL); | ||
3924 | 3929 | ||
3925 | List<SceneObjectGroup> ignoreThese = new List<SceneObjectGroup>(); | 3930 | if (msgAll && invertPoints) |
3931 | return; | ||
3926 | 3932 | ||
3927 | if (invertPoints) | 3933 | if (msgAll || invertPoints) |
3934 | { | ||
3935 | attachments = target.GetAttachments(); | ||
3936 | } | ||
3937 | else | ||
3938 | { | ||
3939 | foreach (int point in aps) | ||
3928 | { | 3940 | { |
3929 | foreach (SceneObjectGroup attachment in attachments) | 3941 | if (point > 0) |
3930 | { | 3942 | { |
3931 | if (aps.Contains((int)attachment.AttachmentPoint)) | 3943 | attachments.AddRange(target.GetAttachments((uint)point)); |
3932 | { | ||
3933 | ignoreThese.Add(attachment); | ||
3934 | } | ||
3935 | } | 3944 | } |
3936 | } | 3945 | } |
3946 | } | ||
3937 | 3947 | ||
3938 | foreach (SceneObjectGroup attachment in ignoreThese) | 3948 | // if we have no attachments at this point, exit now |
3939 | { | 3949 | if (attachments.Count == 0) |
3940 | attachments.Remove(attachment); | 3950 | { |
3941 | } | 3951 | return; |
3942 | ignoreThese.Clear(); | 3952 | } |
3943 | |||
3944 | // if inverting removed all attachments to check, exit now | ||
3945 | if (attachments.Count < 1) | ||
3946 | { | ||
3947 | return; | ||
3948 | } | ||
3949 | 3953 | ||
3950 | if ((options & ScriptBaseClass.OS_ATTACH_MSG_OBJECT_CREATOR) != 0) | 3954 | bool optionObjCreator = (options & |
3951 | { | 3955 | ScriptBaseClass.OS_ATTACH_MSG_OBJECT_CREATOR) != 0; |
3952 | foreach (SceneObjectGroup attachment in attachments) | 3956 | bool optionScriptCreator = (options & |
3953 | { | 3957 | ScriptBaseClass.OS_ATTACH_MSG_SCRIPT_CREATOR) != 0; |
3954 | if (attachment.RootPart.CreatorID != m_host.CreatorID) | ||
3955 | { | ||
3956 | ignoreThese.Add(attachment); | ||
3957 | } | ||
3958 | } | ||
3959 | 3958 | ||
3960 | foreach (SceneObjectGroup attachment in ignoreThese) | 3959 | UUID hostCreatorID = m_host.CreatorID; |
3961 | { | 3960 | UUID itemCreatorID = m_item.CreatorID; |
3962 | attachments.Remove(attachment); | ||
3963 | } | ||
3964 | ignoreThese.Clear(); | ||
3965 | 3961 | ||
3966 | // if filtering by same object creator removed all | 3962 | foreach (SceneObjectGroup sog in attachments) |
3967 | // attachments to check, exit now | 3963 | { |
3968 | if (attachments.Count == 0) | 3964 | if(sog.IsDeleted || sog.inTransit) |
3969 | { | 3965 | continue; |
3970 | return; | ||
3971 | } | ||
3972 | } | ||
3973 | 3966 | ||
3974 | if ((options & ScriptBaseClass.OS_ATTACH_MSG_SCRIPT_CREATOR) != 0) | 3967 | if (invertPoints && aps.Contains((int)sog.AttachmentPoint)) |
3975 | { | 3968 | continue; |
3976 | foreach (SceneObjectGroup attachment in attachments) | ||
3977 | { | ||
3978 | if (attachment.RootPart.CreatorID != m_item.CreatorID) | ||
3979 | { | ||
3980 | ignoreThese.Add(attachment); | ||
3981 | } | ||
3982 | } | ||
3983 | 3969 | ||
3984 | foreach (SceneObjectGroup attachment in ignoreThese) | 3970 | UUID CreatorID = sog.RootPart.CreatorID; |
3985 | { | 3971 | if (optionObjCreator && CreatorID != hostCreatorID) |
3986 | attachments.Remove(attachment); | 3972 | continue; |
3987 | } | ||
3988 | ignoreThese.Clear(); | ||
3989 | 3973 | ||
3990 | // if filtering by object creator must match originating | 3974 | if (optionScriptCreator && CreatorID != itemCreatorID) |
3991 | // script creator removed all attachments to check, | 3975 | continue; |
3992 | // exit now | ||
3993 | if (attachments.Count == 0) | ||
3994 | { | ||
3995 | return; | ||
3996 | } | ||
3997 | } | ||
3998 | 3976 | ||
3999 | foreach (SceneObjectGroup attachment in attachments) | 3977 | SceneObjectPart[] parts = sog.Parts; |
4000 | { | 3978 | foreach(SceneObjectPart p in parts) |
4001 | MessageObject(attachment.RootPart.UUID, message); | 3979 | MessageObject(p.UUID, message); |
4002 | } | ||
4003 | } | 3980 | } |
4004 | } | 3981 | } |
4005 | 3982 | ||
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6a697f2..9251c4f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -659,9 +659,9 @@ namespace OpenSim.Tests.Common | |||
659 | { | 659 | { |
660 | } | 660 | } |
661 | 661 | ||
662 | public virtual void SendWindData(Vector2[] windSpeeds) { } | 662 | public virtual void SendWindData(int version, Vector2[] windSpeeds) { } |
663 | 663 | ||
664 | public virtual void SendCloudData(float[] cloudCover) { } | 664 | public virtual void SendCloudData(int version, float[] cloudCover) { } |
665 | 665 | ||
666 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) | 666 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) |
667 | { | 667 | { |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 418330e..d1ded36 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -293,7 +293,7 @@ | |||
293 | ;; OpenDynamicsEngine was the previous default physics engine in OpenSimulator 0.7.6.1 and before. | 293 | ;; OpenDynamicsEngine was the previous default physics engine in OpenSimulator 0.7.6.1 and before. |
294 | ;; It continues to provide a workable physics implementation. It does not currently support varregions. | 294 | ;; It continues to provide a workable physics implementation. It does not currently support varregions. |
295 | ;; basicphysics effectively does not model physics at all, making all objects phantom. | 295 | ;; basicphysics effectively does not model physics at all, making all objects phantom. |
296 | ;; Default is OpenDynamicsEngine | 296 | ;; Default is BulletSim |
297 | physics = BulletSim | 297 | physics = BulletSim |
298 | ;physics = modified_BulletX | 298 | ;physics = modified_BulletX |
299 | ;physics = OpenDynamicsEngine | 299 | ;physics = OpenDynamicsEngine |