diff options
author | UbitUmarov | 2016-07-27 02:54:32 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-27 02:54:49 +0100 |
commit | f4fa8919285a4399ebe909aee50285d91f6cd5fe (patch) | |
tree | d4cd9e1f68aaec65abea04f3dde8982f84e3de4d /OpenSim/Region/CoreModules/Framework/EntityTransfer | |
parent | missing changes about friends on crossings, and missing angular velocity clea... (diff) | |
download | opensim-SC_OLD-f4fa8919285a4399ebe909aee50285d91f6cd5fe.zip opensim-SC_OLD-f4fa8919285a4399ebe909aee50285d91f6cd5fe.tar.gz opensim-SC_OLD-f4fa8919285a4399ebe909aee50285d91f6cd5fe.tar.bz2 opensim-SC_OLD-f4fa8919285a4399ebe909aee50285d91f6cd5fe.tar.xz |
waste another thread job on another thing that should be part of a more
unified service, and also not hidding on a so called event"
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 103 |
1 files changed, 50 insertions, 53 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index a14fb25..a1ad910 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -2080,66 +2080,63 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2080 | sp.KnownRegions = seeds; | 2080 | sp.KnownRegions = seeds; |
2081 | sp.SetNeighbourRegionSizeInfo(neighbours); | 2081 | sp.SetNeighbourRegionSizeInfo(neighbours); |
2082 | 2082 | ||
2083 | AgentPosition agentpos = new AgentPosition(); | 2083 | if(newneighbours.Count > 0 || previousRegionNeighbourHandles.Count > 0) |
2084 | agentpos.AgentID = new UUID(sp.UUID.Guid); | 2084 | { |
2085 | agentpos.SessionID = spClient.SessionId; | 2085 | AgentPosition agentpos = new AgentPosition(); |
2086 | agentpos.Size = sp.Appearance.AvatarSize; | 2086 | agentpos.AgentID = new UUID(sp.UUID.Guid); |
2087 | agentpos.Center = sp.CameraPosition; | 2087 | agentpos.SessionID = spClient.SessionId; |
2088 | agentpos.Far = sp.DrawDistance; | 2088 | agentpos.Size = sp.Appearance.AvatarSize; |
2089 | agentpos.Position = sp.AbsolutePosition; | 2089 | agentpos.Center = sp.CameraPosition; |
2090 | agentpos.Velocity = sp.Velocity; | 2090 | agentpos.Far = sp.DrawDistance; |
2091 | agentpos.RegionHandle = currentRegionHandler; | 2091 | agentpos.Position = sp.AbsolutePosition; |
2092 | agentpos.Throttles = spClient.GetThrottlesPacked(1); | 2092 | agentpos.Velocity = sp.Velocity; |
2093 | // agentpos.ChildrenCapSeeds = seeds; | 2093 | agentpos.RegionHandle = currentRegionHandler; |
2094 | 2094 | agentpos.Throttles = spClient.GetThrottlesPacked(1); | |
2095 | Util.FireAndForget(delegate | 2095 | // agentpos.ChildrenCapSeeds = seeds; |
2096 | { | 2096 | |
2097 | Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start | 2097 | Util.FireAndForget(delegate |
2098 | int count = 0; | ||
2099 | |||
2100 | foreach (GridRegion neighbour in neighbours) | ||
2101 | { | 2098 | { |
2102 | ulong handler = neighbour.RegionHandle; | 2099 | Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start |
2103 | try | 2100 | int count = 0; |
2101 | |||
2102 | foreach (GridRegion neighbour in neighbours) | ||
2104 | { | 2103 | { |
2105 | if (newneighbours.Contains(handler)) | 2104 | ulong handler = neighbour.RegionHandle; |
2105 | try | ||
2106 | { | 2106 | { |
2107 | InformClientOfNeighbourAsync(sp, cagents[count], neighbour, | 2107 | if (newneighbours.Contains(handler)) |
2108 | neighbour.ExternalEndPoint, true); | 2108 | { |
2109 | count++; | 2109 | InformClientOfNeighbourAsync(sp, cagents[count], neighbour, |
2110 | neighbour.ExternalEndPoint, true); | ||
2111 | count++; | ||
2112 | } | ||
2113 | else if (!previousRegionNeighbourHandles.Contains(handler)) | ||
2114 | { | ||
2115 | spScene.SimulationService.UpdateAgent(neighbour, agentpos); | ||
2116 | } | ||
2110 | } | 2117 | } |
2111 | else if (!previousRegionNeighbourHandles.Contains(handler)) | 2118 | catch (ArgumentOutOfRangeException) |
2112 | { | 2119 | { |
2113 | spScene.SimulationService.UpdateAgent(neighbour, agentpos); | 2120 | m_log.ErrorFormat( |
2121 | "[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).", | ||
2122 | neighbour.ExternalHostName, | ||
2123 | neighbour.RegionHandle, | ||
2124 | neighbour.RegionLocX, | ||
2125 | neighbour.RegionLocY); | ||
2126 | } | ||
2127 | catch (Exception e) | ||
2128 | { | ||
2129 | m_log.ErrorFormat( | ||
2130 | "[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}", | ||
2131 | neighbour.ExternalHostName, | ||
2132 | neighbour.RegionHandle, | ||
2133 | neighbour.RegionLocX, | ||
2134 | neighbour.RegionLocY, | ||
2135 | e); | ||
2114 | } | 2136 | } |
2115 | } | 2137 | } |
2116 | catch (ArgumentOutOfRangeException) | 2138 | }); |
2117 | { | 2139 | } |
2118 | m_log.ErrorFormat( | ||
2119 | "[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).", | ||
2120 | neighbour.ExternalHostName, | ||
2121 | neighbour.RegionHandle, | ||
2122 | neighbour.RegionLocX, | ||
2123 | neighbour.RegionLocY); | ||
2124 | } | ||
2125 | catch (Exception e) | ||
2126 | { | ||
2127 | m_log.ErrorFormat( | ||
2128 | "[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}", | ||
2129 | neighbour.ExternalHostName, | ||
2130 | neighbour.RegionHandle, | ||
2131 | neighbour.RegionLocX, | ||
2132 | neighbour.RegionLocY, | ||
2133 | e); | ||
2134 | |||
2135 | // FIXME: Okay, even though we've failed, we're still going to throw the exception on, | ||
2136 | // since I don't know what will happen if we just let the client continue | ||
2137 | |||
2138 | // XXX: Well, decided to swallow the exception instead for now. Let us see how that goes. | ||
2139 | // throw e; | ||
2140 | } | ||
2141 | } | ||
2142 | }); | ||
2143 | } | 2140 | } |
2144 | 2141 | ||
2145 | // Computes the difference between two region bases. | 2142 | // Computes the difference between two region bases. |