Fix up master avatar handling for estate owners. Introduces a new
hierarchical rights structure. MasterAvatar: Owner of the region server (may be null), net gods (users with GodLevel 200), Estate owner (from database). Look at Opensim.ini.example to enable net gods. Estate owner will default to master avatar.0.6.0-stable
parent
53b0ef82b3
commit
dfc553d0a4
|
@ -58,6 +58,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
region_id = regInfo.RegionID.ToString();
|
||||
region_x = regInfo.RegionLocX;
|
||||
region_y = regInfo.RegionLocY;
|
||||
if (regInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
region_owner_id = regInfo.EstateSettings.EstateOwner.ToString();
|
||||
else
|
||||
region_owner_id = regInfo.MasterAvatarAssignedUUID.ToString();
|
||||
region_http_port = regInfo.HttpPort;
|
||||
region_server_uri = regInfo.ServerURI;
|
||||
|
|
|
@ -2693,6 +2693,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
//Sending Estate Settings
|
||||
returnblock[0].Parameter = Helpers.StringToField(estateName);
|
||||
// TODO: remove this cruft once MasterAvatar is fully deprecated
|
||||
//
|
||||
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.EstateSettings.EstateOwner.ToString());
|
||||
else
|
||||
returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
|
||||
returnblock[2].Parameter = Helpers.StringToField(estateID.ToString());
|
||||
|
||||
|
|
|
@ -135,11 +135,14 @@ namespace OpenSim.Region.ClientStack
|
|||
scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
|
||||
scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight);
|
||||
|
||||
// TODO: Remove this cruft once MasterAvatar is fully deprecated
|
||||
//Master Avatar Setup
|
||||
UserProfileData masterAvatar;
|
||||
if (scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
|
||||
{
|
||||
masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
|
||||
scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName;
|
||||
scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -151,7 +154,7 @@ namespace OpenSim.Region.ClientStack
|
|||
|
||||
if (masterAvatar != null)
|
||||
{
|
||||
m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.ID.ToString() + "]");
|
||||
m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName);
|
||||
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -123,15 +123,10 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
GridParams["server_uri"] = regionInfo.ServerURI;
|
||||
GridParams["region_secret"] = regionInfo.regionSecret;
|
||||
|
||||
// part of an initial brutish effort to provide accurate information (as per the xml region spec)
|
||||
// wrt the ownership of a given region
|
||||
// the (very bad) assumption is that this value is being read and handled inconsistently or
|
||||
// not at all. Current strategy is to put the code in place to support the validity of this information
|
||||
// and to roll forward debugging any issues from that point
|
||||
//
|
||||
// this particular section of the mod attempts to supply a value from the region's xml file to the grid
|
||||
// server for the UUID of the region's owner (master avatar)
|
||||
if(regionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
|
||||
GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString();
|
||||
else
|
||||
GridParams["master_avatar_uuid"] = regionInfo.EstateSettings.EstateOwner.ToString();
|
||||
|
||||
// Package into an XMLRPC Request
|
||||
ArrayList SendParams = new ArrayList();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.DataSnapshot.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
|
||||
|
@ -50,15 +51,20 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
|||
public XmlNode RequestSnapshotData(XmlDocument factory)
|
||||
{
|
||||
//Estate data section - contains who owns a set of sims and the name of the set.
|
||||
//In Opensim all the estate names are the same as the Master Avatar (owner of the sim)
|
||||
//Now in DataSnapshotProvider module form!
|
||||
XmlNode estatedata = factory.CreateNode(XmlNodeType.Element, "estate", "");
|
||||
|
||||
LLUUID ownerid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
ownerid = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
// Can't fail because if it weren't in cache, we wouldn't be here
|
||||
//
|
||||
UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(ownerid);
|
||||
|
||||
//TODO: Change to query userserver about the master avatar UUID ?
|
||||
String firstname = m_scene.RegionInfo.MasterAvatarFirstName;
|
||||
String lastname = m_scene.RegionInfo.MasterAvatarLastName;
|
||||
String firstname = userProfile.FirstName;
|
||||
String lastname = userProfile.SurName;
|
||||
|
||||
//TODO: Fix the marshalling system to have less copypasta gruntwork
|
||||
XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", "");
|
||||
|
|
|
@ -137,6 +137,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
|||
// Try to retain the original creator/owner/lastowner if their uuid is present on this grid
|
||||
// otherwise, use the master avatar uuid instead
|
||||
LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
foreach (SceneObjectPart part in sceneObject.Children.Values)
|
||||
{
|
||||
if (!resolveUserUuid(part.CreatorID))
|
||||
|
|
|
@ -212,6 +212,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
|
|||
{
|
||||
// EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc.
|
||||
|
||||
if (user == m_scene.RegionInfo.EstateSettings.EstateOwner)
|
||||
return; // never process EO
|
||||
if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
|
||||
return; // never process owner
|
||||
|
||||
|
@ -557,6 +559,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
|
|||
|
||||
args.regionFlags = GetRegionFlags();
|
||||
args.regionName = m_scene.RegionInfo.RegionName;
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
args.terrainBase0 = LLUUID.Zero;
|
||||
args.terrainBase1 = LLUUID.Zero;
|
||||
|
@ -811,6 +816,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
|
|||
{
|
||||
if (avatarID == m_scene.RegionInfo.MasterAvatarAssignedUUID)
|
||||
return true;
|
||||
if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner)
|
||||
return true;
|
||||
|
||||
List<LLUUID> ems = new List<LLUUID>(m_scene.RegionInfo.EstateSettings.EstateManagers);
|
||||
if (ems.Contains(avatarID))
|
||||
|
|
|
@ -162,6 +162,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
|||
ILandObject fullSimParcel = new LandObject(LLUUID.Zero, false, m_scene);
|
||||
|
||||
fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
|
||||
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
fullSimParcel.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
fullSimParcel.landData.ClaimDate = Util.UnixTimeSinceEpoch();
|
||||
AddLandObject(fullSimParcel);
|
||||
|
@ -931,6 +934,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
|||
{
|
||||
if (m_scene.ExternalChecks.ExternalChecksCanAbandonParcel(remote_client.AgentId, landList[local_id]))
|
||||
{
|
||||
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
m_scene.Broadcast(SendParcelOverlay);
|
||||
landList[local_id].sendLandUpdateToClient(remote_client);
|
||||
|
@ -945,6 +951,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
|||
{
|
||||
if (m_scene.ExternalChecks.ExternalChecksCanReclaimParcel(remote_client.AgentId, landList[local_id]))
|
||||
{
|
||||
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
|
||||
landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
landList[local_id].landData.ClaimDate = Util.UnixTimeSinceEpoch();
|
||||
m_scene.Broadcast(SendParcelOverlay);
|
||||
|
|
|
@ -32,6 +32,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Modules.Framework;
|
||||
using OpenSim.Region.Environment.Modules.Framework.InterfaceCommander;
|
||||
|
@ -63,6 +64,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
|||
private bool m_bypassPermissions = false;
|
||||
private bool m_bypassPermissionsValue = true;
|
||||
private bool m_debugPermissions = false;
|
||||
private bool m_allowGridGods = false;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -136,6 +138,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
|||
if (!modules.Contains("DefaultPermissionsModule"))
|
||||
return;
|
||||
|
||||
m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false);
|
||||
|
||||
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
|
||||
|
||||
if (m_bypassPermissions)
|
||||
|
@ -231,11 +235,6 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
|||
|
||||
protected bool IsAdministrator(LLUUID user)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[PERMISSIONS]: Is adminstrator called for {0} where region master avatar is {1}",
|
||||
// user, m_scene.RegionInfo.MasterAvatarAssignedUUID);
|
||||
|
||||
// If there is no master avatar, return false
|
||||
if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
|
||||
{
|
||||
if (m_scene.RegionInfo.MasterAvatarAssignedUUID == user)
|
||||
|
@ -246,7 +245,9 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
|||
if (m_scene.RegionInfo.EstateSettings.EstateOwner == user)
|
||||
return true;
|
||||
}
|
||||
|
||||
UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(user);
|
||||
if((userProfile.GodLevel) >= 200 && m_allowGridGods)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
userlevel = 1;
|
||||
}
|
||||
// TODO: remove this cruft once MasterAvatar is fully deprecated
|
||||
//
|
||||
if (m_regInfo.MasterAvatarAssignedUUID == AgentID)
|
||||
{
|
||||
userlevel = 2;
|
||||
|
|
|
@ -3777,5 +3777,22 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
//Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
|
||||
client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
|
||||
}
|
||||
|
||||
// public bool IsAdministrator(LLUUID user)
|
||||
// {
|
||||
// if(RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
|
||||
// {
|
||||
// if(RegionInfo.MasterAvatarAssignedUUID == user)
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// UserProfileData userProfile =
|
||||
// CommsManager.UserService.GetUserProfile(user);
|
||||
//
|
||||
// if(userProfile.GodLevel >= 200)
|
||||
// return true;
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2017,7 +2017,15 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
if (godStatus)
|
||||
{
|
||||
m_godlevel = 250;
|
||||
// TODO: remove this cruft once the master avatar is fully
|
||||
// deprecated. For now, assign god level 200 to anyone
|
||||
// who is granted god powers, but has no god level set.
|
||||
//
|
||||
UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(agentID);
|
||||
if(userProfile.GodLevel > 0)
|
||||
m_godlevel = userProfile.GodLevel;
|
||||
else
|
||||
m_godlevel = 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue