aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2009-10-14 05:10:43 +0100
committerMelanie2009-10-14 05:10:43 +0100
commitd83ace0d3ba3178aab852ae4ed63ea3953ea7c52 (patch)
tree56575e321d60daaf36fa5b3261f4ed9154826566 /OpenSim/Region/Framework
parent* Split Task category into Task and State (diff)
parentSet the estate owner to be the master avatar if it's not set. (diff)
downloadopensim-SC_OLD-d83ace0d3ba3178aab852ae4ed63ea3953ea7c52.zip
opensim-SC_OLD-d83ace0d3ba3178aab852ae4ed63ea3953ea7c52.tar.gz
opensim-SC_OLD-d83ace0d3ba3178aab852ae4ed63ea3953ea7c52.tar.bz2
opensim-SC_OLD-d83ace0d3ba3178aab852ae4ed63ea3953ea7c52.tar.xz
Merge branch 'master' into htb-throttle
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IHyperService.cs37
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs98
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs114
5 files changed, 209 insertions, 75 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IHyperService.cs b/OpenSim/Region/Framework/Interfaces/IHyperService.cs
new file mode 100644
index 0000000..51ea28a
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IHyperService.cs
@@ -0,0 +1,37 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27using System;
28using OpenMetaverse;
29
30namespace OpenSim.Region.Framework.Interfaces
31{
32 public interface IHyperAssetService
33 {
34 string GetUserAssetServer(UUID userID);
35 string GetSimAssetServer();
36 }
37}
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
index b6fa41d..244ac3b 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework;
35using OpenSim.Framework.Communications.Cache; 35using OpenSim.Framework.Communications.Cache;
36using OpenSim.Framework.Communications.Clients; 36using OpenSim.Framework.Communications.Clients;
37using OpenSim.Region.Framework.Scenes.Serialization; 37using OpenSim.Region.Framework.Scenes.Serialization;
38using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
39 40
40//using HyperGrid.Framework; 41//using HyperGrid.Framework;
@@ -52,13 +53,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
52 53
53 private Scene m_scene; 54 private Scene m_scene;
54 55
55 private IHyperlinkService m_hyper; 56 private IHyperAssetService m_hyper;
56 IHyperlinkService HyperlinkService 57 IHyperAssetService HyperlinkAssets
57 { 58 {
58 get 59 get
59 { 60 {
60 if (m_hyper == null) 61 if (m_hyper == null)
61 m_hyper = m_scene.RequestModuleInterface<IHyperlinkService>(); 62 m_hyper = m_scene.RequestModuleInterface<IHyperAssetService>();
62 return m_hyper; 63 return m_hyper;
63 } 64 }
64 } 65 }
@@ -99,7 +100,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
99 100
100 if (asset != null) 101 if (asset != null)
101 { 102 {
102 m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Name + " " + assetID); 103 m_log.DebugFormat("[HGScene]: Copied asset {0} from {1} to local asset server. ", asset.ID, url);
103 return asset; 104 return asset;
104 } 105 }
105 return null; 106 return null;
@@ -129,6 +130,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
129 } 130 }
130 131
131 m_scene.AssetService.Store(asset1); 132 m_scene.AssetService.Store(asset1);
133 m_log.DebugFormat("[HGScene]: Posted copy of asset {0} from local asset server to {1}", asset1.ID, url);
132 } 134 }
133 return true; 135 return true;
134 } 136 }
@@ -167,34 +169,32 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
167 169
168 public void Get(UUID assetID, UUID ownerID) 170 public void Get(UUID assetID, UUID ownerID)
169 { 171 {
170 if (!HyperlinkService.IsLocalUser(ownerID)) 172 // Get the item from the remote asset server onto the local AssetCache
173 // and place an entry in m_assetMap
174
175 string userAssetURL = HyperlinkAssets.GetUserAssetServer(ownerID);
176 if ((userAssetURL != string.Empty) && (userAssetURL != HyperlinkAssets.GetSimAssetServer()))
171 { 177 {
172 // Get the item from the remote asset server onto the local AssetCache 178 m_log.Debug("[HGScene]: Fetching object " + assetID + " from asset server " + userAssetURL);
173 // and place an entry in m_assetMap 179 AssetBase asset = FetchAsset(userAssetURL, assetID);
174 180
175 string userAssetURL = UserAssetURL(ownerID); 181 if (asset != null)
176 if (userAssetURL != null)
177 { 182 {
178 m_log.Debug("[HGScene]: Fetching object " + assetID + " to asset server " + userAssetURL); 183 // OK, now fetch the inside.
179 AssetBase asset = FetchAsset(userAssetURL, assetID); 184 Dictionary<UUID, int> ids = new Dictionary<UUID, int>();
185 HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL);
186 uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids);
187 foreach (UUID uuid in ids.Keys)
188 FetchAsset(userAssetURL, uuid);
189
190 m_log.DebugFormat("[HGScene]: Successfully fetched asset {0} from asset server {1}", asset.ID, userAssetURL);
180 191
181 if (asset != null)
182 {
183 m_log.Debug("[HGScene]: Successfully fetched item from remote asset server " + userAssetURL);
184
185 // OK, now fetch the inside.
186 Dictionary<UUID, int> ids = new Dictionary<UUID, int>();
187 HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL);
188 uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids);
189 foreach (UUID uuid in ids.Keys)
190 FetchAsset(userAssetURL, uuid);
191 }
192 else
193 m_log.Warn("[HGScene]: Could not fetch asset from remote asset server " + userAssetURL);
194 } 192 }
195 else 193 else
196 m_log.Warn("[HGScene]: Unable to locate foreign user's asset server"); 194 m_log.Warn("[HGScene]: Could not fetch asset from remote asset server " + userAssetURL);
197 } 195 }
196 else
197 m_log.Debug("[HGScene]: user's asset server is the local region's asset server");
198 } 198 }
199 199
200 //public InventoryItemBase Get(InventoryItemBase item, UUID rootFolder, CachedUserInfo userInfo) 200 //public InventoryItemBase Get(InventoryItemBase item, UUID rootFolder, CachedUserInfo userInfo)
@@ -225,44 +225,38 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
225 225
226 public void Post(UUID assetID, UUID ownerID) 226 public void Post(UUID assetID, UUID ownerID)
227 { 227 {
228 if (!HyperlinkService.IsLocalUser(ownerID))
229 {
230 // Post the item from the local AssetCache onto the remote asset server 228 // Post the item from the local AssetCache onto the remote asset server
231 // and place an entry in m_assetMap 229 // and place an entry in m_assetMap
232 230
233 string userAssetURL = UserAssetURL(ownerID); 231 string userAssetURL = HyperlinkAssets.GetUserAssetServer(ownerID);
234 if (userAssetURL != null) 232 if ((userAssetURL != string.Empty) && (userAssetURL != HyperlinkAssets.GetSimAssetServer()))
233 {
234 m_log.Debug("[HGScene]: Posting object " + assetID + " to asset server " + userAssetURL);
235 AssetBase asset = m_scene.AssetService.Get(assetID.ToString());
236 if (asset != null)
235 { 237 {
236 m_log.Debug("[HGScene]: Posting object " + assetID + " to asset server " + userAssetURL); 238 Dictionary<UUID, int> ids = new Dictionary<UUID, int>();
237 AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); 239 HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, string.Empty);
238 if (asset != null) 240 uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids);
241 foreach (UUID uuid in ids.Keys)
239 { 242 {
240 Dictionary<UUID, int> ids = new Dictionary<UUID, int>(); 243 asset = m_scene.AssetService.Get(uuid.ToString());
241 HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, string.Empty); 244 if (asset == null)
242 uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); 245 m_log.DebugFormat("[HGScene]: Could not find asset {0}", uuid);
243 foreach (UUID uuid in ids.Keys) 246 else
244 {
245 asset = m_scene.AssetService.Get(uuid.ToString());
246 if (asset != null)
247 m_log.DebugFormat("[HGScene]: Posting {0} {1}", asset.Type.ToString(), asset.Name);
248 else
249 m_log.DebugFormat("[HGScene]: Could not find asset {0}", uuid);
250 PostAsset(userAssetURL, asset); 247 PostAsset(userAssetURL, asset);
251 } 248 }
252 249
253 if (ids.Count > 0) // maybe it succeeded... 250 // maybe all pieces got there...
254 m_log.DebugFormat("[HGScene]: Successfully posted item {0} to remote asset server {1}", assetID, userAssetURL); 251 m_log.DebugFormat("[HGScene]: Successfully posted item {0} to asset server {1}", assetID, userAssetURL);
255 else
256 m_log.WarnFormat("[HGScene]: Could not post asset {0} to remote asset server {1}", assetID, userAssetURL);
257 252
258 }
259 else
260 m_log.Debug("[HGScene]: Something wrong with asset, it could not be found");
261 } 253 }
262 else 254 else
263 m_log.Warn("[HGScene]: Unable to locate foreign user's asset server"); 255 m_log.DebugFormat("[HGScene]: Something wrong with asset {0}, it could not be found", assetID);
264
265 } 256 }
257 else
258 m_log.Debug("[HGScene]: user's asset server is local region's asset server");
259
266 } 260 }
267 261
268 #endregion 262 #endregion
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs
index 8fe3565..6f7f34f 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs
@@ -32,6 +32,7 @@ using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Communications; 33using OpenSim.Framework.Communications;
34using OpenSim.Framework.Communications.Cache; 34using OpenSim.Framework.Communications.Cache;
35using OpenSim.Region.Framework.Interfaces;
35 36
36namespace OpenSim.Region.Framework.Scenes.Hypergrid 37namespace OpenSim.Region.Framework.Scenes.Hypergrid
37{ 38{
@@ -41,6 +42,21 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 43
43 private HGAssetMapper m_assMapper; 44 private HGAssetMapper m_assMapper;
45 public HGAssetMapper AssetMapper
46 {
47 get { return m_assMapper; }
48 }
49
50 private IHyperAssetService m_hyper;
51 private IHyperAssetService HyperAssets
52 {
53 get
54 {
55 if (m_hyper == null)
56 m_hyper = RequestModuleInterface<IHyperAssetService>();
57 return m_hyper;
58 }
59 }
44 60
45 #endregion 61 #endregion
46 62
@@ -140,6 +156,16 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
140 156
141 } 157 }
142 158
159 protected override void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
160 {
161 string userAssetServer = HyperAssets.GetUserAssetServer(sender);
162 if ((userAssetServer != string.Empty) && (userAssetServer != HyperAssets.GetSimAssetServer()))
163 m_assMapper.Get(item.AssetID, sender);
164
165 userAssetServer = HyperAssets.GetUserAssetServer(receiver);
166 if ((userAssetServer != string.Empty) && (userAssetServer != HyperAssets.GetSimAssetServer()))
167 m_assMapper.Post(item.AssetID, receiver);
168 }
143 169
144 #endregion 170 #endregion
145 171
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 1917228..0cb5682 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -408,7 +408,7 @@ namespace OpenSim.Region.Framework.Scenes
408 public virtual InventoryItemBase GiveInventoryItem( 408 public virtual InventoryItemBase GiveInventoryItem(
409 UUID recipient, UUID senderId, UUID itemId, UUID recipientFolderId) 409 UUID recipient, UUID senderId, UUID itemId, UUID recipientFolderId)
410 { 410 {
411 Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); 411 //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem");
412 412
413 InventoryItemBase item = new InventoryItemBase(itemId, senderId); 413 InventoryItemBase item = new InventoryItemBase(itemId, senderId);
414 item = InventoryService.GetItem(item); 414 item = InventoryService.GetItem(item);
@@ -472,7 +472,8 @@ namespace OpenSim.Region.Framework.Scenes
472 itemCopy.SalePrice = item.SalePrice; 472 itemCopy.SalePrice = item.SalePrice;
473 itemCopy.SaleType = item.SaleType; 473 itemCopy.SaleType = item.SaleType;
474 474
475 InventoryService.AddItem(itemCopy); 475 if (InventoryService.AddItem(itemCopy))
476 TransferInventoryAssets(itemCopy, senderId, recipient);
476 477
477 if (!Permissions.BypassPermissions()) 478 if (!Permissions.BypassPermissions())
478 { 479 {
@@ -494,6 +495,10 @@ namespace OpenSim.Region.Framework.Scenes
494 495
495 } 496 }
496 497
498 protected virtual void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
499 {
500 }
501
497 /// <summary> 502 /// <summary>
498 /// Give an entire inventory folder from one user to another. The entire contents (including all descendent 503 /// Give an entire inventory folder from one user to another. The entire contents (including all descendent
499 /// folders) is given. 504 /// folders) is given.
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1ca0267..9f14761 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1772,36 +1772,86 @@ namespace OpenSim.Region.Framework.Scenes
1772 1772
1773 Vector3 pos = attemptedPosition; 1773 Vector3 pos = attemptedPosition;
1774 1774
1775 int changeX = 1;
1776 int changeY = 1;
1777
1775 if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) 1778 if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W))
1776 { 1779 {
1777 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) 1780 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
1778 { 1781 {
1779 //Border crossedBorderx = GetCrossedBorder(attemptedPosition,Cardinals.W); 1782
1780 //Border crossedBordery = GetCrossedBorder(attemptedPosition, Cardinals.S); 1783 Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
1784
1785 if (crossedBorderx.BorderLine.Z > 0)
1786 {
1787 pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
1788 changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize);
1789 }
1790 else
1791 pos.X = ((pos.X + Constants.RegionSize));
1792
1793 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1781 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) 1794 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1782 pos.X = ((pos.X + Constants.RegionSize)); 1795
1783 pos.Y = ((pos.Y + Constants.RegionSize)); 1796 if (crossedBordery.BorderLine.Z > 0)
1797 {
1798 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1799 }
1800 else
1801 pos.Y = ((pos.Y + Constants.RegionSize));
1802
1803
1804
1784 newRegionHandle 1805 newRegionHandle
1785 = Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), 1806 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
1786 (uint)((thisy - 1) * Constants.RegionSize)); 1807 (uint)((thisy - changeY) * Constants.RegionSize));
1787 // x - 1 1808 // x - 1
1788 // y - 1 1809 // y - 1
1789 } 1810 }
1790 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) 1811 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
1791 { 1812 {
1792 pos.X = ((pos.X + Constants.RegionSize)); 1813 Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
1793 pos.Y = ((pos.Y - Constants.RegionSize)); 1814
1815 if (crossedBorderx.BorderLine.Z > 0)
1816 {
1817 pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
1818 changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
1819 }
1820 else
1821 pos.X = ((pos.X + Constants.RegionSize));
1822
1823
1824 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1825 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1826
1827 if (crossedBordery.BorderLine.Z > 0)
1828 {
1829 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1830 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
1831 }
1832 else
1833 pos.Y = ((pos.Y + Constants.RegionSize));
1834
1794 newRegionHandle 1835 newRegionHandle
1795 = Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), 1836 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
1796 (uint)((thisy + 1) * Constants.RegionSize)); 1837 (uint)((thisy + changeY) * Constants.RegionSize));
1797 // x - 1 1838 // x - 1
1798 // y + 1 1839 // y + 1
1799 } 1840 }
1800 else 1841 else
1801 { 1842 {
1802 pos.X = ((pos.X + Constants.RegionSize)); 1843 Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
1844
1845 if (crossedBorderx.BorderLine.Z > 0)
1846 {
1847 pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
1848 changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
1849 }
1850 else
1851 pos.X = ((pos.X + Constants.RegionSize));
1852
1803 newRegionHandle 1853 newRegionHandle
1804 = Util.UIntsToLong((uint) ((thisx - 1)*Constants.RegionSize), 1854 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
1805 (uint) (thisy*Constants.RegionSize)); 1855 (uint) (thisy*Constants.RegionSize));
1806 // x - 1 1856 // x - 1
1807 } 1857 }
@@ -1810,11 +1860,23 @@ namespace OpenSim.Region.Framework.Scenes
1810 { 1860 {
1811 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) 1861 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
1812 { 1862 {
1863
1813 pos.X = ((pos.X - Constants.RegionSize)); 1864 pos.X = ((pos.X - Constants.RegionSize));
1814 pos.Y = ((pos.Y + Constants.RegionSize)); 1865 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1866 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1867
1868 if (crossedBordery.BorderLine.Z > 0)
1869 {
1870 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1871 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
1872 }
1873 else
1874 pos.Y = ((pos.Y + Constants.RegionSize));
1875
1876
1815 newRegionHandle 1877 newRegionHandle
1816 = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), 1878 = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
1817 (uint)((thisy - 1) * Constants.RegionSize)); 1879 (uint)((thisy - changeY) * Constants.RegionSize));
1818 // x + 1 1880 // x + 1
1819 // y - 1 1881 // y - 1
1820 } 1882 }
@@ -1823,8 +1885,8 @@ namespace OpenSim.Region.Framework.Scenes
1823 pos.X = ((pos.X - Constants.RegionSize)); 1885 pos.X = ((pos.X - Constants.RegionSize));
1824 pos.Y = ((pos.Y - Constants.RegionSize)); 1886 pos.Y = ((pos.Y - Constants.RegionSize));
1825 newRegionHandle 1887 newRegionHandle
1826 = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), 1888 = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
1827 (uint)((thisy + 1) * Constants.RegionSize)); 1889 (uint)((thisy + changeY) * Constants.RegionSize));
1828 // x + 1 1890 // x + 1
1829 // y + 1 1891 // y + 1
1830 } 1892 }
@@ -1832,16 +1894,26 @@ namespace OpenSim.Region.Framework.Scenes
1832 { 1894 {
1833 pos.X = ((pos.X - Constants.RegionSize)); 1895 pos.X = ((pos.X - Constants.RegionSize));
1834 newRegionHandle 1896 newRegionHandle
1835 = Util.UIntsToLong((uint) ((thisx + 1)*Constants.RegionSize), 1897 = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
1836 (uint) (thisy*Constants.RegionSize)); 1898 (uint) (thisy*Constants.RegionSize));
1837 // x + 1 1899 // x + 1
1838 } 1900 }
1839 } 1901 }
1840 else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) 1902 else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
1841 { 1903 {
1842 pos.Y = ((pos.Y + Constants.RegionSize)); 1904 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1905 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1906
1907 if (crossedBordery.BorderLine.Z > 0)
1908 {
1909 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1910 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
1911 }
1912 else
1913 pos.Y = ((pos.Y + Constants.RegionSize));
1914
1843 newRegionHandle 1915 newRegionHandle
1844 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - 1) * Constants.RegionSize)); 1916 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - changeY) * Constants.RegionSize));
1845 // y - 1 1917 // y - 1
1846 } 1918 }
1847 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) 1919 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
@@ -1849,7 +1921,7 @@ namespace OpenSim.Region.Framework.Scenes
1849 1921
1850 pos.Y = ((pos.Y - Constants.RegionSize)); 1922 pos.Y = ((pos.Y - Constants.RegionSize));
1851 newRegionHandle 1923 newRegionHandle
1852 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + 1) * Constants.RegionSize)); 1924 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize));
1853 // y + 1 1925 // y + 1
1854 } 1926 }
1855 1927