aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs23
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs8
-rwxr-xr-xOpenSim/Framework/Console/ConsoleBase.cs5
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs36
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs5
-rw-r--r--OpenSim/Framework/WebUtil.cs2
6 files changed, 61 insertions, 18 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 18a5733..5a6b265 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -427,19 +427,30 @@ namespace OpenSim.Framework
427 /// 0x80 bit set then we assume this is an append 427 /// 0x80 bit set then we assume this is an append
428 /// operation otherwise we replace whatever is 428 /// operation otherwise we replace whatever is
429 /// currently attached at the attachpoint 429 /// currently attached at the attachpoint
430 /// return true if something actually changed
430 /// </summary> 431 /// </summary>
431 public void SetAttachment(int attachpoint, UUID item, UUID asset) 432 public bool SetAttachment(int attachpoint, UUID item, UUID asset)
432 { 433 {
433 if (attachpoint == 0) 434 if (attachpoint == 0)
434 return; 435 return false;
435 436
436 if (item == UUID.Zero) 437 if (item == UUID.Zero)
437 { 438 {
438 if (m_attachments.ContainsKey(attachpoint)) 439 if (m_attachments.ContainsKey(attachpoint))
440 {
439 m_attachments.Remove(attachpoint); 441 m_attachments.Remove(attachpoint);
440 return; 442 return true;
443 }
444 return false;
441 } 445 }
442 446
447 // check if the item is already attached at this point
448 if (GetAttachpoint(item) == (attachpoint & 0x7F))
449 {
450 // m_log.DebugFormat("[AVATAR APPEARANCE] attempt to attach an already attached item {0}",item);
451 return false;
452 }
453
443 // check if this is an append or a replace, 0x80 marks it as an append 454 // check if this is an append or a replace, 0x80 marks it as an append
444 if ((attachpoint & 0x80) > 0) 455 if ((attachpoint & 0x80) > 0)
445 { 456 {
@@ -451,6 +462,7 @@ namespace OpenSim.Framework
451 { 462 {
452 ReplaceAttachment(new AvatarAttachment(attachpoint,item,asset)); 463 ReplaceAttachment(new AvatarAttachment(attachpoint,item,asset));
453 } 464 }
465 return true;
454 } 466 }
455 467
456 public int GetAttachpoint(UUID itemID) 468 public int GetAttachpoint(UUID itemID)
@@ -465,7 +477,7 @@ namespace OpenSim.Framework
465 return 0; 477 return 0;
466 } 478 }
467 479
468 public void DetachAttachment(UUID itemID) 480 public bool DetachAttachment(UUID itemID)
469 { 481 {
470 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) 482 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
471 { 483 {
@@ -478,9 +490,10 @@ namespace OpenSim.Framework
478 // And remove the list if there are no more attachments here 490 // And remove the list if there are no more attachments here
479 if (m_attachments[kvp.Key].Count == 0) 491 if (m_attachments[kvp.Key].Count == 0)
480 m_attachments.Remove(kvp.Key); 492 m_attachments.Remove(kvp.Key);
481 return; 493 return true;
482 } 494 }
483 } 495 }
496 return false;
484 } 497 }
485 498
486 public void ClearAttachments() 499 public void ClearAttachments()
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index dbb0781..c2f9c3a 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -765,8 +765,8 @@ namespace OpenSim.Framework.Capabilities
765 { 765 {
766 try 766 try
767 { 767 {
768 m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " + 768// m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " +
769 m_regionName); 769// m_regionName);
770 770
771 string capsBase = "/CAPS/" + m_capsObjectPath; 771 string capsBase = "/CAPS/" + m_capsObjectPath;
772 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 772 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
@@ -1332,7 +1332,7 @@ namespace OpenSim.Framework.Capabilities
1332 newAssetID = UUID.Random(); 1332 newAssetID = UUID.Random();
1333 uploaderPath = path; 1333 uploaderPath = path;
1334 httpListener = httpServer; 1334 httpListener = httpServer;
1335 m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID); 1335// m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID);
1336 } 1336 }
1337 1337
1338 /// <summary> 1338 /// <summary>
@@ -1360,7 +1360,7 @@ namespace OpenSim.Framework.Capabilities
1360 1360
1361 httpListener.RemoveStreamHandler("POST", uploaderPath); 1361 httpListener.RemoveStreamHandler("POST", uploaderPath);
1362 1362
1363 m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID); 1363// m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID);
1364 1364
1365 return res; 1365 return res;
1366 } 1366 }
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index 22ce880..c59fbca 100755
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -75,6 +75,11 @@ namespace OpenSim.Framework.Console
75 { 75 {
76 System.Console.WriteLine(text); 76 System.Console.WriteLine(text);
77 } 77 }
78
79 public virtual void OutputFormat(string format, params object[] components)
80 {
81 Output(string.Format(format, components));
82 }
78 83
79 public string CmdPrompt(string p) 84 public string CmdPrompt(string p)
80 { 85 {
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index cbab2db..b28ad69 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -175,7 +175,7 @@ namespace OpenSim.Framework.Servers
175 175
176 m_console.Commands.AddCommand("base", false, "show info", 176 m_console.Commands.AddCommand("base", false, "show info",
177 "show info", 177 "show info",
178 "Show general information", HandleShow); 178 "Show general information about the server", HandleShow);
179 179
180 m_console.Commands.AddCommand("base", false, "show stats", 180 m_console.Commands.AddCommand("base", false, "show stats",
181 "show stats", 181 "show stats",
@@ -371,8 +371,7 @@ namespace OpenSim.Framework.Servers
371 switch (showParams[0]) 371 switch (showParams[0])
372 { 372 {
373 case "info": 373 case "info":
374 Notice("Version: " + m_version); 374 ShowInfo();
375 Notice("Startup directory: " + m_startupDirectory);
376 break; 375 break;
377 376
378 case "stats": 377 case "stats":
@@ -389,18 +388,30 @@ namespace OpenSim.Framework.Servers
389 break; 388 break;
390 389
391 case "version": 390 case "version":
392 Notice( 391 Notice(GetVersionText());
393 String.Format(
394 "Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion));
395 break; 392 break;
396 } 393 }
397 } 394 }
395
396 protected void ShowInfo()
397 {
398 Notice(GetVersionText());
399 Notice("Startup directory: " + m_startupDirectory);
400 if (null != m_consoleAppender)
401 Notice(String.Format("Console log level: {0}", m_consoleAppender.Threshold));
402 }
403
404 protected string GetVersionText()
405 {
406 return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion);
407 }
398 408
399 /// <summary> 409 /// <summary>
400 /// Console output is only possible if a console has been established. 410 /// Console output is only possible if a console has been established.
401 /// That is something that cannot be determined within this class. So 411 /// That is something that cannot be determined within this class. So
402 /// all attempts to use the console MUST be verified. 412 /// all attempts to use the console MUST be verified.
403 /// </summary> 413 /// </summary>
414 /// <param name="msg"></param>
404 protected void Notice(string msg) 415 protected void Notice(string msg)
405 { 416 {
406 if (m_console != null) 417 if (m_console != null)
@@ -408,6 +419,19 @@ namespace OpenSim.Framework.Servers
408 m_console.Output(msg); 419 m_console.Output(msg);
409 } 420 }
410 } 421 }
422
423 /// <summary>
424 /// Console output is only possible if a console has been established.
425 /// That is something that cannot be determined within this class. So
426 /// all attempts to use the console MUST be verified.
427 /// </summary>
428 /// <param name="format"></param>
429 /// <param name="components"></param>
430 protected void Notice(string format, params string[] components)
431 {
432 if (m_console != null)
433 m_console.OutputFormat(format, components);
434 }
411 435
412 /// <summary> 436 /// <summary>
413 /// Enhance the version string with extra information if it's available. 437 /// Enhance the version string with extra information if it's available.
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 86ad7aa..d4ee7ba 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -587,8 +587,9 @@ namespace OpenSim.Framework.Servers.HttpServer
587 // Every month or so this will wrap and give bad numbers, not really a problem 587 // Every month or so this will wrap and give bad numbers, not really a problem
588 // since its just for reporting, 200ms limit can be adjusted 588 // since its just for reporting, 200ms limit can be adjusted
589 int tickdiff = Environment.TickCount - tickstart; 589 int tickdiff = Environment.TickCount - tickstart;
590 if (tickdiff > 200) 590 if (tickdiff > 500)
591 m_log.InfoFormat("[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms",reqnum,request.RawUrl,tickdiff); 591 m_log.InfoFormat(
592 "[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms", reqnum, request.RawUrl, tickdiff);
592 } 593 }
593 } 594 }
594 595
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index d88d095..d731ac5 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Framework
58 58
59 // number of milliseconds a call can take before it is considered 59 // number of milliseconds a call can take before it is considered
60 // a "long" call for warning & debugging purposes 60 // a "long" call for warning & debugging purposes
61 public const int LongCallTime = 200; 61 public const int LongCallTime = 500;
62 62
63 /// <summary> 63 /// <summary>
64 /// Send LLSD to an HTTP client in application/llsd+json form 64 /// Send LLSD to an HTTP client in application/llsd+json form