mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Merge branch 'avination-current' into ubitwork
This commit is contained in:
@@ -302,7 +302,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
// If we're an NPC then skip all the item checks and manipulations since we don't have an
|
||||
// inventory right now.
|
||||
RezSingleAttachmentFromInventoryInternal(
|
||||
sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, p, true, null);
|
||||
sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, p, true, d);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -182,6 +182,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
try
|
||||
{
|
||||
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
||||
if (obj == null)
|
||||
return;
|
||||
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0
|
||||
|| avatar.Scene.RegionInfo.RegionSettings.AllowDamage)
|
||||
{
|
||||
|
||||
@@ -40,6 +40,13 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
public struct SendReply
|
||||
{
|
||||
public bool Success;
|
||||
public string Message;
|
||||
public int Disposition;
|
||||
}
|
||||
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "OfflineMessageModule")]
|
||||
public class OfflineMessageModule : ISharedRegionModule
|
||||
{
|
||||
@@ -50,6 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
private string m_RestURL = String.Empty;
|
||||
IMessageTransferModule m_TransferModule = null;
|
||||
private bool m_ForwardOfflineGroupMessages = true;
|
||||
private Dictionary<IClientAPI, List<UUID>> m_repliesSent= new Dictionary<IClientAPI, List<UUID>>();
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
@@ -169,6 +177,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnRetrieveInstantMessages += RetrieveInstantMessages;
|
||||
client.OnLogout += OnClientLoggedOut;
|
||||
}
|
||||
|
||||
public void OnClientLoggedOut(IClientAPI client)
|
||||
{
|
||||
m_repliesSent.Remove(client);
|
||||
}
|
||||
|
||||
private void RetrieveInstantMessages(IClientAPI client)
|
||||
@@ -228,7 +242,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
if (scene == null)
|
||||
scene = m_SceneList[0];
|
||||
|
||||
bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>(
|
||||
SendReply reply = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, SendReply>(
|
||||
"POST", m_RestURL+"/SaveMessage/?scope=" +
|
||||
scene.RegionInfo.ScopeID.ToString(), im);
|
||||
|
||||
@@ -238,13 +252,38 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
if (client == null)
|
||||
return;
|
||||
|
||||
client.SendInstantMessage(new GridInstantMessage(
|
||||
null, new UUID(im.toAgentID),
|
||||
"System", new UUID(im.fromAgentID),
|
||||
(byte)InstantMessageDialog.MessageFromAgent,
|
||||
"User is not logged in. "+
|
||||
(success ? "Message saved." : "Message not saved"),
|
||||
false, new Vector3()));
|
||||
if (reply.Message == String.Empty)
|
||||
reply.Message = "User is not logged in. " + (reply.Success ? "Message saved." : "Message not saved");
|
||||
|
||||
bool sendReply = true;
|
||||
|
||||
switch (reply.Disposition)
|
||||
{
|
||||
case 0: // Normal
|
||||
break;
|
||||
case 1: // Only once per user
|
||||
if (m_repliesSent.ContainsKey(client) && m_repliesSent[client].Contains(new UUID(im.toAgentID)))
|
||||
{
|
||||
sendReply = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_repliesSent.ContainsKey(client))
|
||||
m_repliesSent[client] = new List<UUID>();
|
||||
m_repliesSent[client].Add(new UUID(im.toAgentID));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (sendReply)
|
||||
{
|
||||
client.SendInstantMessage(new GridInstantMessage(
|
||||
null, new UUID(im.toAgentID),
|
||||
"System", new UUID(im.fromAgentID),
|
||||
(byte)InstantMessageDialog.MessageFromAgent,
|
||||
reply.Message,
|
||||
false, new Vector3()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
remoteClient.SendAlertMessage("Notecard saved");
|
||||
}
|
||||
else if ((InventoryType)item.InvType == InventoryType.LSL)
|
||||
{
|
||||
@@ -275,7 +275,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
remoteClient.SendAlertMessage("Script saved");
|
||||
}
|
||||
|
||||
AssetBase asset =
|
||||
@@ -799,6 +799,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.LoadXml(xmlData);
|
||||
XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject");
|
||||
Vector3 rez_pos;
|
||||
if (e == null || attachment) // Single
|
||||
{
|
||||
SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
|
||||
@@ -820,6 +821,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
RayStart, RayEnd, RayTargetID, Quaternion.Identity,
|
||||
BypassRayCast, bRayEndIsIntersection, true, g.GetAxisAlignedBoundingBox(out offsetHeight), false);
|
||||
pos.Z += offsetHeight;
|
||||
rez_pos = pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -834,6 +836,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
BypassRayCast, bRayEndIsIntersection, true,
|
||||
bbox, false);
|
||||
|
||||
rez_pos = pos;
|
||||
|
||||
pos -= bbox / 2;
|
||||
|
||||
XmlNodeList groups = e.SelectNodes("SceneObjectGroup");
|
||||
@@ -870,7 +874,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
primcount += g.PrimCount;
|
||||
|
||||
if (!m_Scene.Permissions.CanRezObject(
|
||||
primcount, remoteClient.AgentId, pos)
|
||||
primcount, remoteClient.AgentId, rez_pos)
|
||||
&& !attachment)
|
||||
{
|
||||
// The client operates in no fail mode. It will
|
||||
@@ -887,7 +891,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
return null;
|
||||
}
|
||||
|
||||
if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, attachment))
|
||||
if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, rez_pos, attachment))
|
||||
return null;
|
||||
|
||||
for (int i = 0; i < objlist.Count; i++)
|
||||
|
||||
@@ -96,6 +96,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
m_commands = new EstateManagementCommands(this);
|
||||
m_commands.Initialise();
|
||||
|
||||
m_regionChangeTimer.Interval = 10000;
|
||||
m_regionChangeTimer.Elapsed += RaiseRegionInfoChange;
|
||||
m_regionChangeTimer.AutoReset = false;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene) {}
|
||||
|
||||
@@ -565,7 +565,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
requiredPowers = GroupPowers.LandManageBanned;
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(agentID,
|
||||
land, requiredPowers))
|
||||
land, requiredPowers, false))
|
||||
{
|
||||
land.UpdateAccessList(flags, transactionID, sequenceID,
|
||||
sections, entries, remote_client);
|
||||
@@ -927,7 +927,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
//If we are still here, then they are subdividing within one piece of land
|
||||
//Check owner
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin))
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -996,7 +996,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin))
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1727,7 +1727,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
if (land == null) return;
|
||||
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions))
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions, false))
|
||||
return;
|
||||
|
||||
land.LandData.OtherCleanTime = otherCleanTime;
|
||||
@@ -1827,7 +1827,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
if (targetAvatar.UserLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze))
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true))
|
||||
return;
|
||||
if (flags == 0)
|
||||
{
|
||||
@@ -1876,7 +1876,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
// Check if you even have permission to do this
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze) &&
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true) &&
|
||||
!m_scene.Permissions.IsAdministrator(client.AgentId))
|
||||
return;
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
// ParcelFlags.ForSaleObjects
|
||||
// ParcelFlags.LindenHome
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, false))
|
||||
{
|
||||
allowedDelta |= (uint)(ParcelFlags.AllowLandmark |
|
||||
ParcelFlags.AllowTerraform |
|
||||
@@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
ParcelFlags.AllowFly);
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale, true))
|
||||
{
|
||||
if (args.AuthBuyerID != newData.AuthBuyerID ||
|
||||
args.SalePrice != newData.SalePrice)
|
||||
@@ -324,7 +324,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
allowedDelta |= (uint)ParcelFlags.ForSale;
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces, false))
|
||||
{
|
||||
newData.Category = args.Category;
|
||||
|
||||
@@ -333,21 +333,21 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
ParcelFlags.MaturePublish) | (uint)(1 << 23);
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity, false))
|
||||
{
|
||||
newData.Description = args.Desc;
|
||||
newData.Name = args.Name;
|
||||
newData.SnapshotID = args.SnapshotID;
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint, false))
|
||||
{
|
||||
newData.LandingType = args.LandingType;
|
||||
newData.UserLocation = args.UserLocation;
|
||||
newData.UserLookAt = args.UserLookAt;
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia, false))
|
||||
{
|
||||
newData.MediaAutoScale = args.MediaAutoScale;
|
||||
newData.MediaID = args.MediaID;
|
||||
@@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
ParcelFlags.UseEstateVoiceChan);
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses, false))
|
||||
{
|
||||
newData.PassHours = args.PassHours;
|
||||
newData.PassPrice = args.PassPrice;
|
||||
@@ -376,25 +376,27 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
allowedDelta |= (uint)ParcelFlags.UsePassList;
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed, false))
|
||||
{
|
||||
allowedDelta |= (uint)(ParcelFlags.UseAccessGroup |
|
||||
ParcelFlags.UseAccessList);
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned, false))
|
||||
{
|
||||
allowedDelta |= (uint)(ParcelFlags.UseBanList |
|
||||
ParcelFlags.DenyAnonymous |
|
||||
ParcelFlags.DenyAgeUnverified);
|
||||
}
|
||||
|
||||
uint preserve = LandData.Flags & ~allowedDelta;
|
||||
newData.Flags = preserve | (args.ParcelFlags & allowedDelta);
|
||||
if (allowedDelta != (uint)ParcelFlags.None)
|
||||
{
|
||||
uint preserve = LandData.Flags & ~allowedDelta;
|
||||
newData.Flags = preserve | (args.ParcelFlags & allowedDelta);
|
||||
|
||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
||||
|
||||
SendLandUpdateToAvatarsOverMe(snap_selection);
|
||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
||||
SendLandUpdateToAvatarsOverMe(snap_selection);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area)
|
||||
@@ -950,7 +952,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client)
|
||||
{
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true))
|
||||
{
|
||||
List<uint> resultLocalIDs = new List<uint>();
|
||||
try
|
||||
@@ -1000,7 +1002,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
/// </param>
|
||||
public void SendLandObjectOwners(IClientAPI remote_client)
|
||||
{
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true))
|
||||
{
|
||||
Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
|
||||
List<UUID> groups = new List<UUID>();
|
||||
|
||||
@@ -42,8 +42,8 @@ using PermissionMask = OpenSim.Framework.PermissionMask;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "PermissionsModule")]
|
||||
public class PermissionsModule : INonSharedRegionModule, IPermissionsModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultPermissionsModule")]
|
||||
public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -348,7 +348,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "PermissionsModule"; }
|
||||
get { return "DefaultPermissionsModule"; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
@@ -1047,7 +1047,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
return GenericObjectPermission(editorID, objectID, false);
|
||||
}
|
||||
|
||||
private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene)
|
||||
private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager)
|
||||
{
|
||||
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||
|
||||
Reference in New Issue
Block a user