aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/Application.cs3
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs155
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs53
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs34
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs19
-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.cs157
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs71
10 files changed, 138 insertions, 451 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 447afb4..66ce8e5 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -79,10 +79,9 @@ namespace OpenSim
79 else 79 else
80 { 80 {
81 ServicePointManager.DefaultConnectionLimit = 12; 81 ServicePointManager.DefaultConnectionLimit = 12;
82 try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some crazy mono decides to have it infinity
83 catch { }
84 } 82 }
85 83
84 try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { }
86 ServicePointManager.Expect100Continue = false; 85 ServicePointManager.Expect100Continue = false;
87 ServicePointManager.UseNagleAlgorithm = false; 86 ServicePointManager.UseNagleAlgorithm = false;
88 87
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
index dfe097e..b406b37 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
@@ -63,9 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden
63 private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule. 63 private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule.
64 64
65 private Scene m_scene; 65 private Scene m_scene;
66 private bool m_persistBakedTextures;
67 66
68 private IBakedTextureModule m_BakedTextureModule;
69 private string m_URL; 67 private string m_URL;
70 68
71 public void Initialise(IConfigSource source) 69 public void Initialise(IConfigSource source)
@@ -76,15 +74,12 @@ namespace OpenSim.Region.ClientStack.Linden
76 74
77 m_URL = config.GetString("Cap_UploadBakedTexture", string.Empty); 75 m_URL = config.GetString("Cap_UploadBakedTexture", string.Empty);
78 76
79 IConfig appearanceConfig = source.Configs["Appearance"]; 77// IConfig appearanceConfig = source.Configs["Appearance"];
80 if (appearanceConfig != null)
81 m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
82 } 78 }
83 79
84 public void AddRegion(Scene s) 80 public void AddRegion(Scene s)
85 { 81 {
86 m_scene = s; 82 m_scene = s;
87
88 } 83 }
89 84
90 public void RemoveRegion(Scene s) 85 public void RemoveRegion(Scene s)
@@ -92,7 +87,6 @@ namespace OpenSim.Region.ClientStack.Linden
92 s.EventManager.OnRegisterCaps -= RegisterCaps; 87 s.EventManager.OnRegisterCaps -= RegisterCaps;
93 s.EventManager.OnNewPresence -= RegisterNewPresence; 88 s.EventManager.OnNewPresence -= RegisterNewPresence;
94 s.EventManager.OnRemovePresence -= DeRegisterPresence; 89 s.EventManager.OnRemovePresence -= DeRegisterPresence;
95 m_BakedTextureModule = null;
96 m_scene = null; 90 m_scene = null;
97 } 91 }
98 92
@@ -101,7 +95,6 @@ namespace OpenSim.Region.ClientStack.Linden
101 m_scene.EventManager.OnRegisterCaps += RegisterCaps; 95 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
102 m_scene.EventManager.OnNewPresence += RegisterNewPresence; 96 m_scene.EventManager.OnNewPresence += RegisterNewPresence;
103 m_scene.EventManager.OnRemovePresence += DeRegisterPresence; 97 m_scene.EventManager.OnRemovePresence += DeRegisterPresence;
104
105 } 98 }
106 99
107 private void DeRegisterPresence(UUID agentId) 100 private void DeRegisterPresence(UUID agentId)
@@ -110,156 +103,12 @@ namespace OpenSim.Region.ClientStack.Linden
110 103
111 private void RegisterNewPresence(ScenePresence presence) 104 private void RegisterNewPresence(ScenePresence presence)
112 { 105 {
113// presence.ControllingClient.OnSetAppearance += CaptureAppearanceSettings;
114 } 106 }
115 107
116/* not in use. work done in AvatarFactoryModule ValidateBakedTextureCache() and UpdateBakedTextureCache()
117 private void CaptureAppearanceSettings(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 avSize, WearableCacheItem[] cacheItems)
118 {
119 // if cacheItems.Length > 0 viewer is giving us current textures information.
120 // baked ones should had been uploaded and in assets cache as local itens
121
122
123 if (cacheItems.Length == 0)
124 return; // no textures information, nothing to do
125
126 ScenePresence p = null;
127 if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out p))
128 return; // what are we doing if there is no presence to cache for?
129
130 if (p.IsDeleted)
131 return; // does this really work?
132
133 int maxCacheitemsLoop = cacheItems.Length;
134 if (maxCacheitemsLoop > 20)
135 {
136 maxCacheitemsLoop = AvatarWearable.MAX_WEARABLES;
137 m_log.WarnFormat("[CACHEDBAKES]: Too Many Cache items Provided {0}, the max is {1}. Truncating!", cacheItems.Length, AvatarWearable.MAX_WEARABLES);
138 }
139
140 m_BakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
141
142
143 // some nice debug
144 m_log.Debug("[Cacheitems]: " + cacheItems.Length);
145 for (int iter = 0; iter < maxCacheitemsLoop; iter++)
146 {
147 m_log.Debug("[Cacheitems] {" + iter + "/" + cacheItems[iter].TextureIndex + "}: c-" + cacheItems[iter].CacheId + ", t-" +
148 cacheItems[iter].TextureID);
149 }
150
151 // p.Appearance.WearableCacheItems is in memory primary cashID to textures mapper
152
153 WearableCacheItem[] existingitems = p.Appearance.WearableCacheItems;
154
155 if (existingitems == null)
156 {
157 if (m_BakedTextureModule != null)
158 {
159 WearableCacheItem[] savedcache = null;
160 try
161 {
162 if (p.Appearance.WearableCacheItemsDirty)
163 {
164 savedcache = m_BakedTextureModule.Get(p.UUID);
165 p.Appearance.WearableCacheItems = savedcache;
166 p.Appearance.WearableCacheItemsDirty = false;
167 }
168 }
169
170 catch (Exception)
171 {
172 // The service logs a sufficient error message.
173 }
174
175
176 if (savedcache != null)
177 existingitems = savedcache;
178 }
179 }
180
181 // Existing items null means it's a fully new appearance
182 if (existingitems == null)
183 {
184 for (int i = 0; i < maxCacheitemsLoop; i++)
185 {
186 if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
187 {
188 Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
189 if (face == null)
190 {
191 textureEntry.CreateFace(cacheItems[i].TextureIndex);
192 textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID =
193 AppearanceManager.DEFAULT_AVATAR_TEXTURE;
194 continue;
195 }
196 cacheItems[i].TextureID = face.TextureID;
197 if (m_scene.AssetService != null)
198 cacheItems[i].TextureAsset =
199 m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString());
200 }
201 else
202 {
203 m_log.WarnFormat("[CACHEDBAKES]: Invalid Texture Index Provided, Texture doesn't exist or hasn't been uploaded yet {0}, the max is {1}. Skipping!", cacheItems[i].TextureIndex, textureEntry.FaceTextures.Length);
204 }
205 }
206 }
207 else
208 {
209 for (int i = 0; i < maxCacheitemsLoop; i++)
210 {
211 if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
212 {
213 Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
214 if (face == null)
215 {
216 textureEntry.CreateFace(cacheItems[i].TextureIndex);
217 textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID =
218 AppearanceManager.DEFAULT_AVATAR_TEXTURE;
219 continue;
220 }
221 cacheItems[i].TextureID =
222 face.TextureID;
223 }
224 else
225 {
226 m_log.WarnFormat("[CACHEDBAKES]: Invalid Texture Index Provided, Texture doesn't exist or hasn't been uploaded yet {0}, the max is {1}. Skipping!", cacheItems[i].TextureIndex, textureEntry.FaceTextures.Length);
227 }
228 }
229
230 for (int i = 0; i < maxCacheitemsLoop; i++)
231 {
232 if (cacheItems[i].TextureAsset == null)
233 {
234 cacheItems[i].TextureAsset =
235 m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString());
236 }
237 }
238 }
239 p.Appearance.WearableCacheItems = cacheItems;
240
241 if (m_BakedTextureModule != null)
242 {
243 m_BakedTextureModule.Store(remoteClient.AgentId, cacheItems);
244 p.Appearance.WearableCacheItemsDirty = true;
245
246 }
247 else
248 p.Appearance.WearableCacheItemsDirty = false;
249
250 for (int iter = 0; iter < maxCacheitemsLoop; iter++)
251 {
252 m_log.Debug("[CacheitemsLeaving] {" + iter + "/" + cacheItems[iter].TextureIndex + "}: c-" + cacheItems[iter].CacheId + ", t-" +
253 cacheItems[iter].TextureID);
254 }
255 }
256 */
257 public void PostInitialise() 108 public void PostInitialise()
258 { 109 {
259 } 110 }
260 111
261
262
263 public void Close() { } 112 public void Close() { }
264 113
265 public string Name { get { return "UploadBakedTextureModule"; } } 114 public string Name { get { return "UploadBakedTextureModule"; } }
@@ -275,7 +124,7 @@ namespace OpenSim.Region.ClientStack.Linden
275 if (m_URL == "localhost") 124 if (m_URL == "localhost")
276 { 125 {
277 UploadBakedTextureHandler avatarhandler = new UploadBakedTextureHandler( 126 UploadBakedTextureHandler avatarhandler = new UploadBakedTextureHandler(
278 caps, m_scene.AssetService, m_persistBakedTextures); 127 caps, m_scene.AssetService);
279 128
280 caps.RegisterHandler( 129 caps.RegisterHandler(
281 "UploadBakedTexture", 130 "UploadBakedTexture",
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;
35using Mono.Addins; 35using Mono.Addins;
36using Nini.Config; 36using Nini.Config;
37using OpenMetaverse; 37using OpenMetaverse;
38using OpenSim.Framework;
38using OpenSim.Framework.Servers; 39using OpenSim.Framework.Servers;
39using OpenSim.Framework.Servers.HttpServer; 40using OpenSim.Framework.Servers.HttpServer;
40using OpenSim.Region.Framework.Interfaces; 41using 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
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net; 28using log4net;
32using Mono.Addins; 29using Mono.Addins;
30using System;
31using System.Reflection;
32using System.Collections.Generic;
33using Nini.Config; 33using Nini.Config;
34using OpenMetaverse;
35using OpenSim.Framework; 34using OpenSim.Framework;
36using OpenSim.Server.Base; 35using OpenSim.Services.Connectors;
37using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
39using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
40 39
40
41namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour 41namespace 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
28using log4net;
29using Mono.Addins;
30using System;
31using System.Collections.Generic;
32using System.Reflection;
33using Nini.Config;
34using OpenSim.Framework;
35using OpenSim.Services.Connectors;
36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Services.Interfaces;
39using OpenSim.Server.Base;
40
41namespace 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}
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index f16fd01..4d7a698 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Globalization; 30using System.Globalization;
31using System.Text;
31using System.Text.RegularExpressions; 32using System.Text.RegularExpressions;
32using OpenSim.Framework; 33using OpenSim.Framework;
33 34
@@ -525,7 +526,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
525 } 526 }
526 527
527 [Serializable] 528 [Serializable]
528 public struct list 529 public class list
529 { 530 {
530 private object[] m_data; 531 private object[] m_data;
531 532
@@ -1152,34 +1153,35 @@ namespace OpenSim.Region.ScriptEngine.Shared
1152 1153
1153 public string ToCSV() 1154 public string ToCSV()
1154 { 1155 {
1155 string ret = ""; 1156 if(m_data == null || m_data.Length == 0)
1156 foreach (object o in this.Data) 1157 return String.Empty;
1158
1159 Object o = m_data[0];
1160 int len = m_data.Length;
1161 if(len == 1)
1162 return o.ToString();
1163
1164 StringBuilder sb = new StringBuilder(1024);
1165 sb.Append(o.ToString());
1166 for(int i = 1 ; i < len; i++)
1157 { 1167 {
1158 if (ret == "") 1168 sb.Append(",");
1159 { 1169 sb.Append(o.ToString());
1160 ret = o.ToString();
1161 }
1162 else
1163 {
1164 ret = ret + ", " + o.ToString();
1165 }
1166 } 1170 }
1167 return ret; 1171 return sb.ToString();
1168 } 1172 }
1169 1173
1170 private string ToSoup() 1174 private string ToSoup()
1171 { 1175 {
1172 string output; 1176 if(m_data == null || m_data.Length == 0)
1173 output = String.Empty;
1174 if (Data.Length == 0)
1175 {
1176 return String.Empty; 1177 return String.Empty;
1177 } 1178
1178 foreach (object o in Data) 1179 StringBuilder sb = new StringBuilder(1024);
1180 foreach (object o in m_data)
1179 { 1181 {
1180 output = output + o.ToString(); 1182 sb.Append(o.ToString());
1181 } 1183 }
1182 return output; 1184 return sb.ToString();
1183 } 1185 }
1184 1186
1185 public static explicit operator String(list l) 1187 public static explicit operator String(list l)
@@ -1369,26 +1371,33 @@ namespace OpenSim.Region.ScriptEngine.Shared
1369 1371
1370 public string ToPrettyString() 1372 public string ToPrettyString()
1371 { 1373 {
1372 string output; 1374 if(m_data == null || m_data.Length == 0)
1373 if (Data.Length == 0)
1374 {
1375 return "[]"; 1375 return "[]";
1376 } 1376
1377 output = "["; 1377 StringBuilder sb = new StringBuilder(1024);
1378 foreach (object o in Data) 1378 int len = m_data.Length;
1379 int last = len - 1;
1380 object o;
1381
1382 sb.Append("[");
1383 for(int i = 0; i < len; i++ )
1379 { 1384 {
1385 o = m_data[i];
1380 if (o is String) 1386 if (o is String)
1381 { 1387 {
1382 output = output + "\"" + o + "\", "; 1388 sb.Append("\"");
1389 sb.Append((String)o);
1390 sb.Append("\"");
1383 } 1391 }
1384 else 1392 else
1385 { 1393 {
1386 output = output + o.ToString() + ", "; 1394 sb.Append(o.ToString());
1387 } 1395 }
1396 if(i < last)
1397 sb.Append(",");
1388 } 1398 }
1389 output = output.Substring(0, output.Length - 2); 1399 sb.Append("]");
1390 output = output + "]"; 1400 return sb.ToString();
1391 return output;
1392 } 1401 }
1393 1402
1394 public class AlphaCompare : IComparer 1403 public class AlphaCompare : IComparer