diff options
author | MW | 2007-12-02 18:49:42 +0000 |
---|---|---|
committer | MW | 2007-12-02 18:49:42 +0000 |
commit | 5ae8759de16875309cdd0fccf5d3bb24bac483d6 (patch) | |
tree | d79c6661d5aedb417dcb86db9edc3a5e2d49f558 /OpenSim | |
parent | Very partial Avatar Appearance (ie, clothes/body parts) "storage". In standal... (diff) | |
download | opensim-SC-5ae8759de16875309cdd0fccf5d3bb24bac483d6.zip opensim-SC-5ae8759de16875309cdd0fccf5d3bb24bac483d6.tar.gz opensim-SC-5ae8759de16875309cdd0fccf5d3bb24bac483d6.tar.bz2 opensim-SC-5ae8759de16875309cdd0fccf5d3bb24bac483d6.tar.xz |
Added some error handling (and console output) to BaseHttpServer.
a few other bits of refactoring.
Diffstat (limited to 'OpenSim')
4 files changed, 33 insertions, 29 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index e645e7b..baf5add 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -185,26 +185,34 @@ namespace OpenSim.Framework.Servers | |||
185 | if (xmlRprcRequest != null) | 185 | if (xmlRprcRequest != null) |
186 | { | 186 | { |
187 | string methodName = xmlRprcRequest.MethodName; | 187 | string methodName = xmlRprcRequest.MethodName; |
188 | if (methodName != null) | ||
189 | { | ||
188 | 190 | ||
189 | XmlRpcResponse xmlRpcResponse; | 191 | XmlRpcResponse xmlRpcResponse; |
190 | 192 | ||
191 | XmlRpcMethod method; | 193 | XmlRpcMethod method; |
192 | if (m_rpcHandlers.TryGetValue(methodName, out method)) | 194 | if (m_rpcHandlers.TryGetValue(methodName, out method)) |
193 | { | 195 | { |
194 | xmlRpcResponse = method(xmlRprcRequest); | 196 | xmlRpcResponse = method(xmlRprcRequest); |
197 | } | ||
198 | else | ||
199 | { | ||
200 | xmlRpcResponse = new XmlRpcResponse(); | ||
201 | Hashtable unknownMethodError = new Hashtable(); | ||
202 | unknownMethodError["reason"] = "XmlRequest"; | ||
203 | ; | ||
204 | unknownMethodError["message"] = "Unknown Rpc Request [" + methodName + "]"; | ||
205 | unknownMethodError["login"] = "false"; | ||
206 | xmlRpcResponse.Value = unknownMethodError; | ||
207 | } | ||
208 | |||
209 | responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); | ||
195 | } | 210 | } |
196 | else | 211 | else |
197 | { | 212 | { |
198 | xmlRpcResponse = new XmlRpcResponse(); | 213 | System.Console.WriteLine("Handler not found for http request " +request.RawUrl); |
199 | Hashtable unknownMethodError = new Hashtable(); | 214 | responseString = "Error"; |
200 | unknownMethodError["reason"] = "XmlRequest"; | ||
201 | ; | ||
202 | unknownMethodError["message"] = "Unknown Rpc Request [" + methodName + "]"; | ||
203 | unknownMethodError["login"] = "false"; | ||
204 | xmlRpcResponse.Value = unknownMethodError; | ||
205 | } | 215 | } |
206 | |||
207 | responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); | ||
208 | } | 216 | } |
209 | 217 | ||
210 | response.AddHeader("Content-type", "text/xml"); | 218 | response.AddHeader("Content-type", "text/xml"); |
diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs index b6c373c..c33fdcd 100644 --- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs | |||
@@ -12,7 +12,7 @@ namespace OpenSim.Region.Environment.Modules | |||
12 | public class AvatarFactoryModule : IAvatarFactory | 12 | public class AvatarFactoryModule : IAvatarFactory |
13 | { | 13 | { |
14 | private Scene m_scene = null; | 14 | private Scene m_scene = null; |
15 | private Dictionary<LLUUID, AvatarWearing> m_avatarsClothes = new Dictionary<LLUUID, AvatarWearing>(); | 15 | private Dictionary<LLUUID, AvatarAppearance> m_avatarsClothes = new Dictionary<LLUUID, AvatarAppearance>(); |
16 | 16 | ||
17 | public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, | 17 | public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, |
18 | out byte[] visualParams) | 18 | out byte[] visualParams) |
@@ -20,13 +20,13 @@ namespace OpenSim.Region.Environment.Modules | |||
20 | if (!m_avatarsClothes.ContainsKey(avatarId)) | 20 | if (!m_avatarsClothes.ContainsKey(avatarId)) |
21 | { | 21 | { |
22 | GetDefaultAvatarAppearance(out wearables, out visualParams); | 22 | GetDefaultAvatarAppearance(out wearables, out visualParams); |
23 | AvatarWearing wearing = new AvatarWearing(wearables); | 23 | AvatarAppearance wearing = new AvatarAppearance(wearables); |
24 | m_avatarsClothes[avatarId] = wearing; | 24 | m_avatarsClothes[avatarId] = wearing; |
25 | return true; | 25 | return true; |
26 | } | 26 | } |
27 | else | 27 | else |
28 | { | 28 | { |
29 | visualParams = SetDefaultVisualParams(); | 29 | visualParams = GetDefaultVisualParams(); |
30 | wearables = m_avatarsClothes[avatarId].IsWearing; | 30 | wearables = m_avatarsClothes[avatarId].IsWearing; |
31 | return true; | 31 | return true; |
32 | } | 32 | } |
@@ -91,7 +91,7 @@ namespace OpenSim.Region.Environment.Modules | |||
91 | //Tempoaray dictionary storage. This is be storing to a database | 91 | //Tempoaray dictionary storage. This is be storing to a database |
92 | if (m_avatarsClothes.ContainsKey(clientView.AgentId)) | 92 | if (m_avatarsClothes.ContainsKey(clientView.AgentId)) |
93 | { | 93 | { |
94 | AvatarWearing avWearing = m_avatarsClothes[clientView.AgentId]; | 94 | AvatarAppearance avWearing = m_avatarsClothes[clientView.AgentId]; |
95 | avWearing.IsWearing[wear.Type].AssetID = assetId; | 95 | avWearing.IsWearing[wear.Type].AssetID = assetId; |
96 | avWearing.IsWearing[wear.Type].ItemID = wear.ItemID; | 96 | avWearing.IsWearing[wear.Type].ItemID = wear.ItemID; |
97 | } | 97 | } |
@@ -103,12 +103,11 @@ namespace OpenSim.Region.Environment.Modules | |||
103 | 103 | ||
104 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) | 104 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) |
105 | { | 105 | { |
106 | visualParams = SetDefaultVisualParams(); | 106 | visualParams = GetDefaultVisualParams(); |
107 | |||
108 | wearables = AvatarWearable.DefaultWearables; | 107 | wearables = AvatarWearable.DefaultWearables; |
109 | } | 108 | } |
110 | 109 | ||
111 | private static byte[] SetDefaultVisualParams() | 110 | private static byte[] GetDefaultVisualParams() |
112 | { | 111 | { |
113 | byte[] visualParams; | 112 | byte[] visualParams; |
114 | visualParams = new byte[218]; | 113 | visualParams = new byte[218]; |
@@ -119,11 +118,12 @@ namespace OpenSim.Region.Environment.Modules | |||
119 | return visualParams; | 118 | return visualParams; |
120 | } | 119 | } |
121 | 120 | ||
122 | public class AvatarWearing | 121 | public class AvatarAppearance |
123 | { | 122 | { |
124 | public AvatarWearable[] IsWearing; | 123 | public AvatarWearable[] IsWearing; |
124 | public byte[] VisualParams; | ||
125 | 125 | ||
126 | public AvatarWearing() | 126 | public AvatarAppearance() |
127 | { | 127 | { |
128 | IsWearing = new AvatarWearable[13]; | 128 | IsWearing = new AvatarWearable[13]; |
129 | for (int i = 0; i < 13; i++) | 129 | for (int i = 0; i < 13; i++) |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules | |||
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | public AvatarWearing(AvatarWearable[] wearing) | 135 | public AvatarAppearance(AvatarWearable[] wearing) |
136 | { | 136 | { |
137 | if (wearing.Length == 13) | 137 | if (wearing.Length == 13) |
138 | { | 138 | { |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 435022b..745345d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -190,9 +190,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
190 | } | 190 | } |
191 | replyPacket.Data = searchData; | 191 | replyPacket.Data = searchData; |
192 | client.SendAvatarPickerReply(replyPacket); | 192 | client.SendAvatarPickerReply(replyPacket); |
193 | |||
194 | |||
195 | } | 193 | } |
196 | |||
197 | } | 194 | } |
198 | } \ No newline at end of file | 195 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 46079bb..2ef27fd 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -511,8 +511,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
511 | for (int i = 0; i < visualParam.Length; i++) | 511 | for (int i = 0; i < visualParam.Length; i++) |
512 | { | 512 | { |
513 | m_visualParams[i] = visualParam[i].ParamValue; | 513 | m_visualParams[i] = visualParam[i].ParamValue; |
514 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "VisualData[" + i.ToString() + "]: " + visualParam[i].ParamValue.ToString() + "m"); | 514 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "VisualData[" + i.ToString() + "]: " + visualParam[i].ParamValue.ToString() + "m"); |
515 | |||
516 | } | 515 | } |
517 | 516 | ||
518 | // Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters. | 517 | // Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters. |