diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 53 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 34 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/NeighbourServiceOutConnector.cs (renamed from OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs) | 79 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs | 157 |
7 files changed, 95 insertions, 265 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 535d946..9553f5b 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -369,7 +369,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
369 | return true; | 369 | return true; |
370 | 370 | ||
371 | // uploaded baked textures will be in assets local cache | 371 | // uploaded baked textures will be in assets local cache |
372 | IAssetService cache = m_scene.AssetService; | 372 | IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>(); |
373 | IBakedTextureModule m_BakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); | 373 | IBakedTextureModule m_BakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); |
374 | 374 | ||
375 | int validDirtyBakes = 0; | 375 | int validDirtyBakes = 0; |
@@ -385,7 +385,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
385 | 385 | ||
386 | List<UUID> missing = new List<UUID>(); | 386 | List<UUID> missing = new List<UUID>(); |
387 | 387 | ||
388 | bool haveSkirt = (wearableCache[19].TextureAsset != null); | 388 | bool haveSkirt = (wearableCache[19].TextureID != UUID.Zero); |
389 | bool haveNewSkirt = false; | 389 | bool haveNewSkirt = false; |
390 | 390 | ||
391 | // Process received baked textures | 391 | // Process received baked textures |
@@ -436,7 +436,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
436 | */ | 436 | */ |
437 | wearableCache[idx].TextureAsset = null; | 437 | wearableCache[idx].TextureAsset = null; |
438 | if (cache != null) | 438 | if (cache != null) |
439 | wearableCache[idx].TextureAsset = cache.GetCached(face.TextureID.ToString()); | 439 | { |
440 | AssetBase asb = null; | ||
441 | cache.Get(face.TextureID.ToString(), out asb); | ||
442 | wearableCache[idx].TextureAsset = asb; | ||
443 | } | ||
440 | 444 | ||
441 | if (wearableCache[idx].TextureAsset != null) | 445 | if (wearableCache[idx].TextureAsset != null) |
442 | { | 446 | { |
@@ -481,25 +485,26 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
481 | // if we got a full set of baked textures save all in BakedTextureModule | 485 | // if we got a full set of baked textures save all in BakedTextureModule |
482 | if (m_BakedTextureModule != null) | 486 | if (m_BakedTextureModule != null) |
483 | { | 487 | { |
484 | m_log.Debug("[UpdateBakedCache] start async uploading to bakedModule cache"); | 488 | m_log.DebugFormat("[UpdateBakedCache] Uploading to Bakes Server: cache hits: {0} changed entries: {1} rebakes {2}", |
489 | hits.ToString(), validDirtyBakes.ToString(), missing.Count); | ||
485 | 490 | ||
486 | m_BakedTextureModule.Store(sp.UUID, wearableCache); | 491 | m_BakedTextureModule.Store(sp.UUID, wearableCache); |
487 | } | 492 | } |
488 | } | 493 | } |
494 | else | ||
495 | m_log.DebugFormat("[UpdateBakedCache] cache hits: {0} changed entries: {1} rebakes {2}", | ||
496 | hits.ToString(), validDirtyBakes.ToString(), missing.Count); | ||
489 | 497 | ||
490 | |||
491 | // debug | ||
492 | m_log.Debug("[UpdateBakedCache] cache hits: " + hits.ToString() + " changed entries: " + validDirtyBakes.ToString() + " rebakes " + missing.Count); | ||
493 | /* | ||
494 | for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) | 498 | for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) |
495 | { | 499 | { |
496 | int j = AvatarAppearance.BAKE_INDICES[iter]; | 500 | int j = AvatarAppearance.BAKE_INDICES[iter]; |
497 | m_log.Debug("[UpdateBCache] {" + iter + "/" + | 501 | sp.Appearance.WearableCacheItems[j].TextureAsset = null; |
498 | sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" + | 502 | // m_log.Debug("[UpdateBCache] {" + iter + "/" + |
499 | sp.Appearance.WearableCacheItems[j].CacheId + ", t-" + | 503 | // sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" + |
500 | sp.Appearance.WearableCacheItems[j].TextureID); | 504 | // sp.Appearance.WearableCacheItems[j].CacheId + ", t-" + |
505 | // sp.Appearance.WearableCacheItems[j].TextureID); | ||
501 | } | 506 | } |
502 | */ | 507 | |
503 | return (hits == cacheItems.Length); | 508 | return (hits == cacheItems.Length); |
504 | } | 509 | } |
505 | 510 | ||
@@ -513,7 +518,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
513 | 518 | ||
514 | lock (m_setAppearanceLock) | 519 | lock (m_setAppearanceLock) |
515 | { | 520 | { |
516 | IAssetService cache = m_scene.AssetService; | 521 | IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>(); |
517 | IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); | 522 | IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); |
518 | WearableCacheItem[] bakedModuleCache = null; | 523 | WearableCacheItem[] bakedModuleCache = null; |
519 | 524 | ||
@@ -553,6 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
553 | } | 558 | } |
554 | } | 559 | } |
555 | */ | 560 | */ |
561 | |||
556 | bool wearableCacheValid = false; | 562 | bool wearableCacheValid = false; |
557 | if (wearableCache == null) | 563 | if (wearableCache == null) |
558 | { | 564 | { |
@@ -577,10 +583,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
577 | hits++; | 583 | hits++; |
578 | wearableCache[idx].TextureAsset.Temporary = true; | 584 | wearableCache[idx].TextureAsset.Temporary = true; |
579 | wearableCache[idx].TextureAsset.Local = true; | 585 | wearableCache[idx].TextureAsset.Local = true; |
580 | cache.Store(wearableCache[idx].TextureAsset); | 586 | cache.Cache(wearableCache[idx].TextureAsset); |
587 | wearableCache[idx].TextureAsset = null; | ||
581 | continue; | 588 | continue; |
582 | } | 589 | } |
583 | if (cache.GetCached((wearableCache[idx].TextureID).ToString()) != null) | 590 | |
591 | if (cache.Check((wearableCache[idx].TextureID).ToString())) | ||
584 | { | 592 | { |
585 | hits++; | 593 | hits++; |
586 | continue; | 594 | continue; |
@@ -645,7 +653,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
645 | wearableCache[j].TextureAsset = bakedModuleCache[i].TextureAsset; | 653 | wearableCache[j].TextureAsset = bakedModuleCache[i].TextureAsset; |
646 | bakedModuleCache[i].TextureAsset.Temporary = true; | 654 | bakedModuleCache[i].TextureAsset.Temporary = true; |
647 | bakedModuleCache[i].TextureAsset.Local = true; | 655 | bakedModuleCache[i].TextureAsset.Local = true; |
648 | cache.Store(bakedModuleCache[i].TextureAsset); | 656 | cache.Cache(bakedModuleCache[i].TextureAsset); |
649 | } | 657 | } |
650 | } | 658 | } |
651 | gotbacked = true; | 659 | gotbacked = true; |
@@ -677,6 +685,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
677 | 685 | ||
678 | face.TextureID = wearableCache[idx].TextureID; | 686 | face.TextureID = wearableCache[idx].TextureID; |
679 | hits++; | 687 | hits++; |
688 | wearableCache[idx].TextureAsset = null; | ||
680 | } | 689 | } |
681 | } | 690 | } |
682 | } | 691 | } |
@@ -706,7 +715,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
706 | return 0; | 715 | return 0; |
707 | 716 | ||
708 | int texturesRebaked = 0; | 717 | int texturesRebaked = 0; |
709 | // IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>(); | 718 | IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>(); |
710 | 719 | ||
711 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | 720 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) |
712 | { | 721 | { |
@@ -722,18 +731,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
722 | 731 | ||
723 | if (missingTexturesOnly) | 732 | if (missingTexturesOnly) |
724 | { | 733 | { |
725 | if (m_scene.AssetService.Get(face.TextureID.ToString()) != null) | 734 | if (cache != null && cache.Check(face.TextureID.ToString())) |
726 | { | 735 | { |
727 | continue; | 736 | continue; |
728 | } | 737 | } |
729 | else | 738 | else |
730 | { | 739 | { |
731 | // On inter-simulator teleports, this occurs if baked textures are not being stored by the | ||
732 | // grid asset service (which means that they are not available to the new region and so have | ||
733 | // to be re-requested from the client). | ||
734 | // | ||
735 | // The only available core OpenSimulator behaviour right now | ||
736 | // is not to store these textures, temporarily or otherwise. | ||
737 | m_log.DebugFormat( | 740 | m_log.DebugFormat( |
738 | "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", | 741 | "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", |
739 | face.TextureID, idx, sp.Name); | 742 | face.TextureID, idx, sp.Name); |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 89e3020..e02ca49 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -1839,12 +1839,12 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1839 | webRequest.ContentType = "application/json-rpc"; | 1839 | webRequest.ContentType = "application/json-rpc"; |
1840 | webRequest.Method = "POST"; | 1840 | webRequest.Method = "POST"; |
1841 | 1841 | ||
1842 | using(Stream dataStream = webRequest.GetRequestStream()) | ||
1843 | dataStream.Write(content,0,content.Length); | ||
1844 | |||
1845 | WebResponse webResponse = null; | 1842 | WebResponse webResponse = null; |
1846 | try | 1843 | try |
1847 | { | 1844 | { |
1845 | using(Stream dataStream = webRequest.GetRequestStream()) | ||
1846 | dataStream.Write(content,0,content.Length); | ||
1847 | |||
1848 | webResponse = webRequest.GetResponse(); | 1848 | webResponse = webRequest.GetResponse(); |
1849 | } | 1849 | } |
1850 | catch (WebException e) | 1850 | catch (WebException e) |
@@ -1920,12 +1920,12 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1920 | webRequest.ContentType = "application/json-rpc"; | 1920 | webRequest.ContentType = "application/json-rpc"; |
1921 | webRequest.Method = "POST"; | 1921 | webRequest.Method = "POST"; |
1922 | 1922 | ||
1923 | using(Stream dataStream = webRequest.GetRequestStream()) | ||
1924 | dataStream.Write(content,0,content.Length); | ||
1925 | |||
1926 | WebResponse webResponse = null; | 1923 | WebResponse webResponse = null; |
1927 | try | 1924 | try |
1928 | { | 1925 | { |
1926 | using(Stream dataStream = webRequest.GetRequestStream()) | ||
1927 | dataStream.Write(content,0,content.Length); | ||
1928 | |||
1929 | webResponse = webRequest.GetResponse(); | 1929 | webResponse = webRequest.GetResponse(); |
1930 | } | 1930 | } |
1931 | catch (WebException e) | 1931 | catch (WebException e) |
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 292099d..c0afe7c 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | |||
@@ -142,9 +142,9 @@ namespace OpenSim.Region.CoreModules.Framework | |||
142 | 142 | ||
143 | if (capsObjectPath == oldCaps.CapsObjectPath) | 143 | if (capsObjectPath == oldCaps.CapsObjectPath) |
144 | { | 144 | { |
145 | m_log.WarnFormat( | 145 | // m_log.WarnFormat( |
146 | "[CAPS]: Reusing caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", | 146 | // "[CAPS]: Reusing caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", |
147 | agentId, m_scene.RegionInfo.RegionName, oldCaps.CapsObjectPath, capsObjectPath); | 147 | // agentId, m_scene.RegionInfo.RegionName, oldCaps.CapsObjectPath, capsObjectPath); |
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | else | 150 | else |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ca20604..a1ada4c 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -157,7 +157,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
157 | m_idCache = new ExpiringCache<ulong, DateTime>(); | 157 | m_idCache = new ExpiringCache<ulong, DateTime>(); |
158 | m_bannedRegions.Add(pAgentID, m_idCache, TimeSpan.FromSeconds(newTime)); | 158 | m_bannedRegions.Add(pAgentID, m_idCache, TimeSpan.FromSeconds(newTime)); |
159 | } | 159 | } |
160 | m_idCache.Add(pRegionHandle, DateTime.UtcNow + TimeSpan.FromSeconds(extendTime), TimeSpan.FromSeconds(extendTime)); | 160 | m_idCache.Add(pRegionHandle, DateTime.UtcNow + TimeSpan.FromSeconds(extendTime), extendTime); |
161 | } | 161 | } |
162 | 162 | ||
163 | // Remove the agent from the region's banned list | 163 | // Remove the agent from the region's banned list |
@@ -417,12 +417,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
417 | } | 417 | } |
418 | catch (Exception e) | 418 | catch (Exception e) |
419 | { | 419 | { |
420 | |||
420 | m_log.ErrorFormat( | 421 | m_log.ErrorFormat( |
421 | "[ENTITY TRANSFER MODULE]: Exception on teleport of {0} from {1}@{2} to {3}@{4}: {5}{6}", | 422 | "[ENTITY TRANSFER MODULE]: Exception on teleport of {0} from {1}@{2} to {3}@{4}: {5}{6}", |
422 | sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, destinationRegionName, | 423 | sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, destinationRegionName, |
423 | e.Message, e.StackTrace); | 424 | e.Message, e.StackTrace); |
424 | 425 | if(sp != null && sp.ControllingClient != null && !sp.IsDeleted) | |
425 | sp.ControllingClient.SendTeleportFailed("Internal error"); | 426 | sp.ControllingClient.SendTeleportFailed("Internal error"); |
426 | } | 427 | } |
427 | finally | 428 | finally |
428 | { | 429 | { |
@@ -1216,7 +1217,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1216 | // DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR | 1217 | // DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR |
1217 | // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. | 1218 | // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. |
1218 | 1219 | ||
1219 | Thread.Sleep(15000); | 1220 | Thread.Sleep(25000); |
1220 | // if (m_eqModule != null && !sp.DoNotCloseAfterTeleport) | 1221 | // if (m_eqModule != null && !sp.DoNotCloseAfterTeleport) |
1221 | // m_eqModule.DisableSimulator(sourceRegionHandle,sp.UUID); | 1222 | // m_eqModule.DisableSimulator(sourceRegionHandle,sp.UUID); |
1222 | // Thread.Sleep(1000); | 1223 | // Thread.Sleep(1000); |
@@ -1487,11 +1488,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1487 | Math.Max(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY)); | 1488 | Math.Max(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY)); |
1488 | 1489 | ||
1489 | if (neighbourRegion == null) | 1490 | if (neighbourRegion == null) |
1490 | { | ||
1491 | return null; | 1491 | return null; |
1492 | } | 1492 | |
1493 | if (m_bannedRegionCache.IfBanned(neighbourRegion.RegionHandle, agentID)) | 1493 | if (m_bannedRegionCache.IfBanned(neighbourRegion.RegionHandle, agentID)) |
1494 | { | 1494 | { |
1495 | failureReason = "Access Denied or Temporary not possible"; | ||
1495 | return null; | 1496 | return null; |
1496 | } | 1497 | } |
1497 | 1498 | ||
@@ -1503,13 +1504,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1503 | pos.Z); | 1504 | pos.Z); |
1504 | 1505 | ||
1505 | string homeURI = scene.GetAgentHomeURI(agentID); | 1506 | string homeURI = scene.GetAgentHomeURI(agentID); |
1506 | 1507 | ||
1507 | if (!scene.SimulationService.QueryAccess( | 1508 | if (!scene.SimulationService.QueryAccess( |
1508 | neighbourRegion, agentID, homeURI, false, newpos, | 1509 | neighbourRegion, agentID, homeURI, false, newpos, |
1509 | scene.GetFormatsOffered(), ctx, out failureReason)) | 1510 | scene.GetFormatsOffered(), ctx, out failureReason)) |
1510 | { | 1511 | { |
1511 | // remember the fail | 1512 | // remember the fail |
1512 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); | 1513 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); |
1514 | if(String.IsNullOrWhiteSpace(failureReason)) | ||
1515 | failureReason = "Access Denied"; | ||
1513 | return null; | 1516 | return null; |
1514 | } | 1517 | } |
1515 | 1518 | ||
@@ -1529,13 +1532,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1529 | CrossAsyncDelegate icon = (CrossAsyncDelegate)iar.AsyncState; | 1532 | CrossAsyncDelegate icon = (CrossAsyncDelegate)iar.AsyncState; |
1530 | ScenePresence agent = icon.EndInvoke(iar); | 1533 | ScenePresence agent = icon.EndInvoke(iar); |
1531 | 1534 | ||
1532 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); | ||
1533 | 1535 | ||
1534 | if(!agent.IsChildAgent) | 1536 | if(!agent.IsChildAgent) |
1535 | { | 1537 | { |
1536 | // crossing failed | 1538 | // crossing failed |
1537 | agent.CrossToNewRegionFail(); | 1539 | agent.CrossToNewRegionFail(); |
1538 | } | 1540 | } |
1541 | else | ||
1542 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); | ||
1543 | |||
1539 | agent.IsInTransit = false; | 1544 | agent.IsInTransit = false; |
1540 | } | 1545 | } |
1541 | 1546 | ||
@@ -2153,6 +2158,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2153 | { | 2158 | { |
2154 | Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start | 2159 | Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start |
2155 | int count = 0; | 2160 | int count = 0; |
2161 | IPEndPoint ipe; | ||
2156 | 2162 | ||
2157 | foreach (GridRegion neighbour in neighbours) | 2163 | foreach (GridRegion neighbour in neighbours) |
2158 | { | 2164 | { |
@@ -2161,8 +2167,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2161 | { | 2167 | { |
2162 | if (newneighbours.Contains(handler)) | 2168 | if (newneighbours.Contains(handler)) |
2163 | { | 2169 | { |
2164 | InformClientOfNeighbourAsync(sp, cagents[count], neighbour, | 2170 | ipe = neighbour.ExternalEndPoint; |
2165 | neighbour.ExternalEndPoint, true); | 2171 | if (ipe != null) |
2172 | InformClientOfNeighbourAsync(sp, cagents[count], neighbour, ipe, true); | ||
2173 | else | ||
2174 | { | ||
2175 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: lost DNS resolution for neighbour {0}", neighbour.ExternalHostName); | ||
2176 | } | ||
2166 | count++; | 2177 | count++; |
2167 | } | 2178 | } |
2168 | else if (!previousRegionNeighbourHandles.Contains(handler)) | 2179 | else if (!previousRegionNeighbourHandles.Contains(handler)) |
@@ -2278,9 +2289,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2278 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, | 2289 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, |
2279 | double px, double py, uint pSizeHint) | 2290 | double px, double py, uint pSizeHint) |
2280 | { | 2291 | { |
2281 | m_log.DebugFormat("{0} GetRegionContainingWorldLocation: call, XY=<{1},{2}>", LogHeader, px, py); | 2292 | // m_log.DebugFormat("{0} GetRegionContainingWorldLocation: call, XY=<{1},{2}>", LogHeader, px, py); |
2282 | GridRegion ret = null; | 2293 | GridRegion ret = null; |
2283 | const double fudge = 2.0; | ||
2284 | 2294 | ||
2285 | if (m_notFoundLocationCache.Contains(px, py)) | 2295 | if (m_notFoundLocationCache.Contains(px, py)) |
2286 | { | 2296 | { |
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 66ebdbe..5f72733 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -35,6 +35,7 @@ using log4net; | |||
35 | using Mono.Addins; | 35 | using Mono.Addins; |
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | ||
38 | using OpenSim.Framework.Servers; | 39 | using OpenSim.Framework.Servers; |
39 | using OpenSim.Framework.Servers.HttpServer; | 40 | using OpenSim.Framework.Servers.HttpServer; |
40 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
@@ -146,23 +147,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
146 | } | 147 | } |
147 | 148 | ||
148 | IPAddress ia = null; | 149 | IPAddress ia = null; |
149 | try | 150 | ia = Util.GetHostFromDNS(ExternalHostNameForLSL); |
150 | { | ||
151 | foreach (IPAddress Adr in Dns.GetHostAddresses(ExternalHostNameForLSL)) | ||
152 | { | ||
153 | if (Adr.AddressFamily == AddressFamily.InterNetwork || | ||
154 | Adr.AddressFamily == AddressFamily.InterNetworkV6) // ipv6 will most likely smoke | ||
155 | { | ||
156 | ia = Adr; | ||
157 | break; | ||
158 | } | ||
159 | } | ||
160 | } | ||
161 | catch | ||
162 | { | ||
163 | ia = null; | ||
164 | } | ||
165 | |||
166 | if (ia == null) | 151 | if (ia == null) |
167 | { | 152 | { |
168 | m_ErrorStr = "Could not resolve ExternalHostNameForLSL, HTTP listener for LSL disabled"; | 153 | m_ErrorStr = "Could not resolve ExternalHostNameForLSL, HTTP listener for LSL disabled"; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/NeighbourServiceOutConnector.cs index e8d01b0..60addec 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/NeighbourServiceOutConnector.cs | |||
@@ -25,44 +25,32 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | 28 | using log4net; |
32 | using Mono.Addins; | 29 | using Mono.Addins; |
30 | using System; | ||
31 | using System.Reflection; | ||
32 | using System.Collections.Generic; | ||
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using OpenMetaverse; | ||
35 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
36 | using OpenSim.Server.Base; | 35 | using OpenSim.Services.Connectors; |
37 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
40 | 39 | ||
40 | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour |
42 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalNeighbourServicesConnector")] | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "NeighbourServicesOutConnector")] |
44 | public class LocalNeighbourServicesConnector : | 44 | public class NeighbourServicesOutConnector : |
45 | ISharedRegionModule, INeighbourService | 45 | NeighbourServicesConnector, ISharedRegionModule, INeighbourService |
46 | { | 46 | { |
47 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
48 | LogManager.GetLogger( | 48 | LogManager.GetLogger( |
49 | MethodBase.GetCurrentMethod().DeclaringType); | 49 | MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private List<Scene> m_Scenes = new List<Scene>(); | 51 | private List<Scene> m_Scenes = new List<Scene>(); |
52 | |||
53 | private bool m_Enabled = false; | 52 | private bool m_Enabled = false; |
54 | 53 | ||
55 | public LocalNeighbourServicesConnector() | ||
56 | { | ||
57 | } | ||
58 | |||
59 | public LocalNeighbourServicesConnector(List<Scene> scenes) | ||
60 | { | ||
61 | m_Scenes = scenes; | ||
62 | } | ||
63 | |||
64 | #region ISharedRegionModule | ||
65 | |||
66 | public Type ReplaceableInterface | 54 | public Type ReplaceableInterface |
67 | { | 55 | { |
68 | get { return null; } | 56 | get { return null; } |
@@ -70,7 +58,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
70 | 58 | ||
71 | public string Name | 59 | public string Name |
72 | { | 60 | { |
73 | get { return "LocalNeighbourServicesConnector"; } | 61 | get { return "NeighbourServicesOutConnector"; } |
74 | } | 62 | } |
75 | 63 | ||
76 | public void Initialise(IConfigSource source) | 64 | public void Initialise(IConfigSource source) |
@@ -78,39 +66,32 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
78 | IConfig moduleConfig = source.Configs["Modules"]; | 66 | IConfig moduleConfig = source.Configs["Modules"]; |
79 | if (moduleConfig != null) | 67 | if (moduleConfig != null) |
80 | { | 68 | { |
81 | string name = moduleConfig.GetString("NeighbourServices", this.Name); | 69 | string name = moduleConfig.GetString("NeighbourServices"); |
82 | if (name == Name) | 70 | if (name == Name) |
83 | { | 71 | { |
84 | // m_Enabled rules whether this module registers as INeighbourService or not | ||
85 | m_Enabled = true; | 72 | m_Enabled = true; |
86 | m_log.Info("[NEIGHBOUR CONNECTOR]: Local neighbour connector enabled"); | 73 | m_log.Info("[NEIGHBOUR CONNECTOR]: Neighbour out connector enabled"); |
87 | } | 74 | } |
88 | } | 75 | } |
89 | } | 76 | } |
90 | 77 | ||
78 | public void PostInitialise() | ||
79 | { | ||
80 | } | ||
81 | |||
91 | public void Close() | 82 | public void Close() |
92 | { | 83 | { |
93 | } | 84 | } |
94 | 85 | ||
95 | public void AddRegion(Scene scene) | 86 | public void AddRegion(Scene scene) |
96 | { | 87 | { |
97 | m_Scenes.Add(scene); | ||
98 | |||
99 | if (!m_Enabled) | 88 | if (!m_Enabled) |
100 | return; | 89 | return; |
101 | 90 | ||
91 | m_Scenes.Add(scene); | ||
102 | scene.RegisterModuleInterface<INeighbourService>(this); | 92 | scene.RegisterModuleInterface<INeighbourService>(this); |
103 | } | 93 | } |
104 | 94 | ||
105 | public void RegionLoaded(Scene scene) | ||
106 | { | ||
107 | m_log.Info("[NEIGHBOUR CONNECTOR]: Local neighbour connector enabled for region " + scene.RegionInfo.RegionName); | ||
108 | } | ||
109 | |||
110 | public void PostInitialise() | ||
111 | { | ||
112 | } | ||
113 | |||
114 | public void RemoveRegion(Scene scene) | 95 | public void RemoveRegion(Scene scene) |
115 | { | 96 | { |
116 | // Always remove | 97 | // Always remove |
@@ -118,28 +99,36 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
118 | m_Scenes.Remove(scene); | 99 | m_Scenes.Remove(scene); |
119 | } | 100 | } |
120 | 101 | ||
121 | #endregion ISharedRegionModule | 102 | public void RegionLoaded(Scene scene) |
103 | { | ||
104 | if (!m_Enabled) | ||
105 | return; | ||
106 | |||
107 | m_GridService = scene.GridService; | ||
108 | m_log.InfoFormat("[NEIGHBOUR CONNECTOR]: Enabled out neighbours for region {0}", scene.RegionInfo.RegionName); | ||
109 | |||
110 | } | ||
122 | 111 | ||
123 | #region INeighbourService | 112 | #region INeighbourService |
124 | 113 | ||
125 | public OpenSim.Services.Interfaces.GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) | 114 | public override GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) |
126 | { | 115 | { |
127 | uint x, y; | 116 | if (!m_Enabled) |
128 | Util.RegionHandleToRegionLoc(regionHandle, out x, out y); | 117 | return null; |
129 | 118 | ||
130 | foreach (Scene s in m_Scenes) | 119 | foreach (Scene s in m_Scenes) |
131 | { | 120 | { |
132 | if (s.RegionInfo.RegionHandle == regionHandle) | 121 | if (s.RegionInfo.RegionHandle == regionHandle) |
133 | { | 122 | { |
134 | m_log.DebugFormat("[LOCAL NEIGHBOUR SERVICE CONNECTOR]: HelloNeighbour from region {0} to neighbour {1} at {2}-{3}", | 123 | // uint x, y; |
135 | thisRegion.RegionName, s.Name, x, y ); | 124 | // Util.RegionHandleToRegionLoc(regionHandle, out x, out y); |
136 | 125 | // m_log.DebugFormat("[NEIGHBOUR SERVICE OUT CONNECTOR]: HelloNeighbour from region {0} to neighbour {1} at {2}-{3}", | |
137 | //m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour"); | 126 | // thisRegion.RegionName, s.Name, x, y ); |
138 | return s.IncomingHelloNeighbour(thisRegion); | 127 | return s.IncomingHelloNeighbour(thisRegion); |
139 | } | 128 | } |
140 | } | 129 | } |
141 | //m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle); | 130 | |
142 | return null; | 131 | return base.HelloNeighbour(regionHandle, thisRegion); |
143 | } | 132 | } |
144 | 133 | ||
145 | #endregion INeighbourService | 134 | #endregion INeighbourService |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs deleted file mode 100644 index fcb5521..0000000 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs +++ /dev/null | |||
@@ -1,157 +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 log4net; | ||
29 | using Mono.Addins; | ||
30 | using System; | ||
31 | using System.Collections.Generic; | ||
32 | using System.Reflection; | ||
33 | using Nini.Config; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Services.Connectors; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | using OpenSim.Services.Interfaces; | ||
39 | using OpenSim.Server.Base; | ||
40 | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | ||
42 | { | ||
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteNeighbourServicesConnector")] | ||
44 | public class RemoteNeighbourServicesConnector : | ||
45 | NeighbourServicesConnector, ISharedRegionModule, INeighbourService | ||
46 | { | ||
47 | private static readonly ILog m_log = | ||
48 | LogManager.GetLogger( | ||
49 | MethodBase.GetCurrentMethod().DeclaringType); | ||
50 | |||
51 | private bool m_Enabled = false; | ||
52 | private LocalNeighbourServicesConnector m_LocalService; | ||
53 | //private string serviceDll; | ||
54 | //private List<Scene> m_Scenes = new List<Scene>(); | ||
55 | |||
56 | public Type ReplaceableInterface | ||
57 | { | ||
58 | get { return null; } | ||
59 | } | ||
60 | |||
61 | public string Name | ||
62 | { | ||
63 | get { return "RemoteNeighbourServicesConnector"; } | ||
64 | } | ||
65 | |||
66 | public void Initialise(IConfigSource source) | ||
67 | { | ||
68 | IConfig moduleConfig = source.Configs["Modules"]; | ||
69 | if (moduleConfig != null) | ||
70 | { | ||
71 | string name = moduleConfig.GetString("NeighbourServices"); | ||
72 | if (name == Name) | ||
73 | { | ||
74 | m_LocalService = new LocalNeighbourServicesConnector(); | ||
75 | |||
76 | //IConfig neighbourConfig = source.Configs["NeighbourService"]; | ||
77 | //if (neighbourConfig == null) | ||
78 | //{ | ||
79 | // m_log.Error("[NEIGHBOUR CONNECTOR]: NeighbourService missing from OpenSim.ini"); | ||
80 | // return; | ||
81 | //} | ||
82 | //serviceDll = neighbourConfig.GetString("LocalServiceModule", String.Empty); | ||
83 | //if (serviceDll == String.Empty) | ||
84 | //{ | ||
85 | // m_log.Error("[NEIGHBOUR CONNECTOR]: No LocalServiceModule named in section NeighbourService"); | ||
86 | // return; | ||
87 | //} | ||
88 | |||
89 | m_Enabled = true; | ||
90 | |||
91 | m_log.Info("[NEIGHBOUR CONNECTOR]: Remote Neighbour connector enabled"); | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | |||
96 | public void PostInitialise() | ||
97 | { | ||
98 | //if (m_Enabled) | ||
99 | //{ | ||
100 | // Object[] args = new Object[] { m_Scenes }; | ||
101 | // m_LocalService = | ||
102 | // ServerUtils.LoadPlugin<INeighbourService>(serviceDll, | ||
103 | // args); | ||
104 | |||
105 | // if (m_LocalService == null) | ||
106 | // { | ||
107 | // m_log.Error("[NEIGHBOUR CONNECTOR]: Can't load neighbour service"); | ||
108 | // Unregister(); | ||
109 | // return; | ||
110 | // } | ||
111 | //} | ||
112 | } | ||
113 | |||
114 | public void Close() | ||
115 | { | ||
116 | } | ||
117 | |||
118 | public void AddRegion(Scene scene) | ||
119 | { | ||
120 | if (!m_Enabled) | ||
121 | return; | ||
122 | |||
123 | m_LocalService.AddRegion(scene); | ||
124 | scene.RegisterModuleInterface<INeighbourService>(this); | ||
125 | } | ||
126 | |||
127 | public void RemoveRegion(Scene scene) | ||
128 | { | ||
129 | if (m_Enabled) | ||
130 | m_LocalService.RemoveRegion(scene); | ||
131 | } | ||
132 | |||
133 | public void RegionLoaded(Scene scene) | ||
134 | { | ||
135 | if (!m_Enabled) | ||
136 | return; | ||
137 | |||
138 | m_GridService = scene.GridService; | ||
139 | |||
140 | m_log.InfoFormat("[NEIGHBOUR CONNECTOR]: Enabled remote neighbours for region {0}", scene.RegionInfo.RegionName); | ||
141 | |||
142 | } | ||
143 | |||
144 | #region INeighbourService | ||
145 | |||
146 | public override GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) | ||
147 | { | ||
148 | GridRegion region = m_LocalService.HelloNeighbour(regionHandle, thisRegion); | ||
149 | if (region != null) | ||
150 | return region; | ||
151 | |||
152 | return base.HelloNeighbour(regionHandle, thisRegion); | ||
153 | } | ||
154 | |||
155 | #endregion INeighbourService | ||
156 | } | ||
157 | } | ||