diff options
Diffstat (limited to '')
26 files changed, 513 insertions, 776 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs index e9e2dca..cb9692a 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | |||
@@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
56 | public IAssetService AssetService; | 56 | public IAssetService AssetService; |
57 | public UUID AgentID; | 57 | public UUID AgentID; |
58 | public IInventoryAccessModule InventoryAccessModule; | 58 | public IInventoryAccessModule InventoryAccessModule; |
59 | public OpenJPEG.J2KLayerInfo[] Layers; | 59 | private OpenJPEG.J2KLayerInfo[] m_layers; |
60 | public bool IsDecoded; | 60 | public bool IsDecoded { get; private set; } |
61 | public bool HasAsset; | 61 | public bool HasAsset { get; private set; } |
62 | public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle; | 62 | public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle; |
63 | 63 | ||
64 | private uint m_currentPacket; | 64 | private uint m_currentPacket; |
@@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
170 | if (DiscardLevel >= 0 || m_stopPacket == 0) | 170 | if (DiscardLevel >= 0 || m_stopPacket == 0) |
171 | { | 171 | { |
172 | // This shouldn't happen, but if it does, we really can't proceed | 172 | // This shouldn't happen, but if it does, we really can't proceed |
173 | if (Layers == null) | 173 | if (m_layers == null) |
174 | { | 174 | { |
175 | m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer"); | 175 | m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer"); |
176 | m_currentPacket = m_stopPacket; | 176 | m_currentPacket = m_stopPacket; |
177 | return; | 177 | return; |
178 | } | 178 | } |
179 | 179 | ||
180 | int maxDiscardLevel = Math.Max(0, Layers.Length - 1); | 180 | int maxDiscardLevel = Math.Max(0, m_layers.Length - 1); |
181 | 181 | ||
182 | // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel | 182 | // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel |
183 | if (DiscardLevel < 0 && m_stopPacket == 0) | 183 | if (DiscardLevel < 0 && m_stopPacket == 0) |
@@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
187 | DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel); | 187 | DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel); |
188 | 188 | ||
189 | //Calculate the m_stopPacket | 189 | //Calculate the m_stopPacket |
190 | if (Layers.Length > 0) | 190 | if (m_layers.Length > 0) |
191 | { | 191 | { |
192 | m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End); | 192 | m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End); |
193 | //I don't know why, but the viewer seems to expect the final packet if the file | 193 | //I don't know why, but the viewer seems to expect the final packet if the file |
194 | //is just one packet bigger. | 194 | //is just one packet bigger. |
195 | if (TexturePacketCount() == m_stopPacket + 1) | 195 | if (TexturePacketCount() == m_stopPacket + 1) |
@@ -341,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
341 | 341 | ||
342 | private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers) | 342 | private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers) |
343 | { | 343 | { |
344 | Layers = layers; | 344 | m_layers = layers; |
345 | IsDecoded = true; | 345 | IsDecoded = true; |
346 | RunUpdate(); | 346 | RunUpdate(); |
347 | } | 347 | } |
@@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
385 | string assetServerURL = string.Empty; | 385 | string assetServerURL = string.Empty; |
386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) | 386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) |
387 | { | 387 | { |
388 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); | 388 | if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) |
389 | AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); | 389 | assetServerURL = assetServerURL + "/"; |
390 | |||
391 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id); | ||
392 | AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived); | ||
390 | return; | 393 | return; |
391 | } | 394 | } |
392 | } | 395 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs index 9e0db12..e3a881f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs | |||
@@ -39,6 +39,9 @@ using log4net; | |||
39 | 39 | ||
40 | namespace OpenSim.Region.ClientStack.LindenUDP | 40 | namespace OpenSim.Region.ClientStack.LindenUDP |
41 | { | 41 | { |
42 | /// <summary> | ||
43 | /// This class handles UDP texture requests. | ||
44 | /// </summary> | ||
42 | public class LLImageManager | 45 | public class LLImageManager |
43 | { | 46 | { |
44 | private sealed class J2KImageComparer : IComparer<J2KImage> | 47 | private sealed class J2KImageComparer : IComparer<J2KImage> |
@@ -208,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
208 | 211 | ||
209 | #region Priority Queue Helpers | 212 | #region Priority Queue Helpers |
210 | 213 | ||
211 | J2KImage GetHighestPriorityImage() | 214 | private J2KImage GetHighestPriorityImage() |
212 | { | 215 | { |
213 | J2KImage image = null; | 216 | J2KImage image = null; |
214 | 217 | ||
@@ -223,23 +226,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
223 | return image; | 226 | return image; |
224 | } | 227 | } |
225 | 228 | ||
226 | void AddImageToQueue(J2KImage image) | 229 | private void AddImageToQueue(J2KImage image) |
227 | { | 230 | { |
228 | image.PriorityQueueHandle = null; | 231 | image.PriorityQueueHandle = null; |
229 | 232 | ||
230 | lock (m_syncRoot) | 233 | lock (m_syncRoot) |
234 | { | ||
231 | try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); } | 235 | try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); } |
232 | catch (Exception) { } | 236 | catch (Exception) { } |
237 | } | ||
233 | } | 238 | } |
234 | 239 | ||
235 | void RemoveImageFromQueue(J2KImage image) | 240 | private void RemoveImageFromQueue(J2KImage image) |
236 | { | 241 | { |
237 | lock (m_syncRoot) | 242 | lock (m_syncRoot) |
243 | { | ||
238 | try { m_priorityQueue.Delete(image.PriorityQueueHandle); } | 244 | try { m_priorityQueue.Delete(image.PriorityQueueHandle); } |
239 | catch (Exception) { } | 245 | catch (Exception) { } |
246 | } | ||
240 | } | 247 | } |
241 | 248 | ||
242 | void UpdateImageInQueue(J2KImage image) | 249 | private void UpdateImageInQueue(J2KImage image) |
243 | { | 250 | { |
244 | lock (m_syncRoot) | 251 | lock (m_syncRoot) |
245 | { | 252 | { |
@@ -254,4 +261,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
254 | 261 | ||
255 | #endregion Priority Queue Helpers | 262 | #endregion Priority Queue Helpers |
256 | } | 263 | } |
257 | } | 264 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 1386e86..7dd9087 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -152,6 +152,9 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
152 | /// <param name="j2kData">JPEG2000 data</param> | 152 | /// <param name="j2kData">JPEG2000 data</param> |
153 | private void DoJ2KDecode(UUID assetID, byte[] j2kData) | 153 | private void DoJ2KDecode(UUID assetID, byte[] j2kData) |
154 | { | 154 | { |
155 | // m_log.DebugFormat( | ||
156 | // "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID); | ||
157 | |||
155 | //int DecodeTime = 0; | 158 | //int DecodeTime = 0; |
156 | //DecodeTime = Environment.TickCount; | 159 | //DecodeTime = Environment.TickCount; |
157 | OpenJPEG.J2KLayerInfo[] layers; | 160 | OpenJPEG.J2KLayerInfo[] layers; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 9a97925..a77646c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -50,6 +50,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | IUserManagement m_uMan; | ||
54 | IUserManagement UserManagementModule | ||
55 | { | ||
56 | get | ||
57 | { | ||
58 | if (m_uMan == null) | ||
59 | m_uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>(); | ||
60 | return m_uMan; | ||
61 | } | ||
62 | } | ||
63 | |||
53 | #region ISharedRegionModule | 64 | #region ISharedRegionModule |
54 | public override string Name | 65 | public override string Name |
55 | { | 66 | { |
@@ -369,9 +380,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
369 | protected override FriendInfo[] GetFriendsFromService(IClientAPI client) | 380 | protected override FriendInfo[] GetFriendsFromService(IClientAPI client) |
370 | { | 381 | { |
371 | // m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name); | 382 | // m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name); |
383 | Boolean agentIsLocal = true; | ||
384 | if (UserManagementModule != null) | ||
385 | agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId); | ||
372 | 386 | ||
373 | UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, client.AgentId); | 387 | if (agentIsLocal) |
374 | if (account1 != null) | ||
375 | return base.GetFriendsFromService(client); | 388 | return base.GetFriendsFromService(client); |
376 | 389 | ||
377 | FriendInfo[] finfos = new FriendInfo[0]; | 390 | FriendInfo[] finfos = new FriendInfo[0]; |
@@ -392,16 +405,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
392 | 405 | ||
393 | protected override bool StoreRights(UUID agentID, UUID friendID, int rights) | 406 | protected override bool StoreRights(UUID agentID, UUID friendID, int rights) |
394 | { | 407 | { |
395 | UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); | 408 | Boolean agentIsLocal = true; |
396 | UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID); | 409 | Boolean friendIsLocal = true; |
410 | if (UserManagementModule != null) | ||
411 | { | ||
412 | agentIsLocal = UserManagementModule.IsLocalGridUser(agentID); | ||
413 | friendIsLocal = UserManagementModule.IsLocalGridUser(friendID); | ||
414 | } | ||
415 | |||
397 | // Are they both local users? | 416 | // Are they both local users? |
398 | if (account1 != null && account2 != null) | 417 | if (agentIsLocal && friendIsLocal) |
399 | { | 418 | { |
400 | // local grid users | 419 | // local grid users |
401 | return base.StoreRights(agentID, friendID, rights); | 420 | return base.StoreRights(agentID, friendID, rights); |
402 | } | 421 | } |
403 | 422 | ||
404 | if (account1 != null) // agent is local, friend is foreigner | 423 | if (agentIsLocal) // agent is local, friend is foreigner |
405 | { | 424 | { |
406 | FriendInfo[] finfos = GetFriends(agentID); | 425 | FriendInfo[] finfos = GetFriends(agentID); |
407 | FriendInfo finfo = GetFriend(finfos, friendID); | 426 | FriendInfo finfo = GetFriend(finfos, friendID); |
@@ -412,7 +431,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
412 | } | 431 | } |
413 | } | 432 | } |
414 | 433 | ||
415 | if (account2 != null) // agent is foreigner, friend is local | 434 | if (friendIsLocal) // agent is foreigner, friend is local |
416 | { | 435 | { |
417 | string agentUUI = GetUUI(friendID, agentID); | 436 | string agentUUI = GetUUI(friendID, agentID); |
418 | if (agentUUI != string.Empty) | 437 | if (agentUUI != string.Empty) |
@@ -427,10 +446,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
427 | 446 | ||
428 | protected override void StoreBackwards(UUID friendID, UUID agentID) | 447 | protected override void StoreBackwards(UUID friendID, UUID agentID) |
429 | { | 448 | { |
430 | UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); | 449 | Boolean agentIsLocal = true; |
431 | UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID); | 450 | Boolean friendIsLocal = true; |
451 | if (UserManagementModule != null) | ||
452 | { | ||
453 | agentIsLocal = UserManagementModule.IsLocalGridUser(agentID); | ||
454 | friendIsLocal = UserManagementModule.IsLocalGridUser(friendID); | ||
455 | } | ||
456 | |||
432 | // Are they both local users? | 457 | // Are they both local users? |
433 | if (account1 != null && account2 != null) | 458 | if (agentIsLocal && friendIsLocal) |
434 | { | 459 | { |
435 | // local grid users | 460 | // local grid users |
436 | m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); | 461 | m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); |
@@ -444,10 +469,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
444 | 469 | ||
445 | protected override void StoreFriendships(UUID agentID, UUID friendID) | 470 | protected override void StoreFriendships(UUID agentID, UUID friendID) |
446 | { | 471 | { |
447 | UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); | 472 | Boolean agentIsLocal = true; |
448 | UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID); | 473 | Boolean friendIsLocal = true; |
474 | if (UserManagementModule != null) | ||
475 | { | ||
476 | agentIsLocal = UserManagementModule.IsLocalGridUser(agentID); | ||
477 | friendIsLocal = UserManagementModule.IsLocalGridUser(friendID); | ||
478 | } | ||
479 | |||
449 | // Are they both local users? | 480 | // Are they both local users? |
450 | if (agentAccount != null && friendAccount != null) | 481 | if (agentIsLocal && friendIsLocal) |
451 | { | 482 | { |
452 | // local grid users | 483 | // local grid users |
453 | m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); | 484 | m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); |
@@ -465,13 +496,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
465 | string agentFriendService = string.Empty; | 496 | string agentFriendService = string.Empty; |
466 | string friendFriendService = string.Empty; | 497 | string friendFriendService = string.Empty; |
467 | 498 | ||
468 | if (agentClient != null) | 499 | if (agentIsLocal) |
469 | { | 500 | { |
470 | agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode); | 501 | agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode); |
471 | agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); | 502 | agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); |
472 | agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString(); | 503 | agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString(); |
473 | } | 504 | } |
474 | if (friendClient != null) | 505 | if (friendIsLocal) |
475 | { | 506 | { |
476 | friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode); | 507 | friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode); |
477 | friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit); | 508 | friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit); |
@@ -484,7 +515,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
484 | // Generate a random 8-character hex number that will sign this friendship | 515 | // Generate a random 8-character hex number that will sign this friendship |
485 | string secret = UUID.Random().ToString().Substring(0, 8); | 516 | string secret = UUID.Random().ToString().Substring(0, 8); |
486 | 517 | ||
487 | if (agentAccount != null) // agent is local, 'friend' is foreigner | 518 | if (agentIsLocal) // agent is local, 'friend' is foreigner |
488 | { | 519 | { |
489 | // This may happen when the agent returned home, in which case the friend is not there | 520 | // This may happen when the agent returned home, in which case the friend is not there |
490 | // We need to look for its information in the friends list itself | 521 | // We need to look for its information in the friends list itself |
@@ -520,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
520 | friendsConn.NewFriendship(friendID, agentUUI + ";" + secret); | 551 | friendsConn.NewFriendship(friendID, agentUUI + ";" + secret); |
521 | } | 552 | } |
522 | } | 553 | } |
523 | else if (friendAccount != null) // 'friend' is local, agent is foreigner | 554 | else if (friendIsLocal) // 'friend' is local, agent is foreigner |
524 | { | 555 | { |
525 | // store in the local friends service a reference to the foreign agent | 556 | // store in the local friends service a reference to the foreign agent |
526 | FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1); | 557 | FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1); |
@@ -553,10 +584,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
553 | 584 | ||
554 | protected override bool DeleteFriendship(UUID agentID, UUID exfriendID) | 585 | protected override bool DeleteFriendship(UUID agentID, UUID exfriendID) |
555 | { | 586 | { |
556 | UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID); | 587 | Boolean agentIsLocal = true; |
557 | UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, exfriendID); | 588 | Boolean friendIsLocal = true; |
589 | if (UserManagementModule != null) | ||
590 | { | ||
591 | agentIsLocal = UserManagementModule.IsLocalGridUser(agentID); | ||
592 | friendIsLocal = UserManagementModule.IsLocalGridUser(exfriendID); | ||
593 | } | ||
594 | |||
558 | // Are they both local users? | 595 | // Are they both local users? |
559 | if (agentAccount != null && friendAccount != null) | 596 | if (agentIsLocal && friendIsLocal) |
560 | { | 597 | { |
561 | // local grid users | 598 | // local grid users |
562 | return base.DeleteFriendship(agentID, exfriendID); | 599 | return base.DeleteFriendship(agentID, exfriendID); |
@@ -566,7 +603,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
566 | string agentUUI = string.Empty; | 603 | string agentUUI = string.Empty; |
567 | string friendUUI = string.Empty; | 604 | string friendUUI = string.Empty; |
568 | 605 | ||
569 | if (agentAccount != null) // agent is local, 'friend' is foreigner | 606 | if (agentIsLocal) // agent is local, 'friend' is foreigner |
570 | { | 607 | { |
571 | // We need to look for its information in the friends list itself | 608 | // We need to look for its information in the friends list itself |
572 | FriendInfo[] finfos = GetFriends(agentID); | 609 | FriendInfo[] finfos = GetFriends(agentID); |
@@ -587,7 +624,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
587 | return true; | 624 | return true; |
588 | } | 625 | } |
589 | } | 626 | } |
590 | else if (friendAccount != null) // agent is foreigner, 'friend' is local | 627 | else if (friendIsLocal) // agent is foreigner, 'friend' is local |
591 | { | 628 | { |
592 | agentUUI = GetUUI(exfriendID, agentID); | 629 | agentUUI = GetUUI(exfriendID, agentID); |
593 | 630 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index 560d913..bf1d787 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | |||
@@ -180,10 +180,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
180 | 180 | ||
181 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); | 181 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); |
182 | // Is the user a local user? | 182 | // Is the user a local user? |
183 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, toAgentID); | ||
184 | string url = string.Empty; | 183 | string url = string.Empty; |
185 | bool foreigner = false; | 184 | bool foreigner = false; |
186 | if (account == null) // foreign user | 185 | if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(toAgentID)) // foreign user |
187 | { | 186 | { |
188 | url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI"); | 187 | url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI"); |
189 | foreigner = true; | 188 | foreigner = true; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs index dee0ad4..eb1e4b5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs | |||
@@ -43,7 +43,7 @@ using OpenSim.Services.Interfaces; | |||
43 | namespace OpenSim.Region.CoreModules.Avatar.Profile | 43 | namespace OpenSim.Region.CoreModules.Avatar.Profile |
44 | { | 44 | { |
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
46 | public class BasicProfileModule : ISharedRegionModule | 46 | public class BasicProfileModule : IProfileModule, ISharedRegionModule |
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
@@ -57,6 +57,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
57 | 57 | ||
58 | public void Initialise(IConfigSource config) | 58 | public void Initialise(IConfigSource config) |
59 | { | 59 | { |
60 | // This can be reduced later as the loader will determine | ||
61 | // whether we are needed | ||
60 | if (config.Configs["Profile"] != null) | 62 | if (config.Configs["Profile"] != null) |
61 | { | 63 | { |
62 | if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule") | 64 | if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule") |
@@ -65,14 +67,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
65 | 67 | ||
66 | m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled"); | 68 | m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled"); |
67 | m_Enabled = true; | 69 | m_Enabled = true; |
68 | |||
69 | } | 70 | } |
70 | 71 | ||
71 | public void AddRegion(Scene scene) | 72 | public void AddRegion(Scene scene) |
72 | { | 73 | { |
73 | if (!m_Enabled) | 74 | if (!m_Enabled) |
74 | return; | 75 | return; |
75 | 76 | ||
76 | lock (m_Scenes) | 77 | lock (m_Scenes) |
77 | { | 78 | { |
78 | if (!m_Scenes.Contains(scene)) | 79 | if (!m_Scenes.Contains(scene)) |
@@ -80,6 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
80 | m_Scenes.Add(scene); | 81 | m_Scenes.Add(scene); |
81 | // Hook up events | 82 | // Hook up events |
82 | scene.EventManager.OnNewClient += OnNewClient; | 83 | scene.EventManager.OnNewClient += OnNewClient; |
84 | scene.RegisterModuleInterface<IProfileModule>(this); | ||
83 | } | 85 | } |
84 | } | 86 | } |
85 | } | 87 | } |
@@ -116,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
116 | 118 | ||
117 | public Type ReplaceableInterface | 119 | public Type ReplaceableInterface |
118 | { | 120 | { |
119 | get { return null; } | 121 | get { return typeof(IProfileModule); } |
120 | } | 122 | } |
121 | 123 | ||
122 | #endregion | 124 | #endregion |
@@ -170,4 +172,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
170 | } | 172 | } |
171 | 173 | ||
172 | } | 174 | } |
173 | } \ No newline at end of file | 175 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 87f292c..cbef6ce 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -676,9 +676,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
676 | Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); | 676 | Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); |
677 | Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0); | 677 | Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0); |
678 | 678 | ||
679 | // distance to edge that will trigger crossing | ||
680 | |||
681 | |||
682 | // distance into new region to place avatar | 679 | // distance into new region to place avatar |
683 | const float enterDistance = 0.5f; | 680 | const float enterDistance = 0.5f; |
684 | 681 | ||
@@ -960,29 +957,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
960 | m_log.DebugFormat( | 957 | m_log.DebugFormat( |
961 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", | 958 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", |
962 | agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); | 959 | agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); |
963 | 960 | ||
964 | pos = pos + (agent.Velocity); | 961 | pos = pos + agent.Velocity; |
965 | 962 | Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0); | |
963 | |||
964 | agent.RemoveFromPhysicalScene(); | ||
966 | SetInTransit(agent.UUID); | 965 | SetInTransit(agent.UUID); |
967 | AgentData cAgent = new AgentData(); | 966 | |
967 | AgentData cAgent = new AgentData(); | ||
968 | agent.CopyTo(cAgent); | 968 | agent.CopyTo(cAgent); |
969 | cAgent.Position = pos; | 969 | cAgent.Position = pos; |
970 | if (isFlying) | 970 | if (isFlying) |
971 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 971 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
972 | cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + | 972 | |
973 | "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; | 973 | // We don't need the callback anymnore |
974 | 974 | cAgent.CallbackURI = String.Empty; | |
975 | |||
975 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 976 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
976 | { | 977 | { |
977 | // region doesn't take it | 978 | // region doesn't take it |
978 | ReInstantiateScripts(agent); | 979 | ReInstantiateScripts(agent); |
980 | agent.AddToPhysicalScene(isFlying); | ||
979 | ResetFromTransit(agent.UUID); | 981 | ResetFromTransit(agent.UUID); |
980 | return agent; | 982 | return agent; |
981 | } | 983 | } |
982 | 984 | ||
983 | // Next, let's close the child agent connections that are too far away. | ||
984 | agent.CloseChildAgents(neighbourx, neighboury); | ||
985 | |||
986 | //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 985 | //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
987 | agent.ControllingClient.RequestClientInfo(); | 986 | agent.ControllingClient.RequestClientInfo(); |
988 | 987 | ||
@@ -999,11 +998,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
999 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); | 998 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
1000 | 999 | ||
1001 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 1000 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
1002 | 1001 | ||
1003 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); | 1002 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); |
1004 | if (eq != null) | 1003 | if (eq != null) |
1005 | { | 1004 | { |
1006 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | 1005 | eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint, |
1007 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | 1006 | capsPath, agent.UUID, agent.ControllingClient.SessionId); |
1008 | } | 1007 | } |
1009 | else | 1008 | else |
@@ -1011,32 +1010,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1011 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | 1010 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, |
1012 | capsPath); | 1011 | capsPath); |
1013 | } | 1012 | } |
1014 | 1013 | ||
1015 | if (!WaitForCallback(agent.UUID)) | 1014 | // SUCCESS! |
1016 | { | ||
1017 | m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent"); | ||
1018 | ReInstantiateScripts(agent); | ||
1019 | ResetFromTransit(agent.UUID); | ||
1020 | |||
1021 | // Yikes! We should just have a ref to scene here. | ||
1022 | //agent.Scene.InformClientOfNeighbours(agent); | ||
1023 | EnableChildAgents(agent); | ||
1024 | |||
1025 | return agent; | ||
1026 | } | ||
1027 | |||
1028 | agent.MakeChildAgent(); | 1015 | agent.MakeChildAgent(); |
1029 | 1016 | ResetFromTransit(agent.UUID); | |
1017 | |||
1030 | // now we have a child agent in this region. Request all interesting data about other (root) agents | 1018 | // now we have a child agent in this region. Request all interesting data about other (root) agents |
1031 | agent.SendOtherAgentsAvatarDataToMe(); | 1019 | agent.SendOtherAgentsAvatarDataToMe(); |
1032 | agent.SendOtherAgentsAppearanceToMe(); | 1020 | agent.SendOtherAgentsAppearanceToMe(); |
1033 | 1021 | ||
1034 | // Backwards compatibility | 1022 | // Backwards compatibility. Best effort |
1035 | if (version == "Unknown" || version == string.Empty) | 1023 | if (version == "Unknown" || version == string.Empty) |
1036 | { | 1024 | { |
1037 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one..."); | 1025 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); |
1026 | Thread.Sleep(3000); // wait a little now that we're not waiting for the callback | ||
1038 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); | 1027 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); |
1039 | } | 1028 | } |
1029 | |||
1030 | |||
1031 | // Next, let's close the child agent connections that are too far away. | ||
1032 | agent.CloseChildAgents(neighbourx, neighboury); | ||
1040 | 1033 | ||
1041 | AgentHasMovedAway(agent, false); | 1034 | AgentHasMovedAway(agent, false); |
1042 | 1035 | ||
@@ -1069,16 +1062,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1069 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; | 1062 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; |
1070 | ScenePresence agent = icon.EndInvoke(iar); | 1063 | ScenePresence agent = icon.EndInvoke(iar); |
1071 | 1064 | ||
1072 | // If the cross was successful, this agent is a child agent | 1065 | //// If the cross was successful, this agent is a child agent |
1073 | if (agent.IsChildAgent) | 1066 | //if (agent.IsChildAgent) |
1074 | agent.Reset(); | 1067 | // agent.Reset(); |
1075 | else // Not successful | 1068 | //else // Not successful |
1076 | agent.RestoreInCurrentScene(); | 1069 | // agent.RestoreInCurrentScene(); |
1077 | 1070 | ||
1078 | // In any case | 1071 | // In any case |
1079 | agent.IsInTransit = false; | 1072 | agent.IsInTransit = false; |
1080 | 1073 | ||
1081 | //m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); | 1074 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); |
1082 | } | 1075 | } |
1083 | 1076 | ||
1084 | #endregion | 1077 | #endregion |
@@ -1712,9 +1705,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1712 | uint x = 0, y = 0; | 1705 | uint x = 0, y = 0; |
1713 | Utils.LongToUInts(newRegionHandle, out x, out y); | 1706 | Utils.LongToUInts(newRegionHandle, out x, out y); |
1714 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); | 1707 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); |
1715 | if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) | 1708 | |
1709 | if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent)) | ||
1716 | { | 1710 | { |
1711 | m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID); | ||
1712 | |||
1713 | // We are going to move the object back to the old position so long as the old position | ||
1714 | // is in the region | ||
1715 | oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1); | ||
1716 | oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1); | ||
1717 | oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f); | ||
1718 | |||
1717 | grp.RootPart.GroupPosition = oldGroupPosition; | 1719 | grp.RootPart.GroupPosition = oldGroupPosition; |
1720 | |||
1721 | // Need to turn off the physics flags, otherwise the object will continue to attempt to | ||
1722 | // move out of the region creating an infinite loop of failed attempts to cross | ||
1723 | grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false); | ||
1724 | |||
1718 | grp.ScheduleGroupForFullUpdate(); | 1725 | grp.ScheduleGroupForFullUpdate(); |
1719 | } | 1726 | } |
1720 | } | 1727 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index cc9ba97..8d41728 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
187 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); | 187 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); |
188 | 188 | ||
189 | // Let's find out if this is a foreign user or a local user | 189 | // Let's find out if this is a foreign user or a local user |
190 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, id); | 190 | IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>(); |
191 | if (account != null) | 191 | if (uMan != null && uMan.IsLocalGridUser(id)) |
192 | { | 192 | { |
193 | // local grid user | 193 | // local grid user |
194 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); | 194 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); |
@@ -227,8 +227,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
227 | IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>(); | 227 | IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>(); |
228 | GridRegion homeGatekeeper = MakeRegion(aCircuit); | 228 | GridRegion homeGatekeeper = MakeRegion(aCircuit); |
229 | 229 | ||
230 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}:{5}", | 230 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}", |
231 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName); | 231 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName); |
232 | 232 | ||
233 | DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq); | 233 | DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq); |
234 | } | 234 | } |
@@ -313,8 +313,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
313 | } | 313 | } |
314 | 314 | ||
315 | // Let's find out if this is a foreign user or a local user | 315 | // Let's find out if this is a foreign user or a local user |
316 | IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>(); | ||
316 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); | 317 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); |
317 | if (account != null) | 318 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) |
318 | { | 319 | { |
319 | // local grid user | 320 | // local grid user |
320 | return; | 321 | return; |
@@ -347,6 +348,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
347 | 348 | ||
348 | region.ExternalHostName = uri.Host; | 349 | region.ExternalHostName = uri.Host; |
349 | region.HttpPort = (uint)uri.Port; | 350 | region.HttpPort = (uint)uri.Port; |
351 | region.ServerURI = uri.ToString(); | ||
350 | region.RegionName = string.Empty; | 352 | region.RegionName = string.Empty; |
351 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); | 353 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); |
352 | return region; | 354 | return region; |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 81b65c5..d20c9eb 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -73,7 +73,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
73 | 73 | ||
74 | public AssetBase FetchAsset(string url, UUID assetID) | 74 | public AssetBase FetchAsset(string url, UUID assetID) |
75 | { | 75 | { |
76 | AssetBase asset = m_scene.AssetService.Get(url + "/" + assetID.ToString()); | 76 | if (!url.EndsWith("/") && !url.EndsWith("=")) |
77 | url = url + "/"; | ||
78 | |||
79 | AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString()); | ||
77 | 80 | ||
78 | if (asset != null) | 81 | if (asset != null) |
79 | { | 82 | { |
@@ -87,6 +90,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
87 | { | 90 | { |
88 | if (asset != null) | 91 | if (asset != null) |
89 | { | 92 | { |
93 | if (!url.EndsWith("/") && !url.EndsWith("=")) | ||
94 | url = url + "/"; | ||
95 | |||
90 | // See long comment in AssetCache.AddAsset | 96 | // See long comment in AssetCache.AddAsset |
91 | if (!asset.Temporary || asset.Local) | 97 | if (!asset.Temporary || asset.Local) |
92 | { | 98 | { |
@@ -99,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
99 | Copy(asset, asset1); | 105 | Copy(asset, asset1); |
100 | try | 106 | try |
101 | { | 107 | { |
102 | asset1.ID = url + "/" + asset.ID; | 108 | asset1.ID = url + asset.ID; |
103 | } | 109 | } |
104 | catch | 110 | catch |
105 | { | 111 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 49d484b..bf24ebc 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -124,8 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
124 | 124 | ||
125 | protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix) | 125 | protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix) |
126 | { | 126 | { |
127 | UserAccount account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, presence.UUID); | 127 | if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(presence.UUID)) |
128 | if (account == null) | ||
129 | prefix = "HG "; | 128 | prefix = "HG "; |
130 | else | 129 | else |
131 | prefix = string.Empty; | 130 | prefix = string.Empty; |
@@ -210,12 +209,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
210 | public override bool IsForeignUser(UUID userID, out string assetServerURL) | 209 | public override bool IsForeignUser(UUID userID, out string assetServerURL) |
211 | { | 210 | { |
212 | assetServerURL = string.Empty; | 211 | assetServerURL = string.Empty; |
213 | UserAccount account = null; | ||
214 | if (m_Scene.UserAccountService != null) | ||
215 | account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID); | ||
216 | 212 | ||
217 | if (account == null) // foreign | 213 | if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID)) |
218 | { | 214 | { // foreign |
219 | ScenePresence sp = null; | 215 | ScenePresence sp = null; |
220 | if (m_Scene.TryGetScenePresence(userID, out sp)) | 216 | if (m_Scene.TryGetScenePresence(userID, out sp)) |
221 | { | 217 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index a40a6a4..37292d6 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -50,6 +50,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
50 | public string LastName { get; set; } | 50 | public string LastName { get; set; } |
51 | public string HomeURL { get; set; } | 51 | public string HomeURL { get; set; } |
52 | public Dictionary<string, object> ServerURLs { get; set; } | 52 | public Dictionary<string, object> ServerURLs { get; set; } |
53 | public string Title { get; set; } | ||
54 | public int Flags { get; set; } | ||
55 | public int Created { get; set; } | ||
53 | } | 56 | } |
54 | 57 | ||
55 | public class UserManagementModule : ISharedRegionModule, IUserManagement | 58 | public class UserManagementModule : ISharedRegionModule, IUserManagement |
@@ -281,6 +284,94 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
281 | return string.Empty; | 284 | return string.Empty; |
282 | } | 285 | } |
283 | 286 | ||
287 | public int GetUserFlags(UUID userID) | ||
288 | { | ||
289 | UserData userdata; | ||
290 | lock (m_UserCache) | ||
291 | m_UserCache.TryGetValue(userID, out userdata); | ||
292 | |||
293 | if (userdata.Flags == -1) | ||
294 | GetUserInfo(userID); | ||
295 | |||
296 | if (userdata.Flags != -1) | ||
297 | return userdata.Flags; | ||
298 | |||
299 | return 0; | ||
300 | } | ||
301 | |||
302 | public int GetUserCreated(UUID userID) | ||
303 | { | ||
304 | UserData userdata; | ||
305 | lock (m_UserCache) | ||
306 | m_UserCache.TryGetValue(userID, out userdata); | ||
307 | |||
308 | if (userdata.Flags == -1) | ||
309 | GetUserInfo(userID); | ||
310 | |||
311 | if (userdata.Created != -1) | ||
312 | return userdata.Created; | ||
313 | |||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | public string GetUserTitle(UUID userID) | ||
318 | { | ||
319 | UserData userdata; | ||
320 | lock (m_UserCache) | ||
321 | m_UserCache.TryGetValue(userID, out userdata); | ||
322 | |||
323 | if (userdata.Flags == -1) | ||
324 | GetUserInfo(userID); | ||
325 | |||
326 | if (userdata.Created != -1) | ||
327 | return userdata.Title; | ||
328 | |||
329 | return string.Empty; | ||
330 | } | ||
331 | |||
332 | // This will cache the user data | ||
333 | // Change this to return bool | ||
334 | private bool GetUserInfo(UUID userID) | ||
335 | { | ||
336 | UserData userdata; | ||
337 | lock (m_UserCache) | ||
338 | m_UserCache.TryGetValue(userID, out userdata); | ||
339 | |||
340 | if (userdata != null) | ||
341 | { | ||
342 | // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Requested url type {0} for {1}", serverType, userID); | ||
343 | |||
344 | if (userdata.Flags >= 0) | ||
345 | { | ||
346 | // This is already populated | ||
347 | return true; | ||
348 | } | ||
349 | |||
350 | if (userdata.HomeURL != null && userdata.HomeURL != string.Empty) | ||
351 | { | ||
352 | m_log.DebugFormat( | ||
353 | "[USER MANAGEMENT MODULE]: Requesting user flags from '{0}' for {1}", | ||
354 | userdata.HomeURL, userID); | ||
355 | |||
356 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL); | ||
357 | Dictionary<string, object> info = uConn.GetUserInfo(userID); | ||
358 | |||
359 | // Pull our data now | ||
360 | if (info["result"].ToString() == "success") | ||
361 | { | ||
362 | userdata.Flags = (int)info["user_flags"]; | ||
363 | userdata.Created = (int)info["user_created"]; | ||
364 | userdata.Title = (string)info["user_title"]; | ||
365 | |||
366 | return true; | ||
367 | } | ||
368 | } | ||
369 | } | ||
370 | |||
371 | return false; | ||
372 | } | ||
373 | |||
374 | |||
284 | public string GetUserUUI(UUID userID) | 375 | public string GetUserUUI(UUID userID) |
285 | { | 376 | { |
286 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); | 377 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); |
@@ -352,6 +443,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
352 | { | 443 | { |
353 | UserData user = new UserData(); | 444 | UserData user = new UserData(); |
354 | user.Id = id; | 445 | user.Id = id; |
446 | user.Flags = -1; | ||
447 | user.Created = -1; | ||
355 | 448 | ||
356 | if (creatorData != null && creatorData != string.Empty) | 449 | if (creatorData != null && creatorData != string.Empty) |
357 | { | 450 | { |
@@ -425,6 +518,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
425 | 518 | ||
426 | //} | 519 | //} |
427 | 520 | ||
521 | public bool IsLocalGridUser(UUID uuid) | ||
522 | { | ||
523 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); | ||
524 | if (account == null || (account != null && !account.LocalToGrid)) | ||
525 | return false; | ||
526 | |||
527 | return true; | ||
528 | } | ||
529 | |||
428 | #endregion IUserManagement | 530 | #endregion IUserManagement |
429 | 531 | ||
430 | private void HandleShowUsers(string module, string[] cmd) | 532 | private void HandleShowUsers(string module, string[] cmd) |
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index cabbd31..16cbbf5 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs | |||
@@ -153,10 +153,18 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
153 | 153 | ||
154 | public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) | 154 | public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) |
155 | { | 155 | { |
156 | if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) | 156 | if (m_enableWindlight) |
157 | { | 157 | { |
158 | List<byte[]> param = compileWindlightSettings(wl); | 158 | if (m_scene.RegionInfo.WindlightSettings.valid) |
159 | client.SendGenericMessage("Windlight", param); | 159 | { |
160 | List<byte[]> param = compileWindlightSettings(wl); | ||
161 | client.SendGenericMessage("Windlight", param); | ||
162 | } | ||
163 | else | ||
164 | { | ||
165 | List<byte[]> param = new List<byte[]>(); | ||
166 | client.SendGenericMessage("WindlightReset", param); | ||
167 | } | ||
160 | } | 168 | } |
161 | } | 169 | } |
162 | 170 | ||
@@ -175,8 +183,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
175 | 183 | ||
176 | private void EventManager_OnSaveNewWindlightProfile() | 184 | private void EventManager_OnSaveNewWindlightProfile() |
177 | { | 185 | { |
178 | if (m_scene.RegionInfo.WindlightSettings.valid) | 186 | m_scene.ForEachRootClient(SendProfileToClient); |
179 | m_scene.ForEachRootClient(SendProfileToClient); | ||
180 | } | 187 | } |
181 | 188 | ||
182 | public void PostInitialise() | 189 | public void PostInitialise() |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 43672d1..8fb5d75 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -411,8 +411,21 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
411 | } | 411 | } |
412 | 412 | ||
413 | Request.Timeout = HttpTimeout; | 413 | Request.Timeout = HttpTimeout; |
414 | // execute the request | 414 | try |
415 | response = (HttpWebResponse) Request.GetResponse(); | 415 | { |
416 | // execute the request | ||
417 | response = (HttpWebResponse) Request.GetResponse(); | ||
418 | } | ||
419 | catch (WebException e) | ||
420 | { | ||
421 | if (e.Status != WebExceptionStatus.ProtocolError) | ||
422 | { | ||
423 | throw; | ||
424 | } | ||
425 | response = (HttpWebResponse)e.Response; | ||
426 | } | ||
427 | |||
428 | Status = (int)response.StatusCode; | ||
416 | 429 | ||
417 | Stream resStream = response.GetResponseStream(); | 430 | Stream resStream = response.GetResponseStream(); |
418 | 431 | ||
@@ -436,17 +449,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
436 | } | 449 | } |
437 | catch (Exception e) | 450 | catch (Exception e) |
438 | { | 451 | { |
439 | if (e is WebException && ((WebException)e).Status == WebExceptionStatus.ProtocolError) | 452 | Status = (int)OSHttpStatusCode.ClientErrorJoker; |
440 | { | 453 | ResponseBody = e.Message; |
441 | HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response; | ||
442 | Status = (int)webRsp.StatusCode; | ||
443 | ResponseBody = webRsp.StatusDescription; | ||
444 | } | ||
445 | else | ||
446 | { | ||
447 | Status = (int)OSHttpStatusCode.ClientErrorJoker; | ||
448 | ResponseBody = e.Message; | ||
449 | } | ||
450 | 454 | ||
451 | _finished = true; | 455 | _finished = true; |
452 | return; | 456 | return; |
@@ -457,7 +461,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
457 | response.Close(); | 461 | response.Close(); |
458 | } | 462 | } |
459 | 463 | ||
460 | Status = (int)OSHttpStatusCode.SuccessOk; | ||
461 | _finished = true; | 464 | _finished = true; |
462 | } | 465 | } |
463 | 466 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index e31be21..8395f83 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -382,23 +382,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
382 | return result; | 382 | return result; |
383 | } | 383 | } |
384 | 384 | ||
385 | #region IHyperAssetService | ||
386 | |||
387 | public string GetUserAssetServer(UUID userID) | ||
388 | { | ||
389 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); | ||
390 | |||
391 | if (account != null && account.ServiceURLs.ContainsKey("AssetServerURI") && account.ServiceURLs["AssetServerURI"] != null) | ||
392 | return account.ServiceURLs["AssetServerURI"].ToString(); | ||
393 | |||
394 | return string.Empty; | ||
395 | } | ||
396 | |||
397 | public string GetSimAssetServer() | ||
398 | { | ||
399 | return m_LocalAssetServiceURI; | ||
400 | } | ||
401 | |||
402 | #endregion | ||
403 | } | 385 | } |
404 | } | 386 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index cc5d061..2e6ec90 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -170,6 +170,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
170 | 170 | ||
171 | public AssetBase GetCached(string id) | 171 | public AssetBase GetCached(string id) |
172 | { | 172 | { |
173 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id); | ||
174 | |||
173 | if (m_Cache != null) | 175 | if (m_Cache != null) |
174 | return m_Cache.Get(id); | 176 | return m_Cache.Get(id); |
175 | 177 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs deleted file mode 100644 index dcf08e3..0000000 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ /dev/null | |||
@@ -1,223 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using Nini.Config; | ||
32 | using log4net; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Services.Interfaces; | ||
35 | |||
36 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | ||
37 | { | ||
38 | public abstract class BaseInventoryConnector : IInventoryService | ||
39 | { | ||
40 | protected static InventoryCache m_cache; | ||
41 | private static bool m_Initialized; | ||
42 | |||
43 | protected virtual void Init(IConfigSource source) | ||
44 | { | ||
45 | if (!m_Initialized) | ||
46 | { | ||
47 | m_cache = new InventoryCache(); | ||
48 | m_cache.Init(source, this); | ||
49 | m_Initialized = true; | ||
50 | } | ||
51 | } | ||
52 | |||
53 | /// <summary> | ||
54 | /// Create the entire inventory for a given user | ||
55 | /// </summary> | ||
56 | /// <param name="user"></param> | ||
57 | /// <returns></returns> | ||
58 | public abstract bool CreateUserInventory(UUID user); | ||
59 | |||
60 | /// <summary> | ||
61 | /// Gets the skeleton of the inventory -- folders only | ||
62 | /// </summary> | ||
63 | /// <param name="userId"></param> | ||
64 | /// <returns></returns> | ||
65 | public abstract List<InventoryFolderBase> GetInventorySkeleton(UUID userId); | ||
66 | |||
67 | /// <summary> | ||
68 | /// Synchronous inventory fetch. | ||
69 | /// </summary> | ||
70 | /// <param name="userID"></param> | ||
71 | /// <returns></returns> | ||
72 | public abstract InventoryCollection GetUserInventory(UUID userID); | ||
73 | |||
74 | /// <summary> | ||
75 | /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the | ||
76 | /// inventory has been received | ||
77 | /// </summary> | ||
78 | /// <param name="userID"></param> | ||
79 | /// <param name="callback"></param> | ||
80 | public abstract void GetUserInventory(UUID userID, InventoryReceiptCallback callback); | ||
81 | |||
82 | /// <summary> | ||
83 | /// Retrieve the root inventory folder for the given user. | ||
84 | /// </summary> | ||
85 | /// <param name="userID"></param> | ||
86 | /// <returns>null if no root folder was found</returns> | ||
87 | public InventoryFolderBase GetRootFolder(UUID userID) | ||
88 | { | ||
89 | // Root folder is here as system type Folder. | ||
90 | return m_cache.GetFolderForType(userID, AssetType.Folder); | ||
91 | } | ||
92 | |||
93 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); | ||
94 | |||
95 | /// <summary> | ||
96 | /// Gets the user folder for the given folder-type | ||
97 | /// </summary> | ||
98 | /// <param name="userID"></param> | ||
99 | /// <param name="type"></param> | ||
100 | /// <returns></returns> | ||
101 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | ||
102 | { | ||
103 | return m_cache.GetFolderForType(userID, type); | ||
104 | } | ||
105 | |||
106 | /// <summary> | ||
107 | /// Gets everything (folders and items) inside a folder | ||
108 | /// </summary> | ||
109 | /// <param name="userId"></param> | ||
110 | /// <param name="folderID"></param> | ||
111 | /// <returns></returns> | ||
112 | public abstract InventoryCollection GetFolderContent(UUID userID, UUID folderID); | ||
113 | |||
114 | /// <summary> | ||
115 | /// Gets the items inside a folder | ||
116 | /// </summary> | ||
117 | /// <param name="userID"></param> | ||
118 | /// <param name="folderID"></param> | ||
119 | /// <returns></returns> | ||
120 | public abstract List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID); | ||
121 | |||
122 | /// <summary> | ||
123 | /// Add a new folder to the user's inventory | ||
124 | /// </summary> | ||
125 | /// <param name="folder"></param> | ||
126 | /// <returns>true if the folder was successfully added</returns> | ||
127 | public abstract bool AddFolder(InventoryFolderBase folder); | ||
128 | |||
129 | /// <summary> | ||
130 | /// Update a folder in the user's inventory | ||
131 | /// </summary> | ||
132 | /// <param name="folder"></param> | ||
133 | /// <returns>true if the folder was successfully updated</returns> | ||
134 | public abstract bool UpdateFolder(InventoryFolderBase folder); | ||
135 | |||
136 | /// <summary> | ||
137 | /// Move an inventory folder to a new location | ||
138 | /// </summary> | ||
139 | /// <param name="folder">A folder containing the details of the new location</param> | ||
140 | /// <returns>true if the folder was successfully moved</returns> | ||
141 | public abstract bool MoveFolder(InventoryFolderBase folder); | ||
142 | |||
143 | /// <summary> | ||
144 | /// Delete a list of inventory folders (from trash) | ||
145 | /// </summary> | ||
146 | public abstract bool DeleteFolders(UUID ownerID, List<UUID> folderIDs); | ||
147 | |||
148 | /// <summary> | ||
149 | /// Purge an inventory folder of all its items and subfolders. | ||
150 | /// </summary> | ||
151 | /// <param name="folder"></param> | ||
152 | /// <returns>true if the folder was successfully purged</returns> | ||
153 | public abstract bool PurgeFolder(InventoryFolderBase folder); | ||
154 | |||
155 | /// <summary> | ||
156 | /// Add a new item to the user's inventory. | ||
157 | /// If the given item has to parent folder, it tries to find the most | ||
158 | /// suitable folder for it. | ||
159 | /// </summary> | ||
160 | /// <param name="item"></param> | ||
161 | /// <returns>true if the item was successfully added</returns> | ||
162 | public bool AddItem(InventoryItemBase item) | ||
163 | { | ||
164 | if (item == null) | ||
165 | return false; | ||
166 | |||
167 | if (item.Folder == UUID.Zero) | ||
168 | { | ||
169 | InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType); | ||
170 | if (f != null) | ||
171 | item.Folder = f.ID; | ||
172 | else | ||
173 | { | ||
174 | f = GetRootFolder(item.Owner); | ||
175 | if (f != null) | ||
176 | item.Folder = f.ID; | ||
177 | else | ||
178 | return false; | ||
179 | } | ||
180 | } | ||
181 | |||
182 | return AddItemPlain(item); | ||
183 | } | ||
184 | |||
185 | protected abstract bool AddItemPlain(InventoryItemBase item); | ||
186 | |||
187 | /// <summary> | ||
188 | /// Update an item in the user's inventory | ||
189 | /// </summary> | ||
190 | /// <param name="item"></param> | ||
191 | /// <returns>true if the item was successfully updated</returns> | ||
192 | public abstract bool UpdateItem(InventoryItemBase item); | ||
193 | |||
194 | public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items); | ||
195 | |||
196 | /// <summary> | ||
197 | /// Delete an item from the user's inventory | ||
198 | /// </summary> | ||
199 | /// <param name="item"></param> | ||
200 | /// <returns>true if the item was successfully deleted</returns> | ||
201 | public abstract bool DeleteItems(UUID ownerID, List<UUID> itemIDs); | ||
202 | |||
203 | public abstract InventoryItemBase GetItem(InventoryItemBase item); | ||
204 | |||
205 | public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder); | ||
206 | |||
207 | /// <summary> | ||
208 | /// Does the given user have an inventory structure? | ||
209 | /// </summary> | ||
210 | /// <param name="userID"></param> | ||
211 | /// <returns></returns> | ||
212 | public abstract bool HasInventoryForUser(UUID userID); | ||
213 | |||
214 | /// <summary> | ||
215 | /// Get the active gestures of the agent. | ||
216 | /// </summary> | ||
217 | /// <param name="userId"></param> | ||
218 | /// <returns></returns> | ||
219 | public abstract List<InventoryItemBase> GetActiveGestures(UUID userId); | ||
220 | |||
221 | public abstract int GetAssetPermissions(UUID userID, UUID assetID); | ||
222 | } | ||
223 | } | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 0d121ed..b5c0af6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -218,9 +218,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
218 | /// <param name="userID"></param> | 218 | /// <param name="userID"></param> |
219 | private void CacheInventoryServiceURL(UUID userID) | 219 | private void CacheInventoryServiceURL(UUID userID) |
220 | { | 220 | { |
221 | if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null) | 221 | if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID)) |
222 | { | 222 | { |
223 | // The user does not have a local account; let's cache its service URL | 223 | // The user is not local; let's cache its service URL |
224 | string inventoryURL = string.Empty; | 224 | string inventoryURL = string.Empty; |
225 | ScenePresence sp = null; | 225 | ScenePresence sp = null; |
226 | foreach (Scene scene in m_Scenes) | 226 | foreach (Scene scene in m_Scenes) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs deleted file mode 100644 index 2322d7c..0000000 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ /dev/null | |||
@@ -1,237 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | |||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Framework.Client; | ||
34 | using OpenSim.Region.Framework.Scenes; | ||
35 | |||
36 | using OpenMetaverse; | ||
37 | using Nini.Config; | ||
38 | using log4net; | ||
39 | |||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | ||
41 | { | ||
42 | public class InventoryCache | ||
43 | { | ||
44 | private static readonly ILog m_log = | ||
45 | LogManager.GetLogger( | ||
46 | MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
48 | protected BaseInventoryConnector m_Connector; | ||
49 | protected List<Scene> m_Scenes; | ||
50 | |||
51 | // The cache proper | ||
52 | protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache; | ||
53 | |||
54 | // A cache of userIDs --> ServiceURLs, for HGBroker only | ||
55 | protected Dictionary<UUID, string> m_InventoryURLs = | ||
56 | new Dictionary<UUID, string>(); | ||
57 | |||
58 | public virtual void Init(IConfigSource source, BaseInventoryConnector connector) | ||
59 | { | ||
60 | m_Scenes = new List<Scene>(); | ||
61 | m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>(); | ||
62 | m_Connector = connector; | ||
63 | } | ||
64 | |||
65 | public virtual void AddRegion(Scene scene) | ||
66 | { | ||
67 | m_Scenes.Add(scene); | ||
68 | scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; | ||
69 | scene.EventManager.OnClientClosed += OnClientClosed; | ||
70 | } | ||
71 | |||
72 | public virtual void RemoveRegion(Scene scene) | ||
73 | { | ||
74 | if ((m_Scenes != null) && m_Scenes.Contains(scene)) | ||
75 | { | ||
76 | m_Scenes.Remove(scene); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | void OnMakeRootAgent(ScenePresence presence) | ||
81 | { | ||
82 | // Get system folders | ||
83 | |||
84 | // First check if they're here already | ||
85 | lock (m_InventoryCache) | ||
86 | { | ||
87 | if (m_InventoryCache.ContainsKey(presence.UUID)) | ||
88 | { | ||
89 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, system folders for {0} {1} already in cache", presence.Firstname, presence.Lastname); | ||
90 | return; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | // If not, go get them and place them in the cache | ||
95 | Dictionary<AssetType, InventoryFolderBase> folders = CacheSystemFolders(presence.UUID); | ||
96 | CacheInventoryServiceURL(presence.Scene, presence.UUID); | ||
97 | |||
98 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}", | ||
99 | presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count); | ||
100 | |||
101 | } | ||
102 | |||
103 | void OnClientClosed(UUID clientID, Scene scene) | ||
104 | { | ||
105 | if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache | ||
106 | { | ||
107 | ScenePresence sp = null; | ||
108 | foreach (Scene s in m_Scenes) | ||
109 | { | ||
110 | s.TryGetScenePresence(clientID, out sp); | ||
111 | if ((sp != null) && !sp.IsChildAgent && (s != scene)) | ||
112 | { | ||
113 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache", | ||
114 | scene.RegionInfo.RegionName, clientID); | ||
115 | return; | ||
116 | } | ||
117 | } | ||
118 | |||
119 | m_log.DebugFormat( | ||
120 | "[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders", | ||
121 | scene.RegionInfo.RegionName, clientID); | ||
122 | DropCachedSystemFolders(clientID); | ||
123 | DropInventoryServiceURL(clientID); | ||
124 | } | ||
125 | } | ||
126 | |||
127 | /// <summary> | ||
128 | /// Cache a user's 'system' folders. | ||
129 | /// </summary> | ||
130 | /// <param name="userID"></param> | ||
131 | /// <returns>Folders cached</returns> | ||
132 | protected Dictionary<AssetType, InventoryFolderBase> CacheSystemFolders(UUID userID) | ||
133 | { | ||
134 | // If not, go get them and place them in the cache | ||
135 | Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(userID); | ||
136 | |||
137 | if (folders.Count > 0) | ||
138 | lock (m_InventoryCache) | ||
139 | m_InventoryCache.Add(userID, folders); | ||
140 | |||
141 | return folders; | ||
142 | } | ||
143 | |||
144 | /// <summary> | ||
145 | /// Drop a user's cached 'system' folders | ||
146 | /// </summary> | ||
147 | /// <param name="userID"></param> | ||
148 | protected void DropCachedSystemFolders(UUID userID) | ||
149 | { | ||
150 | // Drop system folders | ||
151 | lock (m_InventoryCache) | ||
152 | if (m_InventoryCache.ContainsKey(userID)) | ||
153 | m_InventoryCache.Remove(userID); | ||
154 | } | ||
155 | |||
156 | /// <summary> | ||
157 | /// Get the system folder for a particular asset type | ||
158 | /// </summary> | ||
159 | /// <param name="userID"></param> | ||
160 | /// <param name="type"></param> | ||
161 | /// <returns></returns> | ||
162 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | ||
163 | { | ||
164 | m_log.DebugFormat("[INVENTORY CACHE]: Getting folder for asset type {0} for user {1}", type, userID); | ||
165 | |||
166 | Dictionary<AssetType, InventoryFolderBase> folders = null; | ||
167 | |||
168 | lock (m_InventoryCache) | ||
169 | { | ||
170 | m_InventoryCache.TryGetValue(userID, out folders); | ||
171 | |||
172 | // In some situations (such as non-secured standalones), system folders can be requested without | ||
173 | // the user being logged in. So we need to try caching them here if we don't already have them. | ||
174 | if (null == folders) | ||
175 | CacheSystemFolders(userID); | ||
176 | |||
177 | m_InventoryCache.TryGetValue(userID, out folders); | ||
178 | } | ||
179 | |||
180 | if ((folders != null) && folders.ContainsKey(type)) | ||
181 | { | ||
182 | m_log.DebugFormat( | ||
183 | "[INVENTORY CACHE]: Returning folder {0} as type {1} for {2}", folders[type], type, userID); | ||
184 | |||
185 | return folders[type]; | ||
186 | } | ||
187 | |||
188 | m_log.WarnFormat("[INVENTORY CACHE]: Could not find folder for system type {0} for {1}", type, userID); | ||
189 | |||
190 | return null; | ||
191 | } | ||
192 | |||
193 | /// <summary> | ||
194 | /// Gets the user's inventory URL from its serviceURLs, if the user is foreign, | ||
195 | /// and sticks it in the cache | ||
196 | /// </summary> | ||
197 | /// <param name="userID"></param> | ||
198 | private void CacheInventoryServiceURL(Scene scene, UUID userID) | ||
199 | { | ||
200 | if (scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, userID) == null) | ||
201 | { | ||
202 | // The user does not have a local account; let's cache its service URL | ||
203 | string inventoryURL = string.Empty; | ||
204 | ScenePresence sp = null; | ||
205 | scene.TryGetScenePresence(userID, out sp); | ||
206 | if (sp != null) | ||
207 | { | ||
208 | AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | ||
209 | if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI")) | ||
210 | { | ||
211 | inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString(); | ||
212 | if (inventoryURL != null && inventoryURL != string.Empty) | ||
213 | { | ||
214 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); | ||
215 | m_InventoryURLs.Add(userID, inventoryURL); | ||
216 | } | ||
217 | } | ||
218 | } | ||
219 | } | ||
220 | } | ||
221 | |||
222 | private void DropInventoryServiceURL(UUID userID) | ||
223 | { | ||
224 | lock (m_InventoryURLs) | ||
225 | if (m_InventoryURLs.ContainsKey(userID)) | ||
226 | m_InventoryURLs.Remove(userID); | ||
227 | } | ||
228 | |||
229 | public string GetInventoryServiceURL(UUID userID) | ||
230 | { | ||
231 | if (m_InventoryURLs.ContainsKey(userID)) | ||
232 | return m_InventoryURLs[userID]; | ||
233 | |||
234 | return null; | ||
235 | } | ||
236 | } | ||
237 | } | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs index c66e053..54dfaf4 100644 --- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs +++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs | |||
@@ -14,6 +14,9 @@ namespace OpenSim.Region.Framework.Interfaces | |||
14 | string GetUserHomeURL(UUID uuid); | 14 | string GetUserHomeURL(UUID uuid); |
15 | string GetUserUUI(UUID uuid); | 15 | string GetUserUUI(UUID uuid); |
16 | string GetUserServerURL(UUID uuid, string serverType); | 16 | string GetUserServerURL(UUID uuid, string serverType); |
17 | int GetUserFlags(UUID userID); | ||
18 | int GetUserCreated(UUID userID); | ||
19 | string GetUserTitle(UUID userID); | ||
17 | 20 | ||
18 | /// <summary> | 21 | /// <summary> |
19 | /// Add a user. | 22 | /// Add a user. |
@@ -48,5 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
48 | /// <param name="firstName"></param> | 51 | /// <param name="firstName"></param> |
49 | /// <param name="profileURL"></param> | 52 | /// <param name="profileURL"></param> |
50 | void AddUser(UUID uuid, string firstName, string lastName, string profileURL); | 53 | void AddUser(UUID uuid, string firstName, string lastName, string profileURL); |
54 | |||
55 | bool IsLocalGridUser(UUID uuid); | ||
51 | } | 56 | } |
52 | } | 57 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6666328..0f84da9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -77,7 +77,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
77 | /// Controls whether physics can be applied to prims. Even if false, prims still have entries in a | 77 | /// Controls whether physics can be applied to prims. Even if false, prims still have entries in a |
78 | /// PhysicsScene in order to perform collision detection | 78 | /// PhysicsScene in order to perform collision detection |
79 | /// </summary> | 79 | /// </summary> |
80 | public bool m_physicalPrim; | 80 | public bool PhysicalPrims { get; private set; } |
81 | |||
82 | /// <summary> | ||
83 | /// Controls whether prims can be collided with. | ||
84 | /// </summary> | ||
85 | /// <remarks> | ||
86 | /// If this is set to false then prims cannot be subject to physics either. | ||
87 | /// </summary> | ||
88 | public bool CollidablePrims { get; private set; } | ||
81 | 89 | ||
82 | public float m_maxNonphys = 256; | 90 | public float m_maxNonphys = 256; |
83 | public float m_maxPhys = 10; | 91 | public float m_maxPhys = 10; |
@@ -650,7 +658,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
650 | //Animation states | 658 | //Animation states |
651 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); | 659 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); |
652 | 660 | ||
653 | m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); | 661 | PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); |
662 | CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); | ||
654 | 663 | ||
655 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); | 664 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); |
656 | if (RegionInfo.NonphysPrimMax > 0) | 665 | if (RegionInfo.NonphysPrimMax > 0) |
@@ -701,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
701 | if (maptileRefresh != 0) | 710 | if (maptileRefresh != 0) |
702 | { | 711 | { |
703 | m_mapGenerationTimer.Interval = maptileRefresh * 1000; | 712 | m_mapGenerationTimer.Interval = maptileRefresh * 1000; |
704 | m_mapGenerationTimer.Elapsed += RegenerateMaptile; | 713 | m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister; |
705 | m_mapGenerationTimer.AutoReset = true; | 714 | m_mapGenerationTimer.AutoReset = true; |
706 | m_mapGenerationTimer.Start(); | 715 | m_mapGenerationTimer.Start(); |
707 | } | 716 | } |
@@ -1638,21 +1647,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1638 | { | 1647 | { |
1639 | m_sceneGridService.SetScene(this); | 1648 | m_sceneGridService.SetScene(this); |
1640 | 1649 | ||
1650 | //// Unfortunately this needs to be here and it can't be async. | ||
1651 | //// The map tile image is stored in RegionSettings, but it also needs to be | ||
1652 | //// stored in the GridService, because that's what the world map module uses | ||
1653 | //// to send the map image UUIDs (of other regions) to the viewer... | ||
1654 | if (m_generateMaptiles) | ||
1655 | RegenerateMaptile(); | ||
1656 | |||
1641 | GridRegion region = new GridRegion(RegionInfo); | 1657 | GridRegion region = new GridRegion(RegionInfo); |
1642 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); | 1658 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); |
1643 | if (error != String.Empty) | 1659 | if (error != String.Empty) |
1644 | { | ||
1645 | throw new Exception(error); | 1660 | throw new Exception(error); |
1646 | } | ||
1647 | |||
1648 | // Generate the maptile asynchronously, because sometimes it can be very slow and we | ||
1649 | // don't want this to delay starting the region. | ||
1650 | if (m_generateMaptiles) | ||
1651 | { | ||
1652 | Util.FireAndForget(delegate { | ||
1653 | RegenerateMaptile(null, null); | ||
1654 | }); | ||
1655 | } | ||
1656 | } | 1661 | } |
1657 | 1662 | ||
1658 | #endregion | 1663 | #endregion |
@@ -5023,13 +5028,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
5023 | /// </summary> | 5028 | /// </summary> |
5024 | /// <param name="sender"></param> | 5029 | /// <param name="sender"></param> |
5025 | /// <param name="e"></param> | 5030 | /// <param name="e"></param> |
5026 | public void RegenerateMaptile(object sender, ElapsedEventArgs e) | 5031 | private void RegenerateMaptile() |
5027 | { | 5032 | { |
5028 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); | 5033 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); |
5029 | if (mapModule != null) | 5034 | if (mapModule != null) |
5030 | mapModule.GenerateMaptile(); | 5035 | mapModule.GenerateMaptile(); |
5031 | } | 5036 | } |
5032 | 5037 | ||
5038 | private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e) | ||
5039 | { | ||
5040 | RegenerateMaptile(); | ||
5041 | |||
5042 | // We need to propagate the new image UUID to the grid service | ||
5043 | // so that all simulators can retrieve it | ||
5044 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); | ||
5045 | if (error != string.Empty) | ||
5046 | throw new Exception(error); | ||
5047 | } | ||
5048 | |||
5033 | // This method is called across the simulation connector to | 5049 | // This method is called across the simulation connector to |
5034 | // determine if a given agent is allowed in this region | 5050 | // determine if a given agent is allowed in this region |
5035 | // AS A ROOT AGENT. Returning false here will prevent them | 5051 | // AS A ROOT AGENT. Returning false here will prevent them |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a3e4b46..1e2901b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -333,7 +333,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
333 | if (rot != null) | 333 | if (rot != null) |
334 | sceneObject.UpdateGroupRotationR((Quaternion)rot); | 334 | sceneObject.UpdateGroupRotationR((Quaternion)rot); |
335 | 335 | ||
336 | //group.ApplyPhysics(m_physicalPrim); | ||
337 | if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) | 336 | if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) |
338 | { | 337 | { |
339 | sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); | 338 | sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index abea788..8860764 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
210 | /// </remarks> | 210 | /// </remarks> |
211 | public bool UsesPhysics | 211 | public bool UsesPhysics |
212 | { | 212 | { |
213 | get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; } | 213 | get { return (RootPart.Flags & PrimFlags.Physics) != 0; } |
214 | } | 214 | } |
215 | 215 | ||
216 | /// <summary> | 216 | /// <summary> |
@@ -669,7 +669,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
669 | //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); | 669 | //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); |
670 | } | 670 | } |
671 | 671 | ||
672 | ApplyPhysics(m_scene.m_physicalPrim); | 672 | ApplyPhysics(); |
673 | 673 | ||
674 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled | 674 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled |
675 | // for the same object with very different properties. The caller must schedule the update. | 675 | // for the same object with very different properties. The caller must schedule the update. |
@@ -1239,8 +1239,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1239 | /// <summary> | 1239 | /// <summary> |
1240 | /// Apply physics to this group | 1240 | /// Apply physics to this group |
1241 | /// </summary> | 1241 | /// </summary> |
1242 | /// <param name="m_physicalPrim"></param> | 1242 | public void ApplyPhysics() |
1243 | public void ApplyPhysics(bool m_physicalPrim) | ||
1244 | { | 1243 | { |
1245 | // Apply physics to the root prim | 1244 | // Apply physics to the root prim |
1246 | m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); | 1245 | m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b29ecc6..aea47e6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1473,6 +1473,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1473 | /// <param name="VolumeDetectActive"></param> | 1473 | /// <param name="VolumeDetectActive"></param> |
1474 | public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive) | 1474 | public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive) |
1475 | { | 1475 | { |
1476 | if (!ParentGroup.Scene.CollidablePrims) | ||
1477 | return; | ||
1478 | |||
1476 | // m_log.DebugFormat( | 1479 | // m_log.DebugFormat( |
1477 | // "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", | 1480 | // "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", |
1478 | // Name, LocalId, UUID, m_physicalPrim); | 1481 | // Name, LocalId, UUID, m_physicalPrim); |
@@ -1739,7 +1742,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1739 | /// <param name="isNew"></param> | 1742 | /// <param name="isNew"></param> |
1740 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) | 1743 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) |
1741 | { | 1744 | { |
1742 | if (!ParentGroup.Scene.m_physicalPrim && UsePhysics) | 1745 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) |
1743 | return; | 1746 | return; |
1744 | 1747 | ||
1745 | if (IsJoint()) | 1748 | if (IsJoint()) |
@@ -4318,7 +4321,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4318 | if (ParentGroup.Scene == null) | 4321 | if (ParentGroup.Scene == null) |
4319 | return; | 4322 | return; |
4320 | 4323 | ||
4321 | if (PhysActor == null) | 4324 | if (ParentGroup.Scene.CollidablePrims && PhysActor == null) |
4322 | { | 4325 | { |
4323 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it | 4326 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it |
4324 | PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( | 4327 | PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b8ae553..42cd4be 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
118 | /// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is | 118 | /// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is |
119 | /// necessary. | 119 | /// necessary. |
120 | /// </remarks> | 120 | /// </remarks> |
121 | protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); | 121 | private List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); |
122 | 122 | ||
123 | public Object AttachmentsSyncLock { get; private set; } | 123 | public Object AttachmentsSyncLock { get; private set; } |
124 | 124 | ||
@@ -550,8 +550,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | m_pos = value; | 553 | // Don't update while sitting |
554 | ParentPosition = Vector3.Zero; | 554 | if (ParentID == 0) |
555 | { | ||
556 | m_pos = value; | ||
557 | ParentPosition = Vector3.Zero; | ||
558 | } | ||
555 | 559 | ||
556 | //m_log.DebugFormat( | 560 | //m_log.DebugFormat( |
557 | // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", | 561 | // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", |
@@ -566,6 +570,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
566 | public Vector3 OffsetPosition | 570 | public Vector3 OffsetPosition |
567 | { | 571 | { |
568 | get { return m_pos; } | 572 | get { return m_pos; } |
573 | // Don't remove setter. It's not currently used in core but | ||
574 | // upcoming Avination code needs it. | ||
575 | set | ||
576 | { | ||
577 | // There is no offset position when not seated | ||
578 | if (ParentID == 0) | ||
579 | return; | ||
580 | m_pos = value; | ||
581 | } | ||
569 | } | 582 | } |
570 | 583 | ||
571 | /// <summary> | 584 | /// <summary> |
@@ -1161,10 +1174,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1161 | public void CompleteMovement(IClientAPI client, bool openChildAgents) | 1174 | public void CompleteMovement(IClientAPI client, bool openChildAgents) |
1162 | { | 1175 | { |
1163 | // DateTime startTime = DateTime.Now; | 1176 | // DateTime startTime = DateTime.Now; |
1164 | 1177 | ||
1165 | // m_log.DebugFormat( | 1178 | m_log.DebugFormat( |
1166 | // "[SCENE PRESENCE]: Completing movement of {0} into region {1}", | 1179 | "[SCENE PRESENCE]: Completing movement of {0} into region {1} in position {2}", |
1167 | // client.Name, Scene.RegionInfo.RegionName); | 1180 | client.Name, Scene.RegionInfo.RegionName, AbsolutePosition); |
1168 | 1181 | ||
1169 | Vector3 look = Velocity; | 1182 | Vector3 look = Velocity; |
1170 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) | 1183 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) |
@@ -2383,9 +2396,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2383 | m_lastVelocity = Velocity; | 2396 | m_lastVelocity = Velocity; |
2384 | } | 2397 | } |
2385 | 2398 | ||
2386 | // followed suggestion from mic bowman. reversed the two lines below. | 2399 | CheckForBorderCrossing(); |
2387 | if (ParentID == 0 && PhysicsActor != null || ParentID != 0) // Check that we have a physics actor or we're sitting on something | ||
2388 | CheckForBorderCrossing(); | ||
2389 | 2400 | ||
2390 | CheckForSignificantMovement(); // sends update to the modules. | 2401 | CheckForSignificantMovement(); // sends update to the modules. |
2391 | } | 2402 | } |
@@ -2738,143 +2749,146 @@ namespace OpenSim.Region.Framework.Scenes | |||
2738 | /// </remarks> | 2749 | /// </remarks> |
2739 | protected void CheckForBorderCrossing() | 2750 | protected void CheckForBorderCrossing() |
2740 | { | 2751 | { |
2741 | if (IsChildAgent) | 2752 | // Check that we we are not a child |
2753 | if (IsChildAgent) | ||
2742 | return; | 2754 | return; |
2743 | 2755 | ||
2744 | Vector3 pos2 = AbsolutePosition; | 2756 | // If we don't have a PhysActor, we can't cross anyway |
2745 | Vector3 vel = Velocity; | 2757 | // Also don't do this while sat, sitting avatars cross with the |
2746 | int neighbor = 0; | 2758 | // object they sit on. |
2747 | int[] fix = new int[2]; | 2759 | if (ParentID != 0 || PhysicsActor == null) |
2748 | 2760 | return; | |
2749 | float timeStep = 0.1f; | ||
2750 | pos2.X = pos2.X + (vel.X*timeStep); | ||
2751 | pos2.Y = pos2.Y + (vel.Y*timeStep); | ||
2752 | pos2.Z = pos2.Z + (vel.Z*timeStep); | ||
2753 | 2761 | ||
2754 | if (!IsInTransit) | 2762 | if (!IsInTransit) |
2755 | { | 2763 | { |
2756 | // Checks if where it's headed exists a region | 2764 | Vector3 pos2 = AbsolutePosition; |
2765 | Vector3 vel = Velocity; | ||
2766 | int neighbor = 0; | ||
2767 | int[] fix = new int[2]; | ||
2757 | 2768 | ||
2758 | bool needsTransit = false; | 2769 | float timeStep = 0.1f; |
2759 | if (m_scene.TestBorderCross(pos2, Cardinals.W)) | 2770 | pos2.X = pos2.X + (vel.X * timeStep); |
2771 | pos2.Y = pos2.Y + (vel.Y * timeStep); | ||
2772 | pos2.Z = pos2.Z + (vel.Z * timeStep); | ||
2773 | |||
2774 | if (!IsInTransit) | ||
2760 | { | 2775 | { |
2761 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) | 2776 | // Checks if where it's headed exists a region |
2762 | { | 2777 | bool needsTransit = false; |
2763 | needsTransit = true; | 2778 | if (m_scene.TestBorderCross(pos2, Cardinals.W)) |
2764 | neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); | ||
2765 | } | ||
2766 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | ||
2767 | { | 2779 | { |
2768 | needsTransit = true; | 2780 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) |
2769 | neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); | 2781 | { |
2782 | needsTransit = true; | ||
2783 | neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); | ||
2784 | } | ||
2785 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | ||
2786 | { | ||
2787 | needsTransit = true; | ||
2788 | neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); | ||
2789 | } | ||
2790 | else | ||
2791 | { | ||
2792 | needsTransit = true; | ||
2793 | neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); | ||
2794 | } | ||
2770 | } | 2795 | } |
2771 | else | 2796 | else if (m_scene.TestBorderCross(pos2, Cardinals.E)) |
2772 | { | 2797 | { |
2773 | needsTransit = true; | 2798 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) |
2774 | neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); | 2799 | { |
2800 | needsTransit = true; | ||
2801 | neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); | ||
2802 | } | ||
2803 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | ||
2804 | { | ||
2805 | needsTransit = true; | ||
2806 | neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); | ||
2807 | } | ||
2808 | else | ||
2809 | { | ||
2810 | needsTransit = true; | ||
2811 | neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); | ||
2812 | } | ||
2775 | } | 2813 | } |
2776 | } | 2814 | else if (m_scene.TestBorderCross(pos2, Cardinals.S)) |
2777 | else if (m_scene.TestBorderCross(pos2, Cardinals.E)) | ||
2778 | { | ||
2779 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) | ||
2780 | { | 2815 | { |
2781 | needsTransit = true; | 2816 | needsTransit = true; |
2782 | neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); | 2817 | neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); |
2783 | } | 2818 | } |
2784 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | 2819 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) |
2785 | { | 2820 | { |
2786 | needsTransit = true; | 2821 | needsTransit = true; |
2787 | neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); | 2822 | neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); |
2788 | } | 2823 | } |
2789 | else | ||
2790 | { | ||
2791 | needsTransit = true; | ||
2792 | neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); | ||
2793 | } | ||
2794 | } | ||
2795 | else if (m_scene.TestBorderCross(pos2, Cardinals.S)) | ||
2796 | { | ||
2797 | needsTransit = true; | ||
2798 | neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); | ||
2799 | } | ||
2800 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | ||
2801 | { | ||
2802 | needsTransit = true; | ||
2803 | neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); | ||
2804 | } | ||
2805 | 2824 | ||
2806 | // Makes sure avatar does not end up outside region | 2825 | // Makes sure avatar does not end up outside region |
2807 | if (neighbor <= 0) | 2826 | if (neighbor <= 0) |
2808 | { | ||
2809 | if (needsTransit) | ||
2810 | { | 2827 | { |
2811 | if (m_requestedSitTargetUUID == UUID.Zero) | 2828 | if (needsTransit) |
2812 | { | 2829 | { |
2813 | bool isFlying = Flying; | 2830 | if (m_requestedSitTargetUUID == UUID.Zero) |
2814 | RemoveFromPhysicalScene(); | 2831 | { |
2815 | 2832 | bool isFlying = Flying; | |
2816 | Vector3 pos = AbsolutePosition; | 2833 | RemoveFromPhysicalScene(); |
2817 | if (AbsolutePosition.X < 0) | 2834 | |
2818 | pos.X += Velocity.X * 2; | 2835 | Vector3 pos = AbsolutePosition; |
2819 | else if (AbsolutePosition.X > Constants.RegionSize) | 2836 | if (AbsolutePosition.X < 0) |
2820 | pos.X -= Velocity.X * 2; | 2837 | pos.X += Velocity.X * 2; |
2821 | if (AbsolutePosition.Y < 0) | 2838 | else if (AbsolutePosition.X > Constants.RegionSize) |
2822 | pos.Y += Velocity.Y * 2; | 2839 | pos.X -= Velocity.X * 2; |
2823 | else if (AbsolutePosition.Y > Constants.RegionSize) | 2840 | if (AbsolutePosition.Y < 0) |
2824 | pos.Y -= Velocity.Y * 2; | 2841 | pos.Y += Velocity.Y * 2; |
2825 | Velocity = Vector3.Zero; | 2842 | else if (AbsolutePosition.Y > Constants.RegionSize) |
2826 | AbsolutePosition = pos; | 2843 | pos.Y -= Velocity.Y * 2; |
2827 | 2844 | Velocity = Vector3.Zero; | |
2828 | // m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); | 2845 | AbsolutePosition = pos; |
2829 | 2846 | ||
2830 | AddToPhysicalScene(isFlying); | 2847 | // m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); |
2848 | |||
2849 | AddToPhysicalScene(isFlying); | ||
2850 | } | ||
2831 | } | 2851 | } |
2832 | } | 2852 | } |
2833 | } | 2853 | else if (neighbor > 0) |
2834 | else if (neighbor > 0) | ||
2835 | { | ||
2836 | if (!CrossToNewRegion()) | ||
2837 | { | 2854 | { |
2838 | if (m_requestedSitTargetUUID == UUID.Zero) | 2855 | if (!CrossToNewRegion()) |
2839 | { | 2856 | { |
2840 | bool isFlying = Flying; | 2857 | if (m_requestedSitTargetUUID == UUID.Zero) |
2841 | RemoveFromPhysicalScene(); | 2858 | { |
2842 | 2859 | bool isFlying = Flying; | |
2843 | Vector3 pos = AbsolutePosition; | 2860 | RemoveFromPhysicalScene(); |
2844 | if (AbsolutePosition.X < 0) | 2861 | |
2845 | pos.X += Velocity.X * 2; | 2862 | Vector3 pos = AbsolutePosition; |
2846 | else if (AbsolutePosition.X > Constants.RegionSize) | 2863 | if (AbsolutePosition.X < 0) |
2847 | pos.X -= Velocity.X * 2; | 2864 | pos.X += Velocity.X * 2; |
2848 | if (AbsolutePosition.Y < 0) | 2865 | else if (AbsolutePosition.X > Constants.RegionSize) |
2849 | pos.Y += Velocity.Y * 2; | 2866 | pos.X -= Velocity.X * 2; |
2850 | else if (AbsolutePosition.Y > Constants.RegionSize) | 2867 | if (AbsolutePosition.Y < 0) |
2851 | pos.Y -= Velocity.Y * 2; | 2868 | pos.Y += Velocity.Y * 2; |
2852 | Velocity = Vector3.Zero; | 2869 | else if (AbsolutePosition.Y > Constants.RegionSize) |
2853 | AbsolutePosition = pos; | 2870 | pos.Y -= Velocity.Y * 2; |
2854 | 2871 | Velocity = Vector3.Zero; | |
2855 | AddToPhysicalScene(isFlying); | 2872 | AbsolutePosition = pos; |
2873 | |||
2874 | AddToPhysicalScene(isFlying); | ||
2875 | } | ||
2856 | } | 2876 | } |
2857 | } | 2877 | } |
2858 | } | 2878 | } |
2859 | } | 2879 | else |
2860 | else | 2880 | { |
2861 | { | 2881 | // This constant has been inferred from experimentation |
2862 | // We must remove the agent from the physical scene if it has been placed in transit. If we don't, | 2882 | // I'm not sure what this value should be, so I tried a few values. |
2863 | // then this method continues to be called from ScenePresence.Update() until the handover of the client between | 2883 | timeStep = 0.04f; |
2864 | // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms | 2884 | pos2 = AbsolutePosition; |
2865 | // event queue polling response from the server), this results in the avatar pausing on the border | 2885 | pos2.X = pos2.X + (vel.X * timeStep); |
2866 | // for the handover period. | 2886 | pos2.Y = pos2.Y + (vel.Y * timeStep); |
2867 | RemoveFromPhysicalScene(); | 2887 | // Don't touch the Z |
2868 | 2888 | m_pos = pos2; | |
2869 | // This constant has been inferred from experimentation | 2889 | m_log.DebugFormat("[SCENE PRESENCE]: In transit m_pos={0}", m_pos); |
2870 | // I'm not sure what this value should be, so I tried a few values. | 2890 | } |
2871 | timeStep = 0.04f; | 2891 | } |
2872 | pos2 = AbsolutePosition; | ||
2873 | pos2.X = pos2.X + (vel.X * timeStep); | ||
2874 | pos2.Y = pos2.Y + (vel.Y * timeStep); | ||
2875 | pos2.Z = pos2.Z + (vel.Z * timeStep); | ||
2876 | m_pos = pos2; | ||
2877 | } | ||
2878 | } | 2892 | } |
2879 | 2893 | ||
2880 | /// <summary> | 2894 | /// <summary> |
@@ -3104,30 +3118,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
3104 | catch { } | 3118 | catch { } |
3105 | 3119 | ||
3106 | // Attachment objects | 3120 | // Attachment objects |
3107 | lock (m_attachments) | 3121 | List<SceneObjectGroup> attachments = GetAttachments(); |
3122 | if (attachments.Count > 0) | ||
3108 | { | 3123 | { |
3109 | if (m_attachments.Count > 0) | 3124 | cAgent.AttachmentObjects = new List<ISceneObject>(); |
3110 | { | 3125 | cAgent.AttachmentObjectStates = new List<string>(); |
3111 | cAgent.AttachmentObjects = new List<ISceneObject>(); | 3126 | // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); |
3112 | cAgent.AttachmentObjectStates = new List<string>(); | 3127 | InTransitScriptStates.Clear(); |
3113 | // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); | ||
3114 | InTransitScriptStates.Clear(); | ||
3115 | 3128 | ||
3116 | foreach (SceneObjectGroup sog in m_attachments) | 3129 | foreach (SceneObjectGroup sog in attachments) |
3117 | { | 3130 | { |
3118 | // We need to make a copy and pass that copy | 3131 | // We need to make a copy and pass that copy |
3119 | // because of transfers withn the same sim | 3132 | // because of transfers withn the same sim |
3120 | ISceneObject clone = sog.CloneForNewScene(); | 3133 | ISceneObject clone = sog.CloneForNewScene(); |
3121 | // Attachment module assumes that GroupPosition holds the offsets...! | 3134 | // Attachment module assumes that GroupPosition holds the offsets...! |
3122 | ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; | 3135 | ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; |
3123 | ((SceneObjectGroup)clone).IsAttachment = false; | 3136 | ((SceneObjectGroup)clone).IsAttachment = false; |
3124 | cAgent.AttachmentObjects.Add(clone); | 3137 | cAgent.AttachmentObjects.Add(clone); |
3125 | string state = sog.GetStateSnapshot(); | 3138 | string state = sog.GetStateSnapshot(); |
3126 | cAgent.AttachmentObjectStates.Add(state); | 3139 | cAgent.AttachmentObjectStates.Add(state); |
3127 | InTransitScriptStates.Add(state); | 3140 | InTransitScriptStates.Add(state); |
3128 | // Let's remove the scripts of the original object here | 3141 | // Let's remove the scripts of the original object here |
3129 | sog.RemoveScriptInstances(true); | 3142 | sog.RemoveScriptInstances(true); |
3130 | } | ||
3131 | } | 3143 | } |
3132 | } | 3144 | } |
3133 | } | 3145 | } |
@@ -3535,26 +3547,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
3535 | /// <param name="args">The arguments for the event</param> | 3547 | /// <param name="args">The arguments for the event</param> |
3536 | public void SendScriptEventToAttachments(string eventName, Object[] args) | 3548 | public void SendScriptEventToAttachments(string eventName, Object[] args) |
3537 | { | 3549 | { |
3538 | if (m_scriptEngines.Length == 0) | 3550 | Util.FireAndForget(delegate(object x) |
3539 | return; | ||
3540 | |||
3541 | lock (m_attachments) | ||
3542 | { | 3551 | { |
3543 | foreach (SceneObjectGroup grp in m_attachments) | 3552 | if (m_scriptEngines.Length == 0) |
3553 | return; | ||
3554 | |||
3555 | lock (m_attachments) | ||
3544 | { | 3556 | { |
3545 | // 16384 is CHANGED_ANIMATION | 3557 | foreach (SceneObjectGroup grp in m_attachments) |
3546 | // | ||
3547 | // Send this to all attachment root prims | ||
3548 | // | ||
3549 | foreach (IScriptModule m in m_scriptEngines) | ||
3550 | { | 3558 | { |
3551 | if (m == null) // No script engine loaded | 3559 | // 16384 is CHANGED_ANIMATION |
3552 | continue; | 3560 | // |
3561 | // Send this to all attachment root prims | ||
3562 | // | ||
3563 | foreach (IScriptModule m in m_scriptEngines) | ||
3564 | { | ||
3565 | if (m == null) // No script engine loaded | ||
3566 | continue; | ||
3553 | 3567 | ||
3554 | m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); | 3568 | m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); |
3569 | } | ||
3555 | } | 3570 | } |
3556 | } | 3571 | } |
3557 | } | 3572 | }); |
3558 | } | 3573 | } |
3559 | 3574 | ||
3560 | internal void PushForce(Vector3 impulse) | 3575 | internal void PushForce(Vector3 impulse) |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 04ba738..228eca9 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
110 | private const uint m_regionWidth = Constants.RegionSize; | 110 | private const uint m_regionWidth = Constants.RegionSize; |
111 | private const uint m_regionHeight = Constants.RegionSize; | 111 | private const uint m_regionHeight = Constants.RegionSize; |
112 | 112 | ||
113 | private float ODE_STEPSIZE = 0.020f; | 113 | private float ODE_STEPSIZE = 0.0178f; |
114 | private float metersInSpace = 29.9f; | 114 | private float metersInSpace = 29.9f; |
115 | private float m_timeDilation = 1.0f; | 115 | private float m_timeDilation = 1.0f; |
116 | 116 | ||
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
456 | mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f); | 456 | mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f); |
457 | mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f); | 457 | mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f); |
458 | 458 | ||
459 | ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", 0.020f); | 459 | ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE); |
460 | m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10); | 460 | m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10); |
461 | 461 | ||
462 | avDensity = physicsconfig.GetFloat("av_density", 80f); | 462 | avDensity = physicsconfig.GetFloat("av_density", 80f); |
@@ -2822,6 +2822,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2822 | m_global_contactcount = 0; | 2822 | m_global_contactcount = 0; |
2823 | 2823 | ||
2824 | d.WorldQuickStep(world, ODE_STEPSIZE); | 2824 | d.WorldQuickStep(world, ODE_STEPSIZE); |
2825 | |||
2825 | d.JointGroupEmpty(contactgroup); | 2826 | d.JointGroupEmpty(contactgroup); |
2826 | } | 2827 | } |
2827 | catch (Exception e) | 2828 | catch (Exception e) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index cb0d765..77a784d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | |||
@@ -486,6 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
486 | m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; | 486 | m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; |
487 | if (m_host.ParentGroup.Scene.SimulationDataService != null) | 487 | if (m_host.ParentGroup.Scene.SimulationDataService != null) |
488 | m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); | 488 | m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); |
489 | m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile(); | ||
489 | } | 490 | } |
490 | /// <summary> | 491 | /// <summary> |
491 | /// Set the current Windlight scene to a target avatar | 492 | /// Set the current Windlight scene to a target avatar |