From 4f0c759fb0efb16c658522bf573c72f61a6067ec Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 27 Sep 2008 23:54:08 +0000 Subject: * With EventQueueGet enabled.. we can see into neighbor regions again on the Security 'fixed' client.. But don't try to cross yet! --- .../Modules/Framework/EventQueueGetModule.cs | 20 ++++++++++---------- .../Modules/Framework/EventQueueHelper.cs | 21 +++++++++++++++++---- 2 files changed, 27 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs index 14574e0..f77a7c0 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Modules.Framework { if (!queues.ContainsKey(agentId)) { - m_log.DebugFormat("[EVENTQUEUE]: Adding new queue for agent {0}", agentId); + m_log.DebugFormat("[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); queues[agentId] = new BlockingLLSDQueue(); } return queues[agentId]; @@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Framework #region IEventQueue Members public bool Enqueue(LLSD ev, UUID avatarID) { - m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0}", avatarID); + m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); BlockingLLSDQueue queue = GetQueue(avatarID); queue.Enqueue(ev); return true; @@ -145,7 +145,7 @@ namespace OpenSim.Region.Environment.Modules.Framework private void OnNewClient(IClientAPI client) { - m_log.DebugFormat("[EVENTQUEUE]: New client {0} detected.", client.AgentId); + m_log.DebugFormat("[EVENTQUEUE]: New client {0} detected in region {1}", client.AgentId, m_scene.RegionInfo.RegionName); client.OnLogout += ClientClosed; } @@ -158,13 +158,13 @@ namespace OpenSim.Region.Environment.Modules.Framework private void ClientClosed(UUID AgentID) { queues.Remove(AgentID); - m_log.DebugFormat("[EVENTQUEUE]: Client {0} deregistered.", AgentID); + m_log.DebugFormat("[EVENTQUEUE]: Client {0} deregistered in region {1}.", AgentID, m_scene.RegionInfo.RegionName); } private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) { m_log.DebugFormat("[EVENTQUEUE]: Avatar {0} entering parcel {1} in region {2}.", - avatar.UUID, localLandID, regionID); + avatar.UUID, localLandID, m_scene.RegionInfo.RegionName); } @@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Framework public void OnRegisterCaps(UUID agentID, Caps caps) { - m_log.DebugFormat("[EVENTQUEUE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); + m_log.DebugFormat("[EVENTQUEUE] OnRegisterCaps: agentID {0} caps {1} region", agentID, caps, m_scene.RegionInfo.RegionName); string capsBase = "/CAPS/"; caps.RegisterHandler("EventQueueGet", new RestHTTPHandler("POST", capsBase + UUID.Random().ToString(), @@ -203,12 +203,12 @@ namespace OpenSim.Region.Environment.Modules.Framework LLSD element = queue.Dequeue(15000); // 15s timeout - String debug = "[EVENTQUEUE]: Got request for agent {0}: [ "; + String debug = "[EVENTQUEUE]: Got request for agent {0} in region {1}: [ "; foreach(object key in request.Keys) { debug += key.ToString() + "=" + request[key].ToString() + " "; } - //m_log.DebugFormat(debug, agentID); + m_log.DebugFormat(debug, agentID, m_scene.RegionInfo.RegionName); if (element == null) // didn't have an event in 15s { @@ -239,7 +239,7 @@ namespace OpenSim.Region.Environment.Modules.Framework responsedata["content_type"] = "application/llsd+xml"; responsedata["keepalive"] = true; responsedata["str_response_string"] = LLSDParser.SerializeXmlString(events); - //m_log.DebugFormat("[EVENTQUEUE]: sending fake response for {0}: {1}", agentID, responsedata["str_response_string"]); + m_log.DebugFormat("[EVENTQUEUE]: sending fake response for {0} in region{1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); return responsedata; } @@ -269,7 +269,7 @@ namespace OpenSim.Region.Environment.Modules.Framework responsedata["content_type"] = "application/llsd+xml"; responsedata["keepalive"] = true; responsedata["str_response_string"] = LLSDParser.SerializeXmlString(events); - m_log.DebugFormat("[EVENTQUEUE]: sending response for {0}: {1}", agentID, responsedata["str_response_string"]); + m_log.DebugFormat("[EVENTQUEUE]: sending fake response for {0} in region{1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); return responsedata; } diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs index 46f7a3f..43f1782 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs @@ -26,8 +26,8 @@ */ using System; -using System.Net; - +using System.Net; +using OpenMetaverse; using OpenMetaverse.StructuredData; namespace OpenSim.Region.Environment @@ -36,10 +36,23 @@ namespace OpenSim.Region.Environment { private EventQueueHelper() {} // no construction possible, it's an utility class - public static LLSD EnableSimulator(ulong regionHandle, IPEndPoint endPoint) + public static LLSD EnableSimulator(ulong Handle, IPEndPoint endPoint) { LLSDMap llsdSimInfo = new LLSDMap(3); - llsdSimInfo.Add("Handle", new LLSDBinary(regionHandle)); + byte[] regionhandle = new byte[8]; + int i = 0; + + // Reverse endianness of RegionHandle + regionhandle[i++] = (byte)((Handle >> 56) % 256); + regionhandle[i++] = (byte)((Handle >> 48) % 256); + regionhandle[i++] = (byte)((Handle >> 40) % 256); + regionhandle[i++] = (byte)((Handle >> 32) % 256); + regionhandle[i++] = (byte)((Handle >> 24) % 256); + regionhandle[i++] = (byte)((Handle >> 16) % 256); + regionhandle[i++] = (byte)((Handle >> 8) % 256); + regionhandle[i++] = (byte)(Handle % 256); + + llsdSimInfo.Add("Handle", new LLSDBinary(regionhandle)); llsdSimInfo.Add("IP", new LLSDBinary(endPoint.Address.GetAddressBytes())); llsdSimInfo.Add("Port", new LLSDInteger(endPoint.Port)); -- cgit v1.1