aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-01-26 23:07:31 +0000
committerMelanie2012-01-26 23:07:31 +0000
commit9d60b84f7805b78ae9413b4dc66c2fbbf387e503 (patch)
tree6aa89951925561a5dbe031b9a92e9dd49c0a272a
parentMerge branch 'master' into careminster (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.zip
opensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.tar.gz
opensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.tar.bz2
opensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/EstateSettings.cs
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/EstateSettings.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs69
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs5
5 files changed, 89 insertions, 0 deletions
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index afbdd49..142b783 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -425,5 +425,11 @@ namespace OpenSim.Framework
425 AllowParcelChanges = ((regionFlags & (ulong)RegionFlags.AllowParcelChanges) == (ulong)RegionFlags.AllowParcelChanges); 425 AllowParcelChanges = ((regionFlags & (ulong)RegionFlags.AllowParcelChanges) == (ulong)RegionFlags.AllowParcelChanges);
426 AllowSetHome = ((regionFlags & (ulong)RegionFlags.AllowSetHome) == (ulong)RegionFlags.AllowSetHome); 426 AllowSetHome = ((regionFlags & (ulong)RegionFlags.AllowSetHome) == (ulong)RegionFlags.AllowSetHome);
427 } 427 }
428
429 public bool GroupAccess(UUID groupID)
430 {
431 return l_EstateGroups.Contains(groupID);
432 }
433
428 } 434 }
429} 435}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 23e3e15..9c4bfb6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -11516,6 +11516,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11516 return list; 11516 return list;
11517 } 11517 }
11518 11518
11519 public LSL_Integer llManageEstateAccess(int action, string avatar)
11520 {
11521 m_host.AddScriptLPS(1);
11522 EstateSettings estate = World.RegionInfo.EstateSettings;
11523 bool isAccount = false;
11524 bool isGroup = false;
11525
11526 if (!estate.IsEstateOwner(m_host.OwnerID) || !estate.IsEstateManager(m_host.OwnerID))
11527 return 0;
11528
11529 UUID id = new UUID();
11530 if (!UUID.TryParse(avatar, out id))
11531 return 0;
11532
11533 UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, id);
11534 isAccount = account != null ? true : false;
11535 if (!isAccount)
11536 {
11537 IGroupsModule groups = World.RequestModuleInterface<IGroupsModule>();
11538 if (groups != null)
11539 {
11540 GroupRecord group = groups.GetGroupRecord(id);
11541 isGroup = group != null ? true : false;
11542 if (!isGroup)
11543 return 0;
11544 }
11545 else
11546 return 0;
11547 }
11548
11549 switch (action)
11550 {
11551 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_ADD:
11552 if (!isAccount) return 0;
11553 if (estate.HasAccess(id)) return 1;
11554 if (estate.IsBanned(id, World.GetUserFlags(id)))
11555 estate.RemoveBan(id);
11556 estate.AddEstateUser(id);
11557 break;
11558 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_REMOVE:
11559 if (!isAccount || !estate.HasAccess(id)) return 0;
11560 estate.RemoveEstateUser(id);
11561 break;
11562 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_ADD:
11563 if (!isGroup) return 0;
11564 if (estate.GroupAccess(id)) return 1;
11565 estate.AddEstateGroup(id);
11566 break;
11567 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_REMOVE:
11568 if (!isGroup || !estate.GroupAccess(id)) return 0;
11569 estate.RemoveEstateGroup(id);
11570 break;
11571 case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_ADD:
11572 if (!isAccount) return 0;
11573 if (estate.IsBanned(id, World.GetUserFlags(id))) return 1;
11574 EstateBan ban = new EstateBan();
11575 ban.EstateID = estate.EstateID;
11576 ban.BannedUserID = id;
11577 estate.AddBan(ban);
11578 break;
11579 case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_REMOVE:
11580 if (!isAccount || !estate.IsBanned(id, World.GetUserFlags(id))) return 0;
11581 estate.RemoveBan(id);
11582 break;
11583 default: return 0;
11584 }
11585 return 1;
11586 }
11587
11519 #region Not Implemented 11588 #region Not Implemented
11520 // 11589 //
11521 // Listing the unimplemented lsl functions here, please move 11590 // Listing the unimplemented lsl functions here, please move
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index f4de93e..73131e6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -244,6 +244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
244 void llLoopSound(string sound, double volume); 244 void llLoopSound(string sound, double volume);
245 void llLoopSoundMaster(string sound, double volume); 245 void llLoopSoundMaster(string sound, double volume);
246 void llLoopSoundSlave(string sound, double volume); 246 void llLoopSoundSlave(string sound, double volume);
247 LSL_Integer llManageEstateAccess(int action, string avatar);
247 void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset); 248 void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset);
248 void llMakeFire(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset); 249 void llMakeFire(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset);
249 void llMakeFountain(int particles, double scale, double vel, double lifetime, double arc, int bounce, string texture, LSL_Vector offset, double bounce_offset); 250 void llMakeFountain(int particles, double scale, double vel, double lifetime, double arc, int bounce, string texture, LSL_Vector offset, double bounce_offset);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 32226f9..11a8883 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -435,6 +435,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
435 public const int REGION_FLAG_ALLOW_DIRECT_TELEPORT = 0x100000; // region allows direct teleports 435 public const int REGION_FLAG_ALLOW_DIRECT_TELEPORT = 0x100000; // region allows direct teleports
436 public const int REGION_FLAG_RESTRICT_PUSHOBJECT = 0x400000; // region restricts llPushObject 436 public const int REGION_FLAG_RESTRICT_PUSHOBJECT = 0x400000; // region restricts llPushObject
437 437
438 //llManageEstateAccess
439 public const int ESTATE_ACCESS_ALLOWED_AGENT_ADD = 0;
440 public const int ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1;
441 public const int ESTATE_ACCESS_ALLOWED_GROUP_ADD = 2;
442 public const int ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 3;
443 public const int ESTATE_ACCESS_BANNED_AGENT_ADD = 4;
444 public const int ESTATE_ACCESS_BANNED_AGENT_REMOVE = 5;
445
438 public static readonly LSLInteger PAY_HIDE = new LSLInteger(-1); 446 public static readonly LSLInteger PAY_HIDE = new LSLInteger(-1);
439 public static readonly LSLInteger PAY_DEFAULT = new LSLInteger(-2); 447 public static readonly LSLInteger PAY_DEFAULT = new LSLInteger(-2);
440 448
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index e0c81c7..a27899f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -1071,6 +1071,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1071 m_LSL_Functions.llLoopSoundSlave(sound, volume); 1071 m_LSL_Functions.llLoopSoundSlave(sound, volume);
1072 } 1072 }
1073 1073
1074 public LSL_Integer llManageEstateAccess(int action, string avatar)
1075 {
1076 return m_LSL_Functions.llManageEstateAccess(action, avatar);
1077 }
1078
1074 public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) 1079 public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset)
1075 { 1080 {
1076 m_LSL_Functions.llMakeExplosion(particles, scale, vel, lifetime, arc, texture, offset); 1081 m_LSL_Functions.llMakeExplosion(particles, scale, vel, lifetime, arc, texture, offset);