Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-09-03 03:37:18 +01:00
commit 4e0d6e8e41
14 changed files with 234 additions and 92 deletions

View File

@ -1,5 +0,0 @@
BEGIN;
ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;

View File

@ -1,6 +0,0 @@
BEGIN;
ALTER TABLE prims ADD COLUMN MediaURL varchar(255);
ALTER TABLE primshapes ADD COLUMN Media TEXT;
COMMIT;

View File

@ -448,11 +448,22 @@ update land
COMMIT;
:VERSION 19
BEGIN ;
ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none' ;
BEGIN;
ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 20
BEGIN;
ALTER TABLE prims ADD COLUMN MediaURL varchar(255);
ALTER TABLE primshapes ADD COLUMN Media TEXT;
COMMIT;
:VERSION 21
BEGIN;
ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none';
ALTER TABLE `land` ADD COLUMN `MediaDescription` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0';
ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE;
COMMIT ;
COMMIT;

View File

@ -338,19 +338,25 @@ namespace OpenSim.Framework.Servers.HttpServer
// HandleRequest(request,resp);
// }
/// <summary>
/// This methods is the start of incoming HTTP request handling.
/// </summary>
/// <param name="request"></param>
/// <param name="response"></param>
public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
{
try
{
// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
// This is the REST agent interface. We require an agent to properly identify
// itself. If the REST handler recognizes the prefix it will attempt to
// satisfy the request. If it is not recognizable, and no damage has occurred
// the request can be passed through to the other handlers. This is a low
// probability event; if a request is matched it is normally expected to be
// handled
// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
IHttpAgentHandler agentHandler;
if (TryGetAgentHandler(request, response, out agentHandler))

View File

@ -218,7 +218,13 @@ namespace OpenSim
m_console.Commands.AddCommand("region", false, "debug packet",
"debug packet <level>",
"Turn on packet debugging", Debug);
"Turn on packet debugging",
"If level > 255 then all incoming and outgoing packets are logged.\n"
+ "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
+ "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
+ "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
+ "If level <= 0 then no packets are logged.",
Debug);
m_console.Commands.AddCommand("region", false, "debug scene",
"debug scene <cripting> <collisions> <physics>",

View File

@ -36,7 +36,6 @@ using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Console;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
@ -403,7 +402,9 @@ namespace OpenSim
}
catch (Exception e)
{
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
m_log.ErrorFormat(
"[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
e.Message, e.StackTrace);
if (scene.SnmpService != null)
{

View File

@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
{
/// <value>
/// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets).
/// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details.
/// </value>
protected int m_debugPacketLevel = 0;
@ -11229,8 +11229,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// handles splitting manually</param>
protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
{
if (m_debugPacketLevel >= 255)
m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
if (m_debugPacketLevel > 0)
{
bool outputPacket = true;
if (m_debugPacketLevel <= 255
&& (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage))
outputPacket = false;
if (m_debugPacketLevel <= 200
&&
(packet.Type == PacketType.ImagePacket
|| packet.Type == PacketType.ImageData
|| packet.Type == PacketType.LayerData
|| packet.Type == PacketType.CoarseLocationUpdate))
outputPacket = false;
if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect))
outputPacket = false;
if (outputPacket)
m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
}
m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
}
@ -11316,26 +11336,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Entryway from the client to the simulator. All UDP packets from the client will end up here
/// </summary>
/// <param name="Pack">OpenMetaverse.packet</param>
public void ProcessInPacket(Packet Pack)
public void ProcessInPacket(Packet packet)
{
if (!m_IsPresenceReady)
if (m_debugPacketLevel > 0)
{
if (m_pendingPackets == null)
{
m_pendingPackets = new List<Packet>();
}
m_pendingPackets.Add(Pack);
bool outputPacket = true;
if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
outputPacket = false;
if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
outputPacket = false;
if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
outputPacket = false;
if (outputPacket)
m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type);
}
else
{
if (m_debugPacketLevel >= 255)
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
if (!ProcessPacketMethod(Pack))
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
if (!ProcessPacketMethod(packet))
m_log.Warn("[CLIENT]: unhandled packet " + packet.Type);
PacketPool.Instance.ReturnPacket(Pack);
}
PacketPool.Instance.ReturnPacket(packet);
}
private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)

View File

@ -174,16 +174,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
UUID itemID = UUID.Zero;
if (sp != null)
{
foreach(SceneObjectGroup grp in sp.Attachments)
foreach(SceneObjectGroup grp in sp.GetAttachments(AttachmentPt))
{
if (grp.GetAttachmentPoint() == (byte)AttachmentPt)
{
itemID = grp.GetFromItemID();
break;
}
}
if (itemID != UUID.Zero)
DetachSingleAttachmentToInv(itemID, remoteClient);
itemID = grp.GetFromItemID();
if (itemID != UUID.Zero)
DetachSingleAttachmentToInv(itemID, remoteClient);
}
}
if (group.GetFromItemID() == UUID.Zero)
@ -197,12 +193,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group);
group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent);
// In case it is later dropped again, don't let
// it get cleaned up
group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
group.HasGroupChanged = false;
AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
}
else
{
@ -551,6 +542,78 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
remoteClient.SendInventoryItemCreateUpdate(item, 0);
}
}
}
}
/// <summary>
/// Attach this scene object to the given avatar.
/// </summary>
///
/// This isn't publicly available since attachments should always perform the corresponding inventory
/// operation (to show the attach in user inventory and update the asset with positional information).
///
/// <param name="sp"></param>
/// <param name="so"></param>
/// <param name="attachmentpoint"></param>
/// <param name="AttachOffset"></param>
/// <param name="silent"></param>
protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent)
{
// don't attach attachments to child agents
if (avatar.IsChildAgent) return;
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
so.DetachFromBackup();
// Remove from database and parcel prim count
m_scene.DeleteFromStorage(so.UUID);
m_scene.EventManager.TriggerParcelPrimCountTainted();
so.RootPart.AttachedAvatar = avatar.UUID;
//Anakin Lohner bug #3839
lock (so.Children)
{
foreach (SceneObjectPart p in so.Children.Values)
{
p.AttachedAvatar = avatar.UUID;
}
}
if (so.RootPart.PhysActor != null)
{
m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor);
so.RootPart.PhysActor = null;
}
so.AbsolutePosition = AttachOffset;
so.RootPart.AttachedPos = AttachOffset;
so.RootPart.IsAttachment = true;
so.RootPart.SetParentLocalId(avatar.LocalId);
so.SetAttachmentPoint(Convert.ToByte(attachmentpoint));
avatar.AddAttachment(so);
if (!silent)
{
// Killing it here will cause the client to deselect it
// It then reappears on the avatar, deselected
// through the full update below
//
if (so.IsSelected)
{
m_scene.SendKillObject(so.RootPart.LocalId);
}
so.IsSelected = false; // fudge....
so.ScheduleGroupForFullUpdate();
}
// In case it is later dropped again, don't let
// it get cleaned up
so.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
so.HasGroupChanged = false;
}
}
}

View File

@ -3911,6 +3911,27 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju
m_attachments.Add(gobj);
}
}
/// <summary>
/// Get the scene object attached to the given point.
/// </summary>
/// <param name="attachmentPoint"></param>
/// <returns>Returns an empty list if there were no attachments at the point.</returns>
public List<SceneObjectGroup> GetAttachments(uint attachmentPoint)
{
List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
lock (m_attachments)
{
foreach (SceneObjectGroup so in m_attachments)
{
if (attachmentPoint == so.RootPart.AttachmentPoint)
attachments.Add(so);
}
}
return attachments;
}
public bool HasAttachments()
{

View File

@ -86,13 +86,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
paramList.Add(hash);
XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
IPEndPoint ext = info.ExternalEndPoint;
string uri = "";
if (ext != null)
{
uri = "http://" + ext.Address + ":" + info.HttpPort + "/";
}
//m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
string uri = "http://" + ((info.ServerURI == string.Empty) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI);
m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
XmlRpcResponse response = null;
try
{
@ -193,12 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
paramList.Add(hash);
XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
IPEndPoint ext = gatekeeper.ExternalEndPoint;
string uri = "";
if (ext != null)
{
uri = "http://" + ext.Address + ":" + gatekeeper.HttpPort + "/";
}
string uri = "http://" + ((gatekeeper.ServerURI == string.Empty) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI);
m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
XmlRpcResponse response = null;
try

View File

@ -51,15 +51,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
MethodBase.GetCurrentMethod().DeclaringType);
string m_ServerURL;
Uri m_Uri;
public UserAgentServiceConnector(string url)
{
m_ServerURL = url;
// Doing this here, because XML-RPC or mono have some strong ideas about
// caching DNS translations.
try
{
m_Uri = new Uri(m_ServerURL);
Uri m_Uri = new Uri(m_ServerURL);
IPAddress ip = Util.GetHostFromDNS(m_Uri.Host);
m_ServerURL = "http://" + ip.ToString() + ":" + m_Uri.Port;
m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); ;
}
catch (Exception e)
{

View File

@ -104,17 +104,23 @@ namespace OpenSim.Services.Connectors.Simulation
return false;
}
// Eventually, we want to use a caps url instead of the agentID
string uri = string.Empty;
try
// HACK -- Simian grid make it work!!!
if (destination.ServerURI != string.Empty)
uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
else
{
uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
}
catch (Exception e)
{
m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
reason = e.Message;
return false;
try
{
uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
}
catch (Exception e)
{
m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
reason = e.Message;
return false;
}
}
//Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);

View File

@ -158,7 +158,7 @@ namespace OpenSim.Services.GridService
string host = "127.0.0.1";
string portstr;
string regionName = "";
uint port = 9000;
uint port = 0;
string[] parts = mapName.Split(new char[] { ':' });
if (parts.Length >= 1)
{
@ -177,18 +177,16 @@ namespace OpenSim.Services.GridService
regionName = parts[2];
}
// Sanity check.
//IPAddress ipaddr = null;
try
{
//ipaddr = Util.GetHostFromDNS(host);
Util.GetHostFromDNS(host);
}
catch
{
reason = "Malformed hostname";
return null;
}
//// Sanity check.
//try
//{
// Util.GetHostFromDNS(host);
//}
//catch
//{
// reason = "Malformed hostname";
// return null;
//}
GridRegion regInfo;
bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, out regInfo, out reason);
@ -217,6 +215,11 @@ namespace OpenSim.Services.GridService
regInfo.RegionLocY = yloc;
regInfo.ScopeID = scopeID;
// Big HACK for Simian Grid !!!
// We need to clean up all URLs used in OpenSim !!!
if (externalHostName.Contains("/"))
regInfo.ServerURI = externalHostName;
try
{
regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);

View File

@ -293,13 +293,35 @@ namespace OpenSim.Services.InventoryService
public virtual bool AddFolder(InventoryFolderBase folder)
{
InventoryFolderBase check = GetFolder(folder);
if (check != null)
return false;
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
return m_Database.StoreFolder(xFolder);
}
public virtual bool UpdateFolder(InventoryFolderBase folder)
{
return AddFolder(folder);
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
InventoryFolderBase check = GetFolder(folder);
if (check == null)
return AddFolder(folder);
if (check.Type != -1 || xFolder.type != -1)
{
if (xFolder.version > check.Version)
return false;
check.Version = (ushort)xFolder.version;
xFolder = ConvertFromOpenSim(check);
return m_Database.StoreFolder(xFolder);
}
if (xFolder.version < check.Version)
xFolder.version = check.Version;
xFolder.folderID = check.ID;
return m_Database.StoreFolder(xFolder);
}
public virtual bool MoveFolder(InventoryFolderBase folder)