From b29e9d37e7705e461f71a3a599d95ad79b57e18a Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 11 Sep 2013 12:15:16 -0700 Subject: Change handling of the FetchInventoryDescendents2 capability configuration to allow for external handlers. --- .../Linden/Caps/WebFetchInvDescModule.cs | 59 +++++++++++++--------- 1 file changed, 36 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 164adeb..340d2e7 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden public List folders; } -// 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; @@ -115,7 +115,7 @@ namespace OpenSim.Region.ClientStack.Linden m_scene.EventManager.OnRegisterCaps -= RegisterCaps; foreach (Thread t in m_workerThreads) - Watchdog.AbortThread(t.ManagedThreadId); + Watchdog.AbortThread(t.ManagedThreadId); m_scene = null; } @@ -296,36 +296,49 @@ namespace OpenSim.Region.ClientStack.Linden requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); lock (responses) - responses[requestID] = response; + responses[requestID] = response; } } private void RegisterCaps(UUID agentID, Caps caps) { - if (m_fetchInventoryDescendents2Url == "") + RegisterFetchDescendentsCap(agentID, caps, "FetchInventoryDescendents2", m_fetchInventoryDescendents2Url); + } + + private void RegisterFetchDescendentsCap(UUID agentID, Caps caps, string capName, string url) + { + string capUrl; + + // disable the cap clause + if (url == "") + { return; + } + // handled by the simulator + else if (url == "localhost") + { + capUrl = "/CAPS/" + UUID.Random() + "/"; - // Register this as a poll service - PollServiceInventoryEventArgs args - = new PollServiceInventoryEventArgs(m_scene, "/CAPS/" + UUID.Random() + "/", agentID); - args.Type = PollServiceEventArgs.EventType.Inventory; + // Register this as a poll service + PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(m_scene, capUrl, agentID); + args.Type = PollServiceEventArgs.EventType.Inventory; - caps.RegisterPollHandler("FetchInventoryDescendents2", args); + caps.RegisterPollHandler(capName, args); + } + // external handler + else + { + capUrl = url; + IExternalCapsModule handler = m_scene.RequestModuleInterface(); + if (handler != null) + handler.RegisterExternalUserCapsHandler(agentID,caps,capName,capUrl); + else + caps.RegisterHandler(capName, capUrl); + } -// MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); -// -// string hostName = m_scene.RegionInfo.ExternalHostName; -// uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; -// string protocol = "http"; -// -// if (MainServer.Instance.UseSSL) -// { -// hostName = MainServer.Instance.SSLCommonName; -// port = MainServer.Instance.SSLPort; -// protocol = "https"; -// } -// -// caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); + // m_log.DebugFormat( + // "[FETCH INVENTORY DESCENDENTS2 MODULE]: Registered capability {0} at {1} in region {2} for {3}", + // capName, capUrl, m_scene.RegionInfo.RegionName, agentID); } // private void DeregisterCaps(UUID agentID, Caps caps) -- cgit v1.1 From 7dbc93c62a6803fbe201e933b8bc1374b48869ad Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 18 Sep 2013 21:41:51 +0100 Subject: Change logging to provide more information on LLUDPServer.HandleCompleteMovementIntoRegion() Add more information on which endpoint sent the packet when we have to wait and if we end up dropping the packet Only check if the client is active - other checks are redundant since they can only failed if IsActve = false --- .../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 49 +++++++++++++++++----- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 102e581..cdc1668 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1693,31 +1693,60 @@ namespace OpenSim.Region.ClientStack.LindenUDP CompleteAgentMovementPacket packet = (CompleteAgentMovementPacket)array[1]; // Determine which agent this packet came from + // We need to wait here because in when using the OpenSimulator V2 teleport protocol to travel to a destination + // simulator with no existing child presence, the viewer (at least LL 3.3.4) will send UseCircuitCode + // and then CompleteAgentMovement immediately without waiting for an ack. As we are now handling these + // packets asynchronously, we need to account for this thread proceeding more quickly than the + // UseCircuitCode thread. int count = 20; - bool ready = false; - while (!ready && count-- > 0) + while (count-- > 0) { - if (m_scene.TryGetClient(endPoint, out client) && client.IsActive && client.SceneAgent != null) + if (m_scene.TryGetClient(endPoint, out client)) { - LLClientView llClientView = (LLClientView)client; - LLUDPClient udpClient = llClientView.UDPClient; - if (udpClient != null && udpClient.IsConnected) - ready = true; + if (client.IsActive) + { + break; + } else { - m_log.Debug("[LLUDPSERVER]: Received a CompleteMovementIntoRegion in " + m_scene.RegionInfo.RegionName + " (not ready yet)"); - Thread.Sleep(200); + // This check exists to catch a condition where the client has been closed by another thread + // but has not yet been removed from the client manager (and possibly a new connection has + // not yet been established). + m_log.DebugFormat( + "[LLUDPSERVER]: Received a CompleteMovementIntoRegion from {0} for {1} in {2} but client is not active. Waiting.", + endPoint, client.Name, m_scene.Name); } } else { - m_log.Debug("[LLUDPSERVER]: Received a CompleteMovementIntoRegion in " + m_scene.RegionInfo.RegionName + " (not ready yet)"); + m_log.DebugFormat( + "[LLUDPSERVER]: Received a CompleteMovementIntoRegion from {0} in {1} but no client exists. Waiting.", + endPoint, m_scene.Name); + Thread.Sleep(200); } } if (client == null) + { + m_log.DebugFormat( + "[LLUDPSERVER]: No client found for CompleteMovementIntoRegion from {0} in {1} after wait. Dropping.", + endPoint, m_scene.Name); + return; + } + else if (!client.IsActive) + { + // This check exists to catch a condition where the client has been closed by another thread + // but has not yet been removed from the client manager. + // The packet could be simply ignored but it is useful to know if this condition occurred for other debugging + // purposes. + m_log.DebugFormat( + "[LLUDPSERVER]: Received a CompleteMovementIntoRegion from {0} for {1} in {2} but client is not active after wait. Dropping.", + endPoint, client.Name, m_scene.Name); + + return; + } IncomingPacket incomingPacket1; -- cgit v1.1 From f4d82a56f4c13bd24305e008418819edcfdc549d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 18 Sep 2013 22:09:46 +0100 Subject: Double the time spent waiting for a UseCircuitCode packet in LLUDPServer.HandleCompleteMovementIntoRegion() This is to deal with one aspect of http://opensimulator.org/mantis/view.php?id=6755 With the V2 teleport arrangements, viewers appear to send the single UseCircuitCode and CompleteAgentMovement packets immediately after each other Possibly, on occasion a poor network might drop the initial UseCircuitCode packet and by the time it retries, the CompleteAgementMovement has timed out and the teleport fails. There's no apparant harm in doubling the wait time (most times only one wait will be performed) so trying this. --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index cdc1668..b1752c1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1698,7 +1698,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // and then CompleteAgentMovement immediately without waiting for an ack. As we are now handling these // packets asynchronously, we need to account for this thread proceeding more quickly than the // UseCircuitCode thread. - int count = 20; + int count = 40; while (count-- > 0) { if (m_scene.TryGetClient(endPoint, out client)) -- cgit v1.1 From 2dc92e7de11086c7649d3ee0f8adc974efce6805 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sun, 4 Aug 2013 19:19:11 +0200 Subject: Preserve attachment point & position when attachment is rezzed in world Patch taken from http://opensimulator.org/mantis/view.php?id=4905 originally by Greg C. Fixed to apply to r/23314 commit ba9daf849e7c8db48e7c03e7cdedb77776b2052f (cherry picked from commit 4ff9fbca441110cc2b93edc7286e0e9339e61cbe) --- OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs | 4 ++++ .../ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | 1 + OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 1 + 3 files changed, 6 insertions(+) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs index 92805e2..94f8bc1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs @@ -155,6 +155,7 @@ namespace OpenSim.Region.ClientStack.Linden Quaternion rotation = Quaternion.Identity; Vector3 scale = Vector3.Zero; int state = 0; + int lastattach = 0; if (r.Type != OSDType.Map) // not a proper req return responsedata; @@ -224,6 +225,7 @@ namespace OpenSim.Region.ClientStack.Linden ray_target_id = ObjMap["RayTargetId"].AsUUID(); state = ObjMap["State"].AsInteger(); + lastattach = ObjMap["LastAttachPoint"].AsInteger(); try { ray_end = ((OSDArray)ObjMap["RayEnd"]).AsVector3(); @@ -290,6 +292,7 @@ namespace OpenSim.Region.ClientStack.Linden //session_id = rm["session_id"].AsUUID(); state = rm["state"].AsInteger(); + lastattach = rm["last_attach_point"].AsInteger(); try { ray_end = ((OSDArray)rm["ray_end"]).AsVector3(); @@ -331,6 +334,7 @@ namespace OpenSim.Region.ClientStack.Linden pbs.ProfileEnd = (ushort)profile_end; pbs.Scale = scale; pbs.State = (byte)state; + pbs.LastAttachPoint = (byte)lastattach; SceneObjectGroup obj = null; ; diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs index 55a503e..769fe28 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs @@ -277,6 +277,7 @@ namespace OpenSim.Region.ClientStack.Linden pbs.ProfileEnd = (ushort) obj.ProfileEnd; pbs.Scale = obj.Scale; pbs.State = (byte) 0; + pbs.LastAttachPoint = (byte) 0; SceneObjectPart prim = new SceneObjectPart(); prim.UUID = UUID.Random(); prim.CreatorID = AgentId; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1b091bf..3609ec1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12188,6 +12188,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP shape.PCode = addPacket.ObjectData.PCode; shape.State = addPacket.ObjectData.State; + shape.LastAttachPoint = addPacket.ObjectData.State; shape.PathBegin = addPacket.ObjectData.PathBegin; shape.PathEnd = addPacket.ObjectData.PathEnd; shape.PathScaleX = addPacket.ObjectData.PathScaleX; -- cgit v1.1 From f384a6291e6b03b451dd3e3fec7667bc8f53c296 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Sep 2013 00:02:17 +0100 Subject: Instead of swallowing any socket begin/end receive exceptions, log them for debugging purposes. This may reveal why on some teleports with current code, the UseCircuitCode message gets through but CompleteMovement disappears into the ether. --- .../ClientStack/Linden/UDP/OpenSimUDPBase.cs | 39 ++++++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index d0ed7e8..88494be 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs @@ -295,7 +295,16 @@ namespace OpenMetaverse m_log.Warn("[UDPBASE]: Salvaged the UDP listener on port " + m_udpPort); } } - catch (ObjectDisposedException) { } + catch (ObjectDisposedException e) + { + m_log.Error( + string.Format("[UDPBASE]: Error processing UDP begin receive {0}. Exception ", UdpReceives), e); + } + catch (Exception e) + { + m_log.Error( + string.Format("[UDPBASE]: Error processing UDP begin receive {0}. Exception ", UdpReceives), e); + } } } @@ -312,12 +321,12 @@ namespace OpenMetaverse if (m_asyncPacketHandling) AsyncBeginReceive(); - // get the buffer that was created in AsyncBeginReceive - // this is the received data - UDPPacketBuffer buffer = (UDPPacketBuffer)iar.AsyncState; - try { + // get the buffer that was created in AsyncBeginReceive + // this is the received data + UDPPacketBuffer buffer = (UDPPacketBuffer)iar.AsyncState; + int startTick = Util.EnvironmentTickCount(); // get the length of data actually read from the socket, store it with the @@ -345,8 +354,24 @@ namespace OpenMetaverse m_currentReceiveTimeSamples++; } } - catch (SocketException) { } - catch (ObjectDisposedException) { } + catch (SocketException se) + { + m_log.Error( + string.Format( + "[UDPBASE]: Error processing UDP end receive {0}, socket error code {1}. Exception ", + UdpReceives, se.ErrorCode), + se); + } + catch (ObjectDisposedException e) + { + m_log.Error( + string.Format("[UDPBASE]: Error processing UDP end receive {0}. Exception ", UdpReceives), e); + } + catch (Exception e) + { + m_log.Error( + string.Format("[UDPBASE]: Error processing UDP end receive {0}. Exception ", UdpReceives), e); + } finally { // if (UsePools) -- cgit v1.1 From 732554be0451b9e7fa5f96ffb8f9f347b964dd88 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Sep 2013 18:29:14 +0100 Subject: Reinsert 200ms sleep accidentally removed in commit 7dbc93c (Wed Sep 18 21:41:51 2013 +0100) --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index b1752c1..a130ffe 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1722,9 +1722,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_log.DebugFormat( "[LLUDPSERVER]: Received a CompleteMovementIntoRegion from {0} in {1} but no client exists. Waiting.", endPoint, m_scene.Name); - - Thread.Sleep(200); } + + Thread.Sleep(200); } if (client == null) -- cgit v1.1 From 32ddfc274056e68bfd9e7e6d3e7921c8062a59d1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Sep 2013 18:45:56 +0100 Subject: Reinsert client.SceneAgent checks into LLUDPServer.HandleCompleteMovementIntoRegion() to fix race condition regression in commit 7dbc93c (Wed Sep 18 21:41:51 2013 +0100) This check is necessary to close a race condition where the CompleteAgentMovement processing could proceed when the UseCircuitCode thread had added the client to the client manager but before the ScenePresence had registered to process the CompleteAgentMovement message. This is most probably why the message appeared to get lost on a proportion of entity transfers. A better long term solution may be to set the IClientAPI.SceneAgent property before the client is added to the manager. --- .../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 37 +++++++++++++++------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index a130ffe..9504f15 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1692,6 +1692,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP endPoint = (IPEndPoint)array[0]; CompleteAgentMovementPacket packet = (CompleteAgentMovementPacket)array[1]; + m_log.DebugFormat( + "[LLUDPSERVER]: Handling CompleteAgentMovement request from {0} in {1}", endPoint, m_scene.Name); + // Determine which agent this packet came from // We need to wait here because in when using the OpenSimulator V2 teleport protocol to travel to a destination // simulator with no existing child presence, the viewer (at least LL 3.3.4) will send UseCircuitCode @@ -1703,24 +1706,36 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (m_scene.TryGetClient(endPoint, out client)) { - if (client.IsActive) - { - break; - } - else + if (!client.IsActive) { // This check exists to catch a condition where the client has been closed by another thread // but has not yet been removed from the client manager (and possibly a new connection has // not yet been established). m_log.DebugFormat( - "[LLUDPSERVER]: Received a CompleteMovementIntoRegion from {0} for {1} in {2} but client is not active. Waiting.", + "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client is not active yet. Waiting.", + endPoint, client.Name, m_scene.Name); + } + else if (client.SceneAgent == null) + { + // This check exists to catch a condition where the new client has been added to the client + // manager but the SceneAgent has not yet been set in Scene.AddNewClient(). If we are too + // eager, then the new ScenePresence may not have registered a listener for this messsage + // before we try to process it. + // XXX: A better long term fix may be to add the SceneAgent before the client is added to + // the client manager + m_log.DebugFormat( + "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client SceneAgent not set yet. Waiting.", endPoint, client.Name, m_scene.Name); } + else + { + break; + } } else { m_log.DebugFormat( - "[LLUDPSERVER]: Received a CompleteMovementIntoRegion from {0} in {1} but no client exists. Waiting.", + "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} in {1} but no client exists yet. Waiting.", endPoint, m_scene.Name); } @@ -1730,19 +1745,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (client == null) { m_log.DebugFormat( - "[LLUDPSERVER]: No client found for CompleteMovementIntoRegion from {0} in {1} after wait. Dropping.", + "[LLUDPSERVER]: No client found for CompleteAgentMovement from {0} in {1} after wait. Dropping.", endPoint, m_scene.Name); return; } - else if (!client.IsActive) + else if (!client.IsActive || client.SceneAgent == null) { // This check exists to catch a condition where the client has been closed by another thread // but has not yet been removed from the client manager. // The packet could be simply ignored but it is useful to know if this condition occurred for other debugging // purposes. m_log.DebugFormat( - "[LLUDPSERVER]: Received a CompleteMovementIntoRegion from {0} for {1} in {2} but client is not active after wait. Dropping.", + "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client is not active after wait. Dropping.", endPoint, client.Name, m_scene.Name); return; @@ -1767,7 +1782,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP catch (Exception e) { m_log.ErrorFormat( - "[LLUDPSERVER]: CompleteMovementIntoRegion handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}", + "[LLUDPSERVER]: CompleteAgentMovement handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}", endPoint != null ? endPoint.ToString() : "n/a", client != null ? client.Name : "unknown", client != null ? client.AgentId.ToString() : "unknown", -- cgit v1.1 From b16bc7b01ca0691758e66f85238d657f02271082 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Sep 2013 19:14:21 +0100 Subject: refactor: rename Scene.IncomingCloseAgent() to CloseAgent() in order to make it clear that all non-clientstack callers should be using this rather than RemoveClient() in order to step through the ScenePresence state machine properly. Adds IScene.CloseAgent() to replace RemoveClient() --- .../ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | 2 +- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 4 ++-- OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index b3b0b8a..9e24bce 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs @@ -96,7 +96,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests UUID spId = TestHelpers.ParseTail(0x1); SceneHelpers.AddScenePresence(m_scene, spId); - m_scene.IncomingCloseAgent(spId, false); + m_scene.CloseAgent(spId, false); // TODO: Add more assertions for the other aspects of event queues Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(0)); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 9504f15..5296a6d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1893,7 +1893,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP client.Kick("Simulator logged you out due to connection timeout."); } - m_scene.IncomingCloseAgent(client.AgentId, true); + m_scene.CloseAgent(client.AgentId, true); } private void IncomingPacketHandler() @@ -2234,7 +2234,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (!client.IsLoggingOut) { client.IsLoggingOut = true; - m_scene.IncomingCloseAgent(client.AgentId, false); + m_scene.CloseAgent(client.AgentId, false); } } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs index 119a677..28b5eb7 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs @@ -59,10 +59,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests // FIXME return null; } - - public override void RemoveClient(UUID agentID, bool someReason) {} -// public override void CloseAllAgents(uint circuitcode) {} + + public override bool CloseAgent(UUID agentID, bool force) { return true; } public override bool CheckClient(UUID clientId, IPEndPoint endPoint) { return true; } + public override void OtherRegionUp(GridRegion otherRegion) { } public override bool TryGetScenePresence(UUID uuid, out ScenePresence sp) { sp = null; return false; } -- cgit v1.1 From 2cd95fac736cc99b1a2ad661e4a03810225ffaca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Sep 2013 22:27:39 +0100 Subject: refactor: Rename Scene.AddNewClient() to AddNewAgent() to make it obvious in the code that this is symmetric with CloseAgent() --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 2 +- OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 3609ec1..6b58fb7 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -750,7 +750,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public virtual void Start() { - m_scene.AddNewClient(this, PresenceType.User); + m_scene.AddNewAgent(this, PresenceType.User); RefreshGroupMembership(); } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 5296a6d..8d957dc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1718,7 +1718,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP else if (client.SceneAgent == null) { // This check exists to catch a condition where the new client has been added to the client - // manager but the SceneAgent has not yet been set in Scene.AddNewClient(). If we are too + // manager but the SceneAgent has not yet been set in Scene.AddNewAgent(). If we are too // eager, then the new ScenePresence may not have registered a listener for this messsage // before we try to process it. // XXX: A better long term fix may be to add the SceneAgent before the client is added to diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs index 28b5eb7..e2178e5 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs @@ -52,7 +52,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests public override void Update(int frames) {} public override void LoadWorldMap() {} - public override ISceneAgent AddNewClient(IClientAPI client, PresenceType type) + public override ISceneAgent AddNewAgent(IClientAPI client, PresenceType type) { client.OnObjectName += RecordObjectNameCall; @@ -61,6 +61,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests } public override bool CloseAgent(UUID agentID, bool force) { return true; } + public override bool CheckClient(UUID clientId, IPEndPoint endPoint) { return true; } public override void OtherRegionUp(GridRegion otherRegion) { } -- cgit v1.1