aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2011-12-08 03:24:25 +0000
committerMelanie2011-12-08 03:24:25 +0000
commit50aa89dae66246395e9aac4d7d31f010e55473e8 (patch)
treeb2d23662cc5a51e13f582728bf7064077f9edc32 /OpenSim/Region
parentFix intersim object give messages (diff)
parentRemove unused SceneManager.TryGetAvatarsScene() (diff)
downloadopensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.zip
opensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.gz
opensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.bz2
opensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.xz
Merge commit 'eda770e978c09c756d15ba62dbbf6ee34a61b2f5' into bigmerge
Conflicts: OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs1
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs6
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs61
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs31
7 files changed, 67 insertions, 57 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index e8e4f19..50baa56 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -62,6 +62,7 @@ namespace OpenSim
62 62
63 // These are the names of the plugin-points extended by this 63 // These are the names of the plugin-points extended by this
64 // class during system startup. 64 // class during system startup.
65 //
65 66
66 private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache"; 67 private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
67 private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient"; 68 private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 9f27abc..8ba6f61 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -361,7 +361,6 @@ namespace OpenSim.Region.ClientStack.Linden
361 // This will persist this beyond the expiry of the caps handlers 361 // This will persist this beyond the expiry of the caps handlers
362 MainServer.Instance.AddPollServiceHTTPHandler( 362 MainServer.Instance.AddPollServiceHTTPHandler(
363 capsBase + EventQueueGetUUID.ToString() + "/", 363 capsBase + EventQueueGetUUID.ToString() + "/",
364 EventQueuePoll,
365 new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); 364 new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));
366 365
367 Random rnd = new Random(Environment.TickCount); 366 Random rnd = new Random(Environment.TickCount);
@@ -578,11 +577,6 @@ namespace OpenSim.Region.ClientStack.Linden
578// return responsedata; 577// return responsedata;
579// } 578// }
580 579
581 public Hashtable EventQueuePoll(Hashtable request)
582 {
583 return new Hashtable();
584 }
585
586// public Hashtable EventQueuePath2(Hashtable request) 580// public Hashtable EventQueuePath2(Hashtable request)
587// { 581// {
588// string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); 582// string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/","");
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
index e61815f..45d6071 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Region.ClientStack.Linden
104 "UploadBakedTexture", 104 "UploadBakedTexture",
105 new RestStreamHandler( 105 new RestStreamHandler(
106 "POST", 106 "POST",
107 "/CAPS/" + m_uploadBakedTexturePath, 107 "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath,
108 new UploadBakedTextureHandler( 108 new UploadBakedTextureHandler(
109 caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture)); 109 caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture));
110 } 110 }
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index 458426b..f5683f0 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -91,11 +91,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
91 get { return null; } 91 get { return null; }
92 } 92 }
93 93
94 private Hashtable HandleHttpPoll(Hashtable request)
95 {
96 return new Hashtable();
97 }
98
99 public string Name 94 public string Name
100 { 95 {
101 get { return "UrlModule"; } 96 get { return "UrlModule"; }
@@ -171,9 +166,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
171 166
172 string uri = "/lslhttp/" + urlcode.ToString(); 167 string uri = "/lslhttp/" + urlcode.ToString();
173 168
174 m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, 169 m_HttpServer.AddPollServiceHTTPHandler(
175 new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, 170 uri,
176 urlcode)); 171 new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
177 172
178 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); 173 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
179 } 174 }
@@ -213,9 +208,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
213 208
214 string uri = "/lslhttps/" + urlcode.ToString() + "/"; 209 string uri = "/lslhttps/" + urlcode.ToString() + "/";
215 210
216 m_HttpsServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, 211 m_HttpsServer.AddPollServiceHTTPHandler(
217 new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, 212 uri,
218 urlcode)); 213 new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
219 214
220 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); 215 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
221 } 216 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 171443e..f9ae39c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3241,37 +3241,38 @@ namespace OpenSim.Region.Framework.Scenes
3241 // Avatar is already disposed :/ 3241 // Avatar is already disposed :/
3242 } 3242 }
3243 3243
3244 m_log.Debug("[Scene] Beginning OnRemovePresence"); 3244 try
3245 m_eventManager.TriggerOnRemovePresence(agentID); 3245 {
3246 m_log.Debug("[Scene] Finished OnRemovePresence"); 3246 m_eventManager.TriggerOnRemovePresence(agentID);
3247 3247
3248 if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) 3248 if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc)
3249 AttachmentsModule.SaveChangedAttachments(avatar); 3249 AttachmentsModule.SaveChangedAttachments(avatar);
3250 3250
3251 if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) 3251 ForEachClient(
3252 AttachmentsModule.SaveChangedAttachments(avatar); 3252 delegate(IClientAPI client)
3253 3253 {
3254 ForEachClient( 3254 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
3255 delegate(IClientAPI client) 3255 try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); }
3256 catch (NullReferenceException) { }
3257 });
3258
3259 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
3260 if (agentTransactions != null)
3256 { 3261 {
3257 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway 3262 agentTransactions.RemoveAgentAssetTransactions(agentID);
3258 try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); } 3263 }
3259 catch (NullReferenceException) { } 3264 }
3260 }); 3265 finally
3261
3262 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
3263 if (agentTransactions != null)
3264 { 3266 {
3265 agentTransactions.RemoveAgentAssetTransactions(agentID); 3267 // Always clean these structures up so that any failure above doesn't cause them to remain in the
3268 // scene with possibly bad effects (e.g. continually timing out on unacked packets and triggering
3269 // the same cleanup exception continually.
3270 // TODO: This should probably extend to the whole method, but we don't want to also catch the NRE
3271 // since this would hide the underlying failure and other associated problems.
3272 m_sceneGraph.RemoveScenePresence(agentID);
3273 m_clientManager.Remove(agentID);
3266 } 3274 }
3267 3275
3268 // Remove the avatar from the scene
3269 m_log.Debug("[Scene] Begin RemoveScenePresence");
3270 m_sceneGraph.RemoveScenePresence(agentID);
3271 m_log.Debug("[Scene] Finished RemoveScenePresence. Removing the client manager");
3272 m_clientManager.Remove(agentID);
3273 m_log.Debug("[Scene] Removed the client manager. Firing avatar.close");
3274
3275 try 3276 try
3276 { 3277 {
3277 avatar.Close(); 3278 avatar.Close();
@@ -4390,7 +4391,7 @@ namespace OpenSim.Region.Framework.Scenes
4390 /// <param name="action"></param> 4391 /// <param name="action"></param>
4391 public void ForEachRootScenePresence(Action<ScenePresence> action) 4392 public void ForEachRootScenePresence(Action<ScenePresence> action)
4392 { 4393 {
4393 if(m_sceneGraph != null) 4394 if (m_sceneGraph != null)
4394 { 4395 {
4395 m_sceneGraph.ForEachAvatar(action); 4396 m_sceneGraph.ForEachAvatar(action);
4396 } 4397 }
@@ -4470,9 +4471,9 @@ namespace OpenSim.Region.Framework.Scenes
4470 return m_sceneGraph.GetGroupByPrim(localID); 4471 return m_sceneGraph.GetGroupByPrim(localID);
4471 } 4472 }
4472 4473
4473 public override bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) 4474 public override bool TryGetScenePresence(UUID agentID, out ScenePresence sp)
4474 { 4475 {
4475 return m_sceneGraph.TryGetScenePresence(avatarId, out avatar); 4476 return m_sceneGraph.TryGetScenePresence(agentID, out sp);
4476 } 4477 }
4477 4478
4478 public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) 4479 public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 0fd5164..29ab071 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -193,6 +193,12 @@ namespace OpenSim.Region.Framework.Scenes
193 return false; 193 return false;
194 } 194 }
195 195
196 /// <summary>
197 /// Try to get a scene presence from the scene
198 /// </summary>
199 /// <param name="agentID"></param>
200 /// <param name="scenePresence">null if there is no scene presence with the given agent id</param>
201 /// <returns>true if there was a scene presence with the given id, false otherwise.</returns>
196 public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence); 202 public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence);
197 203
198 #endregion 204 #endregion
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index 82458e2..d73a959 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -545,23 +545,20 @@ namespace OpenSim.Region.Framework.Scenes
545 return false; 545 return false;
546 } 546 }
547 547
548 public bool TryGetAvatarsScene(UUID avatarId, out Scene scene) 548 public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar)
549 { 549 {
550 ScenePresence avatar = null;
551
552 lock (m_localScenes) 550 lock (m_localScenes)
553 { 551 {
554 foreach (Scene mScene in m_localScenes) 552 foreach (Scene scene in m_localScenes)
555 { 553 {
556 if (mScene.TryGetScenePresence(avatarId, out avatar)) 554 avatar = scene.GetScenePresence(avatarId);
557 { 555
558 scene = mScene; 556 if (avatar != null && !avatar.IsChildAgent)
559 return true; 557 return true;
560 }
561 } 558 }
562 } 559 }
563 560
564 scene = null; 561 avatar = null;
565 return false; 562 return false;
566 } 563 }
567 564
@@ -590,6 +587,22 @@ namespace OpenSim.Region.Framework.Scenes
590 return false; 587 return false;
591 } 588 }
592 589
590 public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp)
591 {
592 lock (m_localScenes)
593 {
594 foreach (Scene scene in m_localScenes)
595 {
596 sp = scene.GetScenePresence(firstName, lastName);
597 if (sp != null && !sp.IsChildAgent)
598 return true;
599 }
600 }
601
602 sp = null;
603 return false;
604 }
605
593 public void ForEachScene(Action<Scene> action) 606 public void ForEachScene(Action<Scene> action)
594 { 607 {
595 lock (m_localScenes) 608 lock (m_localScenes)