aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs35
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs10
2 files changed, 39 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
index 6b2de80..9312fd8 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -274,14 +274,30 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
274 message = (string)requestData["message"]; 274 message = (string)requestData["message"];
275 275
276 // Bytes don't transfer well over XMLRPC, so, we Base64 Encode them. 276 // Bytes don't transfer well over XMLRPC, so, we Base64 Encode them.
277 byte[] dialogdata = Convert.FromBase64String((string)requestData["dialog"]); 277 string requestData1 = (string)requestData["dialog"];
278 dialog = dialogdata[0]; 278 if (string.IsNullOrEmpty(requestData1))
279 {
280 dialog = 0;
281 }
282 else
283 {
284 byte[] dialogdata = Convert.FromBase64String(requestData1);
285 dialog = dialogdata[0];
286 }
279 287
280 if ((string)requestData["from_group"] == "TRUE") 288 if ((string)requestData["from_group"] == "TRUE")
281 fromGroup = true; 289 fromGroup = true;
282 290
283 byte[] offlinedata = Convert.FromBase64String((string)requestData["offline"]); 291 string requestData2 = (string)requestData["offline"];
284 offline = offlinedata[0]; 292 if (String.IsNullOrEmpty(requestData2))
293 {
294 offline = 0;
295 }
296 else
297 {
298 byte[] offlinedata = Convert.FromBase64String(requestData2);
299 offline = offlinedata[0];
300 }
285 301
286 # region ParentEstateID 302 # region ParentEstateID
287 try 303 try
@@ -346,7 +362,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
346 # endregion 362 # endregion
347 363
348 Position = new Vector3(pos_x, pos_y, pos_z); 364 Position = new Vector3(pos_x, pos_y, pos_z);
349 binaryBucket = Convert.FromBase64String((string)requestData["binary_bucket"]); 365
366 string requestData3 = (string)requestData["binary_bucket"];
367 if (string.IsNullOrEmpty(requestData3))
368 {
369 binaryBucket = new byte[0];
370 }
371 else
372 {
373 binaryBucket = Convert.FromBase64String(requestData3);
374 }
350 375
351 // Create a New GridInstantMessageObject the the data 376 // Create a New GridInstantMessageObject the the data
352 GridInstantMessage gim = new GridInstantMessage(); 377 GridInstantMessage gim = new GridInstantMessage();
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index ab2abed..1d122d2 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -245,7 +245,15 @@ namespace OpenSim.Region.Environment.Scenes
245 245
246 public Vector3 Lookat 246 public Vector3 Lookat
247 { 247 {
248 get { return Util.GetNormalizedVector(new Vector3(m_CameraAtAxis.X, m_CameraAtAxis.Y, 0)); } 248 get
249 {
250 Vector3 a = new Vector3(m_CameraAtAxis.X, m_CameraAtAxis.Y, 0);
251
252 if(a == Vector3.Zero)
253 return a;
254
255 return Util.GetNormalizedVector(a);
256 }
249 } 257 }
250 258
251 private readonly string m_firstname; 259 private readonly string m_firstname;