From f0864b5154374a4fb06640e68a96a27b810fd60b Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 4 Jan 2009 19:09:22 +0000 Subject: * Minor tweak to crash logger to copy ini with log if save-to-dir is on. * Added BinaryGenericMessage handler for cases where GenericMessage isnt transmitting pure-utf8 characters. --- OpenSim/Region/Application/Application.cs | 6 +++++- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 08dd7df..1b06b30 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -153,12 +153,16 @@ namespace OpenSim { Directory.CreateDirectory(m_crashDir); } + string log = Util.GetUniqueFilename(ex.GetType() + ".txt"); StreamWriter m_crashLog = new StreamWriter( - Path.Combine(m_crashDir, Util.GetUniqueFilename(ex.GetType() + ".txt")) + Path.Combine(m_crashDir, log) ); + m_crashLog.WriteLine(msg); m_crashLog.Close(); + + File.Copy("opensim.ini", Path.Combine(m_crashDir, log + "_opensim.ini")); } catch (Exception e2) { diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 85cc337..9c0a9cf 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -111,6 +111,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected ulong m_activeGroupPowers; protected Dictionary m_groupPowers = new Dictionary(); + // LLClientView Only + public delegate void BinaryGenericMessage(Object sender, string method, byte[][] args); + /* Instantiated Designated Event Delegates */ //- used so we don't create new objects for each incoming packet and then toss it out later */ @@ -866,6 +869,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Previously ClientView.API partial class public event GenericMessage OnGenericMessage; + public event BinaryGenericMessage OnBinaryGenericMessage; public event Action OnLogout; public event ObjectPermissions OnObjectPermissions; public event Action OnConnectionClosed; @@ -3665,20 +3669,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP { GenericMessagePacket gmpack = (GenericMessagePacket) pack; if (m_genericPacketHandlers.Count == 0) return false; + handlerGenericMessage = null; + string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim(); + if (m_genericPacketHandlers.TryGetValue(method, out handlerGenericMessage)) { List msg = new List(); + List msgBytes = new List(); if (handlerGenericMessage != null) { foreach (GenericMessagePacket.ParamListBlock block in gmpack.ParamList) { msg.Add(Util.FieldToString(block.Parameter)); + msgBytes.Add(block.Parameter); } try { + if (OnBinaryGenericMessage != null) + { + OnBinaryGenericMessage(this, method, msgBytes.ToArray()); + } handlerGenericMessage(sender, method, msg); return true; } -- cgit v1.1