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, " + "SitTargetOrientY, SitTargetOrientZ, " +
"RegionUUID, CreatorID, " + "RegionUUID, CreatorID, " +
"OwnerID, GroupID, " + "OwnerID, GroupID, " +
"LastOwnerID, SceneGroupID, " + "LastOwnerID, RezzerID, SceneGroupID, " +
"PayPrice, PayButton1, " + "PayPrice, PayButton1, " +
"PayButton2, PayButton3, " + "PayButton2, PayButton3, " +
"PayButton4, LoopedSound, " + "PayButton4, LoopedSound, " +
@ -207,7 +207,7 @@ namespace OpenSim.Data.MySQL
"?SitTargetOrientW, ?SitTargetOrientX, " + "?SitTargetOrientW, ?SitTargetOrientX, " +
"?SitTargetOrientY, ?SitTargetOrientZ, " + "?SitTargetOrientY, ?SitTargetOrientZ, " +
"?RegionUUID, ?CreatorID, ?OwnerID, " + "?RegionUUID, ?CreatorID, ?OwnerID, " +
"?GroupID, ?LastOwnerID, ?SceneGroupID, " + "?GroupID, ?LastOwnerID, ?RezzerID, ?SceneGroupID, " +
"?PayPrice, ?PayButton1, ?PayButton2, " + "?PayPrice, ?PayButton1, ?PayButton2, " +
"?PayButton3, ?PayButton4, ?LoopedSound, " + "?PayButton3, ?PayButton4, ?LoopedSound, " +
"?LoopedSoundGain, ?TextureAnimation, " + "?LoopedSoundGain, ?TextureAnimation, " +
@ -1279,6 +1279,10 @@ namespace OpenSim.Data.MySQL
prim.OwnerID = DBGuid.FromDB(row["OwnerID"]); prim.OwnerID = DBGuid.FromDB(row["OwnerID"]);
prim.GroupID = DBGuid.FromDB(row["GroupID"]); prim.GroupID = DBGuid.FromDB(row["GroupID"]);
prim.LastOwnerID = DBGuid.FromDB(row["LastOwnerID"]); 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 // explicit conversion of integers is required, which sort
// of sucks. No idea if there is a shortcut here or not. // 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("OwnerID", prim.OwnerID.ToString());
cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString());
cmd.Parameters.AddWithValue("LastOwnerID", prim.LastOwnerID.ToString()); cmd.Parameters.AddWithValue("LastOwnerID", prim.LastOwnerID.ToString());
cmd.Parameters.AddWithValue("RezzerID", prim.RezzerID.ToString());
cmd.Parameters.AddWithValue("OwnerMask", prim.OwnerMask); cmd.Parameters.AddWithValue("OwnerMask", prim.OwnerMask);
cmd.Parameters.AddWithValue("NextOwnerMask", prim.NextOwnerMask); cmd.Parameters.AddWithValue("NextOwnerMask", prim.NextOwnerMask);
cmd.Parameters.AddWithValue("GroupMask", prim.GroupMask); 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'; MODIFY `cloud_scroll_y` float(9,7) NOT NULL DEFAULT '0.01';
COMMIT; 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); Heightfield blob);
COMMIT; 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, "OwnerID", typeof(String));
createCol(prims, "GroupID", typeof(String)); createCol(prims, "GroupID", typeof(String));
createCol(prims, "LastOwnerID", typeof(String)); createCol(prims, "LastOwnerID", typeof(String));
createCol(prims, "RezzerID", typeof(String));
createCol(prims, "OwnerMask", typeof(Int32)); createCol(prims, "OwnerMask", typeof(Int32));
createCol(prims, "NextOwnerMask", typeof(Int32)); createCol(prims, "NextOwnerMask", typeof(Int32));
createCol(prims, "GroupMask", typeof(Int32)); createCol(prims, "GroupMask", typeof(Int32));
@ -1679,6 +1680,7 @@ namespace OpenSim.Data.SQLite
prim.OwnerID = new UUID((String)row["OwnerID"]); prim.OwnerID = new UUID((String)row["OwnerID"]);
prim.GroupID = new UUID((String)row["GroupID"]); prim.GroupID = new UUID((String)row["GroupID"]);
prim.LastOwnerID = new UUID((String)row["LastOwnerID"]); 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.OwnerMask = Convert.ToUInt32(row["OwnerMask"]);
prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]); prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]);
prim.GroupMask = Convert.ToUInt32(row["GroupMask"]); prim.GroupMask = Convert.ToUInt32(row["GroupMask"]);
@ -2125,6 +2127,7 @@ namespace OpenSim.Data.SQLite
row["OwnerID"] = prim.OwnerID.ToString(); row["OwnerID"] = prim.OwnerID.ToString();
row["GroupID"] = prim.GroupID.ToString(); row["GroupID"] = prim.GroupID.ToString();
row["LastOwnerID"] = prim.LastOwnerID.ToString(); row["LastOwnerID"] = prim.LastOwnerID.ToString();
row["RezzerID"] = prim.RezzerID.ToString();
row["OwnerMask"] = prim.OwnerMask; row["OwnerMask"] = prim.OwnerMask;
row["NextOwnerMask"] = prim.NextOwnerMask; row["NextOwnerMask"] = prim.NextOwnerMask;
row["GroupMask"] = prim.GroupMask; row["GroupMask"] = prim.GroupMask;

View File

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

View File

@ -29,9 +29,11 @@ using System;
using System.Timers; using System.Timers;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Web;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
@ -125,6 +127,8 @@ namespace OpenSim.Region.ClientStack.Linden
private bool m_AllowCapHomeLocation = true; private bool m_AllowCapHomeLocation = true;
private bool m_AllowCapGroupMemberData = true; private bool m_AllowCapGroupMemberData = true;
private IUserManagement m_UserManager;
private enum FileAgentInventoryState : int private enum FileAgentInventoryState : int
{ {
@ -196,6 +200,9 @@ namespace OpenSim.Region.ClientStack.Linden
m_assetService = m_Scene.AssetService; m_assetService = m_Scene.AssetService;
m_regionName = m_Scene.RegionInfo.RegionName; 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(); RegisterHandlers();
@ -229,6 +236,7 @@ namespace OpenSim.Region.ClientStack.Linden
RegisterRegionServiceHandlers(); RegisterRegionServiceHandlers();
RegisterInventoryServiceHandlers(); RegisterInventoryServiceHandlers();
RegisterOtherHandlers();
} }
public void RegisterRegionServiceHandlers() 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> /// <summary>
/// Construct a client response detailing all the capabilities this server can provide. /// Construct a client response detailing all the capabilities this server can provide.
/// </summary> /// </summary>
@ -1022,6 +1046,7 @@ namespace OpenSim.Region.ClientStack.Linden
prim.OwnerID = owner_id; prim.OwnerID = owner_id;
prim.GroupID = UUID.Zero; prim.GroupID = UUID.Zero;
prim.LastOwnerID = creatorID; prim.LastOwnerID = creatorID;
prim.RezzerID = creatorID;
prim.CreationDate = Util.UnixTimeSinceEpoch(); prim.CreationDate = Util.UnixTimeSinceEpoch();
if (grp == null) if (grp == null)
@ -1069,6 +1094,7 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
grp = new SceneObjectGroup(prim); grp = new SceneObjectGroup(prim);
grp.LastOwnerID = creatorID; grp.LastOwnerID = creatorID;
grp.RezzerID = creatorID;
} }
else else
grp.AddPart(prim); grp.AddPart(prim);
@ -1794,6 +1820,72 @@ namespace OpenSim.Region.ClientStack.Linden
response = OSDParser.SerializeLLSDXmlString(resp); response = OSDParser.SerializeLLSDXmlString(resp);
return response; 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 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.OwnerID = AgentId;
prim.GroupID = obj.GroupID; prim.GroupID = obj.GroupID;
prim.LastOwnerID = prim.OwnerID; prim.LastOwnerID = prim.OwnerID;
prim.RezzerID = AgentId;
prim.CreationDate = Util.UnixTimeSinceEpoch(); prim.CreationDate = Util.UnixTimeSinceEpoch();
prim.Name = obj.Name; prim.Name = obj.Name;
prim.Description = ""; prim.Description = "";

View File

@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (UUID.TryParse(friendID, out id)) if (UUID.TryParse(friendID, out id))
return base.FriendshipMessage(friendID); 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) protected override FriendInfo GetFriend(FriendInfo[] friends, UUID friendID)
@ -456,6 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{ {
// local grid users // local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
DeletePreviousHGRelations(agentID, friendID);
base.StoreFriendships(agentID, friendID); base.StoreFriendships(agentID, friendID);
return; 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) protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
{ {
Boolean agentIsLocal = true; Boolean agentIsLocal = true;

View File

@ -2093,19 +2093,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
spScene.SimulationService.UpdateAgent(neighbour, agentpos); 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) catch (Exception e)
{ {
m_log.ErrorFormat( 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.ExternalHostName,
neighbour.RegionHandle, neighbour.RegionHandle,
neighbour.RegionLocX, neighbour.RegionLocX,
@ -2279,24 +2270,28 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// <param name="a"></param> /// <param name="a"></param>
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <param name="endPoint"></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) IPEndPoint endPoint, bool newAgent)
{ {
if (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; Scene scene = sp.Scene;
m_log.DebugFormat( m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})", "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY); 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; string reason = String.Empty;
EntityTransferContext ctx = new EntityTransferContext(); 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) if (regionAccepted)
{ {
@ -2306,6 +2301,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (m_eqModule != null) if (m_eqModule != null)
{ {
#region IP Translation for NAT #region IP Translation for NAT
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
IClientIPEndpoint ipepClient; IClientIPEndpoint ipepClient;
if (sp.ClientView.TryGet(out 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. // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset.
part.LastOwnerID = part.OwnerID; part.LastOwnerID = part.OwnerID;
part.OwnerID = remoteClient.AgentId; part.OwnerID = remoteClient.AgentId;
part.RezzerID = remoteClient.AgentId;
} }
} }
@ -1150,6 +1151,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
part.LastOwnerID = part.OwnerID; part.LastOwnerID = part.OwnerID;
part.OwnerID = item.Owner; part.OwnerID = item.Owner;
part.RezzerID = item.Owner;
part.Inventory.ChangeInventoryOwner(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.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
} }
group.FromPartID = sourcePart.UUID; group.RezzerID = sourcePart.UUID;
if( i == 0) if( i == 0)
AddNewSceneObject(group, true, curpos, rot, vel); AddNewSceneObject(group, true, curpos, rot, vel);
else else

View File

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

View File

@ -886,6 +886,12 @@ namespace OpenSim.Region.Framework.Scenes
set { m_rootPart.LastOwnerID = value; } set { m_rootPart.LastOwnerID = value; }
} }
public UUID RezzerID
{
get { return m_rootPart.RezzerID; }
set { m_rootPart.RezzerID = value; }
}
public UUID OwnerID public UUID OwnerID
{ {
get { return m_rootPart.OwnerID; } get { return m_rootPart.OwnerID; }
@ -1053,7 +1059,12 @@ namespace OpenSim.Region.Framework.Scenes
/// <remarks> /// <remarks>
/// If not applicable will be UUID.Zero /// If not applicable will be UUID.Zero
/// </remarks> /// </remarks>
public UUID FromPartID { get; set; } /// obsolete use RezzerID
public UUID FromPartID
{
get { return RezzerID; }
set {RezzerID = value; }
}
/// <summary> /// <summary>
/// The folder ID that this object was rezzed from, if applicable. /// 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"; m_name = "Object";
CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed); CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
LastOwnerID = CreatorID = OwnerID = ownerID; RezzerID = LastOwnerID = CreatorID = OwnerID = ownerID;
UUID = UUID.Random(); UUID = UUID.Random();
Shape = shape; Shape = shape;
OwnershipCost = 0; OwnershipCost = 0;
@ -484,6 +484,7 @@ namespace OpenSim.Region.Framework.Scenes
#region XML Schema #region XML Schema
private UUID _rezzerID;
private UUID _lastOwnerID; private UUID _lastOwnerID;
private UUID _ownerID; private UUID _ownerID;
private UUID _groupID; private UUID _groupID;
@ -1385,6 +1386,12 @@ namespace OpenSim.Region.Framework.Scenes
set { _lastOwnerID = value; } set { _lastOwnerID = value; }
} }
public UUID RezzerID
{
get { return _rezzerID; }
set { _rezzerID = value; }
}
public uint BaseMask public uint BaseMask
{ {
get { return _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. // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated.
dupe.LastOwnerID = OwnerID; dupe.LastOwnerID = OwnerID;
dupe.RezzerID = RezzerID;
byte[] extraP = new byte[Shape.ExtraParams.Length]; byte[] extraP = new byte[Shape.ExtraParams.Length];
Array.Copy(Shape.ExtraParams, extraP, extraP.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("GroupID", ProcessGroupID);
m_SOPXmlProcessors.Add("OwnerID", ProcessOwnerID); m_SOPXmlProcessors.Add("OwnerID", ProcessOwnerID);
m_SOPXmlProcessors.Add("LastOwnerID", ProcessLastOwnerID); m_SOPXmlProcessors.Add("LastOwnerID", ProcessLastOwnerID);
m_SOPXmlProcessors.Add("RezzerID", ProcessRezzerID);
m_SOPXmlProcessors.Add("BaseMask", ProcessBaseMask); m_SOPXmlProcessors.Add("BaseMask", ProcessBaseMask);
m_SOPXmlProcessors.Add("OwnerMask", ProcessOwnerMask); m_SOPXmlProcessors.Add("OwnerMask", ProcessOwnerMask);
m_SOPXmlProcessors.Add("GroupMask", ProcessGroupMask); m_SOPXmlProcessors.Add("GroupMask", ProcessGroupMask);
@ -864,6 +865,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID"); 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) private static void ProcessBaseMask(SceneObjectPart obj, XmlReader reader)
{ {
obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty); 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; UUID lastOwnerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.LastOwnerID;
WriteUUID(writer, "LastOwnerID", lastOwnerID, options); 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("BaseMask", sop.BaseMask.ToString());
writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString()); writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString());
writer.WriteElementString("GroupMask", sop.GroupMask.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.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
} }
group.FromPartID = host.RootPart.UUID; group.RezzerID = host.RootPart.UUID;
m_scene.AddNewSceneObject(group, true, curpos, rot, vel); m_scene.AddNewSceneObject(group, true, curpos, rot, vel);
UUID storeID = group.UUID; UUID storeID = group.UUID;

View File

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

View File

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

View File

@ -4030,8 +4030,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject"); CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID rezID = m_host.ParentGroup.RezzerID;
return new LSL_Key(m_host.ParentGroup.FromPartID.ToString()); 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> /// <summary>

View File

@ -640,6 +640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int OBJECT_OMEGA = 29; public const int OBJECT_OMEGA = 29;
public const int OBJECT_PRIM_COUNT = 30; public const int OBJECT_PRIM_COUNT = 30;
public const int OBJECT_TOTAL_INVENTORY_COUNT = 31; 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_GROUP_TAG = 33;
public const int OBJECT_TEMP_ATTACHED = 34; public const int OBJECT_TEMP_ATTACHED = 34;