diff options
author | Adam Frisby | 2009-01-04 19:09:22 +0000 |
---|---|---|
committer | Adam Frisby | 2009-01-04 19:09:22 +0000 |
commit | f0864b5154374a4fb06640e68a96a27b810fd60b (patch) | |
tree | 025e18d610d822f2e74e330bd764461c653d3b70 /OpenSim/Region | |
parent | Improve LOD scaling for anisotropic sculpted prim meshes (diff) | |
download | opensim-SC_OLD-f0864b5154374a4fb06640e68a96a27b810fd60b.zip opensim-SC_OLD-f0864b5154374a4fb06640e68a96a27b810fd60b.tar.gz opensim-SC_OLD-f0864b5154374a4fb06640e68a96a27b810fd60b.tar.bz2 opensim-SC_OLD-f0864b5154374a4fb06640e68a96a27b810fd60b.tar.xz |
* 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.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 13 |
2 files changed, 18 insertions, 1 deletions
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 | |||
153 | { | 153 | { |
154 | Directory.CreateDirectory(m_crashDir); | 154 | Directory.CreateDirectory(m_crashDir); |
155 | } | 155 | } |
156 | string log = Util.GetUniqueFilename(ex.GetType() + ".txt"); | ||
156 | StreamWriter m_crashLog = | 157 | StreamWriter m_crashLog = |
157 | new StreamWriter( | 158 | new StreamWriter( |
158 | Path.Combine(m_crashDir, Util.GetUniqueFilename(ex.GetType() + ".txt")) | 159 | Path.Combine(m_crashDir, log) |
159 | ); | 160 | ); |
161 | |||
160 | m_crashLog.WriteLine(msg); | 162 | m_crashLog.WriteLine(msg); |
161 | m_crashLog.Close(); | 163 | m_crashLog.Close(); |
164 | |||
165 | File.Copy("opensim.ini", Path.Combine(m_crashDir, log + "_opensim.ini")); | ||
162 | } | 166 | } |
163 | catch (Exception e2) | 167 | catch (Exception e2) |
164 | { | 168 | { |
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 | |||
111 | protected ulong m_activeGroupPowers; | 111 | protected ulong m_activeGroupPowers; |
112 | protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); | 112 | protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); |
113 | 113 | ||
114 | // LLClientView Only | ||
115 | public delegate void BinaryGenericMessage(Object sender, string method, byte[][] args); | ||
116 | |||
114 | /* Instantiated Designated Event Delegates */ | 117 | /* Instantiated Designated Event Delegates */ |
115 | //- used so we don't create new objects for each incoming packet and then toss it out later */ | 118 | //- used so we don't create new objects for each incoming packet and then toss it out later */ |
116 | 119 | ||
@@ -866,6 +869,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
866 | 869 | ||
867 | // Previously ClientView.API partial class | 870 | // Previously ClientView.API partial class |
868 | public event GenericMessage OnGenericMessage; | 871 | public event GenericMessage OnGenericMessage; |
872 | public event BinaryGenericMessage OnBinaryGenericMessage; | ||
869 | public event Action<IClientAPI> OnLogout; | 873 | public event Action<IClientAPI> OnLogout; |
870 | public event ObjectPermissions OnObjectPermissions; | 874 | public event ObjectPermissions OnObjectPermissions; |
871 | public event Action<IClientAPI> OnConnectionClosed; | 875 | public event Action<IClientAPI> OnConnectionClosed; |
@@ -3665,20 +3669,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3665 | { | 3669 | { |
3666 | GenericMessagePacket gmpack = (GenericMessagePacket) pack; | 3670 | GenericMessagePacket gmpack = (GenericMessagePacket) pack; |
3667 | if (m_genericPacketHandlers.Count == 0) return false; | 3671 | if (m_genericPacketHandlers.Count == 0) return false; |
3672 | |||
3668 | handlerGenericMessage = null; | 3673 | handlerGenericMessage = null; |
3674 | |||
3669 | string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim(); | 3675 | string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim(); |
3676 | |||
3670 | if (m_genericPacketHandlers.TryGetValue(method, out handlerGenericMessage)) | 3677 | if (m_genericPacketHandlers.TryGetValue(method, out handlerGenericMessage)) |
3671 | { | 3678 | { |
3672 | List<string> msg = new List<string>(); | 3679 | List<string> msg = new List<string>(); |
3680 | List<byte[]> msgBytes = new List<byte[]>(); | ||
3673 | 3681 | ||
3674 | if (handlerGenericMessage != null) | 3682 | if (handlerGenericMessage != null) |
3675 | { | 3683 | { |
3676 | foreach (GenericMessagePacket.ParamListBlock block in gmpack.ParamList) | 3684 | foreach (GenericMessagePacket.ParamListBlock block in gmpack.ParamList) |
3677 | { | 3685 | { |
3678 | msg.Add(Util.FieldToString(block.Parameter)); | 3686 | msg.Add(Util.FieldToString(block.Parameter)); |
3687 | msgBytes.Add(block.Parameter); | ||
3679 | } | 3688 | } |
3680 | try | 3689 | try |
3681 | { | 3690 | { |
3691 | if (OnBinaryGenericMessage != null) | ||
3692 | { | ||
3693 | OnBinaryGenericMessage(this, method, msgBytes.ToArray()); | ||
3694 | } | ||
3682 | handlerGenericMessage(sender, method, msg); | 3695 | handlerGenericMessage(sender, method, msg); |
3683 | return true; | 3696 | return true; |
3684 | } | 3697 | } |