Merge branch 'master' into httptests

httptests
UbitUmarov 2016-12-04 23:39:15 +00:00
commit 1680425f4d
21 changed files with 235 additions and 167 deletions

View File

@ -167,7 +167,7 @@ namespace OpenSim.Data.MySQL
"SitTargetOrientY, SitTargetOrientZ, " +
"RegionUUID, CreatorID, " +
"OwnerID, GroupID, " +
"LastOwnerID, SceneGroupID, " +
"LastOwnerID, RezzerID, SceneGroupID, " +
"PayPrice, PayButton1, " +
"PayButton2, PayButton3, " +
"PayButton4, LoopedSound, " +
@ -207,7 +207,7 @@ namespace OpenSim.Data.MySQL
"?SitTargetOrientW, ?SitTargetOrientX, " +
"?SitTargetOrientY, ?SitTargetOrientZ, " +
"?RegionUUID, ?CreatorID, ?OwnerID, " +
"?GroupID, ?LastOwnerID, ?SceneGroupID, " +
"?GroupID, ?LastOwnerID, ?RezzerID, ?SceneGroupID, " +
"?PayPrice, ?PayButton1, ?PayButton2, " +
"?PayButton3, ?PayButton4, ?LoopedSound, " +
"?LoopedSoundGain, ?TextureAnimation, " +
@ -1279,6 +1279,10 @@ namespace OpenSim.Data.MySQL
prim.OwnerID = DBGuid.FromDB(row["OwnerID"]);
prim.GroupID = DBGuid.FromDB(row["GroupID"]);
prim.LastOwnerID = DBGuid.FromDB(row["LastOwnerID"]);
if (row["RezzerID"] != DBNull.Value)
prim.RezzerID = DBGuid.FromDB(row["RezzerID"]);
else
prim.RezzerID = UUID.Zero;
// explicit conversion of integers is required, which sort
// of sucks. No idea if there is a shortcut here or not.
@ -1682,6 +1686,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString());
cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString());
cmd.Parameters.AddWithValue("LastOwnerID", prim.LastOwnerID.ToString());
cmd.Parameters.AddWithValue("RezzerID", prim.RezzerID.ToString());
cmd.Parameters.AddWithValue("OwnerMask", prim.OwnerMask);
cmd.Parameters.AddWithValue("NextOwnerMask", prim.NextOwnerMask);
cmd.Parameters.AddWithValue("GroupMask", prim.GroupMask);

View File

@ -453,3 +453,11 @@ MODIFY `cloud_scroll_x` float(9,7) NOT NULL DEFAULT '0.20',
MODIFY `cloud_scroll_y` float(9,7) NOT NULL DEFAULT '0.01';
COMMIT;
:VERSION 56 #----- Add RezzerID field in table prims
BEGIN;
ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL;
COMMIT;

View File

@ -363,3 +363,11 @@ CREATE TABLE IF NOT EXISTS bakedterrain(
Heightfield blob);
COMMIT;
:VERSION 35 #----- Add RezzerID field in table prims
BEGIN;
ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL;
COMMIT;

View File

@ -1216,6 +1216,7 @@ namespace OpenSim.Data.SQLite
createCol(prims, "OwnerID", typeof(String));
createCol(prims, "GroupID", typeof(String));
createCol(prims, "LastOwnerID", typeof(String));
createCol(prims, "RezzerID", typeof(String));
createCol(prims, "OwnerMask", typeof(Int32));
createCol(prims, "NextOwnerMask", typeof(Int32));
createCol(prims, "GroupMask", typeof(Int32));
@ -1679,6 +1680,7 @@ namespace OpenSim.Data.SQLite
prim.OwnerID = new UUID((String)row["OwnerID"]);
prim.GroupID = new UUID((String)row["GroupID"]);
prim.LastOwnerID = new UUID((String)row["LastOwnerID"]);
prim.RezzerID = row["RezzerID"] == DBNull.Value ? UUID.Zero : new UUID((String)row["RezzerID"]);
prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]);
prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]);
prim.GroupMask = Convert.ToUInt32(row["GroupMask"]);
@ -2125,6 +2127,7 @@ namespace OpenSim.Data.SQLite
row["OwnerID"] = prim.OwnerID.ToString();
row["GroupID"] = prim.GroupID.ToString();
row["LastOwnerID"] = prim.LastOwnerID.ToString();
row["RezzerID"] = prim.RezzerID.ToString();
row["OwnerMask"] = prim.OwnerMask;
row["NextOwnerMask"] = prim.NextOwnerMask;
row["GroupMask"] = prim.GroupMask;

View File

@ -59,6 +59,7 @@ namespace OpenSim.Framework
private int _invType = 0;
private UUID _itemID = UUID.Zero;
private UUID _lastOwnerID = UUID.Zero;
private UUID _rezzerID = UUID.Zero;
private string _name = String.Empty;
private uint _nextOwnerMask = FULL_MASK_PERMISSIONS_GENERAL;
private UUID _ownerID = UUID.Zero;
@ -254,6 +255,16 @@ namespace OpenSim.Framework
}
}
public UUID RezzerID
{
get {
return _rezzerID;
}
set {
_rezzerID = value;
}
}
public string Name {
get {
return _name;

View File

@ -29,9 +29,11 @@ using System;
using System.Timers;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Reflection;
using System.Text;
using System.Web;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
@ -125,6 +127,8 @@ namespace OpenSim.Region.ClientStack.Linden
private bool m_AllowCapHomeLocation = true;
private bool m_AllowCapGroupMemberData = true;
private IUserManagement m_UserManager;
private enum FileAgentInventoryState : int
{
@ -196,6 +200,9 @@ namespace OpenSim.Region.ClientStack.Linden
m_assetService = m_Scene.AssetService;
m_regionName = m_Scene.RegionInfo.RegionName;
m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>();
if (m_UserManager == null)
m_log.Error("[CAPS]: GetDisplayNames disabled because user management component not found");
RegisterHandlers();
@ -229,6 +236,7 @@ namespace OpenSim.Region.ClientStack.Linden
RegisterRegionServiceHandlers();
RegisterInventoryServiceHandlers();
RegisterOtherHandlers();
}
public void RegisterRegionServiceHandlers()
@ -314,6 +322,22 @@ namespace OpenSim.Region.ClientStack.Linden
}
}
public void RegisterOtherHandlers()
{
try
{
if (m_UserManager != null)
{
IRequestHandler GetDisplayNamesHandler = new RestStreamHandler(
"GET", GetNewCapPath(), GetDisplayNames, "GetDisplayNames", null);
m_HostCapsObj.RegisterHandler("GetDisplayNames", GetDisplayNamesHandler);
}
}
catch (Exception e)
{
m_log.Error("[CAPS]: " + e.ToString());
}
}
/// <summary>
/// Construct a client response detailing all the capabilities this server can provide.
/// </summary>
@ -1022,6 +1046,7 @@ namespace OpenSim.Region.ClientStack.Linden
prim.OwnerID = owner_id;
prim.GroupID = UUID.Zero;
prim.LastOwnerID = creatorID;
prim.RezzerID = creatorID;
prim.CreationDate = Util.UnixTimeSinceEpoch();
if (grp == null)
@ -1069,6 +1094,7 @@ namespace OpenSim.Region.ClientStack.Linden
{
grp = new SceneObjectGroup(prim);
grp.LastOwnerID = creatorID;
grp.RezzerID = creatorID;
}
else
grp.AddPart(prim);
@ -1794,6 +1820,72 @@ namespace OpenSim.Region.ClientStack.Linden
response = OSDParser.SerializeLLSDXmlString(resp);
return response;
}
public string GetDisplayNames(string request, string path,
string param, IOSHttpRequest httpRequest,
IOSHttpResponse httpResponse)
{
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.Gone;
httpResponse.ContentType = "text/plain";
ScenePresence sp = m_Scene.GetScenePresence(m_AgentID);
if(sp == null || sp.IsDeleted)
return "";
if(sp.IsInTransit)
{
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.ServiceUnavailable;
httpResponse.AddHeader("Retry-After","30");
return "";
}
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
string[] ids = query.GetValues("ids");
Dictionary<UUID,string> names = m_UserManager.GetUsersNames(ids);
OSDMap osdReply = new OSDMap();
OSDArray agents = new OSDArray();
osdReply["agents"] = agents;
foreach (KeyValuePair<UUID,string> kvp in names)
{
if (string.IsNullOrEmpty(kvp.Value))
continue;
if(kvp.Key == UUID.Zero)
continue;
string[] parts = kvp.Value.Split(new char[] {' '});
OSDMap osdname = new OSDMap();
if(parts[0] == "Unknown")
{
osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddHours(1));
osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddHours(2));
}
else
{
osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8));
osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1));
}
osdname["display_name"] = OSD.FromString(kvp.Value);
osdname["legacy_first_name"] = parts[0];
osdname["legacy_last_name"] = parts[1];
osdname["username"] = OSD.FromString(kvp.Value);
osdname["id"] = OSD.FromUUID(kvp.Key);
osdname["is_display_name_default"] = OSD.FromBoolean(true);
agents.Add(osdname);
}
// Full content request
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.OK;
//httpResponse.ContentLength = ??;
httpResponse.ContentType = "application/llsd+xml";
string reply = OSDParser.SerializeLLSDXmlString(osdReply);
return reply;
}
}
public class AssetUploader

View File

@ -1,143 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Drawing;
using System.Drawing.Imaging;
using System.Reflection;
using System.IO;
using System.Web;
using log4net;
using Nini.Config;
using Mono.Addins;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenMetaverse.Imaging;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using Caps = OpenSim.Framework.Capabilities.Caps;
using OpenSim.Capabilities.Handlers;
namespace OpenSim.Region.ClientStack.Linden
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GetDisplayNamesModule")]
public class GetDisplayNamesModule : INonSharedRegionModule
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene;
protected IUserManagement m_UserManager;
protected bool m_Enabled = false;
protected string m_URL;
#region ISharedRegionModule Members
public virtual void Initialise(IConfigSource source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)
return;
m_URL = config.GetString("Cap_GetDisplayNames", string.Empty);
if (m_URL != string.Empty)
m_Enabled = true;
}
public virtual void AddRegion(Scene s)
{
if (!m_Enabled)
return;
m_scene = s;
}
public virtual void RemoveRegion(Scene s)
{
if (!m_Enabled)
return;
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
m_scene = null;
}
public virtual void RegionLoaded(Scene s)
{
if (!m_Enabled)
return;
m_UserManager = m_scene.RequestModuleInterface<IUserManagement>();
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
public virtual void PostInitialise()
{
}
public virtual void Close() { }
public virtual string Name { get { return "GetDisplayNamesModule"; } }
public virtual Type ReplaceableInterface
{
get { return null; }
}
#endregion
public virtual void RegisterCaps(UUID agentID, Caps caps)
{
if (m_URL == "localhost")
{
string capUrl = "/CAPS/" + UUID.Random() + "/";
// m_log.DebugFormat("[GET_DISPLAY_NAMES]: {0} in region {1}", capUrl, m_scene.RegionInfo.RegionName);
caps.RegisterHandler(
"GetDisplayNames",
new GetDisplayNamesHandler(capUrl, m_UserManager, "GetDisplayNames", agentID.ToString()));
}
else
{
// m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
if (handler != null)
handler.RegisterExternalUserCapsHandler(agentID,caps,"GetDisplayNames", m_URL);
else
caps.RegisterHandler("GetDisplayNames", m_URL);
}
}
}
}

View File

@ -284,6 +284,7 @@ namespace OpenSim.Region.ClientStack.Linden
prim.OwnerID = AgentId;
prim.GroupID = obj.GroupID;
prim.LastOwnerID = prim.OwnerID;
prim.RezzerID = AgentId;
prim.CreationDate = Util.UnixTimeSinceEpoch();
prim.Name = obj.Name;
prim.Description = "";

View File

@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (UUID.TryParse(friendID, out id))
return base.FriendshipMessage(friendID);
return "Please confirm this friendship you made while you were away.";
return "Please confirm this friendship you made while you where on another HG grid";
}
protected override FriendInfo GetFriend(FriendInfo[] friends, UUID friendID)
@ -456,6 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
// local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
DeletePreviousHGRelations(agentID, friendID);
base.StoreFriendships(agentID, friendID);
return;
}
@ -624,6 +625,45 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
private void DeletePreviousHGRelations(UUID a1, UUID a2)
{
// Delete any previous friendship relations
FriendInfo[] finfos = null;
finfos = GetFriendsFromCache(a1);
if (finfos != null)
{
foreach (FriendInfo f in finfos)
{
if (f.TheirFlags == -1)
{
if (f.Friend.StartsWith(a2.ToString()))
{
FriendsService.Delete(a1, f.Friend);
// and also the converse
FriendsService.Delete(f.Friend, a1.ToString());
}
}
}
}
finfos = GetFriendsFromCache(a1);
if (finfos != null)
{
foreach (FriendInfo f in finfos)
{
if (f.TheirFlags == -1)
{
if (f.Friend.StartsWith(a1.ToString()))
{
FriendsService.Delete(a2, f.Friend);
// and also the converse
FriendsService.Delete(f.Friend, a2.ToString());
}
}
}
}
}
protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
{
Boolean agentIsLocal = true;

View File

@ -2093,19 +2093,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
spScene.SimulationService.UpdateAgent(neighbour, agentpos);
}
}
catch (ArgumentOutOfRangeException)
{
m_log.ErrorFormat(
"[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).",
neighbour.ExternalHostName,
neighbour.RegionHandle,
neighbour.RegionLocX,
neighbour.RegionLocY);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}",
"[ENTITY TRANSFER MODULE]: Error creating child agent at {0} ({1} ({2}, {3}). {4}",
neighbour.ExternalHostName,
neighbour.RegionHandle,
neighbour.RegionLocX,
@ -2279,24 +2270,28 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// <param name="a"></param>
/// <param name="regionHandle"></param>
/// <param name="endPoint"></param>
private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData a, GridRegion reg,
private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData agentCircData, GridRegion reg,
IPEndPoint endPoint, bool newAgent)
{
if (newAgent)
{
// we may already had lost this sp
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
Scene scene = sp.Scene;
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(agentCircData.CapsPath);
string reason = String.Empty;
EntityTransferContext ctx = new EntityTransferContext();
bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, a, (uint)TeleportFlags.Default, ctx, out reason);
bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, agentCircData, (uint)TeleportFlags.Default, ctx, out reason);
if (regionAccepted)
{
@ -2306,6 +2301,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (m_eqModule != null)
{
#region IP Translation for NAT
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
IClientIPEndpoint ipepClient;
if (sp.ClientView.TryGet(out ipepClient))
{

View File

@ -981,6 +981,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset.
part.LastOwnerID = part.OwnerID;
part.OwnerID = remoteClient.AgentId;
part.RezzerID = remoteClient.AgentId;
}
}
@ -1150,6 +1151,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
part.LastOwnerID = part.OwnerID;
part.OwnerID = item.Owner;
part.RezzerID = item.Owner;
part.Inventory.ChangeInventoryOwner(item.Owner);
}

View File

@ -2624,7 +2624,8 @@ namespace OpenSim.Region.Framework.Scenes
group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
}
group.FromPartID = sourcePart.UUID;
group.RezzerID = sourcePart.UUID;
if( i == 0)
AddNewSceneObject(group, true, curpos, rot, vel);
else

View File

@ -1942,6 +1942,7 @@ namespace OpenSim.Region.Framework.Scenes
else
{
part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID;
part.RezzerID = part.ParentGroup.RootPart.RezzerID;
childParts.Add(part);
}
}

View File

@ -886,6 +886,12 @@ namespace OpenSim.Region.Framework.Scenes
set { m_rootPart.LastOwnerID = value; }
}
public UUID RezzerID
{
get { return m_rootPart.RezzerID; }
set { m_rootPart.RezzerID = value; }
}
public UUID OwnerID
{
get { return m_rootPart.OwnerID; }
@ -1053,7 +1059,12 @@ namespace OpenSim.Region.Framework.Scenes
/// <remarks>
/// If not applicable will be UUID.Zero
/// </remarks>
public UUID FromPartID { get; set; }
/// obsolete use RezzerID
public UUID FromPartID
{
get { return RezzerID; }
set {RezzerID = value; }
}
/// <summary>
/// The folder ID that this object was rezzed from, if applicable.

View File

@ -460,7 +460,7 @@ namespace OpenSim.Region.Framework.Scenes
m_name = "Object";
CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
LastOwnerID = CreatorID = OwnerID = ownerID;
RezzerID = LastOwnerID = CreatorID = OwnerID = ownerID;
UUID = UUID.Random();
Shape = shape;
OwnershipCost = 0;
@ -484,6 +484,7 @@ namespace OpenSim.Region.Framework.Scenes
#region XML Schema
private UUID _rezzerID;
private UUID _lastOwnerID;
private UUID _ownerID;
private UUID _groupID;
@ -1385,6 +1386,12 @@ namespace OpenSim.Region.Framework.Scenes
set { _lastOwnerID = value; }
}
public UUID RezzerID
{
get { return _rezzerID; }
set { _rezzerID = value; }
}
public uint BaseMask
{
get { return _baseMask; }
@ -2222,6 +2229,7 @@ namespace OpenSim.Region.Framework.Scenes
// This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated.
dupe.LastOwnerID = OwnerID;
dupe.RezzerID = RezzerID;
byte[] extraP = new byte[Shape.ExtraParams.Length];
Array.Copy(Shape.ExtraParams, extraP, extraP.Length);

View File

@ -428,6 +428,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("GroupID", ProcessGroupID);
m_SOPXmlProcessors.Add("OwnerID", ProcessOwnerID);
m_SOPXmlProcessors.Add("LastOwnerID", ProcessLastOwnerID);
m_SOPXmlProcessors.Add("RezzerID", ProcessRezzerID);
m_SOPXmlProcessors.Add("BaseMask", ProcessBaseMask);
m_SOPXmlProcessors.Add("OwnerMask", ProcessOwnerMask);
m_SOPXmlProcessors.Add("GroupMask", ProcessGroupMask);
@ -864,6 +865,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID");
}
private static void ProcessRezzerID(SceneObjectPart obj, XmlReader reader)
{
obj.RezzerID = Util.ReadUUID(reader, "RezzerID");
}
private static void ProcessBaseMask(SceneObjectPart obj, XmlReader reader)
{
obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty);
@ -1452,6 +1458,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
UUID lastOwnerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.LastOwnerID;
WriteUUID(writer, "LastOwnerID", lastOwnerID, options);
UUID rezzerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.RezzerID;
WriteUUID(writer, "RezzerID", rezzerID, options);
writer.WriteElementString("BaseMask", sop.BaseMask.ToString());
writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString());
writer.WriteElementString("GroupMask", sop.GroupMask.ToString());

View File

@ -783,7 +783,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
}
group.FromPartID = host.RootPart.UUID;
group.RezzerID = host.RootPart.UUID;
m_scene.AddNewSceneObject(group, true, curpos, rot, vel);
UUID storeID = group.UUID;

View File

@ -718,8 +718,8 @@ namespace PrimMesher
}
newFace.v1 = 0;
newFace.v2 = numTotalVerts - numHollowVerts;
newFace.v3 = numTotalVerts - 1;
newFace.v2 = numTotalVerts - 1;
newFace.v3 = numTotalVerts - numHollowVerts;
faces.Add(newFace);
}
}

View File

@ -6303,6 +6303,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
IUrlModule UrlModule = World.RequestModuleInterface<IUrlModule>();
return UrlModule.ExternalHostNameForLSL;
}
else if (name == "region_max_prims")
{
return World.RegionInfo.ObjectCapacity.ToString();
}
else
{
return "";
@ -13789,6 +13793,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} catch { };
ret.Add(new LSL_Integer(invcount));
break;
case ScriptBaseClass.OBJECT_REZZER_KEY:
ret.Add(new LSL_Key(id));
break;
case ScriptBaseClass.OBJECT_GROUP_TAG:
ret.Add(new LSL_String(av.Grouptitle));
break;
@ -13984,6 +13991,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
count += parts[i].Inventory.Count;
ret.Add(new LSL_Integer(count));
break;
case ScriptBaseClass.OBJECT_REZZER_KEY:
ret.Add(new LSL_Key(obj.ParentGroup.RezzerID.ToString()));
break;
case ScriptBaseClass.OBJECT_GROUP_TAG:
ret.Add(new LSL_String(String.Empty));
break;

View File

@ -4030,8 +4030,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject");
m_host.AddScriptLPS(1);
return new LSL_Key(m_host.ParentGroup.FromPartID.ToString());
UUID rezID = m_host.ParentGroup.RezzerID;
if(rezID == UUID.Zero || m_host.ParentGroup.Scene.GetScenePresence(rezID) != null)
return new LSL_Key(UUID.Zero.ToString());
return new LSL_Key(rezID.ToString());
}
/// <summary>

View File

@ -640,6 +640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int OBJECT_OMEGA = 29;
public const int OBJECT_PRIM_COUNT = 30;
public const int OBJECT_TOTAL_INVENTORY_COUNT = 31;
public const int OBJECT_REZZER_KEY = 32;
public const int OBJECT_GROUP_TAG = 33;
public const int OBJECT_TEMP_ATTACHED = 34;