From 1c68ad2bba43b87e204cf6eafb7f0a31d3272c01 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 3 Mar 2010 17:50:05 +0000
Subject: remove references to OpenSim.Framework.Commuications.Tests.dll since
all relevant test code has been obsoleted this allows the tests to pass on my
local system
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 16 +++++++++++++---
OpenSim/Region/Framework/Scenes/SceneManager.cs | 2 +-
2 files changed, 14 insertions(+), 4 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index ef49205..569dc8d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -97,6 +97,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
///
public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
{
+ ///
+ /// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets).
+ ///
+ protected int m_debugPacketLevel = 0;
+
#region Events
public event GenericMessage OnGenericMessage;
@@ -472,6 +477,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SetDebugPacketLevel(int newDebug)
{
+ m_debugPacketLevel = newDebug;
}
#region Client Methods
@@ -10952,7 +10958,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LLUDPServer.LogPacketHeader(false, m_circuitCode, 0, packet.Type, (ushort)packet.Length);
#endregion BinaryStats
- m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true);
+ OutPacket(packet, throttlePacketType, true);
}
///
@@ -10965,6 +10971,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// handles splitting manually
protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
{
+ if (m_debugPacketLevel >= 255)
+ m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
+
m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
}
@@ -11036,10 +11045,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// OpenMetaverse.packet
public void ProcessInPacket(Packet Pack)
{
-// m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack);
+ if (m_debugPacketLevel >= 255)
+ m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
if (!ProcessPacketMethod(Pack))
- m_log.Warn("[CLIENT]: unhandled packet " + Pack);
+ m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
PacketPool.Instance.ReturnPacket(Pack);
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index 6395d98..680c39a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -422,7 +422,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!scenePresence.IsChildAgent)
{
- m_log.ErrorFormat("Packet debug for {0} {1} set to {2}",
+ m_log.DebugFormat("Packet debug for {0} {1} set to {2}",
scenePresence.Firstname,
scenePresence.Lastname,
newDebug);
--
cgit v1.1
From 296c68a9de2d8253bdb88c67529619398d8ec6c9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 3 Mar 2010 18:28:30 +0000
Subject: Make the service loader pump out the error to the log (in red) and
include the dll/interface/args that caused the problem This gives people more
of a fighting chance of finding out what went wrong
---
OpenSim/Services/Base/ServiceBase.cs | 20 ++++++++++++++++++--
OpenSim/Services/Friends/FriendsServiceBase.cs | 9 ++++++---
2 files changed, 24 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Services/Base/ServiceBase.cs b/OpenSim/Services/Base/ServiceBase.cs
index 8e24d85..91d5c56 100644
--- a/OpenSim/Services/Base/ServiceBase.cs
+++ b/OpenSim/Services/Base/ServiceBase.cs
@@ -26,7 +26,9 @@
*/
using System;
+using System.Collections.Generic;
using System.Reflection;
+using log4net;
using Nini.Config;
using OpenSim.Services.Interfaces;
@@ -34,6 +36,8 @@ namespace OpenSim.Services.Base
{
public class ServiceBase
{
+ private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
public T LoadPlugin(string dllName) where T:class
{
return LoadPlugin(dllName, new Object[0]);
@@ -61,8 +65,12 @@ namespace OpenSim.Services.Base
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
+// m_log.DebugFormat("[SERVICE BASE]: Found assembly {0}", dllName);
+
foreach (Type pluginType in pluginAssembly.GetTypes())
{
+// m_log.DebugFormat("[SERVICE BASE]: Found type {0}", pluginType);
+
if (pluginType.IsPublic)
{
if (className != String.Empty &&
@@ -86,7 +94,15 @@ namespace OpenSim.Services.Base
}
catch (Exception e)
{
- Console.WriteLine("XXX Exception " + e.StackTrace);
+ List strArgs = new List();
+ foreach (Object arg in args)
+ strArgs.Add(arg.ToString());
+
+ m_log.Error(
+ string.Format(
+ "[SERVICE BASE]: Failed to load plugin {0} from {1} with args {2}",
+ interfaceName, dllName, string.Join(", ", strArgs.ToArray())), e);
+
return null;
}
}
@@ -95,4 +111,4 @@ namespace OpenSim.Services.Base
{
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Services/Friends/FriendsServiceBase.cs b/OpenSim/Services/Friends/FriendsServiceBase.cs
index 9858972..6ab0bff 100644
--- a/OpenSim/Services/Friends/FriendsServiceBase.cs
+++ b/OpenSim/Services/Friends/FriendsServiceBase.cs
@@ -27,13 +27,12 @@
using System;
using System.Reflection;
+using log4net;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Data;
using OpenSim.Services.Interfaces;
using OpenSim.Services.Base;
-using Nini.Config;
-using log4net;
namespace OpenSim.Services.Friends
{
@@ -80,7 +79,11 @@ namespace OpenSim.Services.Friends
m_Database = LoadPlugin(dllName, new Object[] { connString, realm });
if (m_Database == null)
- throw new Exception("Could not find a storage interface in the given module");
+ {
+ throw new Exception(
+ string.Format(
+ "Could not find a storage interface {0} in the given StorageProvider {1}", "IFriendsData", dllName));
+ }
}
}
}
--
cgit v1.1
From 660ebe52cf37828d32647030de940c8928d3c9f2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 1 Feb 2010 20:15:36 +0000
Subject: Actually make EventManager.OnAttach() fire when an object is
attached. Previously, only detach was firing!
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 +++
1 file changed, 3 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 369552f..b7fcd7d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -540,6 +540,9 @@ namespace OpenSim.Region.Framework.Scenes
// Fire after attach, so we don't get messy perms dialogs
// 3 == AttachedRez
objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3);
+
+ // Do this last so that event listeners have access to all the effects of the attachment
+ m_parentScene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
}
return objatt;
}
--
cgit v1.1