merge issue
commit
7ba3fb7b5d
|
@ -764,7 +764,7 @@ namespace OpenSim.Groups
|
||||||
}
|
}
|
||||||
|
|
||||||
// check funds
|
// check funds
|
||||||
// is there is a money module present ?
|
// is there a money module present ?
|
||||||
IMoneyModule money = scene.RequestModuleInterface<IMoneyModule>();
|
IMoneyModule money = scene.RequestModuleInterface<IMoneyModule>();
|
||||||
if (money != null)
|
if (money != null)
|
||||||
{
|
{
|
||||||
|
@ -784,7 +784,7 @@ namespace OpenSim.Groups
|
||||||
if (money != null)
|
if (money != null)
|
||||||
money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate);
|
money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate);
|
||||||
|
|
||||||
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
|
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully");
|
||||||
|
|
||||||
// Update the founder with new group information.
|
// Update the founder with new group information.
|
||||||
SendAgentGroupDataUpdate(remoteClient, false);
|
SendAgentGroupDataUpdate(remoteClient, false);
|
||||||
|
|
|
@ -29,8 +29,6 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
@ -38,12 +36,7 @@ using log4net;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenMetaverse.StructuredData;
|
using OpenMetaverse.StructuredData;
|
||||||
using OpenMetaverse.Imaging;
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Framework.Capabilities;
|
|
||||||
using OpenSim.Framework.Servers;
|
|
||||||
using OpenSim.Framework.Servers.HttpServer;
|
using OpenSim.Framework.Servers.HttpServer;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||||
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
||||||
|
@ -70,7 +63,6 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
|
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
|
||||||
string[] ids = query.GetValues("ids");
|
string[] ids = query.GetValues("ids");
|
||||||
|
|
||||||
|
|
||||||
if (m_UserManagement == null)
|
if (m_UserManagement == null)
|
||||||
{
|
{
|
||||||
m_log.Error("[GET_DISPLAY_NAMES]: Cannot fetch display names without a user management component");
|
m_log.Error("[GET_DISPLAY_NAMES]: Cannot fetch display names without a user management component");
|
||||||
|
@ -78,35 +70,39 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
return new byte[0];
|
return new byte[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dictionary<UUID,string> names = m_UserManagement.GetUsersNames(ids);
|
||||||
|
|
||||||
OSDMap osdReply = new OSDMap();
|
OSDMap osdReply = new OSDMap();
|
||||||
OSDArray agents = new OSDArray();
|
OSDArray agents = new OSDArray();
|
||||||
|
|
||||||
osdReply["agents"] = agents;
|
osdReply["agents"] = agents;
|
||||||
foreach (string id in ids)
|
foreach (KeyValuePair<UUID,string> kvp in names)
|
||||||
{
|
{
|
||||||
UUID uuid = UUID.Zero;
|
if (string.IsNullOrEmpty(kvp.Value))
|
||||||
if (UUID.TryParse(id, out uuid))
|
continue;
|
||||||
{
|
if(kvp.Key == UUID.Zero)
|
||||||
string name = m_UserManagement.GetUserName(uuid);
|
continue;
|
||||||
if (!string.IsNullOrEmpty(name))
|
|
||||||
{
|
|
||||||
string[] parts = name.Split(new char[] {' '});
|
|
||||||
OSDMap osdname = new OSDMap();
|
|
||||||
// a date that is valid
|
|
||||||
// osdname["display_name_next_update"] = OSD.FromDate(new DateTime(1970,1,1));
|
|
||||||
// but send one that blocks edition, since we actually don't suport this
|
|
||||||
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(name);
|
|
||||||
osdname["legacy_first_name"] = parts[0];
|
|
||||||
osdname["legacy_last_name"] = parts[1];
|
|
||||||
osdname["username"] = OSD.FromString(name);
|
|
||||||
osdname["id"] = OSD.FromUUID(uuid);
|
|
||||||
osdname["is_display_name_default"] = OSD.FromBoolean(true);
|
|
||||||
|
|
||||||
agents.Add(osdname);
|
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
|
// Full content request
|
||||||
|
@ -116,8 +112,6 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
string reply = OSDParser.SerializeLLSDXmlString(osdReply);
|
string reply = OSDParser.SerializeLLSDXmlString(osdReply);
|
||||||
return System.Text.Encoding.UTF8.GetBytes(reply);
|
return System.Text.Encoding.UTF8.GetBytes(reply);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,6 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
if (m_UserManagement == null)
|
if (m_UserManagement == null)
|
||||||
throw new Exception(String.Format("Failed to load UserManagement from {0}; config is {1}", umService, m_ConfigName));
|
throw new Exception(String.Format("Failed to load UserManagement from {0}; config is {1}", umService, m_ConfigName));
|
||||||
|
|
||||||
string rurl = serverConfig.GetString("GetTextureRedirectURL");
|
|
||||||
|
|
||||||
server.AddStreamHandler(
|
server.AddStreamHandler(
|
||||||
new GetDisplayNamesHandler("/CAPS/agents/", m_UserManagement, "GetDisplayNames", null));
|
new GetDisplayNamesHandler("/CAPS/agents/", m_UserManagement, "GetDisplayNames", null));
|
||||||
|
|
|
@ -1256,9 +1256,11 @@ namespace OpenSim.Framework
|
||||||
void SendAttachedSoundGainChange(UUID objectID, float gain);
|
void SendAttachedSoundGainChange(UUID objectID, float gain);
|
||||||
|
|
||||||
void SendNameReply(UUID profileId, string firstname, string lastname);
|
void SendNameReply(UUID profileId, string firstname, string lastname);
|
||||||
void SendAlertMessage(string message);
|
|
||||||
|
|
||||||
|
void SendAlertMessage(string message);
|
||||||
|
void SendAlertMessage(string message, string into);
|
||||||
void SendAgentAlertMessage(string message, bool modal);
|
void SendAgentAlertMessage(string message, bool modal);
|
||||||
|
|
||||||
void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url);
|
void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -382,7 +382,8 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
public static ulong RegionGridLocToHandle(uint X, uint Y)
|
public static ulong RegionGridLocToHandle(uint X, uint Y)
|
||||||
{
|
{
|
||||||
ulong handle = X << 40; // shift to higher half and mult by 256)
|
ulong handle = X;
|
||||||
|
handle <<= 40; // shift to higher half and mult by 256)
|
||||||
handle |= (Y << 8); // mult by 256)
|
handle |= (Y << 8); // mult by 256)
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ using log4net;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Capabilities;
|
using OpenSim.Framework.Capabilities;
|
||||||
using OpenSim.Region.Framework;
|
using OpenSim.Region.Framework;
|
||||||
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
|
@ -89,23 +90,11 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Scene m_Scene;
|
private Scene m_Scene;
|
||||||
|
private UUID m_AgentID;
|
||||||
private Caps m_HostCapsObj;
|
private Caps m_HostCapsObj;
|
||||||
private ModelCost m_ModelCost;
|
private ModelCost m_ModelCost;
|
||||||
|
|
||||||
private static readonly string m_requestPath = "0000/";
|
|
||||||
// private static readonly string m_mapLayerPath = "0001/";
|
|
||||||
private static readonly string m_newInventory = "0002/";
|
|
||||||
//private static readonly string m_requestTexture = "0003/";
|
|
||||||
private static readonly string m_notecardUpdatePath = "0004/";
|
|
||||||
private static readonly string m_notecardTaskUpdatePath = "0005/";
|
|
||||||
// private static readonly string m_fetchInventoryPath = "0006/";
|
|
||||||
private static readonly string m_copyFromNotecardPath = "0007/";
|
|
||||||
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
|
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
|
||||||
private static readonly string m_getObjectPhysicsDataPath = "0101/";
|
|
||||||
private static readonly string m_getObjectCostPath = "0102/";
|
|
||||||
private static readonly string m_ResourceCostSelectedPath = "0103/";
|
|
||||||
private static readonly string m_UpdateAgentInformationPath = "0500/";
|
|
||||||
private static readonly string m_animSetTaskUpdatePath = "0260/";
|
|
||||||
|
|
||||||
// These are callbacks which will be setup by the scene so that we can update scene data when we
|
// These are callbacks which will be setup by the scene so that we can update scene data when we
|
||||||
// receive capability calls
|
// receive capability calls
|
||||||
|
@ -134,6 +123,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
private float m_PrimScaleMin = 0.001f;
|
private float m_PrimScaleMin = 0.001f;
|
||||||
|
|
||||||
|
private bool m_AllowCapHomeLocation = true;
|
||||||
|
private bool m_AllowCapGroupMemberData = true;
|
||||||
|
|
||||||
private enum FileAgentInventoryState : int
|
private enum FileAgentInventoryState : int
|
||||||
{
|
{
|
||||||
idle = 0,
|
idle = 0,
|
||||||
|
@ -143,27 +135,16 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
}
|
}
|
||||||
private FileAgentInventoryState m_FileAgentInventoryState = FileAgentInventoryState.idle;
|
private FileAgentInventoryState m_FileAgentInventoryState = FileAgentInventoryState.idle;
|
||||||
|
|
||||||
public BunchOfCaps(Scene scene, Caps caps)
|
public BunchOfCaps(Scene scene, UUID agentID, Caps caps)
|
||||||
{
|
{
|
||||||
m_Scene = scene;
|
m_Scene = scene;
|
||||||
|
m_AgentID = agentID;
|
||||||
m_HostCapsObj = caps;
|
m_HostCapsObj = caps;
|
||||||
|
|
||||||
// create a model upload cost provider
|
// create a model upload cost provider
|
||||||
m_ModelCost = new ModelCost();
|
m_ModelCost = new ModelCost(scene);
|
||||||
// tell it about scene object limits
|
|
||||||
m_ModelCost.NonPhysicalPrimScaleMax = m_Scene.m_maxNonphys;
|
|
||||||
m_ModelCost.PhysicalPrimScaleMax = m_Scene.m_maxPhys;
|
|
||||||
m_ModelCost.ObjectLinkedPartsMax = m_Scene.m_linksetCapacity;
|
|
||||||
|
|
||||||
// m_ModelCost.ObjectLinkedPartsMax = ??
|
|
||||||
// m_ModelCost.PrimScaleMin = ??
|
|
||||||
|
|
||||||
m_PrimScaleMin = m_ModelCost.PrimScaleMin;
|
m_PrimScaleMin = m_ModelCost.PrimScaleMin;
|
||||||
float modelTextureUploadFactor = m_ModelCost.ModelTextureCostFactor;
|
|
||||||
float modelUploadFactor = m_ModelCost.ModelMeshCostFactor;
|
|
||||||
float modelMinUploadCostFactor = m_ModelCost.ModelMinCostFactor;
|
|
||||||
float modelPrimCreationCost = m_ModelCost.primCreationCost;
|
|
||||||
float modelMeshByteCost = m_ModelCost.bytecost;
|
|
||||||
|
|
||||||
IConfigSource config = m_Scene.Config;
|
IConfigSource config = m_Scene.Config;
|
||||||
if (config != null)
|
if (config != null)
|
||||||
|
@ -183,12 +164,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
IConfig EconomyConfig = config.Configs["Economy"];
|
IConfig EconomyConfig = config.Configs["Economy"];
|
||||||
if (EconomyConfig != null)
|
if (EconomyConfig != null)
|
||||||
{
|
{
|
||||||
modelUploadFactor = EconomyConfig.GetFloat("MeshModelUploadCostFactor", modelUploadFactor);
|
m_ModelCost.Econfig(EconomyConfig);
|
||||||
modelTextureUploadFactor = EconomyConfig.GetFloat("MeshModelUploadTextureCostFactor", modelTextureUploadFactor);
|
|
||||||
modelMinUploadCostFactor = EconomyConfig.GetFloat("MeshModelMinCostFactor", modelMinUploadCostFactor);
|
|
||||||
// next 2 are normalized so final cost is afected by modelUploadFactor above and normal cost
|
|
||||||
modelPrimCreationCost = EconomyConfig.GetFloat("ModelPrimCreationCost", modelPrimCreationCost);
|
|
||||||
modelMeshByteCost = EconomyConfig.GetFloat("ModelMeshByteCost", modelMeshByteCost);
|
|
||||||
|
|
||||||
m_enableModelUploadTextureToInventory = EconomyConfig.GetBoolean("MeshModelAllowTextureToInventory", m_enableModelUploadTextureToInventory);
|
m_enableModelUploadTextureToInventory = EconomyConfig.GetBoolean("MeshModelAllowTextureToInventory", m_enableModelUploadTextureToInventory);
|
||||||
|
|
||||||
|
@ -203,12 +179,18 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
if (id != null)
|
if (id != null)
|
||||||
m_testAssetsCreatorID = id;
|
m_testAssetsCreatorID = id;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_ModelCost.ModelMeshCostFactor = modelUploadFactor;
|
IConfig CapsConfig = config.Configs["ClientStack.LindenCaps"];
|
||||||
m_ModelCost.ModelTextureCostFactor = modelTextureUploadFactor;
|
if (CapsConfig != null)
|
||||||
m_ModelCost.ModelMinCostFactor = modelMinUploadCostFactor;
|
{
|
||||||
m_ModelCost.primCreationCost = modelPrimCreationCost;
|
string homeLocationUrl = CapsConfig.GetString("Cap_HomeLocation", "localhost");
|
||||||
m_ModelCost.bytecost = modelMeshByteCost;
|
if(homeLocationUrl == String.Empty)
|
||||||
|
m_AllowCapHomeLocation = false;
|
||||||
|
|
||||||
|
string GroupMemberDataUrl = CapsConfig.GetString("Cap_GroupMemberData", "localhost");
|
||||||
|
if(GroupMemberDataUrl == String.Empty)
|
||||||
|
m_AllowCapGroupMemberData = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,51 +207,71 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
m_FileAgentInventoryState = FileAgentInventoryState.idle;
|
m_FileAgentInventoryState = FileAgentInventoryState.idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetNewCapPath()
|
||||||
|
{
|
||||||
|
return "/CAPS/" + UUID.Random();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Register a bunch of CAPS http service handlers
|
/// Register a bunch of CAPS http service handlers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RegisterHandlers()
|
public void RegisterHandlers()
|
||||||
{
|
{
|
||||||
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
|
// this path is also defined elsewhere so keeping it
|
||||||
|
string seedcapsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath +"0000/";
|
||||||
|
|
||||||
RegisterRegionServiceHandlers(capsBase);
|
// the root of all evil path needs to be capsBase + m_requestPath
|
||||||
RegisterInventoryServiceHandlers(capsBase);
|
m_HostCapsObj.RegisterHandler(
|
||||||
|
"SEED", new RestStreamHandler("POST", seedcapsBase, SeedCapRequest, "SEED", null));
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[CAPS]: Registered seed capability {0} for {1}", seedcapsBase, m_HostCapsObj.AgentID);
|
||||||
|
|
||||||
|
RegisterRegionServiceHandlers();
|
||||||
|
RegisterInventoryServiceHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterRegionServiceHandlers(string capsBase)
|
public void RegisterRegionServiceHandlers()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// the root of all evil
|
|
||||||
m_HostCapsObj.RegisterHandler(
|
|
||||||
"SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest, "SEED", null));
|
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
|
||||||
// "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID);
|
|
||||||
|
|
||||||
//m_capsHandlers["MapLayer"] =
|
//m_capsHandlers["MapLayer"] =
|
||||||
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
|
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
|
||||||
// capsBase + m_mapLayerPath,
|
// GetNewCapPath(),
|
||||||
// GetMapLayer);
|
// GetMapLayer);
|
||||||
|
|
||||||
IRequestHandler getObjectPhysicsDataHandler
|
IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler(
|
||||||
= new RestStreamHandler(
|
"POST", GetNewCapPath(), GetObjectPhysicsData, "GetObjectPhysicsData", null);
|
||||||
"POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData, "GetObjectPhysicsData", null);
|
|
||||||
m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler);
|
m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler);
|
||||||
|
|
||||||
IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost);
|
IRequestHandler getObjectCostHandler = new RestStreamHandler(
|
||||||
|
"POST", GetNewCapPath(), GetObjectCost, "GetObjectCost", null );
|
||||||
m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler);
|
m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler);
|
||||||
IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler("POST", capsBase + m_ResourceCostSelectedPath, ResourceCostSelected);
|
|
||||||
|
IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler(
|
||||||
|
"POST", GetNewCapPath(), ResourceCostSelected, "ResourceCostSelected", null);
|
||||||
m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler);
|
m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler);
|
||||||
|
|
||||||
|
|
||||||
IRequestHandler req
|
|
||||||
= new RestStreamHandler(
|
|
||||||
"POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory, "UpdateScript", null);
|
|
||||||
|
|
||||||
|
IRequestHandler req = new RestStreamHandler(
|
||||||
|
"POST", GetNewCapPath(), ScriptTaskInventory, "UpdateScript", null);
|
||||||
m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req);
|
m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req);
|
||||||
m_HostCapsObj.RegisterHandler("UpdateScriptTask", req);
|
m_HostCapsObj.RegisterHandler("UpdateScriptTask", req);
|
||||||
|
|
||||||
|
if(m_AllowCapHomeLocation)
|
||||||
|
{
|
||||||
|
IRequestHandler HomeLocationHandler = new RestStreamHandler(
|
||||||
|
"POST", GetNewCapPath(), HomeLocation, "HomeLocation", null);
|
||||||
|
m_HostCapsObj.RegisterHandler("HomeLocation", HomeLocationHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_AllowCapGroupMemberData)
|
||||||
|
{
|
||||||
|
IRequestHandler GroupMemberDataHandler = new RestStreamHandler(
|
||||||
|
"POST", GetNewCapPath(), GroupMemberData, "GroupMemberData", null);
|
||||||
|
m_HostCapsObj.RegisterHandler("GroupMemberData", GroupMemberDataHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// IRequestHandler animSetRequestHandler
|
// IRequestHandler animSetRequestHandler
|
||||||
// = new RestStreamHandler(
|
// = new RestStreamHandler(
|
||||||
// "POST", capsBase + m_animSetTaskUpdatePath, AnimSetTaskInventory, "UpdateScript", null);
|
// "POST", capsBase + m_animSetTaskUpdatePath, AnimSetTaskInventory, "UpdateScript", null);
|
||||||
|
@ -282,65 +284,29 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterInventoryServiceHandlers(string capsBase)
|
public void RegisterInventoryServiceHandlers()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_HostCapsObj.RegisterHandler(
|
m_HostCapsObj.RegisterHandler("NewFileAgentInventory",
|
||||||
"NewFileAgentInventory",
|
|
||||||
new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>(
|
new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>(
|
||||||
"POST",
|
"POST", GetNewCapPath(), NewAgentInventoryRequest, "NewFileAgentInventory", null));
|
||||||
capsBase + m_newInventory,
|
|
||||||
NewAgentInventoryRequest,
|
|
||||||
"NewFileAgentInventory",
|
|
||||||
null));
|
|
||||||
|
|
||||||
IRequestHandler req
|
|
||||||
= new RestStreamHandler(
|
|
||||||
"POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory, "Update*", null);
|
|
||||||
|
|
||||||
|
IRequestHandler req = new RestStreamHandler(
|
||||||
|
"POST", GetNewCapPath(), NoteCardAgentInventory, "Update*", null);
|
||||||
m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
|
m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
|
||||||
m_HostCapsObj.RegisterHandler("UpdateAnimSetAgentInventory", req);
|
m_HostCapsObj.RegisterHandler("UpdateAnimSetAgentInventory", req);
|
||||||
m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
|
m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
|
||||||
m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
|
m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
|
||||||
|
|
||||||
|
IRequestHandler UpdateAgentInformationHandler = new RestStreamHandler(
|
||||||
|
"POST", GetNewCapPath(), UpdateAgentInformation, "UpdateAgentInformation", null);
|
||||||
IRequestHandler UpdateAgentInformationHandler
|
|
||||||
= new RestStreamHandler(
|
|
||||||
"POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation, "UpdateAgentInformation", null);
|
|
||||||
m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler);
|
m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler);
|
||||||
|
|
||||||
m_HostCapsObj.RegisterHandler(
|
IRequestHandler CopyInventoryFromNotecardHandler = new RestStreamHandler(
|
||||||
"CopyInventoryFromNotecard",
|
"POST", GetNewCapPath(), CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null);
|
||||||
new RestStreamHandler(
|
m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", CopyInventoryFromNotecardHandler);
|
||||||
"POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null));
|
|
||||||
|
|
||||||
// As of RC 1.22.9 of the Linden client this is
|
|
||||||
// supported
|
|
||||||
|
|
||||||
//m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest);
|
|
||||||
|
|
||||||
// justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and
|
|
||||||
// subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires
|
|
||||||
// enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service,
|
|
||||||
// but when I went on the Linden grid, the
|
|
||||||
// simulators I visited (version 1.21) were, surprisingly, no longer supplying this capability. Instead,
|
|
||||||
// the 1.19.1.4 client appeared to be happily flowing inventory data over UDP
|
|
||||||
//
|
|
||||||
// This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid
|
|
||||||
// we will be
|
|
||||||
// able to get the data we need to implement the necessary part of the protocol to fix the issue above.
|
|
||||||
// m_capsHandlers["FetchInventoryDescendents"] =
|
|
||||||
// new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryRequest);
|
|
||||||
|
|
||||||
// m_capsHandlers["FetchInventoryDescendents"] =
|
|
||||||
// new LLSDStreamhandler<LLSDFetchInventoryDescendents, LLSDInventoryDescendents>("POST",
|
|
||||||
// capsBase + m_fetchInventory,
|
|
||||||
// FetchInventory));
|
|
||||||
// m_capsHandlers["RequestTextureDownload"] = new RestStreamHandler("POST",
|
|
||||||
// capsBase + m_requestTexture,
|
|
||||||
// RequestTexture);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -409,30 +375,28 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate();
|
LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate();
|
||||||
LLSDHelpers.DeserialiseOSDMap(hash, llsdUpdateRequest);
|
LLSDHelpers.DeserialiseOSDMap(hash, llsdUpdateRequest);
|
||||||
|
|
||||||
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
|
string uploaderPath = GetNewCapPath();
|
||||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
|
||||||
|
|
||||||
TaskInventoryScriptUpdater uploader =
|
TaskInventoryScriptUpdater uploader =
|
||||||
new TaskInventoryScriptUpdater(
|
new TaskInventoryScriptUpdater(
|
||||||
llsdUpdateRequest.item_id,
|
llsdUpdateRequest.item_id,
|
||||||
llsdUpdateRequest.task_id,
|
llsdUpdateRequest.task_id,
|
||||||
llsdUpdateRequest.is_script_running,
|
llsdUpdateRequest.is_script_running,
|
||||||
capsBase + uploaderPath,
|
uploaderPath,
|
||||||
m_HostCapsObj.HttpListener,
|
m_HostCapsObj.HttpListener,
|
||||||
m_dumpAssetsToFile);
|
m_dumpAssetsToFile);
|
||||||
uploader.OnUpLoad += TaskScriptUpdated;
|
uploader.OnUpLoad += TaskScriptUpdated;
|
||||||
|
|
||||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||||
new BinaryStreamHandler(
|
new BinaryStreamHandler(
|
||||||
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "TaskInventoryScriptUpdater", null));
|
"POST", uploaderPath, uploader.uploaderCaps, "TaskInventoryScriptUpdater", null));
|
||||||
|
|
||||||
string protocol = "http://";
|
string protocol = "http://";
|
||||||
|
|
||||||
if (m_HostCapsObj.SSLCaps)
|
if (m_HostCapsObj.SSLCaps)
|
||||||
protocol = "https://";
|
protocol = "https://";
|
||||||
|
|
||||||
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase +
|
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + uploaderPath;
|
||||||
uploaderPath;
|
|
||||||
|
|
||||||
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
|
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
|
||||||
uploadResponse.uploader = uploaderURL;
|
uploadResponse.uploader = uploaderURL;
|
||||||
|
@ -653,11 +617,10 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
}
|
}
|
||||||
|
|
||||||
string assetDes = llsdRequest.description;
|
string assetDes = llsdRequest.description;
|
||||||
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
|
|
||||||
UUID newAsset = UUID.Random();
|
UUID newAsset = UUID.Random();
|
||||||
UUID newInvItem = UUID.Random();
|
UUID newInvItem = UUID.Random();
|
||||||
UUID parentFolder = llsdRequest.folder_id;
|
UUID parentFolder = llsdRequest.folder_id;
|
||||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
string uploaderPath = GetNewCapPath();
|
||||||
UUID texturesFolder = UUID.Zero;
|
UUID texturesFolder = UUID.Zero;
|
||||||
|
|
||||||
if(!IsAtestUpload && m_enableModelUploadTextureToInventory)
|
if(!IsAtestUpload && m_enableModelUploadTextureToInventory)
|
||||||
|
@ -665,26 +628,23 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
AssetUploader uploader =
|
AssetUploader uploader =
|
||||||
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
|
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
|
||||||
llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost,
|
llsdRequest.asset_type, uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost,
|
||||||
texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload,
|
texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload,
|
||||||
llsdRequest.next_owner_mask, llsdRequest.group_mask, llsdRequest.everyone_mask);
|
llsdRequest.next_owner_mask, llsdRequest.group_mask, llsdRequest.everyone_mask);
|
||||||
|
|
||||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||||
new BinaryStreamHandler(
|
new BinaryStreamHandler(
|
||||||
"POST",
|
"POST",
|
||||||
capsBase + uploaderPath,
|
uploaderPath,
|
||||||
uploader.uploaderCaps,
|
uploader.uploaderCaps,
|
||||||
"NewAgentInventoryRequest",
|
"NewAgentInventoryRequest",
|
||||||
m_HostCapsObj.AgentID.ToString()));
|
m_HostCapsObj.AgentID.ToString()));
|
||||||
|
|
||||||
string protocol = "http://";
|
string protocol = "http://";
|
||||||
|
|
||||||
if (m_HostCapsObj.SSLCaps)
|
if (m_HostCapsObj.SSLCaps)
|
||||||
protocol = "https://";
|
protocol = "https://";
|
||||||
|
|
||||||
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase +
|
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + uploaderPath;
|
||||||
uploaderPath;
|
|
||||||
|
|
||||||
|
|
||||||
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
|
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
|
||||||
uploadResponse.uploader = uploaderURL;
|
uploadResponse.uploader = uploaderURL;
|
||||||
|
@ -1313,24 +1273,22 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
LLSDItemUpdate llsdRequest = new LLSDItemUpdate();
|
LLSDItemUpdate llsdRequest = new LLSDItemUpdate();
|
||||||
LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest);
|
LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest);
|
||||||
|
|
||||||
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
|
string uploaderPath = GetNewCapPath();
|
||||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
|
||||||
|
|
||||||
ItemUpdater uploader =
|
ItemUpdater uploader =
|
||||||
new ItemUpdater(llsdRequest.item_id, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile);
|
new ItemUpdater(llsdRequest.item_id, uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile);
|
||||||
uploader.OnUpLoad += ItemUpdated;
|
uploader.OnUpLoad += ItemUpdated;
|
||||||
|
|
||||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||||
new BinaryStreamHandler(
|
new BinaryStreamHandler(
|
||||||
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "NoteCardAgentInventory", null));
|
"POST", uploaderPath, uploader.uploaderCaps, "NoteCardAgentInventory", null));
|
||||||
|
|
||||||
string protocol = "http://";
|
string protocol = "http://";
|
||||||
|
|
||||||
if (m_HostCapsObj.SSLCaps)
|
if (m_HostCapsObj.SSLCaps)
|
||||||
protocol = "https://";
|
protocol = "https://";
|
||||||
|
|
||||||
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase +
|
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + uploaderPath;
|
||||||
uploaderPath;
|
|
||||||
|
|
||||||
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
|
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
|
||||||
uploadResponse.uploader = uploaderURL;
|
uploadResponse.uploader = uploaderURL;
|
||||||
|
@ -1576,6 +1534,266 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
string response = OSDParser.SerializeLLSDXmlString(resp);
|
string response = OSDParser.SerializeLLSDXmlString(resp);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool OSDMapTOVector3(OSDMap map, out Vector3 v)
|
||||||
|
{
|
||||||
|
v = Vector3.Zero;
|
||||||
|
if(!map.ContainsKey("X"))
|
||||||
|
return false;
|
||||||
|
if(!map.ContainsKey("Y"))
|
||||||
|
return false;
|
||||||
|
if(!map.ContainsKey("Z"))
|
||||||
|
return false;
|
||||||
|
v.X = (float)map["X"].AsReal();
|
||||||
|
v.Y = (float)map["Y"].AsReal();
|
||||||
|
v.Z = (float)map["Z"].AsReal();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string HomeLocation(string request, string path, string param, IOSHttpRequest httpRequest,
|
||||||
|
IOSHttpResponse httpResponse)
|
||||||
|
{
|
||||||
|
OSDMap resp = new OSDMap();
|
||||||
|
|
||||||
|
resp["success"] = "false";
|
||||||
|
|
||||||
|
|
||||||
|
bool fail = true;
|
||||||
|
string message = "Set Home request failed";
|
||||||
|
int locationID = 1;
|
||||||
|
Vector3 pos = Vector3.Zero;
|
||||||
|
Vector3 lookAt = Vector3.Zero;
|
||||||
|
|
||||||
|
IClientAPI client = null;
|
||||||
|
ScenePresence sp;
|
||||||
|
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
if(m_Scene.GridUserService == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if(m_Scene.UserManagementModule == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
m_Scene.TryGetScenePresence(m_AgentID, out sp);
|
||||||
|
if(sp == null || sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit)
|
||||||
|
break;
|
||||||
|
|
||||||
|
client = sp.ControllingClient;
|
||||||
|
|
||||||
|
if(!m_Scene.UserManagementModule.IsLocalGridUser(m_AgentID))
|
||||||
|
break;
|
||||||
|
|
||||||
|
OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
|
||||||
|
if(!req.ContainsKey("HomeLocation"))
|
||||||
|
break;
|
||||||
|
|
||||||
|
OSDMap HLocation = (OSDMap)req["HomeLocation"];
|
||||||
|
if(!HLocation.ContainsKey("LocationPos"))
|
||||||
|
break;
|
||||||
|
if(!HLocation.ContainsKey("LocationLookAt"))
|
||||||
|
break;
|
||||||
|
|
||||||
|
locationID = HLocation["LocationId"].AsInteger();
|
||||||
|
|
||||||
|
if(!OSDMapTOVector3((OSDMap)HLocation["LocationPos"], out pos))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if(!OSDMapTOVector3((OSDMap)HLocation["LocationLookAt"], out lookAt))
|
||||||
|
break;
|
||||||
|
|
||||||
|
ILandObject land = m_Scene.LandChannel.GetLandObject(pos);
|
||||||
|
if(land == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
ulong gpowers = client.GetGroupPowers(land.LandData.GroupID);
|
||||||
|
SceneObjectGroup telehub = null;
|
||||||
|
if (m_Scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero)
|
||||||
|
// Does the telehub exist in the scene?
|
||||||
|
telehub = m_Scene.GetSceneObjectGroup(m_Scene.RegionInfo.RegionSettings.TelehubObject);
|
||||||
|
|
||||||
|
if (!m_Scene.Permissions.IsAdministrator(m_AgentID) && // (a) gods and land managers can set home
|
||||||
|
!m_Scene.Permissions.IsGod(m_AgentID) &&
|
||||||
|
m_AgentID != land.LandData.OwnerID && // (b) land owners can set home
|
||||||
|
// (c) members of the land-associated group in roles that can set home
|
||||||
|
((gpowers & (ulong)GroupPowers.AllowSetHome) != (ulong)GroupPowers.AllowSetHome) &&
|
||||||
|
// (d) parcels with telehubs can be the home of anyone
|
||||||
|
(telehub == null || !land.ContainsPoint((int)telehub.AbsolutePosition.X, (int)telehub.AbsolutePosition.Y)))
|
||||||
|
{
|
||||||
|
message = "You are not allowed to set your home location in this parcel.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
string userId;
|
||||||
|
UUID test;
|
||||||
|
if (!m_Scene.UserManagementModule.GetUserUUI(m_AgentID, out userId))
|
||||||
|
{
|
||||||
|
message = "Set Home request failed. (User Lookup)";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!UUID.TryParse(userId, out test))
|
||||||
|
{
|
||||||
|
message = "Set Home request failed. (HG visitor)";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_Scene.GridUserService.SetHome(userId, land.RegionUUID, pos, lookAt))
|
||||||
|
fail = false;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
string response;
|
||||||
|
|
||||||
|
if(fail)
|
||||||
|
{
|
||||||
|
if(client != null)
|
||||||
|
client.SendAlertMessage(message, "HomePositionSet");
|
||||||
|
response = OSDParser.SerializeLLSDXmlString(resp);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// so its http but still needs a udp reply to inform user? crap :p
|
||||||
|
if(client != null)
|
||||||
|
client.SendAlertMessage("Home position set.","HomePositionSet");
|
||||||
|
|
||||||
|
resp["success"] = "true";
|
||||||
|
OSDMap homeloc = new OSDMap();
|
||||||
|
OSDMap homelocpos = new OSDMap();
|
||||||
|
// for some odd reason viewers send pos as reals but read as integer
|
||||||
|
homelocpos["X"] = new OSDReal(pos.X);
|
||||||
|
homelocpos["Y"] = new OSDReal(pos.Y);
|
||||||
|
homelocpos["Z"] = new OSDReal(pos.Z);
|
||||||
|
homeloc["LocationPos"] = homelocpos;
|
||||||
|
|
||||||
|
resp["HomeLocation"] = homeloc;
|
||||||
|
|
||||||
|
response = OSDParser.SerializeLLSDXmlString(resp);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int CompareRolesByMembersDesc(GroupRolesData x, GroupRolesData y)
|
||||||
|
{
|
||||||
|
return -(x.Members.CompareTo(y.Members));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GroupMemberData(string request, string path, string param, IOSHttpRequest httpRequest,
|
||||||
|
IOSHttpResponse httpResponse)
|
||||||
|
{
|
||||||
|
OSDMap resp = new OSDMap();
|
||||||
|
|
||||||
|
string response;
|
||||||
|
|
||||||
|
bool fail = true;
|
||||||
|
IClientAPI client = null;
|
||||||
|
ScenePresence sp;
|
||||||
|
IGroupsModule m_GroupsModule;
|
||||||
|
UUID groupID = UUID.Zero;
|
||||||
|
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
m_GroupsModule = m_Scene.RequestModuleInterface<IGroupsModule>();
|
||||||
|
if(m_GroupsModule == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
m_Scene.TryGetScenePresence(m_AgentID, out sp);
|
||||||
|
if(sp == null || sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit)
|
||||||
|
break;
|
||||||
|
|
||||||
|
client = sp.ControllingClient;
|
||||||
|
|
||||||
|
OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
|
||||||
|
if(!req.ContainsKey("group_id"))
|
||||||
|
break;
|
||||||
|
|
||||||
|
groupID = req["group_id"].AsUUID();
|
||||||
|
if(groupID == UUID.Zero)
|
||||||
|
break;
|
||||||
|
|
||||||
|
List<GroupRolesData> roles = m_GroupsModule.GroupRoleDataRequest(client, groupID);
|
||||||
|
if(roles == null || roles.Count == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
List<GroupMembersData> members = m_GroupsModule.GroupMembersRequest(client, groupID);
|
||||||
|
if(members == null || members.Count == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
int memberCount = members.Count;
|
||||||
|
|
||||||
|
Dictionary<string,int> titles = new Dictionary<string,int>();
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
ulong defaultPowers = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// build titles array and index
|
||||||
|
roles.Sort(CompareRolesByMembersDesc);
|
||||||
|
|
||||||
|
OSDArray osdtitles = new OSDArray();
|
||||||
|
foreach(GroupRolesData grd in roles)
|
||||||
|
{
|
||||||
|
if(grd.Title == null)
|
||||||
|
continue;
|
||||||
|
string title = grd.Title;
|
||||||
|
if(i==0)
|
||||||
|
defaultPowers = grd.Powers;
|
||||||
|
|
||||||
|
if(!titles.ContainsKey(title))
|
||||||
|
{
|
||||||
|
titles[title] = i++;
|
||||||
|
osdtitles.Add(new OSDString(title));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(titles.Count == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
OSDMap osdmembers = new OSDMap();
|
||||||
|
foreach(GroupMembersData gmd in members)
|
||||||
|
{
|
||||||
|
OSDMap m = new OSDMap();
|
||||||
|
if(gmd.OnlineStatus != null && gmd.OnlineStatus != "")
|
||||||
|
m["last_login"] = new OSDString(gmd.OnlineStatus);
|
||||||
|
if(gmd.AgentPowers != defaultPowers)
|
||||||
|
m["powers"] = new OSDString((gmd.AgentPowers).ToString("X"));
|
||||||
|
if(gmd.Title != null && titles.ContainsKey(gmd.Title) && titles[gmd.Title] != 0)
|
||||||
|
m["title"] = new OSDInteger(titles[gmd.Title]);
|
||||||
|
if(gmd.IsOwner)
|
||||||
|
m["owner"] = new OSDString("true");
|
||||||
|
if(gmd.Contribution != 0)
|
||||||
|
m["donated_square_meters"] = new OSDInteger(gmd.Contribution);
|
||||||
|
|
||||||
|
osdmembers[(gmd.AgentID).ToString()] = m;
|
||||||
|
}
|
||||||
|
|
||||||
|
OSDMap osddefaults = new OSDMap();
|
||||||
|
osddefaults["default_powers"] = new OSDString(defaultPowers.ToString("X"));
|
||||||
|
|
||||||
|
resp["group_id"] = new OSDUUID(groupID);
|
||||||
|
resp["agent_id"] = new OSDUUID(m_AgentID);
|
||||||
|
resp["member_count"] = new OSDInteger(memberCount);
|
||||||
|
resp["defaults"] = osddefaults;
|
||||||
|
resp["titles"] = osdtitles;
|
||||||
|
resp["members"] = osdmembers;
|
||||||
|
|
||||||
|
fail = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fail)
|
||||||
|
{
|
||||||
|
resp["group_id"] = new OSDUUID(groupID);
|
||||||
|
resp["agent_id"] = new OSDUUID(m_AgentID);
|
||||||
|
resp["member_count"] = new OSDInteger(0);
|
||||||
|
resp["defaults"] = new OSDMap();
|
||||||
|
resp["titles"] = new OSDArray();
|
||||||
|
resp["members"] = new OSDMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
response = OSDParser.SerializeLLSDXmlString(resp);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AssetUploader
|
public class AssetUploader
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
private void OnRegisterCaps(UUID agentID, Caps caps)
|
private void OnRegisterCaps(UUID agentID, Caps caps)
|
||||||
{
|
{
|
||||||
new BunchOfCaps(m_Scene, caps);
|
new BunchOfCaps(m_Scene, agentID, caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,8 @@ using ComponentAce.Compression.Libs.zlib;
|
||||||
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
|
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
|
||||||
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
||||||
|
|
||||||
|
using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.Region.ClientStack.Linden
|
namespace OpenSim.Region.ClientStack.Linden
|
||||||
{
|
{
|
||||||
public struct ModelPrimLimits
|
public struct ModelPrimLimits
|
||||||
|
@ -100,6 +102,25 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
public float PhysicalPrimScaleMax = 10f;
|
public float PhysicalPrimScaleMax = 10f;
|
||||||
public int ObjectLinkedPartsMax = 512;
|
public int ObjectLinkedPartsMax = 512;
|
||||||
|
|
||||||
|
|
||||||
|
public ModelCost(Scene scene)
|
||||||
|
{
|
||||||
|
PrimScaleMin = scene.m_minNonphys;
|
||||||
|
NonPhysicalPrimScaleMax = scene.m_maxNonphys;
|
||||||
|
PhysicalPrimScaleMax = scene.m_maxPhys;
|
||||||
|
ObjectLinkedPartsMax = scene.m_linksetCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Econfig(IConfig EconomyConfig)
|
||||||
|
{
|
||||||
|
ModelMeshCostFactor = EconomyConfig.GetFloat("MeshModelUploadCostFactor", ModelMeshCostFactor);
|
||||||
|
ModelTextureCostFactor = EconomyConfig.GetFloat("MeshModelUploadTextureCostFactor", ModelTextureCostFactor);
|
||||||
|
ModelMinCostFactor = EconomyConfig.GetFloat("MeshModelMinCostFactor", ModelMinCostFactor);
|
||||||
|
// next 2 are normalized so final cost is afected by modelUploadFactor above and normal cost
|
||||||
|
primCreationCost = EconomyConfig.GetFloat("ModelPrimCreationCost", primCreationCost);
|
||||||
|
bytecost = EconomyConfig.GetFloat("ModelMeshByteCost", bytecost);
|
||||||
|
}
|
||||||
|
|
||||||
// storage for a single mesh asset cost parameters
|
// storage for a single mesh asset cost parameters
|
||||||
private class ameshCostParam
|
private class ameshCostParam
|
||||||
{
|
{
|
||||||
|
|
|
@ -577,6 +577,13 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
//m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item);
|
//m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ChatterBoxForceClose(UUID toAgent, UUID sessionID, string reason)
|
||||||
|
{
|
||||||
|
OSD item = EventQueueHelper.ChatterBoxForceClose(sessionID, reason);
|
||||||
|
|
||||||
|
Enqueue(item, toAgent);
|
||||||
|
}
|
||||||
|
|
||||||
public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
|
public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
|
||||||
{
|
{
|
||||||
OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
|
OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
|
||||||
|
|
|
@ -342,6 +342,18 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
return chatterBoxSessionAgentListUpdates;
|
return chatterBoxSessionAgentListUpdates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static OSD ChatterBoxForceClose(UUID sessionID, string reason)
|
||||||
|
{
|
||||||
|
OSDMap body = new OSDMap(2);
|
||||||
|
body.Add("session_id", new OSDUUID(sessionID));
|
||||||
|
body.Add("reason", new OSDString(reason));
|
||||||
|
|
||||||
|
OSDMap chatterBoxForceClose = new OSDMap(2);
|
||||||
|
chatterBoxForceClose.Add("message", new OSDString("ForceCloseChatterBoxSession"));
|
||||||
|
chatterBoxForceClose.Add("body", body);
|
||||||
|
return chatterBoxForceClose;
|
||||||
|
}
|
||||||
|
|
||||||
public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data)
|
public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data)
|
||||||
{
|
{
|
||||||
OSDArray AgentData = new OSDArray(1);
|
OSDArray AgentData = new OSDArray(1);
|
||||||
|
|
|
@ -1711,11 +1711,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
public void SendKillObject(List<uint> localIDs)
|
public void SendKillObject(List<uint> localIDs)
|
||||||
{
|
{
|
||||||
// think we do need this
|
|
||||||
// foreach (uint id in localIDs)
|
// foreach (uint id in localIDs)
|
||||||
// m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, id, regionHandle);
|
// m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, id, regionHandle);
|
||||||
|
|
||||||
// remove pending entities
|
// remove pending entities to reduce looping chances.
|
||||||
lock (m_entityProps.SyncRoot)
|
lock (m_entityProps.SyncRoot)
|
||||||
m_entityProps.Remove(localIDs);
|
m_entityProps.Remove(localIDs);
|
||||||
lock (m_entityUpdates.SyncRoot)
|
lock (m_entityUpdates.SyncRoot)
|
||||||
|
@ -2412,6 +2411,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
OutPacket(alertPack, ThrottleOutPacketType.Task);
|
OutPacket(alertPack, ThrottleOutPacketType.Task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendAlertMessage(string message, string info)
|
||||||
|
{
|
||||||
|
AlertMessagePacket alertPack = (AlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AlertMessage);
|
||||||
|
alertPack.AlertData = new AlertMessagePacket.AlertDataBlock();
|
||||||
|
alertPack.AlertData.Message = Util.StringToBytes256(message);
|
||||||
|
alertPack.AlertInfo = new AlertMessagePacket.AlertInfoBlock[1];
|
||||||
|
alertPack.AlertInfo[0] = new AlertMessagePacket.AlertInfoBlock();
|
||||||
|
alertPack.AlertInfo[0].Message = Util.StringToBytes256(info);
|
||||||
|
alertPack.AlertInfo[0].ExtraParams = new Byte[0];
|
||||||
|
OutPacket(alertPack, ThrottleOutPacketType.Task);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send an agent alert message to the client.
|
/// Send an agent alert message to the client.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -4007,7 +4018,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
bool doCulling = m_scene.ObjectsCullingByDistance;
|
bool doCulling = m_scene.ObjectsCullingByDistance;
|
||||||
float cullingrange = 64.0f;
|
float cullingrange = 64.0f;
|
||||||
HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>();
|
HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>();
|
||||||
List<SceneObjectGroup> kills = new List<SceneObjectGroup>();
|
|
||||||
// Vector3 mycamera = Vector3.Zero;
|
// Vector3 mycamera = Vector3.Zero;
|
||||||
Vector3 mypos = Vector3.Zero;
|
Vector3 mypos = Vector3.Zero;
|
||||||
ScenePresence mysp = (ScenePresence)SceneAgent;
|
ScenePresence mysp = (ScenePresence)SceneAgent;
|
||||||
|
@ -4047,8 +4057,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// Don't send updates for objects that have been marked deleted.
|
// Don't send updates for objects that have been marked deleted.
|
||||||
// Instead send another kill object, because the first one may have gotten
|
// Instead send another kill object, because the first one may have gotten
|
||||||
// into a race condition
|
// into a race condition
|
||||||
if (!m_killRecord.Contains(grp.LocalId))
|
if (part == grp.RootPart && !m_killRecord.Contains(grp.LocalId))
|
||||||
|
{
|
||||||
m_killRecord.Add(grp.LocalId);
|
m_killRecord.Add(grp.LocalId);
|
||||||
|
maxUpdatesBytes -= 30;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4336,16 +4349,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
m_killRecord.Clear();
|
m_killRecord.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kills.Count > 0)
|
|
||||||
{
|
|
||||||
foreach(SceneObjectGroup grp in kills)
|
|
||||||
{
|
|
||||||
foreach(SceneObjectPart p in grp.Parts)
|
|
||||||
SendEntityUpdate(p,PrimUpdateFlags.Kill);
|
|
||||||
}
|
|
||||||
kills.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(GroupsNeedFullUpdate.Count > 0)
|
if(GroupsNeedFullUpdate.Count > 0)
|
||||||
{
|
{
|
||||||
foreach(SceneObjectGroup grp in GroupsNeedFullUpdate)
|
foreach(SceneObjectGroup grp in GroupsNeedFullUpdate)
|
||||||
|
@ -4471,12 +4474,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
if (kills.Count > 0)
|
if (kills.Count > 0)
|
||||||
{
|
{
|
||||||
|
List<uint> partIDs = new List<uint>();
|
||||||
foreach(SceneObjectGroup grp in kills)
|
foreach(SceneObjectGroup grp in kills)
|
||||||
{
|
{
|
||||||
|
SendEntityUpdate(grp.RootPart,PrimUpdateFlags.Kill);
|
||||||
foreach(SceneObjectPart p in grp.Parts)
|
foreach(SceneObjectPart p in grp.Parts)
|
||||||
SendEntityUpdate(p,PrimUpdateFlags.Kill);
|
{
|
||||||
|
if(p != grp.RootPart)
|
||||||
|
partIDs.Add(p.LocalId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
kills.Clear();
|
kills.Clear();
|
||||||
|
if(partIDs.Count > 0)
|
||||||
|
{
|
||||||
|
lock (m_entityProps.SyncRoot)
|
||||||
|
m_entityProps.Remove(partIDs);
|
||||||
|
lock (m_entityUpdates.SyncRoot)
|
||||||
|
m_entityUpdates.Remove(partIDs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GroupsNeedFullUpdate.Count > 0)
|
if(GroupsNeedFullUpdate.Count > 0)
|
||||||
|
@ -11418,12 +11433,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID);
|
m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID);
|
||||||
|
|
||||||
int memberCount = members.Count;
|
int memberCount = members.Count;
|
||||||
|
int indx = 0;
|
||||||
while (true)
|
while (indx < memberCount)
|
||||||
{
|
{
|
||||||
int blockCount = members.Count;
|
int blockCount = memberCount - indx;
|
||||||
if (blockCount > 40)
|
if (blockCount > 25)
|
||||||
blockCount = 40;
|
blockCount = 25;
|
||||||
|
|
||||||
GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply);
|
GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply);
|
||||||
|
|
||||||
|
@ -11444,8 +11459,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
for (int i = 0; i < blockCount; i++)
|
for (int i = 0; i < blockCount; i++)
|
||||||
{
|
{
|
||||||
GroupMembersData m = members[0];
|
GroupMembersData m = members[indx++];
|
||||||
members.RemoveAt(0);
|
|
||||||
|
|
||||||
groupMembersReply.MemberData[i] =
|
groupMembersReply.MemberData[i] =
|
||||||
new GroupMembersReplyPacket.MemberDataBlock();
|
new GroupMembersReplyPacket.MemberDataBlock();
|
||||||
|
@ -11463,8 +11477,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
m.IsOwner;
|
m.IsOwner;
|
||||||
}
|
}
|
||||||
OutPacket(groupMembersReply, ThrottleOutPacketType.Task);
|
OutPacket(groupMembersReply, ThrottleOutPacketType.Task);
|
||||||
if (members.Count == 0)
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -481,6 +481,151 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
return user.FirstName + " " + user.LastName;
|
return user.FirstName + " " + user.LastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual Dictionary<UUID,string> GetUsersNames(string[] ids)
|
||||||
|
{
|
||||||
|
Dictionary<UUID,string> ret = new Dictionary<UUID,string>();
|
||||||
|
if(m_Scenes.Count <= 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
List<string> missing = new List<string>();
|
||||||
|
Dictionary<UUID,string> untried = new Dictionary<UUID, string>();
|
||||||
|
|
||||||
|
// look in cache
|
||||||
|
UserData userdata = new UserData();
|
||||||
|
|
||||||
|
UUID uuid = UUID.Zero;
|
||||||
|
foreach(string id in ids)
|
||||||
|
{
|
||||||
|
if(UUID.TryParse(id, out uuid))
|
||||||
|
{
|
||||||
|
lock (m_UserCache)
|
||||||
|
{
|
||||||
|
if (m_UserCache.TryGetValue(uuid, out userdata) &&
|
||||||
|
userdata.FirstName != "Unknown" && userdata.FirstName != string.Empty)
|
||||||
|
{
|
||||||
|
string name = userdata.FirstName + " " + userdata.LastName;
|
||||||
|
|
||||||
|
if(userdata.HasGridUserTried)
|
||||||
|
ret[uuid] = name;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
untried[uuid] = name;
|
||||||
|
missing.Add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
missing.Add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(missing.Count == 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
// try user account service
|
||||||
|
List<UserAccount> accounts = m_Scenes[0].UserAccountService.GetUserAccounts(
|
||||||
|
m_Scenes[0].RegionInfo.ScopeID, missing);
|
||||||
|
|
||||||
|
if(accounts.Count != 0)
|
||||||
|
{
|
||||||
|
foreach(UserAccount uac in accounts)
|
||||||
|
{
|
||||||
|
if(uac != null)
|
||||||
|
{
|
||||||
|
string name = uac.FirstName + " " + uac.LastName;
|
||||||
|
ret[uac.PrincipalID] = name;
|
||||||
|
missing.Remove(uac.PrincipalID.ToString()); // slowww
|
||||||
|
untried.Remove(uac.PrincipalID);
|
||||||
|
|
||||||
|
userdata = new UserData();
|
||||||
|
userdata.Id = uac.PrincipalID;
|
||||||
|
userdata.FirstName = uac.FirstName;
|
||||||
|
userdata.LastName = uac.LastName;
|
||||||
|
userdata.HomeURL = string.Empty;
|
||||||
|
userdata.IsUnknownUser = false;
|
||||||
|
userdata.HasGridUserTried = true;
|
||||||
|
lock (m_UserCache)
|
||||||
|
m_UserCache[uac.PrincipalID] = userdata;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missing.Count == 0 || m_Scenes[0].GridUserService == null)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
// try grid user service
|
||||||
|
|
||||||
|
GridUserInfo[] pinfos = m_Scenes[0].GridUserService.GetGridUserInfo(missing.ToArray());
|
||||||
|
if(pinfos.Length > 0)
|
||||||
|
{
|
||||||
|
foreach(GridUserInfo uInfo in pinfos)
|
||||||
|
{
|
||||||
|
if (uInfo != null)
|
||||||
|
{
|
||||||
|
string url, first, last, tmp;
|
||||||
|
|
||||||
|
if(uInfo.UserID.Length <= 36)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (Util.ParseUniversalUserIdentifier(uInfo.UserID, out uuid, out url, out first, out last, out tmp))
|
||||||
|
{
|
||||||
|
if (url != string.Empty)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userdata = new UserData();
|
||||||
|
userdata.FirstName = first.Replace(" ", ".") + "." + last.Replace(" ", ".");
|
||||||
|
userdata.LastName = "@" + new Uri(url).Authority;
|
||||||
|
userdata.Id = uuid;
|
||||||
|
userdata.HomeURL = url;
|
||||||
|
userdata.IsUnknownUser = false;
|
||||||
|
userdata.HasGridUserTried = true;
|
||||||
|
lock (m_UserCache)
|
||||||
|
m_UserCache[uuid] = userdata;
|
||||||
|
|
||||||
|
string name = userdata.FirstName + " " + userdata.LastName;
|
||||||
|
ret[uuid] = name;
|
||||||
|
missing.Remove(uuid.ToString());
|
||||||
|
untried.Remove(uuid);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the untried in cache that still failed
|
||||||
|
if(untried.Count > 0)
|
||||||
|
{
|
||||||
|
foreach(KeyValuePair<UUID, string> kvp in untried)
|
||||||
|
{
|
||||||
|
ret[kvp.Key] = kvp.Value;
|
||||||
|
missing.Remove((kvp.Key).ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the UMMthings ( not sure we should)
|
||||||
|
if(missing.Count > 0)
|
||||||
|
{
|
||||||
|
foreach(string id in missing)
|
||||||
|
{
|
||||||
|
if(UUID.TryParse(id, out uuid) && uuid != UUID.Zero)
|
||||||
|
{
|
||||||
|
if (m_Scenes[0].LibraryService != null &&
|
||||||
|
(m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid))
|
||||||
|
ret[uuid] = "Mr OpenSim";
|
||||||
|
else
|
||||||
|
ret[uuid] = "Unknown UserUMMAU43";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual string GetUserHomeURL(UUID userID)
|
public virtual string GetUserHomeURL(UUID userID)
|
||||||
{
|
{
|
||||||
UserData user;
|
UserData user;
|
||||||
|
@ -584,7 +729,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
userdata = new UserData();
|
userdata = new UserData();
|
||||||
userdata.HasGridUserTried = false;
|
|
||||||
userdata.Id = uuid;
|
userdata.Id = uuid;
|
||||||
userdata.FirstName = "Unknown";
|
userdata.FirstName = "Unknown";
|
||||||
userdata.LastName = "UserUMMAU42";
|
userdata.LastName = "UserUMMAU42";
|
||||||
|
|
|
@ -203,21 +203,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
|
|
||||||
void OnClientClosed(UUID clientID, Scene scene)
|
void OnClientClosed(UUID clientID, Scene scene)
|
||||||
{
|
{
|
||||||
if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache
|
ScenePresence sp = null;
|
||||||
|
foreach (Scene s in m_Scenes)
|
||||||
{
|
{
|
||||||
ScenePresence sp = null;
|
s.TryGetScenePresence(clientID, out sp);
|
||||||
foreach (Scene s in m_Scenes)
|
if ((sp != null) && !sp.IsChildAgent && (s != scene))
|
||||||
{
|
{
|
||||||
s.TryGetScenePresence(clientID, out sp);
|
m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache",
|
||||||
if ((sp != null) && !sp.IsChildAgent && (s != scene))
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache",
|
|
||||||
scene.RegionInfo.RegionName, clientID);
|
scene.RegionInfo.RegionName, clientID);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
DropInventoryServiceURL(clientID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache
|
||||||
|
DropInventoryServiceURL(clientID);
|
||||||
|
|
||||||
|
m_Cache.RemoveAll(clientID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -38,12 +38,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class InventoryCache
|
public class InventoryCache
|
||||||
{
|
{
|
||||||
private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour
|
private const double CACHE_EXPIRATION_SECONDS = 60.0; // 1 minute
|
||||||
|
|
||||||
private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>();
|
private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>();
|
||||||
private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>();
|
private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>();
|
||||||
private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>();
|
private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>();
|
||||||
|
|
||||||
|
|
||||||
|
public void RemoveAll(UUID userID)
|
||||||
|
{
|
||||||
|
if(m_RootFolders.Contains(userID))
|
||||||
|
m_RootFolders.Remove(userID);
|
||||||
|
if(m_FolderTypes.Contains(userID))
|
||||||
|
m_FolderTypes.Remove(userID);
|
||||||
|
if(m_Inventories.Contains(userID))
|
||||||
|
m_Inventories.Remove(userID);
|
||||||
|
}
|
||||||
|
|
||||||
public void Cache(UUID userID, InventoryFolderBase root)
|
public void Cache(UUID userID, InventoryFolderBase root)
|
||||||
{
|
{
|
||||||
m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS);
|
m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS);
|
||||||
|
|
|
@ -153,12 +153,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
public UserAccount GetUserAccount(UUID scopeID, UUID userID)
|
public UserAccount GetUserAccount(UUID scopeID, UUID userID)
|
||||||
{
|
{
|
||||||
bool inCache = false;
|
bool inCache = false;
|
||||||
UserAccount account = m_Cache.Get(userID, out inCache);
|
UserAccount account;
|
||||||
|
lock(m_Cache)
|
||||||
|
account = m_Cache.Get(userID, out inCache);
|
||||||
if (inCache)
|
if (inCache)
|
||||||
return account;
|
return account;
|
||||||
|
|
||||||
account = UserAccountService.GetUserAccount(scopeID, userID);
|
account = UserAccountService.GetUserAccount(scopeID, userID);
|
||||||
m_Cache.Cache(userID, account);
|
lock(m_Cache)
|
||||||
|
m_Cache.Cache(userID, account);
|
||||||
|
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
@ -166,13 +169,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
|
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
|
||||||
{
|
{
|
||||||
bool inCache = false;
|
bool inCache = false;
|
||||||
UserAccount account = m_Cache.Get(firstName + " " + lastName, out inCache);
|
UserAccount account;
|
||||||
|
lock(m_Cache)
|
||||||
|
account = m_Cache.Get(firstName + " " + lastName, out inCache);
|
||||||
if (inCache)
|
if (inCache)
|
||||||
return account;
|
return account;
|
||||||
|
|
||||||
account = UserAccountService.GetUserAccount(scopeID, firstName, lastName);
|
account = UserAccountService.GetUserAccount(scopeID, firstName, lastName);
|
||||||
if (account != null)
|
if (account != null)
|
||||||
m_Cache.Cache(account.PrincipalID, account);
|
lock(m_Cache)
|
||||||
|
m_Cache.Cache(account.PrincipalID, account);
|
||||||
|
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
@ -182,6 +188,45 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
return UserAccountService.GetUserAccount(scopeID, Email);
|
return UserAccountService.GetUserAccount(scopeID, Email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
|
||||||
|
{
|
||||||
|
List<UserAccount> ret = new List<UserAccount>();
|
||||||
|
List<string> missing = new List<string>();
|
||||||
|
|
||||||
|
// still another cache..
|
||||||
|
bool inCache = false;
|
||||||
|
UUID uuid = UUID.Zero;
|
||||||
|
UserAccount account;
|
||||||
|
foreach(string id in IDs)
|
||||||
|
{
|
||||||
|
if(UUID.TryParse(id, out uuid))
|
||||||
|
{
|
||||||
|
lock(m_Cache)
|
||||||
|
account = m_Cache.Get(uuid, out inCache);
|
||||||
|
if (inCache)
|
||||||
|
ret.Add(account);
|
||||||
|
else
|
||||||
|
missing.Add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(missing.Count == 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
List<UserAccount> ext = UserAccountService.GetUserAccounts(scopeID, missing);
|
||||||
|
if(ext != null && ext.Count > 0)
|
||||||
|
{
|
||||||
|
ret.AddRange(ext);
|
||||||
|
foreach(UserAccount acc in ext)
|
||||||
|
{
|
||||||
|
if(acc != null)
|
||||||
|
lock(m_Cache)
|
||||||
|
m_Cache.Cache(acc.PrincipalID, acc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
|
public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using log4net;
|
using log4net;
|
||||||
using Mono.Addins;
|
using Mono.Addins;
|
||||||
|
@ -126,7 +128,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
// flags, title, etc. And country, don't forget country!
|
// flags, title, etc. And country, don't forget country!
|
||||||
private void OnNewClient(IClientAPI client)
|
private void OnNewClient(IClientAPI client)
|
||||||
{
|
{
|
||||||
m_Cache.Remove(client.Name);
|
lock(m_Cache)
|
||||||
|
m_Cache.Remove(client.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Overwritten methods from IUserAccountService
|
#region Overwritten methods from IUserAccountService
|
||||||
|
@ -134,12 +137,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
public override UserAccount GetUserAccount(UUID scopeID, UUID userID)
|
public override UserAccount GetUserAccount(UUID scopeID, UUID userID)
|
||||||
{
|
{
|
||||||
bool inCache = false;
|
bool inCache = false;
|
||||||
UserAccount account = m_Cache.Get(userID, out inCache);
|
UserAccount account;
|
||||||
|
lock(m_Cache)
|
||||||
|
account = m_Cache.Get(userID, out inCache);
|
||||||
if (inCache)
|
if (inCache)
|
||||||
return account;
|
return account;
|
||||||
|
|
||||||
account = base.GetUserAccount(scopeID, userID);
|
account = base.GetUserAccount(scopeID, userID);
|
||||||
m_Cache.Cache(userID, account);
|
lock(m_Cache)
|
||||||
|
if(account != null)
|
||||||
|
m_Cache.Cache(userID, account);
|
||||||
|
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
@ -147,17 +154,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
public override UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
|
public override UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
|
||||||
{
|
{
|
||||||
bool inCache = false;
|
bool inCache = false;
|
||||||
UserAccount account = m_Cache.Get(firstName + " " + lastName, out inCache);
|
UserAccount account;
|
||||||
|
lock(m_Cache)
|
||||||
|
account = m_Cache.Get(firstName + " " + lastName, out inCache);
|
||||||
if (inCache)
|
if (inCache)
|
||||||
return account;
|
return account;
|
||||||
|
|
||||||
account = base.GetUserAccount(scopeID, firstName, lastName);
|
account = base.GetUserAccount(scopeID, firstName, lastName);
|
||||||
if (account != null)
|
if (account != null)
|
||||||
m_Cache.Cache(account.PrincipalID, account);
|
lock(m_Cache)
|
||||||
|
m_Cache.Cache(account.PrincipalID, account);
|
||||||
|
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
|
||||||
|
{
|
||||||
|
List<UserAccount> accs = new List<UserAccount>();
|
||||||
|
List<string> missing = new List<string>();
|
||||||
|
|
||||||
|
UUID uuid = UUID.Zero;
|
||||||
|
UserAccount account;
|
||||||
|
bool inCache = false;
|
||||||
|
|
||||||
|
foreach(string id in IDs)
|
||||||
|
{
|
||||||
|
if(UUID.TryParse(id, out uuid))
|
||||||
|
{
|
||||||
|
lock(m_Cache)
|
||||||
|
account = m_Cache.Get(uuid, out inCache);
|
||||||
|
if (inCache)
|
||||||
|
accs.Add(account);
|
||||||
|
else
|
||||||
|
missing.Add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(missing.Count > 0)
|
||||||
|
{
|
||||||
|
List<UserAccount> ext = base.GetUserAccounts(scopeID, missing);
|
||||||
|
if(ext != null && ext.Count >0 )
|
||||||
|
{
|
||||||
|
accs.AddRange(ext);
|
||||||
|
foreach(UserAccount acc in ext)
|
||||||
|
{
|
||||||
|
if(acc != null)
|
||||||
|
lock(m_Cache)
|
||||||
|
m_Cache.Cache(acc.PrincipalID, acc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return accs;
|
||||||
|
}
|
||||||
|
|
||||||
public override bool StoreUserAccount(UserAccount data)
|
public override bool StoreUserAccount(UserAccount data)
|
||||||
{
|
{
|
||||||
// This remote connector refuses to serve this method
|
// This remote connector refuses to serve this method
|
||||||
|
|
|
@ -572,6 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||||
bool UseEstateSun, bool UseFixedSun, float SunHour,
|
bool UseEstateSun, bool UseFixedSun, float SunHour,
|
||||||
bool UseGlobal, bool EstateFixedSun, float EstateSunHour)
|
bool UseGlobal, bool EstateFixedSun, float EstateSunHour)
|
||||||
{
|
{
|
||||||
|
double lastwaterlevel = Scene.RegionInfo.RegionSettings.WaterHeight;
|
||||||
// Water Height
|
// Water Height
|
||||||
Scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight;
|
Scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight;
|
||||||
|
|
||||||
|
@ -584,6 +585,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||||
Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
|
Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
|
||||||
Scene.RegionInfo.RegionSettings.SunPosition = SunHour;
|
Scene.RegionInfo.RegionSettings.SunPosition = SunHour;
|
||||||
|
|
||||||
|
if(Scene.PhysicsEnabled && Scene.PhysicsScene != null && lastwaterlevel != WaterHeight)
|
||||||
|
Scene.PhysicsScene.SetWaterLevel(WaterHeight);
|
||||||
|
|
||||||
Scene.TriggerEstateSunUpdate();
|
Scene.TriggerEstateSunUpdate();
|
||||||
|
|
||||||
//m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
|
//m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
|
||||||
|
@ -1471,7 +1475,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||||
Scene.RegionInfo.EstateSettings.FixedSun,
|
Scene.RegionInfo.EstateSettings.FixedSun,
|
||||||
(float)Scene.RegionInfo.EstateSettings.SunPosition);
|
(float)Scene.RegionInfo.EstateSettings.SunPosition);
|
||||||
|
|
||||||
sendRegionInfoPacketToAll();
|
// sendRegionInfoPacketToAll(); already done by setRegionTerrainSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -374,9 +374,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
|
public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
remote_client.SceneAgent.Invulnerable =
|
if(m_scene.RegionInfo.RegionSettings.AllowDamage)
|
||||||
!m_scene.RegionInfo.RegionSettings.AllowDamage ||
|
remote_client.SceneAgent.Invulnerable = false;
|
||||||
(m_landData.Flags & (uint)ParcelFlags.AllowDamage) == 0;
|
else
|
||||||
|
remote_client.SceneAgent.Invulnerable = (m_landData.Flags & (uint)ParcelFlags.AllowDamage) == 0;
|
||||||
|
|
||||||
if (remote_client.SceneAgent.PresenceType == PresenceType.Npc)
|
if (remote_client.SceneAgent.PresenceType == PresenceType.Npc)
|
||||||
return;
|
return;
|
||||||
|
@ -779,11 +780,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
{
|
{
|
||||||
if (over.LandData.LocalID == LandData.LocalID)
|
if (over.LandData.LocalID == LandData.LocalID)
|
||||||
{
|
{
|
||||||
if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) &&
|
if(m_scene.RegionInfo.RegionSettings.AllowDamage)
|
||||||
m_scene.RegionInfo.RegionSettings.AllowDamage)
|
|
||||||
avatar.Invulnerable = false;
|
avatar.Invulnerable = false;
|
||||||
else
|
else
|
||||||
avatar.Invulnerable = true;
|
avatar.Invulnerable = (over.LandData.Flags & (uint)ParcelFlags.AllowDamage) == 0;
|
||||||
|
|
||||||
SendLandUpdateToClient(snap_selection, avatar.ControllingClient);
|
SendLandUpdateToClient(snap_selection, avatar.ControllingClient);
|
||||||
avatar.currentParcelUUID = LandData.GlobalID;
|
avatar.currentParcelUUID = LandData.GlobalID;
|
||||||
|
|
|
@ -52,11 +52,12 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
string capsURL, UUID avatarID, UUID sessionID,
|
string capsURL, UUID avatarID, UUID sessionID,
|
||||||
int regionSizeX, int regionSizeY);
|
int regionSizeX, int regionSizeY);
|
||||||
void ChatterboxInvitation(UUID sessionID, string sessionName,
|
void ChatterboxInvitation(UUID sessionID, string sessionName,
|
||||||
UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog,
|
UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog,
|
||||||
uint timeStamp, bool offline, int parentEstateID, Vector3 position,
|
uint timeStamp, bool offline, int parentEstateID, Vector3 position,
|
||||||
uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket);
|
uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket);
|
||||||
void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, bool canVoiceChat,
|
void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent,
|
||||||
bool isModerator, bool textMute, bool isEnterorLeave);
|
bool canVoiceChat, bool isModerator, bool textMute, bool isEnterorLeave);
|
||||||
|
void ChatterBoxForceClose(UUID toAgent, UUID sessionID, string reason);
|
||||||
void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID);
|
void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID);
|
||||||
void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data);
|
void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data);
|
||||||
OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono);
|
OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono);
|
||||||
|
|
|
@ -108,6 +108,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
priority = GetPriorityByFrontBack(client, entity);
|
priority = GetPriorityByFrontBack(client, entity);
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
|
case UpdatePrioritizationSchemes.SimpleAngularDistance:
|
||||||
|
priority = GetPriorityByAngularDistance(client, entity); // TODO: Reimplement SimpleAngularDistance
|
||||||
|
break;
|
||||||
case UpdatePrioritizationSchemes.BestAvatarResponsiveness:
|
case UpdatePrioritizationSchemes.BestAvatarResponsiveness:
|
||||||
default:
|
default:
|
||||||
priority = GetPriorityByBestAvatarResponsiveness(client, entity);
|
priority = GetPriorityByBestAvatarResponsiveness(client, entity);
|
||||||
|
@ -241,7 +244,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
*/
|
*/
|
||||||
if (distance > 10f)
|
if (distance > 10f)
|
||||||
{
|
{
|
||||||
float tmp = (float)Math.Log((double)distance) * 1.4426950408889634073599246810019f - 3.3219280948873623478703194294894f;
|
float tmp = (float)Math.Log((double)distance) * 1.442695f - 3.321928f;
|
||||||
// for a map identical to original:
|
// for a map identical to original:
|
||||||
// now
|
// now
|
||||||
// 1st constant is 1/(log(2)) (natural log) so we get log2(distance)
|
// 1st constant is 1/(log(2)) (natural log) so we get log2(distance)
|
||||||
|
@ -269,5 +272,67 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return pqueue;
|
return pqueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private uint GetPriorityByAngularDistance(IClientAPI client, ISceneEntity entity)
|
||||||
|
{
|
||||||
|
uint pqueue = 2; // keep compiler happy
|
||||||
|
|
||||||
|
ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
|
||||||
|
if (presence == null)
|
||||||
|
return PriorityQueue.NumberOfQueues - 1;
|
||||||
|
|
||||||
|
// All avatars other than our own go into pqueue 1
|
||||||
|
if (entity is ScenePresence)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if (entity is SceneObjectPart)
|
||||||
|
{
|
||||||
|
// Attachments are high priority,
|
||||||
|
if (((SceneObjectPart)entity).ParentGroup.IsAttachment)
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
pqueue = ComputeAngleDistancePriority(presence, entity);
|
||||||
|
|
||||||
|
// Non physical prims are lower priority than physical prims
|
||||||
|
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
|
||||||
|
if (physActor == null || !physActor.IsPhysical)
|
||||||
|
pqueue++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pqueue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private uint ComputeAngleDistancePriority(ScenePresence presence, ISceneEntity entity)
|
||||||
|
{
|
||||||
|
double distance;
|
||||||
|
|
||||||
|
Vector3 presencePos = presence.AbsolutePosition;
|
||||||
|
|
||||||
|
SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
|
||||||
|
float bradius = group.GetBoundsRadius();
|
||||||
|
Vector3 grppos = group.AbsolutePosition + group.getBoundsCenter();
|
||||||
|
distance = Vector3.Distance(presencePos, grppos);
|
||||||
|
distance -= bradius;
|
||||||
|
distance *= group.getAreaFactor();
|
||||||
|
|
||||||
|
// And convert the distance to a priority queue, this computation gives queues
|
||||||
|
// at 10, 20, 40, 80, 160, 320, 640, and 1280m
|
||||||
|
uint pqueue = PriorityQueue.NumberOfImmediateQueues + 1; // reserve attachments queue
|
||||||
|
uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues;
|
||||||
|
|
||||||
|
if (distance > 10f)
|
||||||
|
{
|
||||||
|
float tmp = (float)Math.Log(distance) * 1.442695f - 3.321928f;
|
||||||
|
// for a map identical to original:
|
||||||
|
// now
|
||||||
|
// 1st constant is 1/(log(2)) (natural log) so we get log2(distance)
|
||||||
|
// 2st constant makes it be log2(distance/10)
|
||||||
|
|
||||||
|
pqueue += (uint)tmp;
|
||||||
|
if (pqueue > queues - 1)
|
||||||
|
pqueue = queues - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pqueue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3866,15 +3866,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
foreach (uint localID in localIDs)
|
foreach (uint localID in localIDs)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
if (part != null) // It is a prim
|
if (part != null && part.ParentGroup != null &&
|
||||||
{
|
part.ParentGroup.RootPart == part)
|
||||||
if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid
|
deleteIDs.Add(localID);
|
||||||
{
|
|
||||||
if (part.ParentGroup.RootPart != part) // Child part
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
deleteIDs.Add(localID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ForEachClient(c => c.SendKillObject(deleteIDs));
|
ForEachClient(c => c.SendKillObject(deleteIDs));
|
||||||
|
@ -4458,7 +4452,7 @@ Label_GroupsDone:
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate",
|
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate",
|
||||||
agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
|
agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
|
||||||
reason = String.Format("Denied access to private region {0}: You are do not have access to that region.",
|
reason = String.Format("Denied access to private region {0}: You do not have access to that region.",
|
||||||
RegionInfo.RegionName);
|
RegionInfo.RegionName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1586,12 +1586,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return m_boundsCenter;
|
return m_boundsCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private float m_areaFactor;
|
||||||
|
public float getAreaFactor()
|
||||||
|
{
|
||||||
|
// math is done in GetBoundsRadius();
|
||||||
|
if(m_boundsRadius == null)
|
||||||
|
GetBoundsRadius();
|
||||||
|
return m_areaFactor;
|
||||||
|
}
|
||||||
|
|
||||||
public float GetBoundsRadius()
|
public float GetBoundsRadius()
|
||||||
{
|
{
|
||||||
// this may need more threading work
|
// this may need more threading work
|
||||||
if(m_boundsRadius == null)
|
if(m_boundsRadius == null)
|
||||||
{
|
{
|
||||||
float res = 0;
|
float res = 0;
|
||||||
|
float areaF = 0;
|
||||||
SceneObjectPart p;
|
SceneObjectPart p;
|
||||||
SceneObjectPart[] parts;
|
SceneObjectPart[] parts;
|
||||||
float partR;
|
float partR;
|
||||||
|
@ -1613,12 +1623,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
if(partR > res)
|
if(partR > res)
|
||||||
res = partR;
|
res = partR;
|
||||||
|
if(p.maxSimpleArea() > areaF)
|
||||||
|
areaF = p.maxSimpleArea();
|
||||||
}
|
}
|
||||||
if(parts.Length > 1)
|
if(parts.Length > 1)
|
||||||
{
|
{
|
||||||
offset /= parts.Length; // basicly geometric center
|
offset /= parts.Length; // basicly geometric center
|
||||||
offset = offset * RootPart.RotationOffset;
|
offset = offset * RootPart.RotationOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
areaF = 10.0f / areaF; // scale it
|
||||||
|
areaF = Util.Clamp(areaF, 0.001f, 1000f); // clamp it
|
||||||
|
|
||||||
|
m_areaFactor = (float)Math.Sqrt(areaF);
|
||||||
m_boundsCenter = offset;
|
m_boundsCenter = offset;
|
||||||
m_boundsRadius = res;
|
m_boundsRadius = res;
|
||||||
return res;
|
return res;
|
||||||
|
@ -2048,41 +2065,37 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// We need to keep track of this state in case this group is still queued for backup.
|
// We need to keep track of this state in case this group is still queued for backup.
|
||||||
IsDeleted = true;
|
IsDeleted = true;
|
||||||
HasGroupChanged = true;
|
|
||||||
|
|
||||||
DetachFromBackup();
|
DetachFromBackup();
|
||||||
|
|
||||||
|
if(Scene == null) // should not happen unless restart/shutdown ?
|
||||||
|
return;
|
||||||
|
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
for (int i = 0; i < parts.Length; i++)
|
for (int i = 0; i < parts.Length; i++)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = parts[i];
|
SceneObjectPart part = parts[i];
|
||||||
|
|
||||||
if (Scene != null)
|
Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
if (!avatar.IsChildAgent && avatar.ParentID == LocalId)
|
||||||
{
|
avatar.StandUp();
|
||||||
if (!avatar.IsChildAgent && avatar.ParentID == LocalId)
|
|
||||||
avatar.StandUp();
|
|
||||||
|
|
||||||
if (!silent)
|
if (!silent)
|
||||||
|
{
|
||||||
|
part.ClearUpdateSchedule();
|
||||||
|
if (part == m_rootPart)
|
||||||
{
|
{
|
||||||
part.ClearUpdateSchedule();
|
if (!IsAttachment
|
||||||
if (part == m_rootPart)
|
|| AttachedAvatar == avatar.ControllingClient.AgentId
|
||||||
|
|| !HasPrivateAttachmentPoint)
|
||||||
{
|
{
|
||||||
if (!IsAttachment
|
// Send a kill object immediately
|
||||||
|| AttachedAvatar == avatar.ControllingClient.AgentId
|
avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId });
|
||||||
|| !HasPrivateAttachmentPoint)
|
|
||||||
{
|
|
||||||
// Send a kill object immediately
|
|
||||||
avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId });
|
|
||||||
// Also, send a terse update; in case race conditions make the object pop again in the client,
|
|
||||||
// this update will send another kill object
|
|
||||||
m_rootPart.SendTerseUpdateToClient(avatar.ControllingClient);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// but reversed logic: bit cleared means free to rotate
|
// but reversed logic: bit cleared means free to rotate
|
||||||
public byte RotationAxisLocks = 0;
|
public byte RotationAxisLocks = 0;
|
||||||
|
|
||||||
public bool VolumeDetectActive;
|
// WRONG flag in libOmvPrimFlags
|
||||||
|
private const uint primFlagVolumeDetect = (uint)PrimFlags.JointLP2P;
|
||||||
|
|
||||||
|
public bool VolumeDetectActive
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (Flags & (PrimFlags)primFlagVolumeDetect) != 0;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(value)
|
||||||
|
Flags |= (PrimFlags)primFlagVolumeDetect;
|
||||||
|
else
|
||||||
|
Flags &= (PrimFlags)(~primFlagVolumeDetect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsWaitingForFirstSpinUpdatePacket;
|
public bool IsWaitingForFirstSpinUpdatePacket;
|
||||||
|
|
||||||
|
@ -1188,6 +1204,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float maxSimpleArea()
|
||||||
|
{
|
||||||
|
float a,b;
|
||||||
|
float sx = m_shape.Scale.X;
|
||||||
|
float sy = m_shape.Scale.Y;
|
||||||
|
float sz = m_shape.Scale.Z;
|
||||||
|
|
||||||
|
if( sx > sy)
|
||||||
|
{
|
||||||
|
a = sx;
|
||||||
|
if(sy > sz)
|
||||||
|
b = sy;
|
||||||
|
else
|
||||||
|
b = sz;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
a = sy;
|
||||||
|
if(sx > sz)
|
||||||
|
b = sx;
|
||||||
|
else
|
||||||
|
b = sz;
|
||||||
|
}
|
||||||
|
|
||||||
|
return a * b;
|
||||||
|
}
|
||||||
|
|
||||||
public UpdateRequired UpdateFlag { get; set; }
|
public UpdateRequired UpdateFlag { get; set; }
|
||||||
public bool UpdatePhysRequired { get; set; }
|
public bool UpdatePhysRequired { get; set; }
|
||||||
|
|
||||||
|
@ -2078,12 +2121,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (localGlobalTF)
|
if (localGlobalTF)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
Quaternion grot = GetWorldRotation();
|
|
||||||
Quaternion AXgrot = grot;
|
|
||||||
Vector3 AXimpulsei = impulsei;
|
|
||||||
Vector3 newimpulse = AXimpulsei * AXgrot;
|
|
||||||
*/
|
|
||||||
torque *= GetWorldRotation();
|
torque *= GetWorldRotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2222,16 +2259,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (userExposed)
|
if (userExposed)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero)
|
|
||||||
{
|
|
||||||
ParentGroup.Scene.AssetService.Get(
|
|
||||||
dupe.m_shape.SculptTexture.ToString(), dupe, dupe.AssetReceived);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0);
|
bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0);
|
||||||
dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
|
dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||||
// dupe.UpdatePhysicsSubscribedEvents(); // not sure...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dupe.PhysActor != null)
|
if (dupe.PhysActor != null)
|
||||||
|
@ -2244,23 +2273,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return dupe;
|
return dupe;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Called back by asynchronous asset fetch.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id">ID of asset received</param>
|
|
||||||
/// <param name="sender">Register</param>
|
|
||||||
/// <param name="asset"></param>
|
|
||||||
/*
|
|
||||||
protected void AssetReceived(string id, Object sender, AssetBase asset)
|
|
||||||
{
|
|
||||||
if (asset != null)
|
|
||||||
SculptTextureCallback(asset);
|
|
||||||
// else
|
|
||||||
// m_log.WarnFormat(
|
|
||||||
// "[SCENE OBJECT PART]: Part {0} {1} requested mesh/sculpt data for asset id {2} from asset service but received no data",
|
|
||||||
// Name, UUID, id);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Do a physics property update for a NINJA joint.
|
/// Do a physics property update for a NINJA joint.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3242,39 +3254,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
ParentGroup.ScriptSetPhysicsStatus(UsePhysics);
|
ParentGroup.ScriptSetPhysicsStatus(UsePhysics);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Set sculpt and mesh data, and tell the physics engine to process the change.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="texture">The mesh itself.</param>
|
|
||||||
/*
|
|
||||||
public void SculptTextureCallback(AssetBase texture)
|
|
||||||
{
|
|
||||||
if (m_shape.SculptEntry)
|
|
||||||
{
|
|
||||||
// commented out for sculpt map caching test - null could mean a cached sculpt map has been found
|
|
||||||
//if (texture != null)
|
|
||||||
{
|
|
||||||
if (texture != null)
|
|
||||||
{
|
|
||||||
// m_log.DebugFormat(
|
|
||||||
// "[SCENE OBJECT PART]: Setting sculpt data for {0} on SculptTextureCallback()", Name);
|
|
||||||
|
|
||||||
m_shape.SculptData = texture.Data;
|
|
||||||
}
|
|
||||||
|
|
||||||
PhysicsActor pa = PhysActor;
|
|
||||||
|
|
||||||
if (pa != null)
|
|
||||||
{
|
|
||||||
// Update the physics actor with the new loaded sculpt data and set the taint signal.
|
|
||||||
pa.Shape = m_shape;
|
|
||||||
|
|
||||||
ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send a full update to the client for the given part
|
/// Send a full update to the client for the given part
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -4015,103 +3994,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot)
|
|
||||||
{
|
|
||||||
// In this case we're using a sphere with a radius of the largest dimension of the prim
|
|
||||||
// TODO: Change to take shape into account
|
|
||||||
|
|
||||||
EntityIntersection result = new EntityIntersection();
|
|
||||||
Vector3 vAbsolutePosition = AbsolutePosition;
|
|
||||||
Vector3 vScale = Scale;
|
|
||||||
Vector3 rOrigin = iray.Origin;
|
|
||||||
Vector3 rDirection = iray.Direction;
|
|
||||||
|
|
||||||
//rDirection = rDirection.Normalize();
|
|
||||||
// Buidling the first part of the Quadratic equation
|
|
||||||
Vector3 r2ndDirection = rDirection*rDirection;
|
|
||||||
float itestPart1 = r2ndDirection.X + r2ndDirection.Y + r2ndDirection.Z;
|
|
||||||
|
|
||||||
// Buidling the second part of the Quadratic equation
|
|
||||||
Vector3 tmVal2 = rOrigin - vAbsolutePosition;
|
|
||||||
Vector3 r2Direction = rDirection*2.0f;
|
|
||||||
Vector3 tmVal3 = r2Direction*tmVal2;
|
|
||||||
|
|
||||||
float itestPart2 = tmVal3.X + tmVal3.Y + tmVal3.Z;
|
|
||||||
|
|
||||||
// Buidling the third part of the Quadratic equation
|
|
||||||
Vector3 tmVal4 = rOrigin*rOrigin;
|
|
||||||
Vector3 tmVal5 = vAbsolutePosition*vAbsolutePosition;
|
|
||||||
|
|
||||||
Vector3 tmVal6 = vAbsolutePosition*rOrigin;
|
|
||||||
|
|
||||||
// Set Radius to the largest dimension of the prim
|
|
||||||
float radius = 0f;
|
|
||||||
if (vScale.X > radius)
|
|
||||||
radius = vScale.X;
|
|
||||||
if (vScale.Y > radius)
|
|
||||||
radius = vScale.Y;
|
|
||||||
if (vScale.Z > radius)
|
|
||||||
radius = vScale.Z;
|
|
||||||
|
|
||||||
// the second part of this is the default prim size
|
|
||||||
// once we factor in the aabb of the prim we're adding we can
|
|
||||||
// change this to;
|
|
||||||
// radius = (radius / 2) - 0.01f;
|
|
||||||
//
|
|
||||||
radius = (radius / 2) + (0.5f / 2) - 0.1f;
|
|
||||||
|
|
||||||
//radius = radius;
|
|
||||||
|
|
||||||
float itestPart3 = tmVal4.X + tmVal4.Y + tmVal4.Z + tmVal5.X + tmVal5.Y + tmVal5.Z -
|
|
||||||
(2.0f*(tmVal6.X + tmVal6.Y + tmVal6.Z + (radius*radius)));
|
|
||||||
|
|
||||||
// Yuk Quadradrics.. Solve first
|
|
||||||
float rootsqr = (itestPart2*itestPart2) - (4.0f*itestPart1*itestPart3);
|
|
||||||
if (rootsqr < 0.0f)
|
|
||||||
{
|
|
||||||
// No intersection
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
float root = ((-itestPart2) - (float) Math.Sqrt((double) rootsqr))/(itestPart1*2.0f);
|
|
||||||
|
|
||||||
if (root < 0.0f)
|
|
||||||
{
|
|
||||||
// perform second quadratic root solution
|
|
||||||
root = ((-itestPart2) + (float) Math.Sqrt((double) rootsqr))/(itestPart1*2.0f);
|
|
||||||
|
|
||||||
// is there any intersection?
|
|
||||||
if (root < 0.0f)
|
|
||||||
{
|
|
||||||
// nope, no intersection
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We got an intersection. putting together an EntityIntersection object with the
|
|
||||||
// intersection information
|
|
||||||
Vector3 ipoint =
|
|
||||||
new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root),
|
|
||||||
iray.Origin.Z + (iray.Direction.Z*root));
|
|
||||||
|
|
||||||
result.HitTF = true;
|
|
||||||
result.ipoint = ipoint;
|
|
||||||
|
|
||||||
// Normal is calculated by the difference and then normalizing the result
|
|
||||||
Vector3 normalpart = ipoint - vAbsolutePosition;
|
|
||||||
result.normal = normalpart / normalpart.Length();
|
|
||||||
|
|
||||||
// It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't.
|
|
||||||
// I can write a function to do it.. but I like the fact that this one is Static.
|
|
||||||
|
|
||||||
Vector3 distanceConvert1 = new Vector3(iray.Origin.X, iray.Origin.Y, iray.Origin.Z);
|
|
||||||
Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z);
|
|
||||||
float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2);
|
|
||||||
|
|
||||||
result.distance = distance;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityIntersection TestIntersectionOBB(Ray iray, Quaternion parentrot, bool frontFacesOnly, bool faceCenters)
|
public EntityIntersection TestIntersectionOBB(Ray iray, Quaternion parentrot, bool frontFacesOnly, bool faceCenters)
|
||||||
{
|
{
|
||||||
// In this case we're using a rectangular prism, which has 6 faces and therefore 6 planes
|
// In this case we're using a rectangular prism, which has 6 faces and therefore 6 planes
|
||||||
|
@ -4479,15 +4361,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
|
public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
|
||||||
{
|
{
|
||||||
m_shape.ReadInUpdateExtraParam(type, inUse, data);
|
m_shape.ReadInUpdateExtraParam(type, inUse, data);
|
||||||
/*
|
|
||||||
if (type == 0x30)
|
|
||||||
{
|
|
||||||
if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero)
|
|
||||||
{
|
|
||||||
ParentGroup.Scene.AssetService.Get(m_shape.SculptTexture.ToString(), this, AssetReceived);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (ParentGroup != null)
|
if (ParentGroup != null)
|
||||||
{
|
{
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
@ -4714,9 +4588,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
|
|
||||||
VolumeDetectActive = SetVD;
|
VolumeDetectActive = SetVD;
|
||||||
|
|
||||||
// volume detector implies phantom
|
// volume detector implies phantom we need to decouple this mess
|
||||||
if (VolumeDetectActive)
|
if (SetVD)
|
||||||
SetPhantom = true;
|
SetPhantom = true;
|
||||||
|
else if(wasVD)
|
||||||
|
SetPhantom = false;
|
||||||
|
|
||||||
if (UsePhysics)
|
if (UsePhysics)
|
||||||
AddFlag(PrimFlags.Physics);
|
AddFlag(PrimFlags.Physics);
|
||||||
|
@ -4733,7 +4609,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
else
|
else
|
||||||
RemFlag(PrimFlags.TemporaryOnRez);
|
RemFlag(PrimFlags.TemporaryOnRez);
|
||||||
|
|
||||||
|
|
||||||
if (ParentGroup.Scene == null)
|
if (ParentGroup.Scene == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -4763,26 +4638,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
{
|
{
|
||||||
AddToPhysics(UsePhysics, SetPhantom, building, false);
|
AddToPhysics(UsePhysics, SetPhantom, building, false);
|
||||||
pa = PhysActor;
|
pa = PhysActor;
|
||||||
/*
|
|
||||||
if (pa != null)
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
|
|
||||||
((AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) ||
|
|
||||||
((ParentGroup.RootPart.AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) ||
|
|
||||||
(CollisionSound != UUID.Zero)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
pa.OnCollisionUpdate += PhysicsCollision;
|
|
||||||
pa.SubscribeEvents(1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
{
|
{
|
||||||
pa.SetMaterial(Material);
|
pa.SetMaterial(Material);
|
||||||
|
@ -4793,12 +4649,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
{
|
{
|
||||||
|
|
||||||
DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status.
|
DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status.
|
||||||
/* moved into DoPhysicsPropertyUpdate
|
|
||||||
if(VolumeDetectActive)
|
|
||||||
pa.SetVolumeDetect(1);
|
|
||||||
else
|
|
||||||
pa.SetVolumeDetect(0);
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (pa.Building != building)
|
if (pa.Building != building)
|
||||||
pa.Building = building;
|
pa.Building = building;
|
||||||
|
@ -4807,32 +4657,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
UpdatePhysicsSubscribedEvents();
|
UpdatePhysicsSubscribedEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SetVD)
|
|
||||||
{
|
|
||||||
// If the above logic worked (this is urgent candidate to unit tests!)
|
|
||||||
// we now have a physicsactor.
|
|
||||||
// Defensive programming calls for a check here.
|
|
||||||
// Better would be throwing an exception that could be catched by a unit test as the internal
|
|
||||||
// logic should make sure, this Physactor is always here.
|
|
||||||
if (pa != null)
|
|
||||||
{
|
|
||||||
pa.SetVolumeDetect(1);
|
|
||||||
AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active
|
|
||||||
VolumeDetectActive = true;
|
|
||||||
}
|
|
||||||
// m_log.Debug("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
|
|
||||||
}
|
|
||||||
else if (SetVD != wasVD)
|
|
||||||
{
|
|
||||||
// Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like
|
|
||||||
// (mumbles, well, at least if you have infinte CPU powers :-))
|
|
||||||
if (pa != null)
|
|
||||||
pa.SetVolumeDetect(0);
|
|
||||||
|
|
||||||
RemFlag(PrimFlags.Phantom);
|
// and last in case we have a new actor and not building
|
||||||
VolumeDetectActive = false;
|
|
||||||
}
|
|
||||||
// and last in case we have a new actor and not building
|
|
||||||
|
|
||||||
if (ParentGroup != null)
|
if (ParentGroup != null)
|
||||||
{
|
{
|
||||||
|
@ -5093,42 +4919,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics
|
|
||||||
/// engine can use it.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// When the physics engine has finished with it, the sculpt data is discarded to save memory.
|
|
||||||
/// </remarks>
|
|
||||||
/*
|
|
||||||
public void CheckSculptAndLoad()
|
|
||||||
{
|
|
||||||
// m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (ParentGroup.IsDeleted)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((ParentGroup.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (Shape.SculptEntry && Shape.SculptTexture != UUID.Zero)
|
|
||||||
{
|
|
||||||
// check if a previously decoded sculpt map has been cached
|
|
||||||
// We don't read the file here - the meshmerizer will do that later.
|
|
||||||
// TODO: Could we simplify the meshmerizer code by reading and setting the data here?
|
|
||||||
if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + Shape.SculptTexture.ToString())))
|
|
||||||
{
|
|
||||||
SculptTextureCallback(null);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ParentGroup.Scene.AssetService.Get(Shape.SculptTexture.ToString(), this, AssetReceived);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the texture entry for this part.
|
/// Update the texture entry for this part.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -5259,7 +5049,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
{
|
{
|
||||||
// subscribe to physics updates.
|
// subscribe to physics updates.
|
||||||
pa.OnCollisionUpdate += PhysicsCollision;
|
pa.OnCollisionUpdate += PhysicsCollision;
|
||||||
pa.SubscribeEvents(100); // 10 reports per second
|
pa.SubscribeEvents(50); // 20 reports per second
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -5304,41 +5094,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
{
|
{
|
||||||
objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
|
objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
PhysicsActor pa = PhysActor;
|
|
||||||
if (pa != null)
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
|
|
||||||
// ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
|
|
||||||
((AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || ((ParentGroup.RootPart.AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || (CollisionSound != UUID.Zero)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// subscribe to physics updates.
|
|
||||||
pa.OnCollisionUpdate += PhysicsCollision;
|
|
||||||
pa.SubscribeEvents(1000);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pa.UnSubscribeEvents();
|
|
||||||
pa.OnCollisionUpdate -= PhysicsCollision;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
UpdatePhysicsSubscribedEvents();
|
|
||||||
|
|
||||||
//if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
|
UpdatePhysicsSubscribedEvents();
|
||||||
//{
|
|
||||||
// ParentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// ParentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
|
|
||||||
//}
|
|
||||||
|
|
||||||
LocalFlags = (PrimFlags)objectflagupdate;
|
LocalFlags = (PrimFlags)objectflagupdate;
|
||||||
|
|
||||||
|
@ -5393,6 +5150,9 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
|
|
||||||
public void SendTerseUpdateToClient(IClientAPI remoteClient)
|
public void SendTerseUpdateToClient(IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
|
if (ParentGroup.IsDeleted)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ParentGroup.IsAttachment
|
if (ParentGroup.IsAttachment
|
||||||
&& (ParentGroup.RootPart != this
|
&& (ParentGroup.RootPart != this
|
||||||
|| ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint))
|
|| ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint))
|
||||||
|
|
|
@ -107,7 +107,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
m_so1.ScriptSetVolumeDetect(true);
|
m_so1.ScriptSetVolumeDetect(true);
|
||||||
|
|
||||||
// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags);
|
// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags);
|
||||||
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom));
|
// PrimFlags.JointLP2P is incorrect it now means VolumeDetect (as defined by viewers)
|
||||||
|
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom | PrimFlags.JointLP2P));
|
||||||
|
|
||||||
m_so1.ScriptSetVolumeDetect(false);
|
m_so1.ScriptSetVolumeDetect(false);
|
||||||
|
|
||||||
|
@ -146,7 +147,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
m_so1.ScriptSetPhysicsStatus(true);
|
m_so1.ScriptSetPhysicsStatus(true);
|
||||||
m_so1.ScriptSetVolumeDetect(true);
|
m_so1.ScriptSetVolumeDetect(true);
|
||||||
|
|
||||||
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom | PrimFlags.Physics));
|
// PrimFlags.JointLP2P is incorrect it now means VolumeDetect (as defined by viewers)
|
||||||
|
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom | PrimFlags.Physics | PrimFlags.JointLP2P));
|
||||||
|
|
||||||
m_so1.ScriptSetVolumeDetect(false);
|
m_so1.ScriptSetVolumeDetect(false);
|
||||||
|
|
||||||
|
|
|
@ -1217,6 +1217,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendAlertMessage(string message, string info)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
|
public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
|
||||||
{
|
{
|
||||||
IRC_SendChannelPrivmsg(objectname,url);
|
IRC_SendChannelPrivmsg(objectname,url);
|
||||||
|
|
|
@ -862,7 +862,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
{
|
{
|
||||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||||
|
|
||||||
if (m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), UUID.Zero, name) != null)
|
GroupRecord groupRecord = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), UUID.Zero, name);
|
||||||
|
|
||||||
|
if (groupRecord != null)
|
||||||
{
|
{
|
||||||
remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists.");
|
remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists.");
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
|
@ -877,26 +879,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
{
|
{
|
||||||
if (avatar.UserLevel < m_levelGroupCreate)
|
if (avatar.UserLevel < m_levelGroupCreate)
|
||||||
{
|
{
|
||||||
remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient permissions to create a group.");
|
remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have insufficient permissions to create a group.");
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check funds
|
// check funds
|
||||||
// is there is a money module present ?
|
// is there a money module present ?
|
||||||
IMoneyModule money = scene.RequestModuleInterface<IMoneyModule>();
|
IMoneyModule money = scene.RequestModuleInterface<IMoneyModule>();
|
||||||
if (money != null)
|
if (money != null && money.GroupCreationCharge > 0)
|
||||||
{
|
{
|
||||||
// do the transaction, that is if the agent has got sufficient funds
|
// do the transaction, that is if the agent has sufficient funds
|
||||||
if (!money.AmountCovered(remoteClient.AgentId, money.GroupCreationCharge)) {
|
if (!money.AmountCovered(remoteClient.AgentId, money.GroupCreationCharge)) {
|
||||||
remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient funds to create a group.");
|
remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have insufficient funds to create a group.");
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, MoneyTransactionType.GroupCreate);
|
money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, MoneyTransactionType.GroupCreate, name);
|
||||||
}
|
}
|
||||||
UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient));
|
UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient));
|
||||||
|
|
||||||
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
|
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully");
|
||||||
|
|
||||||
// Update the founder with new group information.
|
// Update the founder with new group information.
|
||||||
SendAgentGroupDataUpdate(remoteClient, false);
|
SendAgentGroupDataUpdate(remoteClient, false);
|
||||||
|
@ -1092,6 +1094,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
// Should check to see if OpenEnrollment, or if there's an outstanding invitation
|
// Should check to see if OpenEnrollment, or if there's an outstanding invitation
|
||||||
m_groupData.AddAgentToGroup(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID, UUID.Zero);
|
m_groupData.AddAgentToGroup(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID, UUID.Zero);
|
||||||
|
|
||||||
|
// check funds
|
||||||
|
// is there a money module present ?
|
||||||
|
GroupRecord groupRecord = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), groupID, null);
|
||||||
|
IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>();
|
||||||
|
if (money != null && groupRecord.MembershipFee > 0)
|
||||||
|
{
|
||||||
|
// do the transaction, that is if the agent has sufficient funds
|
||||||
|
if (!money.AmountCovered(GetRequestingAgentID(remoteClient), groupRecord.MembershipFee)) {
|
||||||
|
remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have insufficient funds to join the group.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
money.ApplyCharge(GetRequestingAgentID(remoteClient), groupRecord.MembershipFee, MoneyTransactionType.GroupJoin, groupRecord.GroupName);
|
||||||
|
}
|
||||||
|
|
||||||
remoteClient.SendJoinGroupReply(groupID, true);
|
remoteClient.SendJoinGroupReply(groupID, true);
|
||||||
|
|
||||||
SendAgentGroupDataUpdate(remoteClient, true);
|
SendAgentGroupDataUpdate(remoteClient, true);
|
||||||
|
|
|
@ -1008,11 +1008,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
respData.Add("error", e.ToString());
|
respData.Add("error", e.ToString());
|
||||||
return respData;
|
return respData;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((m_cacheTimeout > 0) && (CacheKey != null))
|
if ((m_cacheTimeout > 0) && (CacheKey != null))
|
||||||
{
|
{
|
||||||
m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout));
|
m_memoryCache.AddOrUpdate(CacheKey, resp, 10.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resp.Value is Hashtable)
|
if (resp.Value is Hashtable)
|
||||||
|
|
|
@ -108,8 +108,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
||||||
{
|
{
|
||||||
if (m_Enabled)
|
if (m_Enabled)
|
||||||
{
|
{
|
||||||
IEntityTransferModule et = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
m_Helper = new SimulatorFeaturesHelper(scene);
|
||||||
m_Helper = new SimulatorFeaturesHelper(scene, et);
|
|
||||||
|
|
||||||
ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>();
|
ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>();
|
||||||
if (featuresModule != null)
|
if (featuresModule != null)
|
||||||
|
@ -124,7 +123,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
||||||
private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
|
private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[CAMERA-ONLY MODE]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName);
|
m_log.DebugFormat("[CAMERA-ONLY MODE]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName);
|
||||||
if (m_Helper.ShouldSend(agentID) && m_Helper.UserLevel(agentID) <= m_UserLevel)
|
if (m_Helper.UserLevel(agentID) <= m_UserLevel)
|
||||||
{
|
{
|
||||||
OSDMap extrasMap;
|
OSDMap extrasMap;
|
||||||
if (features.ContainsKey("OpenSimExtras"))
|
if (features.ContainsKey("OpenSimExtras"))
|
||||||
|
|
|
@ -53,86 +53,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private IEntityTransferModule m_TransferModule;
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
|
|
||||||
private struct RegionSend {
|
public SimulatorFeaturesHelper(Scene scene)
|
||||||
public UUID region;
|
|
||||||
public bool send;
|
|
||||||
};
|
|
||||||
// Using a static cache so that we don't have to perform the time-consuming tests
|
|
||||||
// in ShouldSend on Extra SimFeatures that go on the same response but come from
|
|
||||||
// different modules.
|
|
||||||
// This cached is indexed on the agentID and maps to a list of regions
|
|
||||||
private static ExpiringCache<UUID, List<RegionSend>> m_Cache = new ExpiringCache<UUID, List<RegionSend>>();
|
|
||||||
private const double TIMEOUT = 1.0; // time in cache
|
|
||||||
|
|
||||||
public SimulatorFeaturesHelper(Scene scene, IEntityTransferModule et)
|
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_TransferModule = et;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ShouldSend(UUID agentID)
|
|
||||||
{
|
|
||||||
List<RegionSend> rsendlist;
|
|
||||||
RegionSend rsend;
|
|
||||||
if (m_Cache.TryGetValue(agentID, out rsendlist))
|
|
||||||
{
|
|
||||||
rsend = rsendlist.Find(r => r.region == m_scene.RegionInfo.RegionID);
|
|
||||||
if (rsend.region != UUID.Zero) // Found it
|
|
||||||
{
|
|
||||||
return rsend.send;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Relatively complex logic for deciding whether to send the extra SimFeature or not.
|
|
||||||
// This is because the viewer calls this cap to all sims that it knows about,
|
|
||||||
// including the departing sims and non-neighbors (those that are cached).
|
|
||||||
rsend.region = m_scene.RegionInfo.RegionID;
|
|
||||||
rsend.send = false;
|
|
||||||
IClientAPI client = null;
|
|
||||||
int counter = 200;
|
|
||||||
|
|
||||||
// Let's wait a little to see if we get a client here
|
|
||||||
while (!m_scene.TryGetClient(agentID, out client) && counter-- > 0)
|
|
||||||
Thread.Sleep(50);
|
|
||||||
|
|
||||||
if (client != null)
|
|
||||||
{
|
|
||||||
ScenePresence sp = WaitGetScenePresence(agentID);
|
|
||||||
|
|
||||||
if (sp != null)
|
|
||||||
{
|
|
||||||
// On the receiving region, the call to this cap may arrive before
|
|
||||||
// the agent is root. Make sure we only proceed from here when the agent
|
|
||||||
// has been made root
|
|
||||||
counter = 200;
|
|
||||||
while ((sp.IsInTransit || sp.IsChildAgent) && counter-- > 0)
|
|
||||||
{
|
|
||||||
Thread.Sleep(50);
|
|
||||||
}
|
|
||||||
|
|
||||||
// The viewer calls this cap on the departing sims too. Make sure
|
|
||||||
// that we only proceed after the agent is not in transit anymore.
|
|
||||||
// The agent must be root and not going anywhere
|
|
||||||
if (!sp.IsChildAgent && !m_TransferModule.IsInTransit(agentID))
|
|
||||||
rsend.send = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//else
|
|
||||||
// m_log.DebugFormat("[XXX]: client is null");
|
|
||||||
|
|
||||||
|
|
||||||
if (rsendlist == null)
|
|
||||||
{
|
|
||||||
rsendlist = new List<RegionSend>();
|
|
||||||
m_Cache.AddOrUpdate(agentID, rsendlist, TIMEOUT);
|
|
||||||
}
|
|
||||||
rsendlist.Add(rsend);
|
|
||||||
|
|
||||||
return rsend.send;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int UserLevel(UUID agentID)
|
public int UserLevel(UUID agentID)
|
||||||
|
@ -144,28 +69,5 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
||||||
|
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual ScenePresence WaitGetScenePresence(UUID agentID)
|
|
||||||
{
|
|
||||||
int ntimes = 20;
|
|
||||||
ScenePresence sp = null;
|
|
||||||
while ((sp = m_scene.GetScenePresence(agentID)) == null && (ntimes-- > 0))
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
|
|
||||||
if (sp == null)
|
|
||||||
m_log.WarnFormat(
|
|
||||||
"[XXX]: Did not find presence with id {0} in {1} before timeout",
|
|
||||||
agentID, m_scene.RegionInfo.RegionName);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ntimes = 10;
|
|
||||||
while (sp.IsInTransit && (ntimes-- > 0))
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sp;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,8 +102,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
||||||
{
|
{
|
||||||
if (m_Enabled)
|
if (m_Enabled)
|
||||||
{
|
{
|
||||||
IEntityTransferModule et = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
m_Helper = new SimulatorFeaturesHelper(scene);
|
||||||
m_Helper = new SimulatorFeaturesHelper(scene, et);
|
|
||||||
|
|
||||||
ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>();
|
ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>();
|
||||||
if (featuresModule != null)
|
if (featuresModule != null)
|
||||||
|
@ -118,7 +117,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
||||||
private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
|
private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[SPECIAL UI]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName);
|
m_log.DebugFormat("[SPECIAL UI]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName);
|
||||||
if (m_Helper.ShouldSend(agentID) && m_Helper.UserLevel(agentID) <= m_UserLevel)
|
if (m_Helper.UserLevel(agentID) <= m_UserLevel)
|
||||||
{
|
{
|
||||||
OSDMap extrasMap;
|
OSDMap extrasMap;
|
||||||
OSDMap specialUI = new OSDMap();
|
OSDMap specialUI = new OSDMap();
|
||||||
|
|
|
@ -885,6 +885,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendAlertMessage(string message, string info)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void SendSystemAlertMessage(string message)
|
public void SendSystemAlertMessage(string message)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -1605,18 +1605,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (m_cureventsubscription < m_eventsubscription)
|
if (m_cureventsubscription < m_eventsubscription)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_cureventsubscription = 0;
|
|
||||||
|
|
||||||
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
|
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
|
||||||
|
|
||||||
if (!SentEmptyCollisionsEvent || ncolisions > 0)
|
if (!SentEmptyCollisionsEvent || ncolisions > 0)
|
||||||
{
|
{
|
||||||
base.SendCollisionUpdate(CollisionEventsThisFrame);
|
base.SendCollisionUpdate(CollisionEventsThisFrame);
|
||||||
|
m_cureventsubscription = 0;
|
||||||
|
|
||||||
if (ncolisions == 0)
|
if (ncolisions == 0)
|
||||||
{
|
{
|
||||||
SentEmptyCollisionsEvent = true;
|
SentEmptyCollisionsEvent = true;
|
||||||
_parent_scene.RemoveCollisionEventReporting(this);
|
// _parent_scene.RemoveCollisionEventReporting(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1000,9 +1000,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
|
|
||||||
public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact)
|
public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (CollisionEventsThisFrame == null)
|
if (CollisionEventsThisFrame == null)
|
||||||
CollisionEventsThisFrame = new CollisionEventUpdate();
|
CollisionEventsThisFrame = new CollisionEventUpdate();
|
||||||
|
|
||||||
CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
|
CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
|
||||||
_parent_scene.AddCollisionEventReporting(this);
|
_parent_scene.AddCollisionEventReporting(this);
|
||||||
}
|
}
|
||||||
|
@ -1033,28 +1033,27 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (CollisionEventsThisFrame == null)
|
if (CollisionEventsThisFrame == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
|
||||||
|
|
||||||
if (m_cureventsubscription < m_eventsubscription)
|
if (m_cureventsubscription < m_eventsubscription)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_cureventsubscription = 0;
|
|
||||||
|
|
||||||
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
|
|
||||||
|
|
||||||
if (!SentEmptyCollisionsEvent || ncolisions > 0)
|
if (!SentEmptyCollisionsEvent || ncolisions > 0)
|
||||||
{
|
{
|
||||||
base.SendCollisionUpdate(CollisionEventsThisFrame);
|
base.SendCollisionUpdate(CollisionEventsThisFrame);
|
||||||
|
m_cureventsubscription = 0;
|
||||||
|
|
||||||
if (ncolisions == 0)
|
if (ncolisions == 0)
|
||||||
{
|
{
|
||||||
SentEmptyCollisionsEvent = true;
|
SentEmptyCollisionsEvent = true;
|
||||||
_parent_scene.RemoveCollisionEventReporting(this);
|
// _parent_scene.RemoveCollisionEventReporting(this);
|
||||||
}
|
}
|
||||||
else if(Body == IntPtr.Zero || d.BodyIsEnabled(Body))
|
else if(Body == IntPtr.Zero || d.BodyIsEnabled(Body))
|
||||||
{
|
{
|
||||||
SentEmptyCollisionsEvent = false;
|
SentEmptyCollisionsEvent = false;
|
||||||
CollisionEventsThisFrame.Clear();
|
CollisionEventsThisFrame.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SubscribedEvents()
|
public override bool SubscribedEvents()
|
||||||
|
|
|
@ -417,7 +417,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
|
||||||
meshOsd = (OSDMap)osd;
|
meshOsd = (OSDMap)osd;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.Warn("[Mesh}: unable to cast mesh asset to OSDMap");
|
m_log.WarnFormat("[Mesh}: unable to cast mesh asset to OSDMap prim: {0}",primName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -451,7 +451,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
|
||||||
|
|
||||||
if (physicsParms == null)
|
if (physicsParms == null)
|
||||||
{
|
{
|
||||||
m_log.Warn("[MESH]: unknown mesh type");
|
m_log.WarnFormat("[MESH]: unknown mesh type for {0}",primName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -228,6 +228,8 @@ namespace OpenSim.Server.Handlers.GridUser
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (GridUserInfo pinfo in pinfos)
|
foreach (GridUserInfo pinfo in pinfos)
|
||||||
{
|
{
|
||||||
|
if(pinfo == null)
|
||||||
|
continue;
|
||||||
Dictionary<string, object> rinfoDict = pinfo.ToKeyValuePairs();
|
Dictionary<string, object> rinfoDict = pinfo.ToKeyValuePairs();
|
||||||
result["griduser" + i] = rinfoDict;
|
result["griduser" + i] = rinfoDict;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -103,6 +103,8 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||||
return GetAccount(request);
|
return GetAccount(request);
|
||||||
case "getaccounts":
|
case "getaccounts":
|
||||||
return GetAccounts(request);
|
return GetAccounts(request);
|
||||||
|
case "getmultiaccounts":
|
||||||
|
return GetMultiAccounts(request);
|
||||||
case "setaccount":
|
case "setaccount":
|
||||||
if (m_AllowSetAccount)
|
if (m_AllowSetAccount)
|
||||||
return StoreAccount(request);
|
return StoreAccount(request);
|
||||||
|
@ -201,6 +203,52 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||||
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
|
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
byte[] GetMultiAccounts(Dictionary<string, object> request)
|
||||||
|
{
|
||||||
|
UUID scopeID = UUID.Zero;
|
||||||
|
if (request.ContainsKey("ScopeID") && !UUID.TryParse(request["ScopeID"].ToString(), out scopeID))
|
||||||
|
return FailureResult();
|
||||||
|
|
||||||
|
if (!request.ContainsKey("IDS"))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts called without required uuids argument");
|
||||||
|
return FailureResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(request["IDS"] is List<string>))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts input argument was of unexpected type {0}", request["IDS"].GetType().ToString());
|
||||||
|
return FailureResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> userIDs = (List<string>)request["IDS"];
|
||||||
|
|
||||||
|
List<UserAccount> accounts = m_UserAccountService.GetUserAccounts(scopeID, userIDs);
|
||||||
|
|
||||||
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||||
|
if ((accounts == null) || ((accounts != null) && (accounts.Count == 0)))
|
||||||
|
{
|
||||||
|
result["result"] = "null";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
foreach (UserAccount acc in accounts)
|
||||||
|
{
|
||||||
|
if(acc == null)
|
||||||
|
continue;
|
||||||
|
Dictionary<string, object> rinfoDict = acc.ToKeyValuePairs();
|
||||||
|
result["account" + i] = rinfoDict;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string xmlString = ServerUtils.BuildXmlResponse(result);
|
||||||
|
|
||||||
|
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
|
||||||
|
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
|
||||||
|
}
|
||||||
|
|
||||||
byte[] StoreAccount(Dictionary<string, object> request)
|
byte[] StoreAccount(Dictionary<string, object> request)
|
||||||
{
|
{
|
||||||
UUID principalID = UUID.Zero;
|
UUID principalID = UUID.Zero;
|
||||||
|
|
|
@ -201,6 +201,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public bool StoreUserAccount(UserAccount data)
|
public bool StoreUserAccount(UserAccount data)
|
||||||
{
|
{
|
||||||
// m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name);
|
// m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name);
|
||||||
|
|
|
@ -191,6 +191,98 @@ namespace OpenSim.Services.Connectors
|
||||||
return accounts;
|
return accounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
|
||||||
|
{
|
||||||
|
List<UserAccount> accs = new List<UserAccount>();
|
||||||
|
bool multisuported = true;
|
||||||
|
accs = doGetMultiUserAccounts(scopeID, IDs, out multisuported);
|
||||||
|
if(multisuported)
|
||||||
|
return accs;
|
||||||
|
|
||||||
|
// service does not do multi accounts so need to do it one by one
|
||||||
|
|
||||||
|
UUID uuid = UUID.Zero;
|
||||||
|
foreach(string id in IDs)
|
||||||
|
{
|
||||||
|
if(UUID.TryParse(id, out uuid) && uuid != UUID.Zero)
|
||||||
|
accs.Add(GetUserAccount(scopeID,uuid));
|
||||||
|
}
|
||||||
|
|
||||||
|
return accs;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<UserAccount> doGetMultiUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
|
||||||
|
{
|
||||||
|
suported = true;
|
||||||
|
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||||
|
//sendData["SCOPEID"] = scopeID.ToString();
|
||||||
|
sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
|
||||||
|
sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
|
||||||
|
sendData["METHOD"] = "getmultiaccounts";
|
||||||
|
|
||||||
|
sendData["ScopeID"] = scopeID.ToString();
|
||||||
|
sendData["IDS"] = new List<string>(IDs);
|
||||||
|
|
||||||
|
string reply = string.Empty;
|
||||||
|
string reqString = ServerUtils.BuildQueryString(sendData);
|
||||||
|
string uri = m_ServerURI + "/accounts";
|
||||||
|
// m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
||||||
|
uri,
|
||||||
|
reqString,
|
||||||
|
m_Auth);
|
||||||
|
if (reply == null || (reply != null && reply == string.Empty))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[ACCOUNT CONNECTOR]: GetMultiUserAccounts received null or empty reply");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting user accounts server at {0}: {1}", uri, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<UserAccount> accounts = new List<UserAccount>();
|
||||||
|
|
||||||
|
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||||
|
|
||||||
|
if (replyData != null)
|
||||||
|
{
|
||||||
|
if (replyData.ContainsKey("result"))
|
||||||
|
{
|
||||||
|
if(replyData["result"].ToString() == "null")
|
||||||
|
return accounts;
|
||||||
|
|
||||||
|
if(replyData["result"].ToString() == "Failure")
|
||||||
|
{
|
||||||
|
suported = false;
|
||||||
|
return accounts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, object>.ValueCollection accountList = replyData.Values;
|
||||||
|
//m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetAgents returned {0} elements", pinfosList.Count);
|
||||||
|
foreach (object acc in accountList)
|
||||||
|
{
|
||||||
|
if (acc is Dictionary<string, object>)
|
||||||
|
{
|
||||||
|
UserAccount pinfo = new UserAccount((Dictionary<string, object>)acc);
|
||||||
|
accounts.Add(pinfo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_log.DebugFormat("[ACCOUNT CONNECTOR]: GetMultiUserAccounts received invalid response type {0}",
|
||||||
|
acc.GetType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetMultiUserAccounts received null response");
|
||||||
|
|
||||||
|
return accounts;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void InvalidateCache(UUID userID)
|
public void InvalidateCache(UUID userID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,6 +100,11 @@ namespace OpenSim.Services.HypergridService
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void InvalidateCache(UUID userID)
|
public void InvalidateCache(UUID userID)
|
||||||
{
|
{
|
||||||
m_UUIDCache.Remove(userID);
|
m_UUIDCache.Remove(userID);
|
||||||
|
|
|
@ -187,6 +187,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<UserAccount> GetUserAccounts(UUID scopeID, string query);
|
List<UserAccount> GetUserAccounts(UUID scopeID, string query);
|
||||||
List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where);
|
List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where);
|
||||||
|
List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Store the data given, wich replaces the stored data, therefore must be complete.
|
/// Store the data given, wich replaces the stored data, therefore must be complete.
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
string GetUserUUI(UUID uuid);
|
string GetUserUUI(UUID uuid);
|
||||||
bool GetUserUUI(UUID userID, out string uui);
|
bool GetUserUUI(UUID userID, out string uui);
|
||||||
string GetUserServerURL(UUID uuid, string serverType);
|
string GetUserServerURL(UUID uuid, string serverType);
|
||||||
|
Dictionary<UUID,string> GetUsersNames(string[] ids);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get user ID by the given name.
|
/// Get user ID by the given name.
|
||||||
|
|
|
@ -265,6 +265,19 @@ namespace OpenSim.Services.UserAccountService
|
||||||
return MakeUserAccount(d[0]);
|
return MakeUserAccount(d[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
|
||||||
|
{
|
||||||
|
// do it one at a time db access should be fast, so no need to break its api
|
||||||
|
List<UserAccount> accs = new List<UserAccount>();
|
||||||
|
UUID uuid = UUID.Zero;
|
||||||
|
foreach(string id in IDs)
|
||||||
|
{
|
||||||
|
if (UUID.TryParse(id, out uuid) && uuid != UUID.Zero)
|
||||||
|
accs.Add(GetUserAccount(scopeID, uuid));
|
||||||
|
}
|
||||||
|
return accs;
|
||||||
|
}
|
||||||
|
|
||||||
public void InvalidateCache(UUID userID)
|
public void InvalidateCache(UUID userID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -861,6 +861,10 @@ namespace OpenSim.Tests.Common
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendAlertMessage(string message, string info)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void SendSystemAlertMessage(string message)
|
public void SendSystemAlertMessage(string message)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,11 @@ namespace OpenSim.Tests.Common
|
||||||
AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute, isEnterorLeave);
|
AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute, isEnterorLeave);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ChatterBoxForceClose (UUID toAgent, UUID sessionID, string reason)
|
||||||
|
{
|
||||||
|
AddEvent(toAgent, "ForceCloseChatterBoxSession", sessionID, reason);
|
||||||
|
}
|
||||||
|
|
||||||
public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
|
public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
|
||||||
{
|
{
|
||||||
AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage);
|
AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage);
|
||||||
|
|
|
@ -725,7 +725,8 @@
|
||||||
Cap_GetObjectCost = ""
|
Cap_GetObjectCost = ""
|
||||||
Cap_GetObjectPhysicsData = ""
|
Cap_GetObjectPhysicsData = ""
|
||||||
Cap_GroupProposalBallot = ""
|
Cap_GroupProposalBallot = ""
|
||||||
Cap_HomeLocation = ""
|
Cap_GroupMemberData = "localhost"
|
||||||
|
Cap_HomeLocation = "localhost"
|
||||||
Cap_LandResources = ""
|
Cap_LandResources = ""
|
||||||
Cap_MapLayer = "localhost"
|
Cap_MapLayer = "localhost"
|
||||||
Cap_MapLayerGod = "localhost"
|
Cap_MapLayerGod = "localhost"
|
||||||
|
|
|
@ -213,6 +213,7 @@
|
||||||
; Some of these were added as early functionality for NPCs. This has been replaced with the NPC functions.
|
; Some of these were added as early functionality for NPCs. This has been replaced with the NPC functions.
|
||||||
Allow_osAvatarPlayAnimation = false
|
Allow_osAvatarPlayAnimation = false
|
||||||
Allow_osAvatarStopAnimation = false
|
Allow_osAvatarStopAnimation = false
|
||||||
|
Allow_osForceAttachToOtherAvatarFromInventory = false
|
||||||
Allow_osForceDetachFromAvatar = false
|
Allow_osForceDetachFromAvatar = false
|
||||||
Allow_osForceOtherSit = false
|
Allow_osForceOtherSit = false
|
||||||
; The notecard functions can cause a lot of load on the region if over used
|
; The notecard functions can cause a lot of load on the region if over used
|
||||||
|
@ -225,7 +226,6 @@
|
||||||
|
|
||||||
; ThreatLevel Severe
|
; ThreatLevel Severe
|
||||||
Allow_osConsoleCommand = false
|
Allow_osConsoleCommand = false
|
||||||
Allow_osForceAttachToOtherAvatarFromInventory = false
|
|
||||||
Allow_osGrantScriptPermissions = false
|
Allow_osGrantScriptPermissions = false
|
||||||
Allow_osKickAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
|
Allow_osKickAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
|
||||||
Allow_osRevokeScriptPermissions = false
|
Allow_osRevokeScriptPermissions = false
|
||||||
|
|
Loading…
Reference in New Issue