From bdcfd6afee5651bd5fc3b4e6a2dfeeb47b983661 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 17:35:33 +0000 Subject: Add disabled CrossBehaviour to pCampBot, which is designed to cross test bots between neighbouring regions. Not yet enabled since there is a bug where the initial cross will work but all subsequent movements on the receiving simulator appear to fail. --- OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 3804017..657975b 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap return; } -m_log.DebugFormat("MAP NAME=({0})", mapName); +//m_log.DebugFormat("MAP NAME=({0})", mapName); // try to fetch from GridServer List regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); -- cgit v1.1 From 0174e326e3680ebc76dbd525191ad9b07634ec6d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 20:27:11 +0000 Subject: Add a "debug eq" console command for debugging. This will log outgoing event queue message names if turned on. --- .../Linden/Caps/EventQueue/EventQueueGetModule.cs | 85 ++++++++++++++++++++-- 1 file changed, 79 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 7d73b3e..f5feb71 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -39,6 +39,7 @@ using OpenMetaverse.Messages.Linden; using OpenMetaverse.Packets; using OpenMetaverse.StructuredData; using OpenSim.Framework; +using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; @@ -58,9 +59,15 @@ namespace OpenSim.Region.ClientStack.Linden public class EventQueueGetModule : IEventQueue, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected Scene m_scene = null; + + /// + /// Debug level. + /// + public int DebugLevel { get; set; } + + protected Scene m_scene; private IConfigSource m_gConfig; - bool enabledYN = false; + bool enabledYN; private Dictionary m_ids = new Dictionary(); @@ -97,6 +104,15 @@ namespace OpenSim.Region.ClientStack.Linden scene.EventManager.OnClientClosed += ClientClosed; scene.EventManager.OnMakeChildAgent += MakeChildAgent; scene.EventManager.OnRegisterCaps += OnRegisterCaps; + + MainConsole.Instance.Commands.AddCommand( + "event queue", + false, + "debug eq", + "debug eq [0|1]", + "debug eq 1 will turn on event queue debugging. This will log all outgoing event queue messages to clients.\n" + + "debug eq 1 will turn off event queue debugging.", + HandleDebugEq); } else { @@ -128,6 +144,22 @@ namespace OpenSim.Region.ClientStack.Linden } #endregion + protected void HandleDebugEq(string module, string[] args) + { + int debugLevel; + + if (!(args.Length == 3 && int.TryParse(args[2], out debugLevel))) + { + MainConsole.Instance.OutputFormat("Usage: debug eq [0|1]"); + } + else + { + DebugLevel = debugLevel; + MainConsole.Instance.OutputFormat( + "Set event queue debug level to {0} in {1}", DebugLevel, m_scene.RegionInfo.RegionName); + } + } + /// /// Always returns a valid queue /// @@ -323,7 +355,9 @@ namespace OpenSim.Region.ClientStack.Linden // This will persist this beyond the expiry of the caps handlers MainServer.Instance.AddPollServiceHTTPHandler( - capsBase + EventQueueGetUUID.ToString() + "/", EventQueuePoll, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); + capsBase + EventQueueGetUUID.ToString() + "/", + EventQueuePoll, + new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); Random rnd = new Random(Environment.TickCount); lock (m_ids) @@ -370,12 +404,31 @@ namespace OpenSim.Region.ClientStack.Linden } else { + if (DebugLevel > 0 && element is OSDMap) + { + OSDMap ev = (OSDMap)element; + m_log.DebugFormat( + "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", + ev["message"], m_scene.GetScenePresence(pAgentId).Name); + } + array.Add(element); + lock (queue) { while (queue.Count > 0) { - array.Add(queue.Dequeue()); + element = queue.Dequeue(); + + if (DebugLevel > 0 && element is OSDMap) + { + OSDMap ev = (OSDMap)element; + m_log.DebugFormat( + "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", + ev["message"], m_scene.GetScenePresence(pAgentId).Name); + } + + array.Add(element); thisID++; } } @@ -471,11 +524,29 @@ namespace OpenSim.Region.ClientStack.Linden { array.Add(element); + if (element is OSDMap) + { + OSDMap ev = (OSDMap)element; + m_log.DebugFormat( + "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", + ev["message"], m_scene.GetScenePresence(agentID).Name); + } + lock (queue) { while (queue.Count > 0) { - array.Add(queue.Dequeue()); + element = queue.Dequeue(); + + if (element is OSDMap) + { + OSDMap ev = (OSDMap)element; + m_log.DebugFormat( + "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", + ev["message"], m_scene.GetScenePresence(agentID).Name); + } + + array.Add(element); thisID++; } } @@ -494,7 +565,8 @@ namespace OpenSim.Region.ClientStack.Linden responsedata["content_type"] = "application/xml"; responsedata["keepalive"] = false; responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); - //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); + + m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); return responsedata; } @@ -717,6 +789,7 @@ namespace OpenSim.Region.ClientStack.Linden OSD item = EventQueueHelper.GroupMembership(groupUpdate); Enqueue(item, avatarID); } + public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID) { OSD item = EventQueueHelper.PlacesQuery(groupUpdate); -- cgit v1.1 From 63c137820b44e9d1e248ba32ccd6df5110a2bdb9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 21:27:35 +0000 Subject: Stop passing a request handler to the initial caps.RegisterHandler in EventQueueGetModule since this is immediatley replaced by a poll server handler. This allows us to comment out a bunch of code and simplify the codebase and readability. --- .../Linden/Caps/EventQueue/EventQueueGetModule.cs | 319 +++++++++++---------- 1 file changed, 162 insertions(+), 157 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index f5feb71..24f76d69 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -346,12 +346,16 @@ namespace OpenSim.Region.ClientStack.Linden } // Register this as a caps handler + // FIXME: Confusingly, we need to register separate as a capability so that the client is told about + // EventQueueGet when it receive capability information, but then we replace the rest handler immediately + // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but + // really it should be possible to directly register the poll handler as a capability. caps.RegisterHandler("EventQueueGet", - new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString() + "/", - delegate(Hashtable m_dhttpMethod) - { - return ProcessQueue(m_dhttpMethod, agentID, caps); - })); + new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString() + "/", null)); +// delegate(Hashtable m_dhttpMethod) +// { +// return ProcessQueue(m_dhttpMethod, agentID, caps); +// })); // This will persist this beyond the expiry of the caps handlers MainServer.Instance.AddPollServiceHTTPHandler( @@ -382,6 +386,8 @@ namespace OpenSim.Region.ClientStack.Linden public Hashtable GetEvents(UUID requestID, UUID pAgentId, string request) { + m_log.DebugFormat("[EVENT QUEUE GET MODULE]: Invoked GetEvents() for {0}", pAgentId); + Queue queue = TryGetQueue(pAgentId); OSD element; lock (queue) @@ -465,167 +471,166 @@ namespace OpenSim.Region.ClientStack.Linden return responsedata; } - public Hashtable ProcessQueue(Hashtable request, UUID agentID, Caps caps) - { - // TODO: this has to be redone to not busy-wait (and block the thread), - // TODO: as soon as we have a non-blocking way to handle HTTP-requests. - -// if (m_log.IsDebugEnabled) -// { -// String debug = "[EVENTQUEUE]: Got request for agent {0} in region {1} from thread {2}: [ "; -// foreach (object key in request.Keys) +// public Hashtable ProcessQueue(Hashtable request, UUID agentID, Caps caps) +// { +// // TODO: this has to be redone to not busy-wait (and block the thread), +// // TODO: as soon as we have a non-blocking way to handle HTTP-requests. +// +//// if (m_log.IsDebugEnabled) +//// { +//// String debug = "[EVENTQUEUE]: Got request for agent {0} in region {1} from thread {2}: [ "; +//// foreach (object key in request.Keys) +//// { +//// debug += key.ToString() + "=" + request[key].ToString() + " "; +//// } +//// m_log.DebugFormat(debug + " ]", agentID, m_scene.RegionInfo.RegionName, System.Threading.Thread.CurrentThread.Name); +//// } +// +// Queue queue = TryGetQueue(agentID); +// OSD element; +// +// lock (queue) +// element = queue.Dequeue(); // 15s timeout +// +// Hashtable responsedata = new Hashtable(); +// +// int thisID = 0; +// lock (m_ids) +// thisID = m_ids[agentID]; +// +// if (element == null) +// { +// //m_log.ErrorFormat("[EVENTQUEUE]: Nothing to process in " + m_scene.RegionInfo.RegionName); +// if (thisID == -1) // close-request // { -// debug += key.ToString() + "=" + request[key].ToString() + " "; +// m_log.ErrorFormat("[EVENTQUEUE]: 404 in " + m_scene.RegionInfo.RegionName); +// responsedata["int_response_code"] = 404; //501; //410; //404; +// responsedata["content_type"] = "text/plain"; +// responsedata["keepalive"] = false; +// responsedata["str_response_string"] = "Closed EQG"; +// return responsedata; // } -// m_log.DebugFormat(debug + " ]", agentID, m_scene.RegionInfo.RegionName, System.Threading.Thread.CurrentThread.Name); +// responsedata["int_response_code"] = 502; +// responsedata["content_type"] = "text/plain"; +// responsedata["keepalive"] = false; +// responsedata["str_response_string"] = "Upstream error: "; +// responsedata["error_status_text"] = "Upstream error:"; +// responsedata["http_protocol_version"] = "HTTP/1.0"; +// return responsedata; // } - - Queue queue = TryGetQueue(agentID); - OSD element; - - lock (queue) - element = queue.Dequeue(); // 15s timeout - - Hashtable responsedata = new Hashtable(); - - int thisID = 0; - lock (m_ids) - thisID = m_ids[agentID]; - - if (element == null) - { - //m_log.ErrorFormat("[EVENTQUEUE]: Nothing to process in " + m_scene.RegionInfo.RegionName); - if (thisID == -1) // close-request - { - m_log.ErrorFormat("[EVENTQUEUE]: 404 in " + m_scene.RegionInfo.RegionName); - responsedata["int_response_code"] = 404; //501; //410; //404; - responsedata["content_type"] = "text/plain"; - responsedata["keepalive"] = false; - responsedata["str_response_string"] = "Closed EQG"; - return responsedata; - } - responsedata["int_response_code"] = 502; - responsedata["content_type"] = "text/plain"; - responsedata["keepalive"] = false; - responsedata["str_response_string"] = "Upstream error: "; - responsedata["error_status_text"] = "Upstream error:"; - responsedata["http_protocol_version"] = "HTTP/1.0"; - return responsedata; - } - - OSDArray array = new OSDArray(); - if (element == null) // didn't have an event in 15s - { - // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! - array.Add(EventQueueHelper.KeepAliveEvent()); - //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); - } - else - { - array.Add(element); - - if (element is OSDMap) - { - OSDMap ev = (OSDMap)element; - m_log.DebugFormat( - "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", - ev["message"], m_scene.GetScenePresence(agentID).Name); - } - - lock (queue) - { - while (queue.Count > 0) - { - element = queue.Dequeue(); - - if (element is OSDMap) - { - OSDMap ev = (OSDMap)element; - m_log.DebugFormat( - "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", - ev["message"], m_scene.GetScenePresence(agentID).Name); - } - - array.Add(element); - thisID++; - } - } - } - - OSDMap events = new OSDMap(); - events.Add("events", array); - - events.Add("id", new OSDInteger(thisID)); - lock (m_ids) - { - m_ids[agentID] = thisID + 1; - } - - responsedata["int_response_code"] = 200; - responsedata["content_type"] = "application/xml"; - responsedata["keepalive"] = false; - responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); - - m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); - - return responsedata; - } +// +// OSDArray array = new OSDArray(); +// if (element == null) // didn't have an event in 15s +// { +// // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! +// array.Add(EventQueueHelper.KeepAliveEvent()); +// //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); +// } +// else +// { +// array.Add(element); +// +// if (element is OSDMap) +// { +// OSDMap ev = (OSDMap)element; +// m_log.DebugFormat( +// "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", +// ev["message"], m_scene.GetScenePresence(agentID).Name); +// } +// +// lock (queue) +// { +// while (queue.Count > 0) +// { +// element = queue.Dequeue(); +// +// if (element is OSDMap) +// { +// OSDMap ev = (OSDMap)element; +// m_log.DebugFormat( +// "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}", +// ev["message"], m_scene.GetScenePresence(agentID).Name); +// } +// +// array.Add(element); +// thisID++; +// } +// } +// } +// +// OSDMap events = new OSDMap(); +// events.Add("events", array); +// +// events.Add("id", new OSDInteger(thisID)); +// lock (m_ids) +// { +// m_ids[agentID] = thisID + 1; +// } +// +// responsedata["int_response_code"] = 200; +// responsedata["content_type"] = "application/xml"; +// responsedata["keepalive"] = false; +// responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); +// +// m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); +// +// return responsedata; +// } public Hashtable EventQueuePoll(Hashtable request) { return new Hashtable(); } - public Hashtable EventQueuePath2(Hashtable request) - { - string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); - // pull off the last "/" in the path. - Hashtable responsedata = new Hashtable(); - capuuid = capuuid.Substring(0, capuuid.Length - 1); - capuuid = capuuid.Replace("/CAPS/EQG/", ""); - UUID AvatarID = UUID.Zero; - UUID capUUID = UUID.Zero; - - // parse the path and search for the avatar with it registered - if (UUID.TryParse(capuuid, out capUUID)) - { - lock (m_QueueUUIDAvatarMapping) - { - if (m_QueueUUIDAvatarMapping.ContainsKey(capUUID)) - { - AvatarID = m_QueueUUIDAvatarMapping[capUUID]; - } - } - - if (AvatarID != UUID.Zero) - { - return ProcessQueue(request, AvatarID, m_scene.CapsModule.GetCapsForUser(AvatarID)); - } - else - { - responsedata["int_response_code"] = 404; - responsedata["content_type"] = "text/plain"; - responsedata["keepalive"] = false; - responsedata["str_response_string"] = "Not Found"; - responsedata["error_status_text"] = "Not Found"; - responsedata["http_protocol_version"] = "HTTP/1.0"; - return responsedata; - // return 404 - } - } - else - { - responsedata["int_response_code"] = 404; - responsedata["content_type"] = "text/plain"; - responsedata["keepalive"] = false; - responsedata["str_response_string"] = "Not Found"; - responsedata["error_status_text"] = "Not Found"; - responsedata["http_protocol_version"] = "HTTP/1.0"; - return responsedata; - // return 404 - } - - } +// public Hashtable EventQueuePath2(Hashtable request) +// { +// string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); +// // pull off the last "/" in the path. +// Hashtable responsedata = new Hashtable(); +// capuuid = capuuid.Substring(0, capuuid.Length - 1); +// capuuid = capuuid.Replace("/CAPS/EQG/", ""); +// UUID AvatarID = UUID.Zero; +// UUID capUUID = UUID.Zero; +// +// // parse the path and search for the avatar with it registered +// if (UUID.TryParse(capuuid, out capUUID)) +// { +// lock (m_QueueUUIDAvatarMapping) +// { +// if (m_QueueUUIDAvatarMapping.ContainsKey(capUUID)) +// { +// AvatarID = m_QueueUUIDAvatarMapping[capUUID]; +// } +// } +// +// if (AvatarID != UUID.Zero) +// { +// return ProcessQueue(request, AvatarID, m_scene.CapsModule.GetCapsForUser(AvatarID)); +// } +// else +// { +// responsedata["int_response_code"] = 404; +// responsedata["content_type"] = "text/plain"; +// responsedata["keepalive"] = false; +// responsedata["str_response_string"] = "Not Found"; +// responsedata["error_status_text"] = "Not Found"; +// responsedata["http_protocol_version"] = "HTTP/1.0"; +// return responsedata; +// // return 404 +// } +// } +// else +// { +// responsedata["int_response_code"] = 404; +// responsedata["content_type"] = "text/plain"; +// responsedata["keepalive"] = false; +// responsedata["str_response_string"] = "Not Found"; +// responsedata["error_status_text"] = "Not Found"; +// responsedata["http_protocol_version"] = "HTTP/1.0"; +// return responsedata; +// // return 404 +// } +// } public OSD EventQueueFallBack(string path, OSD request, string endpoint) { -- cgit v1.1 From 0a60e9537f2a1aa30fd1d9c23ada5bf1fcfed889 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 21:30:40 +0000 Subject: comment out a noisy log line I accidentally left in from the last commit --- .../Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 24f76d69..5c721d4 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -386,7 +386,7 @@ namespace OpenSim.Region.ClientStack.Linden public Hashtable GetEvents(UUID requestID, UUID pAgentId, string request) { - m_log.DebugFormat("[EVENT QUEUE GET MODULE]: Invoked GetEvents() for {0}", pAgentId); +// m_log.DebugFormat("[EVENT QUEUE GET MODULE]: Invoked GetEvents() for {0}", pAgentId); Queue queue = TryGetQueue(pAgentId); OSD element; -- cgit v1.1 From a58f5b2f6679bfb8565741afaead7e6d8dc8c299 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 22:08:34 +0000 Subject: When setting packet level logging via "debug packet", apply to all clients, not just root ones. Also adds scene name and client type (root|child) to logged information. --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 18 +++++++++------- OpenSim/Region/Framework/Scenes/SceneManager.cs | 24 +++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 133da0f..7d39ddc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -11621,7 +11621,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP logPacket = false; if (logPacket) - m_log.DebugFormat("[CLIENT]: Packet OUT {0} to {1}", packet.Type, Name); + m_log.DebugFormat( + "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}", + Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); } m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); @@ -11664,19 +11666,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (DebugPacketLevel > 0) { - bool outputPacket = true; + bool logPacket = true; if (DebugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) - outputPacket = false; + logPacket = false; if (DebugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) - outputPacket = false; + logPacket = false; if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) - outputPacket = false; + logPacket = false; - if (outputPacket) - m_log.DebugFormat("[CLIENT]: Packet IN {0} from {1}", packet.Type, Name); + if (logPacket) + m_log.DebugFormat( + "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", + Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); } if (!ProcessPacketMethod(packet)) diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index eeb087f..82458e2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -448,29 +448,25 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Set the debug packet level on the current scene. This level governs which packets are printed out to the + /// Set the debug packet level on each current scene. This level governs which packets are printed out to the /// console. /// /// /// Name of avatar to debug public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) { - ForEachCurrentScene( - delegate(Scene scene) + ForEachCurrentScene(scene => + scene.ForEachScenePresence(sp => { - scene.ForEachRootClient(delegate(IClientAPI client) + if (name == null || sp.Name == name) { - if (name == null || client.Name == name) - { - m_log.DebugFormat("Packet debug for {0} {1} set to {2}", - client.FirstName, - client.LastName, - newDebug); + m_log.DebugFormat( + "Packet debug for {0} ({1}) set to {2}", + sp.Name, sp.IsChildAgent ? "child" : "root", newDebug); - client.DebugPacketLevel = newDebug; - } - }); - } + sp.ControllingClient.DebugPacketLevel = newDebug; + } + }) ); } -- cgit v1.1 From 8e32ce85a7a33730ca6656637d6a720d538c1dfa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 22:45:29 +0000 Subject: Remove bizarre call to PhysicsScene.Simulate(0) in Scene.GetNearestAllowedPosition() At least on ODE, this wasn't doing any harm but there wasn't any point to it either --- OpenSim/Region/Framework/Scenes/Scene.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 47450ed..9a71cd4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4633,9 +4633,6 @@ namespace OpenSim.Region.Framework.Scenes public Vector3? GetNearestAllowedPosition(ScenePresence avatar) { - //simulate to make sure we have pretty up to date positions - PhysicsScene.Simulate(0); - ILandObject nearestParcel = GetNearestAllowedParcel(avatar.UUID, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); if (nearestParcel != null) @@ -4662,12 +4659,13 @@ namespace OpenSim.Region.Framework.Scenes //Ultimate backup if we have no idea where they are Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); return avatar.lastKnownAllowedPosition; - } //Go to the edge, this happens in teleporting to a region with no available parcels Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); + //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); + return nearestRegionEdgePoint; } -- cgit v1.1 From 8c82ff16ad07635b9bf1ccebd8ecc52c2aadf751 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Nov 2011 21:54:31 +0000 Subject: Fix WebFetchInventoryDescendents cap to use Utils.AssetTypeTostring/InventoryTypeToString to convert types to strings These cover a wider range of types. --- OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 94629a2..1c1d83c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -122,11 +122,13 @@ namespace OpenSim.Region.ClientStack.Linden WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/" + UUID.Random(), webFetchHandler.FetchInventoryDescendentsRequest); caps.RegisterHandler("WebFetchInventoryDescendents", reqHandler); +// caps.RegisterHandler("FetchInventoryDescendents2", reqHandler); } else { m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); caps.RegisterHandler("WebFetchInventoryDescendents", m_URL); +// caps.RegisterHandler("FetchInventoryDescendents2", m_URL); } } -- cgit v1.1 From 0688861aa72dc162a3da7b60804ac17ff5908067 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Nov 2011 22:15:29 +0000 Subject: Use the more extensive Utils.AssetTypeToString()/InventoryTypeToString() conversion rather than the arrays in TaskInventoryItem --- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d80944b..daddb90 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -832,8 +832,8 @@ namespace OpenSim.Region.Framework.Scenes invString.AddSectionEnd(); invString.AddNameValueLine("asset_id", item.AssetID.ToString()); - invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); - invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); + invString.AddNameValueLine("type", Utils.AssetTypeToString((AssetType)item.Type)); + invString.AddNameValueLine("inv_type", Utils.InventoryTypeToString((InventoryType)item.InvType)); invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); invString.AddSaleStart(); -- cgit v1.1 From b785f204ce33fc78ec4b0f9a30c20bc56ebea0d9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Nov 2011 22:19:57 +0000 Subject: remove some mono compiler warnings --- OpenSim/Region/Physics/Manager/PhysicsScene.cs | 2 +- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 6 +++--- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 7ab295a..2a6163c 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.Physics.Manager public abstract class PhysicsScene { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Name of this scene. Useful in debug messages to distinguish one OdeScene instance from another. diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 489a23a..73c1c02 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -86,7 +86,7 @@ namespace OpenSim.Region.Physics.OdePlugin private float CAPSULE_RADIUS = 0.37f; private float CAPSULE_LENGTH = 2.140599f; private float m_tensor = 3800000f; - private float heightFudgeFactor = 0.52f; +// private float heightFudgeFactor = 0.52f; private float walkDivisor = 1.3f; private float runDivisor = 0.8f; private bool flying = false; @@ -149,7 +149,7 @@ namespace OpenSim.Region.Physics.OdePlugin public OdeCharacter( String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, - float capsule_radius, float tensor, float density, float height_fudge_factor, + float capsule_radius, float tensor, float density, float walk_divisor, float rundivisor) { m_uuid = UUID.Random(); @@ -187,7 +187,7 @@ namespace OpenSim.Region.Physics.OdePlugin CAPSULE_RADIUS = capsule_radius; m_tensor = tensor; m_density = density; - heightFudgeFactor = height_fudge_factor; +// heightFudgeFactor = height_fudge_factor; walkDivisor = walk_divisor; runDivisor = rundivisor; diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 0456f56..5b28e7c 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -156,7 +156,7 @@ namespace OpenSim.Region.Physics.OdePlugin private bool avCapsuleTilted = true; // true = old compatibility mode with leaning capsule; false = new corrected mode public bool IsAvCapsuleTilted { get { return avCapsuleTilted; } set { avCapsuleTilted = value; } } private float avDensity = 80f; - private float avHeightFudgeFactor = 0.52f; +// private float avHeightFudgeFactor = 0.52f; private float avMovementDivisorWalk = 1.3f; private float avMovementDivisorRun = 0.8f; private float minimumGroundFlightOffset = 3f; @@ -316,7 +316,7 @@ namespace OpenSim.Region.Physics.OdePlugin private int m_physicsiterations = 10; private const float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag private readonly PhysicsActor PANull = new NullPhysicsActor(); - private float step_time = 0.0f; +// private float step_time = 0.0f; //Ckrinke: Comment out until used. We declare it, initialize it, but do not use it //Ckrinke private int ms = 0; public IntPtr world; @@ -479,7 +479,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10); avDensity = physicsconfig.GetFloat("av_density", 80f); - avHeightFudgeFactor = physicsconfig.GetFloat("av_height_fudge_factor", 0.52f); +// avHeightFudgeFactor = physicsconfig.GetFloat("av_height_fudge_factor", 0.52f); avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f); avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f); avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f); @@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Physics.OdePlugin OdeCharacter newAv = new OdeCharacter( avName, this, pos, size, avPIDD, avPIDP, - avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, + avCapRadius, avStandupTensor, avDensity, avMovementDivisorWalk, avMovementDivisorRun); newAv.Flying = isFlying; -- cgit v1.1 From 676d32974adc913b2902db6cfa456c77bd52cd85 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Nov 2011 22:46:42 +0000 Subject: Implement the FetchInventoryDescendents2 capability using the same code as WebFetchInventoryDescendents. Enabling this by setting Cap_FetchInventoryDescendents2 = "localhost" in the [ClientStack.LindenCaps] section of OpenSim.ini downloads inventory via http rather than udp in later viewers. --- .../Linden/Caps/WebFetchInvDescModule.cs | 55 +++++++++++++++------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 1c1d83c..2a41b87 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -42,18 +42,24 @@ using OpenSim.Capabilities.Handlers; namespace OpenSim.Region.ClientStack.Linden { - + /// + /// This module implements both WebFetchInventoryDescendents and FetchInventoryDescendents2 capabilities. + /// [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class WebFetchInvDescModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; private IInventoryService m_InventoryService; private ILibraryService m_LibraryService; - private bool m_Enabled = false; - private string m_URL; + + private bool m_Enabled; + + private string m_fetchInventoryDescendents2Url; + private string m_webFetchInventoryDescendentsUrl; #region ISharedRegionModule Members @@ -63,9 +69,10 @@ namespace OpenSim.Region.ClientStack.Linden if (config == null) return; - m_URL = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty); - // Cap doesn't exist - if (m_URL != string.Empty) + m_fetchInventoryDescendents2Url = config.GetString("Cap_FetchInventoryDescendents2", string.Empty); + m_webFetchInventoryDescendentsUrl = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty); + + if (m_fetchInventoryDescendents2Url != string.Empty || m_webFetchInventoryDescendentsUrl != string.Empty) m_Enabled = true; } @@ -111,26 +118,40 @@ namespace OpenSim.Region.ClientStack.Linden #endregion - public void RegisterCaps(UUID agentID, Caps caps) + private void RegisterCaps(UUID agentID, Caps caps) { UUID capID = UUID.Random(); - //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); - if (m_URL == "localhost") + if (m_webFetchInventoryDescendentsUrl != "") + RegisterFetchCap(agentID, caps, "WebFetchInventoryDescendents", m_webFetchInventoryDescendentsUrl); + else if (m_fetchInventoryDescendents2Url != "") + RegisterFetchCap(agentID, caps, "FetchInventoryDescendents2", m_fetchInventoryDescendents2Url); + } + + private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url) + { + string capUrl; + + if (url == "localhost") { - m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); + capUrl = "/CAPS/" + UUID.Random(); + WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); - IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/" + UUID.Random(), webFetchHandler.FetchInventoryDescendentsRequest); - caps.RegisterHandler("WebFetchInventoryDescendents", reqHandler); -// caps.RegisterHandler("FetchInventoryDescendents2", reqHandler); + IRequestHandler reqHandler + = new RestStreamHandler("POST", capUrl, webFetchHandler.FetchInventoryDescendentsRequest); + + caps.RegisterHandler(capName, reqHandler); } else { - m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); - caps.RegisterHandler("WebFetchInventoryDescendents", m_URL); -// caps.RegisterHandler("FetchInventoryDescendents2", m_URL); + capUrl = url; + + caps.RegisterHandler(capName, capUrl); } - } +// m_log.DebugFormat( +// "[WEB FETCH INV DESC MODULE]: Registered capability {0} at {1} in region {2} for {3}", +// capName, capUrl, m_scene.RegionInfo.RegionName, agentID); + } } } -- cgit v1.1 From 5b4fe23f7f1877a150ed50dd63beaac762fe8674 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Nov 2011 23:43:57 +0000 Subject: Resolve error where an unknown asset type would cause the fetch inventory descendents cap to fail. Introduced just a few commits ago in 0688861 --- OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 2a41b87..a49d619 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -48,8 +48,7 @@ namespace OpenSim.Region.ClientStack.Linden [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class WebFetchInvDescModule : INonSharedRegionModule { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; @@ -120,8 +119,6 @@ namespace OpenSim.Region.ClientStack.Linden private void RegisterCaps(UUID agentID, Caps caps) { - UUID capID = UUID.Random(); - if (m_webFetchInventoryDescendentsUrl != "") RegisterFetchCap(agentID, caps, "WebFetchInventoryDescendents", m_webFetchInventoryDescendentsUrl); else if (m_fetchInventoryDescendents2Url != "") -- cgit v1.1 From 95a686dbf5fce50b332c16231e5ebfdd07add0e4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Nov 2011 23:45:29 +0000 Subject: Fix config so that you can have both WebFetchInventoryDescendents and FetchInvnetoryDescendents2 caps active at once --- OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index a49d619..72177a8 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -121,7 +121,8 @@ namespace OpenSim.Region.ClientStack.Linden { if (m_webFetchInventoryDescendentsUrl != "") RegisterFetchCap(agentID, caps, "WebFetchInventoryDescendents", m_webFetchInventoryDescendentsUrl); - else if (m_fetchInventoryDescendents2Url != "") + + if (m_fetchInventoryDescendents2Url != "") RegisterFetchCap(agentID, caps, "FetchInventoryDescendents2", m_fetchInventoryDescendents2Url); } -- cgit v1.1 From 11c19b0d2ea97e82f3da3bb8fde665a25b044943 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 26 Nov 2011 00:29:01 +0000 Subject: Use the same web fetch handler for every request from every avatar, since it contains no instance code --- .../ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 72177a8..10f43d1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -60,6 +60,8 @@ namespace OpenSim.Region.ClientStack.Linden private string m_fetchInventoryDescendents2Url; private string m_webFetchInventoryDescendentsUrl; + private WebFetchInvDescHandler m_webFetchHandler; + #region ISharedRegionModule Members public void Initialise(IConfigSource source) @@ -72,7 +74,9 @@ namespace OpenSim.Region.ClientStack.Linden m_webFetchInventoryDescendentsUrl = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty); if (m_fetchInventoryDescendents2Url != string.Empty || m_webFetchInventoryDescendentsUrl != string.Empty) + { m_Enabled = true; + } } public void AddRegion(Scene s) @@ -97,8 +101,13 @@ namespace OpenSim.Region.ClientStack.Linden if (!m_Enabled) return; - m_InventoryService = m_scene.InventoryService; ; + m_InventoryService = m_scene.InventoryService; m_LibraryService = m_scene.LibraryService; + + // We'll reuse the same handler for all requests. + if (m_fetchInventoryDescendents2Url == "localhost" || m_webFetchInventoryDescendentsUrl == "localhost") + m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); + m_scene.EventManager.OnRegisterCaps += RegisterCaps; } @@ -134,9 +143,8 @@ namespace OpenSim.Region.ClientStack.Linden { capUrl = "/CAPS/" + UUID.Random(); - WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); IRequestHandler reqHandler - = new RestStreamHandler("POST", capUrl, webFetchHandler.FetchInventoryDescendentsRequest); + = new RestStreamHandler("POST", capUrl, m_webFetchHandler.FetchInventoryDescendentsRequest); caps.RegisterHandler(capName, reqHandler); } -- cgit v1.1 From bafea2282a95017099578a0a31a908e746161414 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 26 Nov 2011 01:39:23 +0000 Subject: Rip out unused Scene.HandleFetchInventoryDescendentsCAPS(). This has been handled by WebFetchInvDescHandler.Fetch() for some time. --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 1 - .../Framework/Scenes/Scene.PacketHandlers.cs | 58 ---------------------- 2 files changed, 59 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index b93a41b..8f0ae76 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -134,7 +134,6 @@ namespace OpenSim.Region.ClientStack.Linden AddNewInventoryItem = m_Scene.AddUploadedInventoryItem; ItemUpdatedCall = m_Scene.CapsUpdateInventoryItemAsset; TaskScriptUpdatedCall = m_Scene.CapsUpdateTaskInventoryScriptAsset; - CAPSFetchInventoryDescendents = m_Scene.HandleFetchInventoryDescendentsCAPS; GetClient = m_Scene.SceneGraph.GetControllingClient; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 270e582..2ac6387 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -511,64 +511,6 @@ namespace OpenSim.Region.Framework.Scenes SendInventoryDelegate d = (SendInventoryDelegate)iar.AsyncState; d.EndInvoke(iar); } - - /// - /// Handle the caps inventory descendents fetch. - /// - /// Since the folder structure is sent to the client on login, I believe we only need to handle items. - /// Diva comment 8/13/2009: what if someone gave us a folder in the meantime?? - /// - /// - /// - /// - /// - /// - /// - /// null if the inventory look up failed - public InventoryCollection HandleFetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID, - bool fetchFolders, bool fetchItems, int sortOrder, out int version) - { - m_log.DebugFormat( - "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", - fetchFolders, fetchItems, folderID, agentID); - - // FIXME MAYBE: We're not handling sortOrder! - - // TODO: This code for looking in the folder for the library should be folded back into the - // CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc. - // can be handled transparently). - InventoryFolderImpl fold; - if (LibraryService != null && LibraryService.LibraryRootFolder != null) - if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null) - { - version = 0; - InventoryCollection ret = new InventoryCollection(); - ret.Folders = new List(); - ret.Items = fold.RequestListOfItems(); - - return ret; - } - - InventoryCollection contents = new InventoryCollection(); - - if (folderID != UUID.Zero) - { - contents = InventoryService.GetFolderContent(agentID, folderID); - InventoryFolderBase containingFolder = new InventoryFolderBase(); - containingFolder.ID = folderID; - containingFolder.Owner = agentID; - containingFolder = InventoryService.GetFolder(containingFolder); - version = containingFolder.Version; - } - else - { - // Lost itemsm don't really need a version - version = 1; - } - - return contents; - - } /// /// Handle an inventory folder creation request from the client. -- cgit v1.1 From 46e1bcb6b68e1b032fa658582cab68682f98d230 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 26 Nov 2011 01:40:46 +0000 Subject: minor: remove mono compiler warning --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index f9af9c1..f9d6eee 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance { public class ScriptInstance : MarshalByRefObject, IScriptInstance { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IScriptEngine m_Engine; private IScriptWorkItem m_CurrentResult = null; -- cgit v1.1 From 86cc00aaa8dba93ea614460ceab7d6ba5e1adec5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 26 Nov 2011 01:52:12 +0000 Subject: minor: formatting changes in Scene.PacketHandlers.cs --- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 2ac6387..6ba74c7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -330,7 +330,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - } + } public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List surfaceArgs) { @@ -484,6 +484,7 @@ namespace OpenSim.Region.Framework.Scenes // can be handled transparently). InventoryFolderImpl fold = null; if (LibraryService != null && LibraryService.LibraryRootFolder != null) + { if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null) { remoteClient.SendInventoryFolderDetails( @@ -491,6 +492,7 @@ namespace OpenSim.Region.Framework.Scenes fold.RequestListOfFolders(), fold.Version, fetchFolders, fetchItems); return; } + } // We're going to send the reply async, because there may be // an enormous quantity of packets -- basically the entire inventory! @@ -585,14 +587,13 @@ namespace OpenSim.Region.Framework.Scenes } } + delegate void PurgeFolderDelegate(UUID userID, UUID folder); + /// /// This should delete all the items and folders in the given directory. /// /// /// - - delegate void PurgeFolderDelegate(UUID userID, UUID folder); - public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) { PurgeFolderDelegate d = PurgeFolderAsync; @@ -606,7 +607,6 @@ namespace OpenSim.Region.Framework.Scenes } } - private void PurgeFolderAsync(UUID userID, UUID folderID) { InventoryFolderBase folder = new InventoryFolderBase(folderID, userID); -- cgit v1.1 From 4efd9a3b7bedbacf166ab8a923dd0219e0d548af Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 26 Nov 2011 01:55:36 +0000 Subject: When removing an LSL sensor for a script (e.g. through llResetScript() or state change), don't also remove sensors for other scripts in the same prim. Hopefully fixes http://opensimulator.org/mantis/view.php?id=4448 and http://opensimulator.org/mantis/view.php?id=4452 --- .../ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 5527d14..3eeb23d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -140,7 +140,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins List NewSensors = new List(); foreach (SenseRepeatClass ts in SenseRepeaters) { - if (ts.localID != m_localID && ts.itemID != m_itemID) + if (ts.localID != m_localID || ts.itemID != m_itemID) { NewSensors.Add(ts); } -- cgit v1.1 From ea0fc7b12c8f6eba8cba2d4e74dc70b6095d4610 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 26 Nov 2011 17:06:28 -0500 Subject: Add missing property to llGetLinkPrimitiveParams --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 +++ OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 1 + 2 files changed, 4 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5ed8c47..6c54c9b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8090,6 +8090,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_ROT_LOCAL: res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W)); break; + case (int)ScriptBaseClass.PRIM_POS_LOCAL: + res.Add(new LSL_Vector(GetPartLocalPos(part))); + break; } } return res; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index ce4661c..fd08373 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -322,6 +322,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_DESC = 28; public const int PRIM_ROT_LOCAL = 29; public const int PRIM_OMEGA = 32; + public const int PRIM_POS_LOCAL = 33; public const int PRIM_LINK_TARGET = 34; public const int PRIM_TEXGEN_DEFAULT = 0; public const int PRIM_TEXGEN_PLANAR = 1; -- cgit v1.1