diff options
author | UbitUmarov | 2015-08-26 03:21:48 +0100 |
---|---|---|
committer | UbitUmarov | 2015-08-26 03:21:48 +0100 |
commit | 73124f22cc5974596ddf6bcedb9a1d251ec880cc (patch) | |
tree | e6bfa036700197e879630fdc7e1600e29aef745a | |
parent | fix bug (diff) | |
download | opensim-SC-73124f22cc5974596ddf6bcedb9a1d251ec880cc.zip opensim-SC-73124f22cc5974596ddf6bcedb9a1d251ec880cc.tar.gz opensim-SC-73124f22cc5974596ddf6bcedb9a1d251ec880cc.tar.bz2 opensim-SC-73124f22cc5974596ddf6bcedb9a1d251ec880cc.tar.xz |
change teleport version number to v0.3, without actually adding the checks
for 0.7 sims, etc that we don't have. Also still not using the homeURL
added in core.
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 77 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | 4 |
2 files changed, 29 insertions, 52 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index c81e5aa..ef9f8df 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -209,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
209 | protected virtual void InitialiseCommon(IConfigSource source) | 209 | protected virtual void InitialiseCommon(IConfigSource source) |
210 | { | 210 | { |
211 | string transferVersionName = "SIMULATION"; | 211 | string transferVersionName = "SIMULATION"; |
212 | float maxTransferVersion = 0.2f; | 212 | float maxTransferVersion = 0.3f; |
213 | 213 | ||
214 | IConfig transferConfig = source.Configs["EntityTransfer"]; | 214 | IConfig transferConfig = source.Configs["EntityTransfer"]; |
215 | if (transferConfig != null) | 215 | if (transferConfig != null) |
@@ -703,6 +703,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
703 | return; | 703 | return; |
704 | } | 704 | } |
705 | 705 | ||
706 | string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); | ||
707 | |||
706 | m_log.DebugFormat( | 708 | m_log.DebugFormat( |
707 | "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", | 709 | "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", |
708 | sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, | 710 | sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, |
@@ -749,6 +751,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
749 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); | 751 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); |
750 | if (!Scene.SimulationService.QueryAccess( | 752 | if (!Scene.SimulationService.QueryAccess( |
751 | finalDestination, sp.ControllingClient.AgentId, position, out version, out reason)) | 753 | finalDestination, sp.ControllingClient.AgentId, position, out version, out reason)) |
754 | // if (!Scene.SimulationService.QueryAccess( | ||
755 | // finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, out version, out reason)) | ||
752 | { | 756 | { |
753 | sp.ControllingClient.SendTeleportFailed(reason); | 757 | sp.ControllingClient.SendTeleportFailed(reason); |
754 | 758 | ||
@@ -843,7 +847,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
843 | if (versionComponents.Length >= 2) | 847 | if (versionComponents.Length >= 2) |
844 | float.TryParse(versionComponents[1], out versionNumber); | 848 | float.TryParse(versionComponents[1], out versionNumber); |
845 | 849 | ||
846 | if (versionNumber == 0.2f && MaxOutgoingTransferVersion >= versionNumber) | 850 | if (versionNumber >= 0.2f && MaxOutgoingTransferVersion >= versionNumber) |
847 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 851 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
848 | else | 852 | else |
849 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 853 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
@@ -2270,7 +2274,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2270 | #endregion // NotFoundLocationCache class | 2274 | #endregion // NotFoundLocationCache class |
2271 | private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache(); | 2275 | private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache(); |
2272 | 2276 | ||
2273 | // Given a world position (fractional meter coordinate), get the GridRegion info for | 2277 | // Given a world position, get the GridRegion info for |
2274 | // the region containing that point. | 2278 | // the region containing that point. |
2275 | // Someday this should be a method on GridService. | 2279 | // Someday this should be a method on GridService. |
2276 | // 'pSizeHint' is the size of the source region but since the destination point can be anywhere | 2280 | // 'pSizeHint' is the size of the source region but since the destination point can be anywhere |
@@ -2471,14 +2475,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2471 | { | 2475 | { |
2472 | // The area to check is as big as the current region. | 2476 | // The area to check is as big as the current region. |
2473 | // We presume all adjacent regions are the same size as this region. | 2477 | // We presume all adjacent regions are the same size as this region. |
2474 | uint dd = Math.Max((uint)avatar.Scene.DefaultDrawDistance, | 2478 | // this needs to be reduced a lot |
2475 | Math.Max(Scene.RegionInfo.RegionSizeX, Scene.RegionInfo.RegionSizeY)); | 2479 | // and updated in avatar CheckForSignificantMovement (larger than current 64m?) |
2476 | 2480 | // and draw distance changes | |
2477 | uint startX = Util.RegionToWorldLoc(pRegionLocX) - dd + Constants.RegionSize/2; | 2481 | // sending client the necessary information |
2478 | uint startY = Util.RegionToWorldLoc(pRegionLocY) - dd + Constants.RegionSize/2; | 2482 | uint dd = Math.Max((uint)avatar.DrawDistance, Constants.RegionSize); |
2479 | 2483 | ||
2480 | uint endX = Util.RegionToWorldLoc(pRegionLocX) + dd + Constants.RegionSize/2; | 2484 | dd--; |
2481 | uint endY = Util.RegionToWorldLoc(pRegionLocY) + dd + Constants.RegionSize/2; | 2485 | uint ddX = Math.Max(dd, Scene.RegionInfo.RegionSizeX); |
2486 | uint ddY = Math.Max(dd, Scene.RegionInfo.RegionSizeY); | ||
2487 | |||
2488 | // region center. Should be avatar position | ||
2489 | uint startX = Util.RegionToWorldLoc(pRegionLocX) + m_regionInfo.RegionSizeX / 2; | ||
2490 | uint endX = startX; | ||
2491 | uint startY = Util.RegionToWorldLoc(pRegionLocY) + m_regionInfo.RegionSizeY / 2; | ||
2492 | uint endY = startY; | ||
2493 | |||
2494 | startX -= dd; | ||
2495 | startY -= dd; | ||
2496 | endX += dd; | ||
2497 | endY += dd; | ||
2482 | 2498 | ||
2483 | neighbours | 2499 | neighbours |
2484 | = avatar.Scene.GridService.GetRegionRange( | 2500 | = avatar.Scene.GridService.GetRegionRange( |
@@ -2502,45 +2518,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2502 | 2518 | ||
2503 | return neighbours; | 2519 | return neighbours; |
2504 | } | 2520 | } |
2505 | /* not in use | ||
2506 | private List<ulong> NewNeighbours(List<ulong> currentNeighbours, List<ulong> previousNeighbours) | ||
2507 | { | ||
2508 | return currentNeighbours.FindAll(delegate(ulong handle) { return !previousNeighbours.Contains(handle); }); | ||
2509 | } | ||
2510 | |||
2511 | // private List<ulong> CommonNeighbours(List<ulong> currentNeighbours, List<ulong> previousNeighbours) | ||
2512 | // { | ||
2513 | // return currentNeighbours.FindAll(delegate(ulong handle) { return previousNeighbours.Contains(handle); }); | ||
2514 | // } | ||
2515 | |||
2516 | // private List<ulong> OldNeighbours(List<ulong> currentNeighbours, List<ulong> previousNeighbours) | ||
2517 | // { | ||
2518 | // return previousNeighbours.FindAll(delegate(ulong handle) { return !currentNeighbours.Contains(handle); }); | ||
2519 | // } | ||
2520 | |||
2521 | // private List<ulong> NeighbourHandles(List<GridRegion> neighbours) | ||
2522 | // { | ||
2523 | // List<ulong> handles = new List<ulong>(); | ||
2524 | // foreach (GridRegion reg in neighbours) | ||
2525 | // { | ||
2526 | // handles.Add(reg.RegionHandle); | ||
2527 | // } | ||
2528 | // return handles; | ||
2529 | // } | ||
2530 | |||
2531 | // private void Dump(string msg, List<ulong> handles) | ||
2532 | // { | ||
2533 | // m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); | ||
2534 | // foreach (ulong handle in handles) | ||
2535 | // { | ||
2536 | // uint x, y; | ||
2537 | // Utils.LongToUInts(handle, out x, out y); | ||
2538 | // x = x / Constants.RegionSize; | ||
2539 | // y = y / Constants.RegionSize; | ||
2540 | // m_log.InfoFormat("({0}, {1})", x, y); | ||
2541 | // } | ||
2542 | // } | ||
2543 | */ | ||
2544 | #endregion | 2521 | #endregion |
2545 | 2522 | ||
2546 | #region Agent Arrived | 2523 | #region Agent Arrived |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 7a6a174..361bf34 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -84,13 +84,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
84 | 84 | ||
85 | public void InitialiseService(IConfigSource configSource) | 85 | public void InitialiseService(IConfigSource configSource) |
86 | { | 86 | { |
87 | ServiceVersion = "SIMULATION/0.2"; | 87 | ServiceVersion = "SIMULATION/0.3"; |
88 | IConfig config = configSource.Configs["SimulationService"]; | 88 | IConfig config = configSource.Configs["SimulationService"]; |
89 | if (config != null) | 89 | if (config != null) |
90 | { | 90 | { |
91 | ServiceVersion = config.GetString("ConnectorProtocolVersion", ServiceVersion); | 91 | ServiceVersion = config.GetString("ConnectorProtocolVersion", ServiceVersion); |
92 | 92 | ||
93 | if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2") | 93 | if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2" && ServiceVersion != "SIMULATION/0.3") |
94 | throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion)); | 94 | throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion)); |
95 | 95 | ||
96 | m_log.InfoFormat( | 96 | m_log.InfoFormat( |