aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2016-08-19 03:05:25 +0100
committerUbitUmarov2016-08-19 03:05:25 +0100
commit7ba3fb7b5d9c883b7a99d19f893ff6d43689b629 (patch)
tree1ea4937e30520d440979ab02e92882f6f54a3e73 /OpenSim/Region/CoreModules
parentfix entity update flags update (diff)
parent catch some NULL refs (diff)
downloadopensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.zip
opensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.tar.gz
opensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.tar.bz2
opensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.tar.xz
merge issue
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs146
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs19
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs13
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs53
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs60
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs12
7 files changed, 282 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index b72593c..eabeaf1 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -481,6 +481,151 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
481 return user.FirstName + " " + user.LastName; 481 return user.FirstName + " " + user.LastName;
482 } 482 }
483 483
484 public virtual Dictionary<UUID,string> GetUsersNames(string[] ids)
485 {
486 Dictionary<UUID,string> ret = new Dictionary<UUID,string>();
487 if(m_Scenes.Count <= 0)
488 return ret;
489
490 List<string> missing = new List<string>();
491 Dictionary<UUID,string> untried = new Dictionary<UUID, string>();
492
493 // look in cache
494 UserData userdata = new UserData();
495
496 UUID uuid = UUID.Zero;
497 foreach(string id in ids)
498 {
499 if(UUID.TryParse(id, out uuid))
500 {
501 lock (m_UserCache)
502 {
503 if (m_UserCache.TryGetValue(uuid, out userdata) &&
504 userdata.FirstName != "Unknown" && userdata.FirstName != string.Empty)
505 {
506 string name = userdata.FirstName + " " + userdata.LastName;
507
508 if(userdata.HasGridUserTried)
509 ret[uuid] = name;
510 else
511 {
512 untried[uuid] = name;
513 missing.Add(id);
514 }
515 }
516 else
517 missing.Add(id);
518 }
519 }
520 }
521
522 if(missing.Count == 0)
523 return ret;
524
525 // try user account service
526 List<UserAccount> accounts = m_Scenes[0].UserAccountService.GetUserAccounts(
527 m_Scenes[0].RegionInfo.ScopeID, missing);
528
529 if(accounts.Count != 0)
530 {
531 foreach(UserAccount uac in accounts)
532 {
533 if(uac != null)
534 {
535 string name = uac.FirstName + " " + uac.LastName;
536 ret[uac.PrincipalID] = name;
537 missing.Remove(uac.PrincipalID.ToString()); // slowww
538 untried.Remove(uac.PrincipalID);
539
540 userdata = new UserData();
541 userdata.Id = uac.PrincipalID;
542 userdata.FirstName = uac.FirstName;
543 userdata.LastName = uac.LastName;
544 userdata.HomeURL = string.Empty;
545 userdata.IsUnknownUser = false;
546 userdata.HasGridUserTried = true;
547 lock (m_UserCache)
548 m_UserCache[uac.PrincipalID] = userdata;
549 }
550 }
551 }
552
553 if (missing.Count == 0 || m_Scenes[0].GridUserService == null)
554 return ret;
555
556 // try grid user service
557
558 GridUserInfo[] pinfos = m_Scenes[0].GridUserService.GetGridUserInfo(missing.ToArray());
559 if(pinfos.Length > 0)
560 {
561 foreach(GridUserInfo uInfo in pinfos)
562 {
563 if (uInfo != null)
564 {
565 string url, first, last, tmp;
566
567 if(uInfo.UserID.Length <= 36)
568 continue;
569
570 if (Util.ParseUniversalUserIdentifier(uInfo.UserID, out uuid, out url, out first, out last, out tmp))
571 {
572 if (url != string.Empty)
573 {
574 try
575 {
576 userdata = new UserData();
577 userdata.FirstName = first.Replace(" ", ".") + "." + last.Replace(" ", ".");
578 userdata.LastName = "@" + new Uri(url).Authority;
579 userdata.Id = uuid;
580 userdata.HomeURL = url;
581 userdata.IsUnknownUser = false;
582 userdata.HasGridUserTried = true;
583 lock (m_UserCache)
584 m_UserCache[uuid] = userdata;
585
586 string name = userdata.FirstName + " " + userdata.LastName;
587 ret[uuid] = name;
588 missing.Remove(uuid.ToString());
589 untried.Remove(uuid);
590 }
591 catch
592 {
593 }
594 }
595 }
596 }
597 }
598 }
599
600 // add the untried in cache that still failed
601 if(untried.Count > 0)
602 {
603 foreach(KeyValuePair<UUID, string> kvp in untried)
604 {
605 ret[kvp.Key] = kvp.Value;
606 missing.Remove((kvp.Key).ToString());
607 }
608 }
609
610 // add the UMMthings ( not sure we should)
611 if(missing.Count > 0)
612 {
613 foreach(string id in missing)
614 {
615 if(UUID.TryParse(id, out uuid) && uuid != UUID.Zero)
616 {
617 if (m_Scenes[0].LibraryService != null &&
618 (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid))
619 ret[uuid] = "Mr OpenSim";
620 else
621 ret[uuid] = "Unknown UserUMMAU43";
622 }
623 }
624 }
625
626 return ret;
627 }
628
484 public virtual string GetUserHomeURL(UUID userID) 629 public virtual string GetUserHomeURL(UUID userID)
485 { 630 {
486 UserData user; 631 UserData user;
@@ -584,7 +729,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
584 else 729 else
585 { 730 {
586 userdata = new UserData(); 731 userdata = new UserData();
587 userdata.HasGridUserTried = false;
588 userdata.Id = uuid; 732 userdata.Id = uuid;
589 userdata.FirstName = "Unknown"; 733 userdata.FirstName = "Unknown";
590 userdata.LastName = "UserUMMAU42"; 734 userdata.LastName = "UserUMMAU42";
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 863560b..c48186f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -203,21 +203,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
203 203
204 void OnClientClosed(UUID clientID, Scene scene) 204 void OnClientClosed(UUID clientID, Scene scene)
205 { 205 {
206 if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache 206 ScenePresence sp = null;
207 foreach (Scene s in m_Scenes)
207 { 208 {
208 ScenePresence sp = null; 209 s.TryGetScenePresence(clientID, out sp);
209 foreach (Scene s in m_Scenes) 210 if ((sp != null) && !sp.IsChildAgent && (s != scene))
210 { 211 {
211 s.TryGetScenePresence(clientID, out sp); 212 m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache",
212 if ((sp != null) && !sp.IsChildAgent && (s != scene))
213 {
214 m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache",
215 scene.RegionInfo.RegionName, clientID); 213 scene.RegionInfo.RegionName, clientID);
216 return; 214 return;
217 }
218 } 215 }
219 DropInventoryServiceURL(clientID);
220 } 216 }
217
218 if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache
219 DropInventoryServiceURL(clientID);
220
221 m_Cache.RemoveAll(clientID);
221 } 222 }
222 223
223 /// <summary> 224 /// <summary>
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
index 3195e6b..f7ef2ea 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
@@ -38,12 +38,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
38 /// </summary> 38 /// </summary>
39 public class InventoryCache 39 public class InventoryCache
40 { 40 {
41 private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour 41 private const double CACHE_EXPIRATION_SECONDS = 60.0; // 1 minute
42 42
43 private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>(); 43 private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>();
44 private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>(); 44 private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>();
45 private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>(); 45 private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>();
46 46
47
48 public void RemoveAll(UUID userID)
49 {
50 if(m_RootFolders.Contains(userID))
51 m_RootFolders.Remove(userID);
52 if(m_FolderTypes.Contains(userID))
53 m_FolderTypes.Remove(userID);
54 if(m_Inventories.Contains(userID))
55 m_Inventories.Remove(userID);
56 }
57
47 public void Cache(UUID userID, InventoryFolderBase root) 58 public void Cache(UUID userID, InventoryFolderBase root)
48 { 59 {
49 m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS); 60 m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
index cf9a7b4..3127199 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
@@ -153,12 +153,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
153 public UserAccount GetUserAccount(UUID scopeID, UUID userID) 153 public UserAccount GetUserAccount(UUID scopeID, UUID userID)
154 { 154 {
155 bool inCache = false; 155 bool inCache = false;
156 UserAccount account = m_Cache.Get(userID, out inCache); 156 UserAccount account;
157 lock(m_Cache)
158 account = m_Cache.Get(userID, out inCache);
157 if (inCache) 159 if (inCache)
158 return account; 160 return account;
159 161
160 account = UserAccountService.GetUserAccount(scopeID, userID); 162 account = UserAccountService.GetUserAccount(scopeID, userID);
161 m_Cache.Cache(userID, account); 163 lock(m_Cache)
164 m_Cache.Cache(userID, account);
162 165
163 return account; 166 return account;
164 } 167 }
@@ -166,13 +169,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
166 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) 169 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
167 { 170 {
168 bool inCache = false; 171 bool inCache = false;
169 UserAccount account = m_Cache.Get(firstName + " " + lastName, out inCache); 172 UserAccount account;
173 lock(m_Cache)
174 account = m_Cache.Get(firstName + " " + lastName, out inCache);
170 if (inCache) 175 if (inCache)
171 return account; 176 return account;
172 177
173 account = UserAccountService.GetUserAccount(scopeID, firstName, lastName); 178 account = UserAccountService.GetUserAccount(scopeID, firstName, lastName);
174 if (account != null) 179 if (account != null)
175 m_Cache.Cache(account.PrincipalID, account); 180 lock(m_Cache)
181 m_Cache.Cache(account.PrincipalID, account);
176 182
177 return account; 183 return account;
178 } 184 }
@@ -182,6 +188,45 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
182 return UserAccountService.GetUserAccount(scopeID, Email); 188 return UserAccountService.GetUserAccount(scopeID, Email);
183 } 189 }
184 190
191 public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
192 {
193 List<UserAccount> ret = new List<UserAccount>();
194 List<string> missing = new List<string>();
195
196 // still another cache..
197 bool inCache = false;
198 UUID uuid = UUID.Zero;
199 UserAccount account;
200 foreach(string id in IDs)
201 {
202 if(UUID.TryParse(id, out uuid))
203 {
204 lock(m_Cache)
205 account = m_Cache.Get(uuid, out inCache);
206 if (inCache)
207 ret.Add(account);
208 else
209 missing.Add(id);
210 }
211 }
212
213 if(missing.Count == 0)
214 return ret;
215
216 List<UserAccount> ext = UserAccountService.GetUserAccounts(scopeID, missing);
217 if(ext != null && ext.Count > 0)
218 {
219 ret.AddRange(ext);
220 foreach(UserAccount acc in ext)
221 {
222 if(acc != null)
223 lock(m_Cache)
224 m_Cache.Cache(acc.PrincipalID, acc);
225 }
226 }
227 return ret;
228 }
229
185 public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query) 230 public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
186 { 231 {
187 return null; 232 return null;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs
index afbba30..eead05d 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs
@@ -26,6 +26,8 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
30using System.Collections.Generic;
29using Nini.Config; 31using Nini.Config;
30using log4net; 32using log4net;
31using Mono.Addins; 33using Mono.Addins;
@@ -126,7 +128,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
126 // flags, title, etc. And country, don't forget country! 128 // flags, title, etc. And country, don't forget country!
127 private void OnNewClient(IClientAPI client) 129 private void OnNewClient(IClientAPI client)
128 { 130 {
129 m_Cache.Remove(client.Name); 131 lock(m_Cache)
132 m_Cache.Remove(client.Name);
130 } 133 }
131 134
132 #region Overwritten methods from IUserAccountService 135 #region Overwritten methods from IUserAccountService
@@ -134,12 +137,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
134 public override UserAccount GetUserAccount(UUID scopeID, UUID userID) 137 public override UserAccount GetUserAccount(UUID scopeID, UUID userID)
135 { 138 {
136 bool inCache = false; 139 bool inCache = false;
137 UserAccount account = m_Cache.Get(userID, out inCache); 140 UserAccount account;
141 lock(m_Cache)
142 account = m_Cache.Get(userID, out inCache);
138 if (inCache) 143 if (inCache)
139 return account; 144 return account;
140 145
141 account = base.GetUserAccount(scopeID, userID); 146 account = base.GetUserAccount(scopeID, userID);
142 m_Cache.Cache(userID, account); 147 lock(m_Cache)
148 if(account != null)
149 m_Cache.Cache(userID, account);
143 150
144 return account; 151 return account;
145 } 152 }
@@ -147,17 +154,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
147 public override UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) 154 public override UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
148 { 155 {
149 bool inCache = false; 156 bool inCache = false;
150 UserAccount account = m_Cache.Get(firstName + " " + lastName, out inCache); 157 UserAccount account;
158 lock(m_Cache)
159 account = m_Cache.Get(firstName + " " + lastName, out inCache);
151 if (inCache) 160 if (inCache)
152 return account; 161 return account;
153 162
154 account = base.GetUserAccount(scopeID, firstName, lastName); 163 account = base.GetUserAccount(scopeID, firstName, lastName);
155 if (account != null) 164 if (account != null)
156 m_Cache.Cache(account.PrincipalID, account); 165 lock(m_Cache)
166 m_Cache.Cache(account.PrincipalID, account);
157 167
158 return account; 168 return account;
159 } 169 }
160 170
171 public override List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
172 {
173 List<UserAccount> accs = new List<UserAccount>();
174 List<string> missing = new List<string>();
175
176 UUID uuid = UUID.Zero;
177 UserAccount account;
178 bool inCache = false;
179
180 foreach(string id in IDs)
181 {
182 if(UUID.TryParse(id, out uuid))
183 {
184 lock(m_Cache)
185 account = m_Cache.Get(uuid, out inCache);
186 if (inCache)
187 accs.Add(account);
188 else
189 missing.Add(id);
190 }
191 }
192
193 if(missing.Count > 0)
194 {
195 List<UserAccount> ext = base.GetUserAccounts(scopeID, missing);
196 if(ext != null && ext.Count >0 )
197 {
198 accs.AddRange(ext);
199 foreach(UserAccount acc in ext)
200 {
201 if(acc != null)
202 lock(m_Cache)
203 m_Cache.Cache(acc.PrincipalID, acc);
204 }
205 }
206 }
207
208 return accs;
209 }
210
161 public override bool StoreUserAccount(UserAccount data) 211 public override bool StoreUserAccount(UserAccount data)
162 { 212 {
163 // This remote connector refuses to serve this method 213 // This remote connector refuses to serve this method
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 3ded00c..56d41a8 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -572,6 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
572 bool UseEstateSun, bool UseFixedSun, float SunHour, 572 bool UseEstateSun, bool UseFixedSun, float SunHour,
573 bool UseGlobal, bool EstateFixedSun, float EstateSunHour) 573 bool UseGlobal, bool EstateFixedSun, float EstateSunHour)
574 { 574 {
575 double lastwaterlevel = Scene.RegionInfo.RegionSettings.WaterHeight;
575 // Water Height 576 // Water Height
576 Scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight; 577 Scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight;
577 578
@@ -584,6 +585,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
584 Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; 585 Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
585 Scene.RegionInfo.RegionSettings.SunPosition = SunHour; 586 Scene.RegionInfo.RegionSettings.SunPosition = SunHour;
586 587
588 if(Scene.PhysicsEnabled && Scene.PhysicsScene != null && lastwaterlevel != WaterHeight)
589 Scene.PhysicsScene.SetWaterLevel(WaterHeight);
590
587 Scene.TriggerEstateSunUpdate(); 591 Scene.TriggerEstateSunUpdate();
588 592
589 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); 593 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
@@ -1471,7 +1475,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
1471 Scene.RegionInfo.EstateSettings.FixedSun, 1475 Scene.RegionInfo.EstateSettings.FixedSun,
1472 (float)Scene.RegionInfo.EstateSettings.SunPosition); 1476 (float)Scene.RegionInfo.EstateSettings.SunPosition);
1473 1477
1474 sendRegionInfoPacketToAll(); 1478// sendRegionInfoPacketToAll(); already done by setRegionTerrainSettings
1475 } 1479 }
1476 1480
1477 1481
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index b00f2b0..69a3455 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -374,9 +374,10 @@ namespace OpenSim.Region.CoreModules.World.Land
374 374
375 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 375 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
376 { 376 {
377 remote_client.SceneAgent.Invulnerable = 377 if(m_scene.RegionInfo.RegionSettings.AllowDamage)
378 !m_scene.RegionInfo.RegionSettings.AllowDamage || 378 remote_client.SceneAgent.Invulnerable = false;
379 (m_landData.Flags & (uint)ParcelFlags.AllowDamage) == 0; 379 else
380 remote_client.SceneAgent.Invulnerable = (m_landData.Flags & (uint)ParcelFlags.AllowDamage) == 0;
380 381
381 if (remote_client.SceneAgent.PresenceType == PresenceType.Npc) 382 if (remote_client.SceneAgent.PresenceType == PresenceType.Npc)
382 return; 383 return;
@@ -779,11 +780,10 @@ namespace OpenSim.Region.CoreModules.World.Land
779 { 780 {
780 if (over.LandData.LocalID == LandData.LocalID) 781 if (over.LandData.LocalID == LandData.LocalID)
781 { 782 {
782 if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && 783 if(m_scene.RegionInfo.RegionSettings.AllowDamage)
783 m_scene.RegionInfo.RegionSettings.AllowDamage)
784 avatar.Invulnerable = false; 784 avatar.Invulnerable = false;
785 else 785 else
786 avatar.Invulnerable = true; 786 avatar.Invulnerable = (over.LandData.Flags & (uint)ParcelFlags.AllowDamage) == 0;
787 787
788 SendLandUpdateToClient(snap_selection, avatar.ControllingClient); 788 SendLandUpdateToClient(snap_selection, avatar.ControllingClient);
789 avatar.currentParcelUUID = LandData.GlobalID; 789 avatar.currentParcelUUID = LandData.GlobalID;