aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Data/PGSQL/PGSQLSimulationData.cs7
-rw-r--r--OpenSim/Data/PGSQL/Resources/RegionStore.migrations14
-rw-r--r--OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs64
-rw-r--r--OpenSim/Framework/ILandChannel.cs2
-rw-r--r--OpenSim/Framework/ILandObject.cs2
-rw-r--r--OpenSim/Framework/LandData.cs12
-rw-r--r--OpenSim/Region/Application/Application.cs7
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs6
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/DwellModule.cs27
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandChannel.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs65
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs57
-rw-r--r--OpenSim/Region/Framework/Interfaces/IDwellModule.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs14
-rw-r--r--OpenSim/Server/Handlers/Land/LandHandlers.cs1
-rw-r--r--OpenSim/Server/ServerMain.cs4
-rw-r--r--OpenSim/Services/Connectors/Land/LandServicesConnector.cs2
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs11
-rw-r--r--OpenSim/Tests/Common/Mock/TestLandChannel.cs5
22 files changed, 244 insertions, 79 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index 625120b..f4af40b 100755
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -1789,6 +1789,7 @@ namespace OpenSim.Data.PGSQL
1789 prim.CollisionSoundVolume = Convert.ToSingle(primRow["CollisionSoundVolume"]); 1789 prim.CollisionSoundVolume = Convert.ToSingle(primRow["CollisionSoundVolume"]);
1790 1790
1791 prim.PassTouches = (bool)primRow["PassTouches"]; 1791 prim.PassTouches = (bool)primRow["PassTouches"];
1792 prim.PassCollisions = (bool)primRow["PassCollisions"];
1792 1793
1793 if (!(primRow["MediaURL"] is System.DBNull)) 1794 if (!(primRow["MediaURL"] is System.DBNull))
1794 prim.MediaUrl = (string)primRow["MediaURL"]; 1795 prim.MediaUrl = (string)primRow["MediaURL"];
@@ -2212,7 +2213,7 @@ namespace OpenSim.Data.PGSQL
2212 parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume)); 2213 parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume));
2213 2214
2214 parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches)); 2215 parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches));
2215 parameters.Add(_Database.CreateParameter("PassCollisions", prim.PassCollisions)); 2216 parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions));
2216 2217
2217 2218
2218 if (prim.PassTouches) 2219 if (prim.PassTouches)
@@ -2221,9 +2222,9 @@ namespace OpenSim.Data.PGSQL
2221 parameters.Add(_Database.CreateParameter("PassTouches", false)); 2222 parameters.Add(_Database.CreateParameter("PassTouches", false));
2222 2223
2223 if (prim.PassCollisions) 2224 if (prim.PassCollisions)
2224 parameters.Add(_Database.CreateParameter("PassCollisions", 1)); 2225 parameters.Add(_Database.CreateParameter("PassCollisions", true));
2225 else 2226 else
2226 parameters.Add(_Database.CreateParameter("PassCollisions", 0)); 2227 parameters.Add(_Database.CreateParameter("PassCollisions", false));
2227 2228
2228 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); 2229 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
2229 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); 2230 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
index 948d177..fcefb6b 100644
--- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
@@ -1211,3 +1211,17 @@ BEGIN TRANSACTION;
1211ALTER TABLE prims ADD "PhysInertia" TEXT; 1211ALTER TABLE prims ADD "PhysInertia" TEXT;
1212 1212
1213COMMIT; 1213COMMIT;
1214
1215
1216:VERSION 47 #---- Convert field PassCollisions in table prims to BOOLEAN
1217
1218BEGIN TRANSACTION;
1219
1220ALTER TABLE "public"."prims" ALTER COLUMN "PassCollisions" DROP DEFAULT;
1221ALTER TABLE "public"."prims"
1222 ALTER COLUMN "PassCollisions" TYPE BOOLEAN
1223 USING CASE WHEN "PassCollisions" = 0 THEN FALSE
1224 WHEN "PassCollisions" = 1 THEN TRUE
1225 ELSE NULL
1226 END;
1227COMMIT;
diff --git a/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs b/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs
index 55ec13e..816523b 100644
--- a/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs
+++ b/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs
@@ -74,21 +74,19 @@ namespace OpenSim.Framework
74 { 74 {
75 rwLock.EnterWriteLock(); 75 rwLock.EnterWriteLock();
76 gotLock = true; 76 gotLock = true;
77 if (Dictionary1.ContainsKey(key1))
78 {
79 if (!Dictionary2.ContainsKey(key2))
80 throw new ArgumentException("key1 exists in the dictionary but not key2");
81 }
82 else if (Dictionary2.ContainsKey(key2))
83 {
84 if (!Dictionary1.ContainsKey(key1))
85 throw new ArgumentException("key2 exists in the dictionary but not key1");
86 }
87 Dictionary1[key1] = value;
88 Dictionary2[key2] = value;
77 } 89 }
78
79 if (Dictionary1.ContainsKey(key1))
80 {
81 if (!Dictionary2.ContainsKey(key2))
82 throw new ArgumentException("key1 exists in the dictionary but not key2");
83 }
84 else if (Dictionary2.ContainsKey(key2))
85 {
86 if (!Dictionary1.ContainsKey(key1))
87 throw new ArgumentException("key2 exists in the dictionary but not key1");
88 }
89
90 Dictionary1[key1] = value;
91 Dictionary2[key2] = value;
92 } 90 }
93 finally 91 finally
94 { 92 {
@@ -112,10 +110,9 @@ namespace OpenSim.Framework
112 { 110 {
113 rwLock.EnterWriteLock(); 111 rwLock.EnterWriteLock();
114 gotLock = true; 112 gotLock = true;
113 Dictionary1.Remove(key1);
114 success = Dictionary2.Remove(key2);
115 } 115 }
116
117 Dictionary1.Remove(key1);
118 success = Dictionary2.Remove(key2);
119 } 116 }
120 finally 117 finally
121 { 118 {
@@ -151,8 +148,12 @@ namespace OpenSim.Framework
151 { 148 {
152 if (kvp.Value.Equals(value)) 149 if (kvp.Value.Equals(value))
153 { 150 {
154 Dictionary1.Remove(key1); 151 try { }
155 Dictionary2.Remove(kvp.Key); 152 finally
153 {
154 Dictionary1.Remove(key1);
155 Dictionary2.Remove(kvp.Key);
156 }
156 found = true; 157 found = true;
157 break; 158 break;
158 } 159 }
@@ -193,8 +194,12 @@ namespace OpenSim.Framework
193 { 194 {
194 if (kvp.Value.Equals(value)) 195 if (kvp.Value.Equals(value))
195 { 196 {
196 Dictionary2.Remove(key2); 197 try { }
197 Dictionary1.Remove(kvp.Key); 198 finally
199 {
200 Dictionary2.Remove(key2);
201 Dictionary1.Remove(kvp.Key);
202 }
198 found = true; 203 found = true;
199 break; 204 break;
200 } 205 }
@@ -224,10 +229,9 @@ namespace OpenSim.Framework
224 { 229 {
225 rwLock.EnterWriteLock(); 230 rwLock.EnterWriteLock();
226 gotLock = true; 231 gotLock = true;
232 Dictionary1.Clear();
233 Dictionary2.Clear();
227 } 234 }
228
229 Dictionary1.Clear();
230 Dictionary2.Clear();
231 } 235 }
232 finally 236 finally
233 { 237 {
@@ -485,15 +489,15 @@ namespace OpenSim.Framework
485 try {} 489 try {}
486 finally 490 finally
487 { 491 {
488 rwLock.EnterUpgradeableReadLock(); 492 rwLock.EnterWriteLock();
489 gotWriteLock = true; 493 gotWriteLock = true;
490 }
491 494
492 for (int i = 0; i < list.Count; i++) 495 for (int i = 0; i < list.Count; i++)
493 Dictionary1.Remove(list[i]); 496 Dictionary1.Remove(list[i]);
494 497
495 for (int i = 0; i < list2.Count; i++) 498 for (int i = 0; i < list2.Count; i++)
496 Dictionary2.Remove(list2[i]); 499 Dictionary2.Remove(list2[i]);
500 }
497 } 501 }
498 finally 502 finally
499 { 503 {
diff --git a/OpenSim/Framework/ILandChannel.cs b/OpenSim/Framework/ILandChannel.cs
index 44a24b9..12a8228 100644
--- a/OpenSim/Framework/ILandChannel.cs
+++ b/OpenSim/Framework/ILandChannel.cs
@@ -76,6 +76,8 @@ namespace OpenSim.Region.Framework.Interfaces
76 /// <returns></returns> 76 /// <returns></returns>
77 ILandObject GetLandObject(int localID); 77 ILandObject GetLandObject(int localID);
78 78
79 ILandObject GetLandObject(UUID GlobalID);
80
79 /// <summary> 81 /// <summary>
80 /// Clear the land channel of all parcels. 82 /// Clear the land channel of all parcels.
81 /// </summary> 83 /// </summary>
diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs
index f3b850d..a783256 100644
--- a/OpenSim/Framework/ILandObject.cs
+++ b/OpenSim/Framework/ILandObject.cs
@@ -189,5 +189,7 @@ namespace OpenSim.Framework
189 /// </summary> 189 /// </summary>
190 /// <returns>The music url.</returns> 190 /// <returns>The music url.</returns>
191 string GetMusicUrl(); 191 string GetMusicUrl();
192
193 void Clear();
192 } 194 }
193} 195}
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index 13d2977..13b58be 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -97,7 +97,9 @@ namespace OpenSim.Framework
97 private bool _mediaLoop = false; 97 private bool _mediaLoop = false;
98 private bool _obscureMusic = false; 98 private bool _obscureMusic = false;
99 private bool _obscureMedia = false; 99 private bool _obscureMedia = false;
100 private float _dwell = 0; 100
101 private float m_dwell = 0;
102 public double LastDwellTimeMS;
101 103
102 public bool SeeAVs { get; set; } 104 public bool SeeAVs { get; set; }
103 public bool AnyAVSounds { get; set; } 105 public bool AnyAVSounds { get; set; }
@@ -111,11 +113,12 @@ namespace OpenSim.Framework
111 { 113 {
112 get 114 get
113 { 115 {
114 return _dwell; 116 return m_dwell;
115 } 117 }
116 set 118 set
117 { 119 {
118 _dwell = value; 120 m_dwell = value;
121 LastDwellTimeMS = Util.GetTimeStampMS();
119 } 122 }
120 } 123 }
121 124
@@ -735,6 +738,7 @@ namespace OpenSim.Framework
735 SeeAVs = true; 738 SeeAVs = true;
736 AnyAVSounds = true; 739 AnyAVSounds = true;
737 GroupAVSounds = true; 740 GroupAVSounds = true;
741 LastDwellTimeMS = Util.GetTimeStampMS();
738 } 742 }
739 743
740 /// <summary> 744 /// <summary>
@@ -784,7 +788,7 @@ namespace OpenSim.Framework
784 landData._obscureMedia = _obscureMedia; 788 landData._obscureMedia = _obscureMedia;
785 landData._simwideArea = _simwideArea; 789 landData._simwideArea = _simwideArea;
786 landData._simwidePrims = _simwidePrims; 790 landData._simwidePrims = _simwidePrims;
787 landData._dwell = _dwell; 791 landData.m_dwell = m_dwell;
788 landData.SeeAVs = SeeAVs; 792 landData.SeeAVs = SeeAVs;
789 landData.AnyAVSounds = AnyAVSounds; 793 landData.AnyAVSounds = AnyAVSounds;
790 landData.GroupAVSounds = GroupAVSounds; 794 landData.GroupAVSounds = GroupAVSounds;
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 5cb6a88..bc6d7b3 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -74,7 +74,12 @@ namespace OpenSim
74 AppDomain.CurrentDomain.UnhandledException += 74 AppDomain.CurrentDomain.UnhandledException +=
75 new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 75 new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
76 76
77 ServicePointManager.DefaultConnectionLimit = 12; 77 if(Util.IsWindows())
78 ServicePointManager.DefaultConnectionLimit = 32;
79 else
80 ServicePointManager.DefaultConnectionLimit = 12;
81
82 ServicePointManager.Expect100Continue = false;
78 ServicePointManager.UseNagleAlgorithm = false; 83 ServicePointManager.UseNagleAlgorithm = false;
79 84
80 // Add the arguments supplied when running the application to the configuration 85 // Add the arguments supplied when running the application to the configuration
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 5b3c3e6..298c933 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3111,10 +3111,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3111 3111
3112 public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y) 3112 public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
3113 { 3113 {
3114 float dwell = 0.0f;
3115 IDwellModule dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
3116 if (dwellModule != null)
3117 dwell = dwellModule.GetDwell(land.GlobalID);
3118 ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); 3114 ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply);
3119 reply.AgentData.AgentID = m_agentId; 3115 reply.AgentData.AgentID = m_agentId;
3120 reply.Data.ParcelID = parcelID; 3116 reply.Data.ParcelID = parcelID;
@@ -3141,7 +3137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3141 reply.Data.GlobalZ = pos.Z; 3137 reply.Data.GlobalZ = pos.Z;
3142 reply.Data.SimName = Utils.StringToBytes(info.RegionName); 3138 reply.Data.SimName = Utils.StringToBytes(info.RegionName);
3143 reply.Data.SnapshotID = land.SnapshotID; 3139 reply.Data.SnapshotID = land.SnapshotID;
3144 reply.Data.Dwell = dwell; 3140 reply.Data.Dwell = land.Dwell;
3145 reply.Data.SalePrice = land.SalePrice; 3141 reply.Data.SalePrice = land.SalePrice;
3146 reply.Data.AuctionID = (int)land.AuctionID; 3142 reply.Data.AuctionID = (int)land.AuctionID;
3147 3143
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
index 21483c5..fb8c306 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
@@ -151,7 +151,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
151 x = rx - s.RegionInfo.WorldLocX; 151 x = rx - s.RegionInfo.WorldLocX;
152 y = ry - s.RegionInfo.WorldLocY; 152 y = ry - s.RegionInfo.WorldLocY;
153 regionAccess = s.RegionInfo.AccessLevel; 153 regionAccess = s.RegionInfo.AccessLevel;
154 return s.GetLandData(x, y); 154 LandData land = s.GetLandData(x, y);
155 IDwellModule dwellModule = s.RequestModuleInterface<IDwellModule>();
156 if (dwellModule != null)
157 land.Dwell = dwellModule.GetDwell(land);
158 return land;
155 } 159 }
156 } 160 }
157 m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle); 161 m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
index cad2061..8baf41a 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
@@ -143,6 +143,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
143 { 143 {
144 LandData land = s.GetLandData(x, y); 144 LandData land = s.GetLandData(x, y);
145 regionAccess = s.RegionInfo.AccessLevel; 145 regionAccess = s.RegionInfo.AccessLevel;
146 IDwellModule dwellModule = s.RequestModuleInterface<IDwellModule>();
147 if (dwellModule != null)
148 land.Dwell = dwellModule.GetDwell(land);
149
146 return land; 150 return land;
147 } 151 }
148 } 152 }
diff --git a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
index 70c6028..22480e6 100644
--- a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
@@ -53,7 +53,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
53namespace OpenSim.Region.CoreModules.World.Land 53namespace OpenSim.Region.CoreModules.World.Land
54{ 54{
55 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultDwellModule")] 55 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultDwellModule")]
56 public class DefaultDwellModule : IDwellModule, INonSharedRegionModule 56 public class DefaultDwellModule : INonSharedRegionModule, IDwellModule
57 { 57 {
58 private Scene m_scene; 58 private Scene m_scene;
59 private IConfigSource m_Config; 59 private IConfigSource m_Config;
@@ -88,16 +88,21 @@ namespace OpenSim.Region.CoreModules.World.Land
88 return; 88 return;
89 89
90 m_scene = scene; 90 m_scene = scene;
91 91 m_scene.RegisterModuleInterface<IDwellModule>(this);
92 m_scene.EventManager.OnNewClient += OnNewClient;
93 } 92 }
94 93
95 public void RegionLoaded(Scene scene) 94 public void RegionLoaded(Scene scene)
96 { 95 {
96 if (!m_Enabled)
97 return;
98 m_scene.EventManager.OnNewClient += OnNewClient;
97 } 99 }
98 100
99 public void RemoveRegion(Scene scene) 101 public void RemoveRegion(Scene scene)
100 { 102 {
103 if (!m_Enabled)
104 return;
105 m_scene.EventManager.OnNewClient -= OnNewClient;
101 } 106 }
102 107
103 public void Close() 108 public void Close()
@@ -115,12 +120,26 @@ namespace OpenSim.Region.CoreModules.World.Land
115 if (parcel == null) 120 if (parcel == null)
116 return; 121 return;
117 122
118 client.SendParcelDwellReply(localID, parcel.LandData.GlobalID, parcel.LandData.Dwell); 123 LandData land = parcel.LandData;
124 if(land!= null)
125 client.SendParcelDwellReply(localID, land.GlobalID, land.Dwell);
119 } 126 }
120 127
128
121 public int GetDwell(UUID parcelID) 129 public int GetDwell(UUID parcelID)
122 { 130 {
131 ILandObject parcel = m_scene.LandChannel.GetLandObject(parcelID);
132 if (parcel != null && parcel.LandData != null)
133 return (int)(parcel.LandData.Dwell);
134 return 0;
135 }
136
137 public int GetDwell(LandData land)
138 {
139 if (land != null)
140 return (int)(land.Dwell);
123 return 0; 141 return 0;
124 } 142 }
143
125 } 144 }
126} 145}
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
index e4c0373..b59e2af 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
@@ -106,6 +106,15 @@ namespace OpenSim.Region.CoreModules.World.Land
106 return null; 106 return null;
107 } 107 }
108 108
109 public ILandObject GetLandObject(UUID GlobalID)
110 {
111 if (m_landManagementModule != null)
112 {
113 return m_landManagementModule.GetLandObject(GlobalID);
114 }
115 return null;
116 }
117
109 public ILandObject GetLandObject(Vector3 position) 118 public ILandObject GetLandObject(Vector3 position)
110 { 119 {
111 return GetLandObject(position.X, position.Y); 120 return GetLandObject(position.X, position.Y);
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 53b9796..057e204 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -92,6 +92,7 @@ namespace OpenSim.Region.CoreModules.World.Land
92 92
93 //ubit: removed the readonly so i can move it around 93 //ubit: removed the readonly so i can move it around
94 private Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); 94 private Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
95 private Dictionary<UUID, int> m_landUUIDList = new Dictionary<UUID, int>();
95 96
96 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; 97 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
97 98
@@ -249,7 +250,10 @@ namespace OpenSim.Region.CoreModules.World.Land
249 lock (m_landList) 250 lock (m_landList)
250 { 251 {
251 if (m_landList.TryGetValue(local_id, out land)) 252 if (m_landList.TryGetValue(local_id, out land))
253 {
252 land.LandData = newData; 254 land.LandData = newData;
255 m_landUUIDList[newData.GlobalID] = local_id;
256 }
253 } 257 }
254 258
255 if (land != null) 259 if (land != null)
@@ -270,7 +274,11 @@ namespace OpenSim.Region.CoreModules.World.Land
270 //Remove all the land objects in the sim and add a blank, full sim land object set to public 274 //Remove all the land objects in the sim and add a blank, full sim land object set to public
271 lock (m_landList) 275 lock (m_landList)
272 { 276 {
277 foreach(ILandObject parcel in m_landList.Values)
278 parcel.Clear();
279
273 m_landList.Clear(); 280 m_landList.Clear();
281 m_landUUIDList.Clear();
274 m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; 282 m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
275 283
276 m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; 284 m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit];
@@ -588,10 +596,8 @@ namespace OpenSim.Region.CoreModules.World.Land
588 /// The land object being added. 596 /// The land object being added.
589 /// Will return null if this overlaps with an existing parcel that has not had its bitmap adjusted. 597 /// Will return null if this overlaps with an existing parcel that has not had its bitmap adjusted.
590 /// </param> 598 /// </param>
591 public ILandObject AddLandObject(ILandObject land) 599 public ILandObject AddLandObject(ILandObject new_land)
592 { 600 {
593 ILandObject new_land = land.Copy();
594
595 // Only now can we add the prim counts to the land object - we rely on the global ID which is generated 601 // Only now can we add the prim counts to the land object - we rely on the global ID which is generated
596 // as a random UUID inside LandData initialization 602 // as a random UUID inside LandData initialization
597 if (m_primCountModule != null) 603 if (m_primCountModule != null)
@@ -656,6 +662,7 @@ namespace OpenSim.Region.CoreModules.World.Land
656 } 662 }
657 663
658 m_landList.Add(newLandLocalID, new_land); 664 m_landList.Add(newLandLocalID, new_land);
665 m_landUUIDList[new_land.LandData.GlobalID] = newLandLocalID;
659 m_lastLandLocalID++; 666 m_lastLandLocalID++;
660 } 667 }
661 668
@@ -690,6 +697,9 @@ namespace OpenSim.Region.CoreModules.World.Land
690 697
691 land = m_landList[local_id]; 698 land = m_landList[local_id];
692 m_landList.Remove(local_id); 699 m_landList.Remove(local_id);
700 if(land.LandData != null)
701 m_landUUIDList.Remove(land.LandData.GlobalID);
702 land.Clear();
693 } 703 }
694 704
695 m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); 705 m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID);
@@ -740,11 +750,29 @@ namespace OpenSim.Region.CoreModules.World.Land
740 } 750 }
741 } 751 }
742 } 752 }
743 753 master.LandData.Dwell += slave.LandData.Dwell;
744 removeLandObject(slave.LandData.LocalID); 754 removeLandObject(slave.LandData.LocalID);
745 UpdateLandObject(master.LandData.LocalID, master.LandData); 755 UpdateLandObject(master.LandData.LocalID, master.LandData);
746 } 756 }
747 757
758 public ILandObject GetLandObject(UUID globalID)
759 {
760 lock (m_landList)
761 {
762 int lid = -1;
763 if(m_landUUIDList.TryGetValue(globalID, out lid) && lid >= 0)
764 {
765 if (m_landList.ContainsKey(lid))
766 {
767 return m_landList[lid];
768 }
769 else
770 m_landUUIDList.Remove(globalID); // auto heal
771 }
772 }
773 return null;
774 }
775
748 public ILandObject GetLandObject(int parcelLocalID) 776 public ILandObject GetLandObject(int parcelLocalID)
749 { 777 {
750 lock (m_landList) 778 lock (m_landList)
@@ -1351,7 +1379,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1351 1379
1352 public void ClientOnParcelObjectOwnerRequest(int local_id, IClientAPI remote_client) 1380 public void ClientOnParcelObjectOwnerRequest(int local_id, IClientAPI remote_client)
1353 { 1381 {
1354 ILandObject land; 1382 ILandObject land = null;
1355 lock (m_landList) 1383 lock (m_landList)
1356 { 1384 {
1357 m_landList.TryGetValue(local_id, out land); 1385 m_landList.TryGetValue(local_id, out land);
@@ -1360,7 +1388,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1360 if (land != null) 1388 if (land != null)
1361 { 1389 {
1362 m_scene.EventManager.TriggerParcelPrimCountUpdate(); 1390 m_scene.EventManager.TriggerParcelPrimCountUpdate();
1363 m_landList[local_id].SendLandObjectOwners(remote_client); 1391 land.SendLandObjectOwners(remote_client);
1364 } 1392 }
1365 else 1393 else
1366 { 1394 {
@@ -1370,7 +1398,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1370 1398
1371 public void ClientOnParcelGodForceOwner(int local_id, UUID ownerID, IClientAPI remote_client) 1399 public void ClientOnParcelGodForceOwner(int local_id, UUID ownerID, IClientAPI remote_client)
1372 { 1400 {
1373 ILandObject land; 1401 ILandObject land = null;
1374 lock (m_landList) 1402 lock (m_landList)
1375 { 1403 {
1376 m_landList.TryGetValue(local_id, out land); 1404 m_landList.TryGetValue(local_id, out land);
@@ -1393,7 +1421,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1393 1421
1394 public void ClientOnParcelAbandonRequest(int local_id, IClientAPI remote_client) 1422 public void ClientOnParcelAbandonRequest(int local_id, IClientAPI remote_client)
1395 { 1423 {
1396 ILandObject land; 1424 ILandObject land = null;
1397 lock (m_landList) 1425 lock (m_landList)
1398 { 1426 {
1399 m_landList.TryGetValue(local_id, out land); 1427 m_landList.TryGetValue(local_id, out land);
@@ -1417,7 +1445,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1417 1445
1418 public void ClientOnParcelReclaim(int local_id, IClientAPI remote_client) 1446 public void ClientOnParcelReclaim(int local_id, IClientAPI remote_client)
1419 { 1447 {
1420 ILandObject land; 1448 ILandObject land = null;
1421 lock (m_landList) 1449 lock (m_landList)
1422 { 1450 {
1423 m_landList.TryGetValue(local_id, out land); 1451 m_landList.TryGetValue(local_id, out land);
@@ -1503,17 +1531,16 @@ namespace OpenSim.Region.CoreModules.World.Land
1503 1531
1504 void ClientOnParcelDeedToGroup(int parcelLocalID, UUID groupID, IClientAPI remote_client) 1532 void ClientOnParcelDeedToGroup(int parcelLocalID, UUID groupID, IClientAPI remote_client)
1505 { 1533 {
1506 ILandObject land; 1534 ILandObject land = null;
1507 lock (m_landList) 1535 lock (m_landList)
1508 { 1536 {
1509 m_landList.TryGetValue(parcelLocalID, out land); 1537 m_landList.TryGetValue(parcelLocalID, out land);
1510 } 1538 }
1511 1539
1512 if (!m_scene.Permissions.CanDeedParcel(remote_client.AgentId, land))
1513 return;
1514
1515 if (land != null) 1540 if (land != null)
1516 { 1541 {
1542 if (!m_scene.Permissions.CanDeedParcel(remote_client.AgentId, land))
1543 return;
1517 land.DeedToGroup(groupID); 1544 land.DeedToGroup(groupID);
1518 } 1545 }
1519 } 1546 }
@@ -1587,8 +1614,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1587 1614
1588 private void IncomingLandObjectFromStorage(LandData data) 1615 private void IncomingLandObjectFromStorage(LandData data)
1589 { 1616 {
1590 ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); 1617 ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene, data);
1591 new_land.LandData = data.Copy();
1592 1618
1593 new_land.SetLandBitmapFromByteArray(); 1619 new_land.SetLandBitmapFromByteArray();
1594 AddLandObject(new_land); 1620 AddLandObject(new_land);
@@ -1763,7 +1789,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1763 land_update.GroupAVSounds = true; 1789 land_update.GroupAVSounds = true;
1764 } 1790 }
1765 1791
1766 ILandObject land; 1792 ILandObject land = null;
1767 lock (m_landList) 1793 lock (m_landList)
1768 { 1794 {
1769 m_landList.TryGetValue(parcelID, out land); 1795 m_landList.TryGetValue(parcelID, out land);
@@ -1926,6 +1952,9 @@ namespace OpenSim.Region.CoreModules.World.Land
1926 if (data.RegionHandle == m_scene.RegionInfo.RegionHandle) 1952 if (data.RegionHandle == m_scene.RegionInfo.RegionHandle)
1927 { 1953 {
1928 info = new GridRegion(m_scene.RegionInfo); 1954 info = new GridRegion(m_scene.RegionInfo);
1955 IDwellModule dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
1956 if (dwellModule != null)
1957 data.LandData.Dwell = dwellModule.GetDwell(data.LandData);
1929 } 1958 }
1930 else 1959 else
1931 { 1960 {
@@ -1951,7 +1980,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1951 1980
1952 public void setParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime) 1981 public void setParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime)
1953 { 1982 {
1954 ILandObject land; 1983 ILandObject land = null;
1955 lock (m_landList) 1984 lock (m_landList)
1956 { 1985 {
1957 m_landList.TryGetValue(localID, out land); 1986 m_landList.TryGetValue(localID, out land);
@@ -2248,7 +2277,7 @@ namespace OpenSim.Region.CoreModules.World.Land
2248 if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[2], out landLocalId)) 2277 if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[2], out landLocalId))
2249 return; 2278 return;
2250 2279
2251 ILandObject lo; 2280 ILandObject lo = null;
2252 2281
2253 lock (m_landList) 2282 lock (m_landList)
2254 { 2283 {
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 2b5cb31..b534a2b 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -58,6 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Land
58 58
59 protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>(); 59 protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>();
60 protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds 60 protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds
61 IDwellModule m_dwellModule;
61 62
62 private bool[,] m_landBitmap; 63 private bool[,] m_landBitmap;
63 public bool[,] LandBitmap 64 public bool[,] LandBitmap
@@ -268,27 +269,48 @@ namespace OpenSim.Region.CoreModules.World.Land
268 { 269 {
269 LandData = landData.Copy(); 270 LandData = landData.Copy();
270 m_scene = scene; 271 m_scene = scene;
272 m_scene.EventManager.OnFrame += OnFrame;
273 m_dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
271 } 274 }
272 275
273 public LandObject(UUID owner_id, bool is_group_owned, Scene scene) 276 public LandObject(UUID owner_id, bool is_group_owned, Scene scene, LandData data = null)
274 { 277 {
275 m_scene = scene; 278 m_scene = scene;
276 if (m_scene == null) 279 if (m_scene == null)
277 LandBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit]; 280 LandBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit];
278 else 281 else
282 {
279 LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; 283 LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit];
284 m_dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
285 }
286
287 if(data == null)
288 LandData = new LandData();
289 else
290 LandData = data;
280 291
281 LandData = new LandData();
282 LandData.OwnerID = owner_id; 292 LandData.OwnerID = owner_id;
283 if (is_group_owned) 293 if (is_group_owned)
284 LandData.GroupID = owner_id; 294 LandData.GroupID = owner_id;
285 else 295 else
286 LandData.GroupID = UUID.Zero; 296 LandData.GroupID = UUID.Zero;
297
287 LandData.IsGroupOwned = is_group_owned; 298 LandData.IsGroupOwned = is_group_owned;
288 299
300 if(m_dwellModule == null)
301 LandData.Dwell = 0;
302
289 m_scene.EventManager.OnFrame += OnFrame; 303 m_scene.EventManager.OnFrame += OnFrame;
290 } 304 }
291 305
306 public void Clear()
307 {
308 if(m_scene != null)
309 m_scene.EventManager.OnFrame -= OnFrame;
310 LandData = null;
311 }
312
313
292 #endregion 314 #endregion
293 315
294 #region Member Functions 316 #region Member Functions
@@ -1812,6 +1834,37 @@ namespace OpenSim.Region.CoreModules.World.Land
1812 ExpireAccessList(); 1834 ExpireAccessList();
1813 m_expiryCounter = 0; 1835 m_expiryCounter = 0;
1814 } 1836 }
1837
1838 // need to update dwell here bc landdata has no parent info
1839 if(LandData != null && m_dwellModule != null)
1840 {
1841 double now = Util.GetTimeStampMS();
1842 double elapsed = now - LandData.LastDwellTimeMS;
1843 if(elapsed > 150000) //2.5 minutes resolution / throttle
1844 {
1845 float dwell = LandData.Dwell;
1846 double cur = dwell * 60000.0;
1847 double decay = 1.5e-8 * cur * elapsed;
1848 cur -= decay;
1849 if(cur < 0)
1850 cur = 0;
1851
1852 UUID lgid = LandData.GlobalID;
1853 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
1854 {
1855 if(sp.IsNPC || sp.IsLoggingIn || sp.IsDeleted || sp.currentParcelUUID != lgid)
1856 return;
1857 cur += (now - sp.ParcelDwellTickMS);
1858 sp.ParcelDwellTickMS = now;
1859 });
1860
1861 float newdwell = (float)(cur * 1.666666666667e-5);
1862 LandData.Dwell = newdwell;
1863
1864 if(Math.Abs(newdwell - dwell) >= 0.9)
1865 m_scene.EventManager.TriggerLandObjectAdded(this);
1866 }
1867 }
1815 } 1868 }
1816 1869
1817 private void ExpireAccessList() 1870 private void ExpireAccessList()
diff --git a/OpenSim/Region/Framework/Interfaces/IDwellModule.cs b/OpenSim/Region/Framework/Interfaces/IDwellModule.cs
index db50439..ebef5a4 100644
--- a/OpenSim/Region/Framework/Interfaces/IDwellModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDwellModule.cs
@@ -33,5 +33,6 @@ namespace OpenSim.Region.Framework.Interfaces
33 public interface IDwellModule 33 public interface IDwellModule
34 { 34 {
35 int GetDwell(UUID parcelID); 35 int GetDwell(UUID parcelID);
36 int GetDwell(LandData land);
36 } 37 }
37} 38}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6d4cb52..805c9ad 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -170,6 +170,7 @@ namespace OpenSim.Region.Framework.Scenes
170 private bool m_previusParcelHide = false; 170 private bool m_previusParcelHide = false;
171 private bool m_currentParcelHide = false; 171 private bool m_currentParcelHide = false;
172 private object parcelLock = new Object(); 172 private object parcelLock = new Object();
173 public double ParcelDwellTickMS;
173 174
174 public UUID currentParcelUUID 175 public UUID currentParcelUUID
175 { 176 {
@@ -182,6 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
182 bool checksame = true; 183 bool checksame = true;
183 if (value != m_currentParcelUUID) 184 if (value != m_currentParcelUUID)
184 { 185 {
186 ParcelDwellTickMS = Util.GetTimeStampMS();
185 m_previusParcelHide = m_currentParcelHide; 187 m_previusParcelHide = m_currentParcelHide;
186 m_previusParcelUUID = m_currentParcelUUID; 188 m_previusParcelUUID = m_currentParcelUUID;
187 checksame = false; 189 checksame = false;
@@ -2141,6 +2143,7 @@ namespace OpenSim.Region.Framework.Scenes
2141 m_previusParcelUUID = UUID.Zero; 2143 m_previusParcelUUID = UUID.Zero;
2142 m_currentParcelHide = false; 2144 m_currentParcelHide = false;
2143 m_currentParcelUUID = UUID.Zero; 2145 m_currentParcelUUID = UUID.Zero;
2146 ParcelDwellTickMS = Util.GetTimeStampMS();
2144 2147
2145 if(!IsNPC) 2148 if(!IsNPC)
2146 { 2149 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 1808c34..cc98bbb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -160,7 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
160 ts.arc = arc; 160 ts.arc = arc;
161 ts.host = host; 161 ts.host = host;
162 162
163 ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); 163 ts.next = DateTime.UtcNow.AddSeconds(ts.interval);
164 164
165 AddSenseRepeater(ts); 165 AddSenseRepeater(ts);
166 } 166 }
@@ -196,14 +196,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
196 public void CheckSenseRepeaterEvents() 196 public void CheckSenseRepeaterEvents()
197 { 197 {
198 // Go through all timers 198 // Go through all timers
199 foreach (SensorInfo ts in SenseRepeaters) 199
200 List<SensorInfo> curSensors;
201 lock(SenseRepeatListLock)
202 curSensors = SenseRepeaters;
203
204 DateTime now = DateTime.UtcNow;
205 foreach (SensorInfo ts in curSensors)
200 { 206 {
201 // Time has passed? 207 // Time has passed?
202 if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) 208 if (ts.next < now)
203 { 209 {
204 SensorSweep(ts); 210 SensorSweep(ts);
205 // set next interval 211 // set next interval
206 ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); 212 ts.next = now.AddSeconds(ts.interval);
207 } 213 }
208 } 214 }
209 } 215 }
diff --git a/OpenSim/Server/Handlers/Land/LandHandlers.cs b/OpenSim/Server/Handlers/Land/LandHandlers.cs
index 150eaae..d74077a 100644
--- a/OpenSim/Server/Handlers/Land/LandHandlers.cs
+++ b/OpenSim/Server/Handlers/Land/LandHandlers.cs
@@ -85,6 +85,7 @@ namespace OpenSim.Server.Handlers.Land
85 hash["SnapshotID"] = landData.SnapshotID.ToString(); 85 hash["SnapshotID"] = landData.SnapshotID.ToString();
86 hash["UserLocation"] = landData.UserLocation.ToString(); 86 hash["UserLocation"] = landData.UserLocation.ToString();
87 hash["RegionAccess"] = regionAccess.ToString(); 87 hash["RegionAccess"] = regionAccess.ToString();
88 hash["Dwell"] = landData.Dwell.ToString();
88 } 89 }
89 90
90 XmlRpcResponse response = new XmlRpcResponse(); 91 XmlRpcResponse response = new XmlRpcResponse();
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 75aef5f..5e7e14f 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -76,8 +76,8 @@ namespace OpenSim.Server
76 76
77 public static int Main(string[] args) 77 public static int Main(string[] args)
78 { 78 {
79 // Make sure we don't get outbound connections queueing 79 ServicePointManager.DefaultConnectionLimit = 64;
80 ServicePointManager.DefaultConnectionLimit = 50; 80 ServicePointManager.Expect100Continue = false;
81 ServicePointManager.UseNagleAlgorithm = false; 81 ServicePointManager.UseNagleAlgorithm = false;
82 ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; 82 ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
83 83
diff --git a/OpenSim/Services/Connectors/Land/LandServicesConnector.cs b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
index 047880a..5492e83 100644
--- a/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
@@ -117,6 +117,8 @@ namespace OpenSim.Services.Connectors
117 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]); 117 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
118 if (hash["RegionAccess"] != null) 118 if (hash["RegionAccess"] != null)
119 regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]); 119 regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]);
120 if(hash["Dwell"] != null)
121 landData.Dwell = Convert.ToSingle((string)hash["Dwell"]);
120 m_log.DebugFormat("[LAND CONNECTOR]: Got land data for parcel {0}", landData.Name); 122 m_log.DebugFormat("[LAND CONNECTOR]: Got land data for parcel {0}", landData.Name);
121 } 123 }
122 catch (Exception e) 124 catch (Exception e)
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 9bf3cf8..8e3cf0e 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -376,7 +376,8 @@ namespace OpenSim.Services.HypergridService
376 return false; 376 return false;
377 } 377 }
378 378
379 if(account.PrincipalID == new UUID("6571e388-6218-4574-87db-f9379718315e")) 379 UUID agentID = aCircuit.AgentID;
380 if(agentID == new UUID("6571e388-6218-4574-87db-f9379718315e"))
380 { 381 {
381 // really? 382 // really?
382 reason = "Invalid account ID"; 383 reason = "Invalid account ID";
@@ -385,21 +386,21 @@ namespace OpenSim.Services.HypergridService
385 386
386 if(m_GridUserService != null) 387 if(m_GridUserService != null)
387 { 388 {
388 string PrincipalIDstr = account.PrincipalID.ToString(); 389 string PrincipalIDstr = agentID.ToString();
389 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(PrincipalIDstr); 390 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(PrincipalIDstr);
390 391
391 if(!m_allowDuplicatePresences) 392 if(!m_allowDuplicatePresences)
392 { 393 {
393 if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero) 394 if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero)
394 { 395 {
395 if(SendAgentGodKillToRegion(UUID.Zero, account.PrincipalID, guinfo)) 396 if(SendAgentGodKillToRegion(UUID.Zero, agentID, guinfo))
396 { 397 {
397 m_log.InfoFormat( 398 m_log.InfoFormat(
398 "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in", 399 "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in",
399 account.FirstName, account.LastName); 400 account.FirstName, account.LastName);
400 reason = "You appear to be already logged in on destiny grid " + 401 reason = "You appear to be already logged in on the destination grid " +
401 "Please wait a a minute or two and retry. " + 402 "Please wait a a minute or two and retry. " +
402 "If this takes longer than a few minutes please contact the grid owner. "; 403 "If this takes longer than a few minutes please contact the grid owner.";
403 return false; 404 return false;
404 } 405 }
405 } 406 }
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
index 3d44a33..48dc840 100644
--- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs
+++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
@@ -96,6 +96,11 @@ namespace OpenSim.Tests.Common
96 return GetNoLand(); 96 return GetNoLand();
97 } 97 }
98 98
99 public ILandObject GetLandObject(UUID ID)
100 {
101 return GetNoLand();
102 }
103
99 public ILandObject GetLandObject(float x, float y) 104 public ILandObject GetLandObject(float x, float y)
100 { 105 {
101 return GetNoLand(); 106 return GetNoLand();