llManageEstateAccess implementation http://wiki.secondlife.com/wiki/LlManageEstateAccess
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>iar_mods
parent
a6abecf5fa
commit
616373db16
|
@ -373,5 +373,11 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
return l_EstateAccess.Contains(user);
|
return l_EstateAccess.Contains(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool GroupAccess(UUID groupID)
|
||||||
|
{
|
||||||
|
return l_EstateGroups.Contains(groupID);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10646,6 +10646,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Integer llManageEstateAccess(int action, string avatar)
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
EstateSettings estate = World.RegionInfo.EstateSettings;
|
||||||
|
bool isAccount = false;
|
||||||
|
bool isGroup = false;
|
||||||
|
|
||||||
|
if (!estate.IsEstateOwner(m_host.OwnerID) || !estate.IsEstateManager(m_host.OwnerID))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
UUID id = new UUID();
|
||||||
|
if (!UUID.TryParse(avatar, out id))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, id);
|
||||||
|
isAccount = account != null ? true : false;
|
||||||
|
if (!isAccount)
|
||||||
|
{
|
||||||
|
IGroupsModule groups = World.RequestModuleInterface<IGroupsModule>();
|
||||||
|
if (groups != null)
|
||||||
|
{
|
||||||
|
GroupRecord group = groups.GetGroupRecord(id);
|
||||||
|
isGroup = group != null ? true : false;
|
||||||
|
if (!isGroup)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_ADD:
|
||||||
|
if (!isAccount) return 0;
|
||||||
|
if (estate.HasAccess(id)) return 1;
|
||||||
|
if (estate.IsBanned(id))
|
||||||
|
estate.RemoveBan(id);
|
||||||
|
estate.AddEstateUser(id);
|
||||||
|
break;
|
||||||
|
case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_REMOVE:
|
||||||
|
if (!isAccount || !estate.HasAccess(id)) return 0;
|
||||||
|
estate.RemoveEstateUser(id);
|
||||||
|
break;
|
||||||
|
case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_ADD:
|
||||||
|
if (!isGroup) return 0;
|
||||||
|
if (estate.GroupAccess(id)) return 1;
|
||||||
|
estate.AddEstateGroup(id);
|
||||||
|
break;
|
||||||
|
case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_REMOVE:
|
||||||
|
if (!isGroup || !estate.GroupAccess(id)) return 0;
|
||||||
|
estate.RemoveEstateGroup(id);
|
||||||
|
break;
|
||||||
|
case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_ADD:
|
||||||
|
if (!isAccount) return 0;
|
||||||
|
if (estate.IsBanned(id)) return 1;
|
||||||
|
EstateBan ban = new EstateBan();
|
||||||
|
ban.EstateID = estate.EstateID;
|
||||||
|
ban.BannedUserID = id;
|
||||||
|
estate.AddBan(ban);
|
||||||
|
break;
|
||||||
|
case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_REMOVE:
|
||||||
|
if (!isAccount || !estate.IsBanned(id)) return 0;
|
||||||
|
estate.RemoveBan(id);
|
||||||
|
break;
|
||||||
|
default: return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
#region Not Implemented
|
#region Not Implemented
|
||||||
//
|
//
|
||||||
// Listing the unimplemented lsl functions here, please move
|
// Listing the unimplemented lsl functions here, please move
|
||||||
|
|
|
@ -242,6 +242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
void llLoopSound(string sound, double volume);
|
void llLoopSound(string sound, double volume);
|
||||||
void llLoopSoundMaster(string sound, double volume);
|
void llLoopSoundMaster(string sound, double volume);
|
||||||
void llLoopSoundSlave(string sound, double volume);
|
void llLoopSoundSlave(string sound, double volume);
|
||||||
|
LSL_Integer llManageEstateAccess(int action, string avatar);
|
||||||
void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset);
|
void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset);
|
||||||
void llMakeFire(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset);
|
void llMakeFire(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset);
|
||||||
void llMakeFountain(int particles, double scale, double vel, double lifetime, double arc, int bounce, string texture, LSL_Vector offset, double bounce_offset);
|
void llMakeFountain(int particles, double scale, double vel, double lifetime, double arc, int bounce, string texture, LSL_Vector offset, double bounce_offset);
|
||||||
|
|
|
@ -432,6 +432,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
public const int REGION_FLAG_ALLOW_DIRECT_TELEPORT = 0x100000; // region allows direct teleports
|
public const int REGION_FLAG_ALLOW_DIRECT_TELEPORT = 0x100000; // region allows direct teleports
|
||||||
public const int REGION_FLAG_RESTRICT_PUSHOBJECT = 0x400000; // region restricts llPushObject
|
public const int REGION_FLAG_RESTRICT_PUSHOBJECT = 0x400000; // region restricts llPushObject
|
||||||
|
|
||||||
|
//llManageEstateAccess
|
||||||
|
public const int ESTATE_ACCESS_ALLOWED_AGENT_ADD = 0;
|
||||||
|
public const int ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1;
|
||||||
|
public const int ESTATE_ACCESS_ALLOWED_GROUP_ADD = 2;
|
||||||
|
public const int ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 3;
|
||||||
|
public const int ESTATE_ACCESS_BANNED_AGENT_ADD = 4;
|
||||||
|
public const int ESTATE_ACCESS_BANNED_AGENT_REMOVE = 5;
|
||||||
|
|
||||||
public static readonly LSLInteger PAY_HIDE = new LSLInteger(-1);
|
public static readonly LSLInteger PAY_HIDE = new LSLInteger(-1);
|
||||||
public static readonly LSLInteger PAY_DEFAULT = new LSLInteger(-2);
|
public static readonly LSLInteger PAY_DEFAULT = new LSLInteger(-2);
|
||||||
|
|
||||||
|
|
|
@ -1054,6 +1054,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_LSL_Functions.llLoopSoundSlave(sound, volume);
|
m_LSL_Functions.llLoopSoundSlave(sound, volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Integer llManageEstateAccess(int action, string avatar)
|
||||||
|
{
|
||||||
|
return m_LSL_Functions.llManageEstateAccess(action, avatar);
|
||||||
|
}
|
||||||
|
|
||||||
public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset)
|
public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset)
|
||||||
{
|
{
|
||||||
m_LSL_Functions.llMakeExplosion(particles, scale, vel, lifetime, arc, texture, offset);
|
m_LSL_Functions.llMakeExplosion(particles, scale, vel, lifetime, arc, texture, offset);
|
||||||
|
|
Loading…
Reference in New Issue