diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules')
4 files changed, 135 insertions, 25 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 28f04b3..89704d5 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | |||
@@ -48,10 +48,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AppearanceInfoModule")] | 48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AppearanceInfoModule")] |
49 | public class AppearanceInfoModule : ISharedRegionModule | 49 | public class AppearanceInfoModule : ISharedRegionModule |
50 | { | 50 | { |
51 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | protected Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); | 53 | public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}"; |
54 | protected IAvatarFactoryModule m_avatarFactory; | 54 | |
55 | private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); | ||
56 | private IAvatarFactoryModule m_avatarFactory; | ||
55 | 57 | ||
56 | public string Name { get { return "Appearance Information Module"; } } | 58 | public string Name { get { return "Appearance Information Module"; } } |
57 | 59 | ||
@@ -90,46 +92,154 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
90 | // m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); | 92 | // m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); |
91 | 93 | ||
92 | lock (m_scenes) | 94 | lock (m_scenes) |
93 | m_scenes[scene.RegionInfo.RegionID] = scene; | 95 | m_scenes[scene.RegionInfo.RegionID] = scene; |
96 | |||
97 | scene.AddCommand( | ||
98 | this, "show appearance", | ||
99 | "show appearance [<first-name> <last-name>]", | ||
100 | "Synonym for 'appearance show'", | ||
101 | HandleShowAppearanceCommand); | ||
94 | 102 | ||
95 | scene.AddCommand( | 103 | scene.AddCommand( |
96 | this, "appearance show", | 104 | this, "appearance show", |
97 | "appearance show", | 105 | "appearance show [<first-name> <last-name>]", |
98 | "Show appearance information for each avatar in the simulator.", | 106 | "Show appearance information for each avatar in the simulator.", |
99 | "At the moment this actually just checks that we have all the required baked textures. If not, then appearance is 'corrupt' and other avatars will continue to see a cloud.", | 107 | "This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. " |
100 | ShowAppearanceInfo); | 108 | + "\nIf not, then appearance is 'corrupt' and other avatars will continue to see it as a cloud." |
109 | + "\nOptionally, you can view just a particular avatar's appearance information." | ||
110 | + "\nIn this case, the texture UUID for each bake type is also shown and whether the simulator can find the referenced texture.", | ||
111 | HandleShowAppearanceCommand); | ||
101 | 112 | ||
102 | scene.AddCommand( | 113 | scene.AddCommand( |
103 | this, "appearance send", | 114 | this, "appearance send", |
104 | "appearance send", | 115 | "appearance send [<first-name> <last-name>]", |
105 | "Send appearance data for each avatar in the simulator to viewers.", | 116 | "Send appearance data for each avatar in the simulator to other viewers.", |
106 | SendAppearance); | 117 | "Optionally, you can specify that only a particular avatar's appearance data is sent.", |
118 | HandleSendAppearanceCommand); | ||
107 | } | 119 | } |
108 | 120 | ||
109 | private void SendAppearance(string module, string[] cmd) | 121 | private void HandleSendAppearanceCommand(string module, string[] cmd) |
110 | { | 122 | { |
123 | if (cmd.Length != 2 && cmd.Length < 4) | ||
124 | { | ||
125 | MainConsole.Instance.OutputFormat("Usage: appearance send [<first-name> <last-name>]"); | ||
126 | return; | ||
127 | } | ||
128 | |||
129 | bool targetNameSupplied = false; | ||
130 | string optionalTargetFirstName = null; | ||
131 | string optionalTargetLastName = null; | ||
132 | |||
133 | if (cmd.Length >= 4) | ||
134 | { | ||
135 | targetNameSupplied = true; | ||
136 | optionalTargetFirstName = cmd[2]; | ||
137 | optionalTargetLastName = cmd[3]; | ||
138 | } | ||
139 | |||
111 | lock (m_scenes) | 140 | lock (m_scenes) |
112 | { | 141 | { |
113 | foreach (Scene scene in m_scenes.Values) | 142 | foreach (Scene scene in m_scenes.Values) |
114 | { | 143 | { |
115 | scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID)); | 144 | if (targetNameSupplied) |
145 | { | ||
146 | ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); | ||
147 | if (sp != null && !sp.IsChildAgent) | ||
148 | { | ||
149 | MainConsole.Instance.OutputFormat( | ||
150 | "Sending appearance information for {0} to all other avatars in {1}", | ||
151 | sp.Name, scene.RegionInfo.RegionName); | ||
152 | |||
153 | scene.AvatarFactory.SendAppearance(sp.UUID); | ||
154 | } | ||
155 | } | ||
156 | else | ||
157 | { | ||
158 | scene.ForEachRootScenePresence( | ||
159 | sp => | ||
160 | { | ||
161 | MainConsole.Instance.OutputFormat( | ||
162 | "Sending appearance information for {0} to all other avatars in {1}", | ||
163 | sp.Name, scene.RegionInfo.RegionName); | ||
164 | |||
165 | scene.AvatarFactory.SendAppearance(sp.UUID); | ||
166 | } | ||
167 | ); | ||
168 | } | ||
116 | } | 169 | } |
117 | } | 170 | } |
118 | } | 171 | } |
119 | 172 | ||
120 | protected void ShowAppearanceInfo(string module, string[] cmd) | 173 | protected void HandleShowAppearanceCommand(string module, string[] cmd) |
121 | { | 174 | { |
175 | if (cmd.Length != 2 && cmd.Length < 4) | ||
176 | { | ||
177 | MainConsole.Instance.OutputFormat("Usage: appearance show [<first-name> <last-name>]"); | ||
178 | return; | ||
179 | } | ||
180 | |||
181 | bool targetNameSupplied = false; | ||
182 | string optionalTargetFirstName = null; | ||
183 | string optionalTargetLastName = null; | ||
184 | |||
185 | if (cmd.Length >= 4) | ||
186 | { | ||
187 | targetNameSupplied = true; | ||
188 | optionalTargetFirstName = cmd[2]; | ||
189 | optionalTargetLastName = cmd[3]; | ||
190 | } | ||
191 | |||
122 | lock (m_scenes) | 192 | lock (m_scenes) |
123 | { | 193 | { |
124 | foreach (Scene scene in m_scenes.Values) | 194 | foreach (Scene scene in m_scenes.Values) |
125 | { | 195 | { |
126 | scene.ForEachRootScenePresence( | 196 | if (targetNameSupplied) |
127 | delegate(ScenePresence sp) | 197 | { |
198 | ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); | ||
199 | if (sp != null && !sp.IsChildAgent) | ||
128 | { | 200 | { |
201 | MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName); | ||
202 | MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID"); | ||
203 | |||
204 | Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures | ||
205 | = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID); | ||
206 | foreach (BakeType bt in bakedTextures.Keys) | ||
207 | { | ||
208 | string rawTextureID; | ||
209 | |||
210 | if (bakedTextures[bt] == null) | ||
211 | { | ||
212 | rawTextureID = "not set"; | ||
213 | } | ||
214 | else | ||
215 | { | ||
216 | rawTextureID = bakedTextures[bt].TextureID.ToString(); | ||
217 | |||
218 | if (scene.AssetService.Get(rawTextureID) == null) | ||
219 | rawTextureID += " (not found)"; | ||
220 | else | ||
221 | rawTextureID += " (uploaded)"; | ||
222 | } | ||
223 | |||
224 | MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID); | ||
225 | } | ||
226 | |||
129 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); | 227 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); |
130 | MainConsole.Instance.OutputFormat( | 228 | MainConsole.Instance.OutputFormat( |
131 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | 229 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); |
132 | }); | 230 | } |
231 | } | ||
232 | else | ||
233 | { | ||
234 | scene.ForEachRootScenePresence( | ||
235 | sp => | ||
236 | { | ||
237 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); | ||
238 | MainConsole.Instance.OutputFormat( | ||
239 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | ||
240 | } | ||
241 | ); | ||
242 | } | ||
133 | } | 243 | } |
134 | } | 244 | } |
135 | } | 245 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index a5bba4f..5323a95 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -309,7 +309,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
309 | caps.RegisterHandler("ProvisionVoiceAccountRequest", | 309 | caps.RegisterHandler("ProvisionVoiceAccountRequest", |
310 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, | 310 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, |
311 | delegate(string request, string path, string param, | 311 | delegate(string request, string path, string param, |
312 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 312 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
313 | { | 313 | { |
314 | return ProvisionVoiceAccountRequest(scene, request, path, param, | 314 | return ProvisionVoiceAccountRequest(scene, request, path, param, |
315 | agentID, caps); | 315 | agentID, caps); |
@@ -317,7 +317,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
317 | caps.RegisterHandler("ParcelVoiceInfoRequest", | 317 | caps.RegisterHandler("ParcelVoiceInfoRequest", |
318 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, | 318 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, |
319 | delegate(string request, string path, string param, | 319 | delegate(string request, string path, string param, |
320 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 320 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
321 | { | 321 | { |
322 | return ParcelVoiceInfoRequest(scene, request, path, param, | 322 | return ParcelVoiceInfoRequest(scene, request, path, param, |
323 | agentID, caps); | 323 | agentID, caps); |
@@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
325 | caps.RegisterHandler("ChatSessionRequest", | 325 | caps.RegisterHandler("ChatSessionRequest", |
326 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, | 326 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, |
327 | delegate(string request, string path, string param, | 327 | delegate(string request, string path, string param, |
328 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 328 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
329 | { | 329 | { |
330 | return ChatSessionRequest(scene, request, path, param, | 330 | return ChatSessionRequest(scene, request, path, param, |
331 | agentID, caps); | 331 | agentID, caps); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 534bf92..70e2f7e 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | |||
@@ -421,7 +421,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
421 | caps.RegisterHandler("ProvisionVoiceAccountRequest", | 421 | caps.RegisterHandler("ProvisionVoiceAccountRequest", |
422 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, | 422 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, |
423 | delegate(string request, string path, string param, | 423 | delegate(string request, string path, string param, |
424 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 424 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
425 | { | 425 | { |
426 | return ProvisionVoiceAccountRequest(scene, request, path, param, | 426 | return ProvisionVoiceAccountRequest(scene, request, path, param, |
427 | agentID, caps); | 427 | agentID, caps); |
@@ -429,7 +429,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
429 | caps.RegisterHandler("ParcelVoiceInfoRequest", | 429 | caps.RegisterHandler("ParcelVoiceInfoRequest", |
430 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, | 430 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, |
431 | delegate(string request, string path, string param, | 431 | delegate(string request, string path, string param, |
432 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 432 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
433 | { | 433 | { |
434 | return ParcelVoiceInfoRequest(scene, request, path, param, | 434 | return ParcelVoiceInfoRequest(scene, request, path, param, |
435 | agentID, caps); | 435 | agentID, caps); |
@@ -437,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
437 | caps.RegisterHandler("ChatSessionRequest", | 437 | caps.RegisterHandler("ChatSessionRequest", |
438 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, | 438 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, |
439 | delegate(string request, string path, string param, | 439 | delegate(string request, string path, string param, |
440 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 440 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
441 | { | 441 | { |
442 | return ChatSessionRequest(scene, request, path, param, | 442 | return ChatSessionRequest(scene, request, path, param, |
443 | agentID, caps); | 443 | agentID, caps); |
diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index f47d9c7..550b5d4 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
56 | } | 56 | } |
57 | 57 | ||
58 | public override byte[] Handle(string path, Stream requestData, | 58 | public override byte[] Handle(string path, Stream requestData, |
59 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
60 | { | 60 | { |
61 | httpResponse.ContentType = "image/jpeg"; | 61 | httpResponse.ContentType = "image/jpeg"; |
62 | 62 | ||