aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AssetBase.cs1
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Framework/PrimitiveBaseShape.cs48
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs57
-rw-r--r--OpenSim/Framework/Util.cs35
5 files changed, 104 insertions, 39 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index 5f68cda..e8c85c9 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -273,6 +273,7 @@ namespace OpenSim.Framework
273 273
274 return m_id; 274 return m_id;
275 } 275 }
276
276 set 277 set
277 { 278 {
278 UUID uuid = UUID.Zero; 279 UUID uuid = UUID.Zero;
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 659d42f..f6e2977 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -737,7 +737,7 @@ namespace OpenSim.Framework
737 bool IsActive { get; set; } 737 bool IsActive { get; set; }
738 738
739 /// <value> 739 /// <value>
740 /// Determines whether the client is logging out or not. 740 /// Determines whether the client is or has been removed from a given scene
741 /// </value> 741 /// </value>
742 bool IsLoggingOut { get; set; } 742 bool IsLoggingOut { get; set; }
743 743
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index 7b5fb2e..d873071 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -213,6 +213,8 @@ namespace OpenSim.Framework
213 /// <param name="prim"></param> 213 /// <param name="prim"></param>
214 public PrimitiveBaseShape(Primitive prim) 214 public PrimitiveBaseShape(Primitive prim)
215 { 215 {
216// m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Creating from {0}", prim.ID);
217
216 PCode = (byte)prim.PrimData.PCode; 218 PCode = (byte)prim.PrimData.PCode;
217 ExtraParams = new byte[1]; 219 ExtraParams = new byte[1];
218 220
@@ -376,7 +378,7 @@ namespace OpenSim.Framework
376 _pathEnd = Primitive.PackEndCut(end); 378 _pathEnd = Primitive.PackEndCut(end);
377 } 379 }
378 380
379 public void SetSculptData(byte sculptType, UUID SculptTextureUUID) 381 public void SetSculptProperties(byte sculptType, UUID SculptTextureUUID)
380 { 382 {
381 _sculptType = sculptType; 383 _sculptType = sculptType;
382 _sculptTexture = SculptTextureUUID; 384 _sculptTexture = SculptTextureUUID;
@@ -613,29 +615,39 @@ namespace OpenSim.Framework
613 } 615 }
614 } 616 }
615 617
616 public byte SculptType { 618 public byte SculptType
617 get { 619 {
620 get
621 {
618 return _sculptType; 622 return _sculptType;
619 } 623 }
620 set { 624 set
625 {
621 _sculptType = value; 626 _sculptType = value;
622 } 627 }
623 } 628 }
624 629
625 public byte[] SculptData { 630 public byte[] SculptData
626 get { 631 {
632 get
633 {
627 return _sculptData; 634 return _sculptData;
628 } 635 }
629 set { 636 set
637 {
638// m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Setting SculptData to data with length {0}", value.Length);
630 _sculptData = value; 639 _sculptData = value;
631 } 640 }
632 } 641 }
633 642
634 public int FlexiSoftness { 643 public int FlexiSoftness
635 get { 644 {
645 get
646 {
636 return _flexiSoftness; 647 return _flexiSoftness;
637 } 648 }
638 set { 649 set
650 {
639 _flexiSoftness = value; 651 _flexiSoftness = value;
640 } 652 }
641 } 653 }
@@ -849,6 +861,8 @@ namespace OpenSim.Framework
849 861
850 public byte[] ExtraParamsToBytes() 862 public byte[] ExtraParamsToBytes()
851 { 863 {
864// m_log.DebugFormat("[EXTRAPARAMS]: Called ExtraParamsToBytes()");
865
852 ushort FlexiEP = 0x10; 866 ushort FlexiEP = 0x10;
853 ushort LightEP = 0x20; 867 ushort LightEP = 0x20;
854 ushort SculptEP = 0x30; 868 ushort SculptEP = 0x30;
@@ -864,18 +878,21 @@ namespace OpenSim.Framework
864 TotalBytesLength += 16;// data 878 TotalBytesLength += 16;// data
865 TotalBytesLength += 2 + 4; // type 879 TotalBytesLength += 2 + 4; // type
866 } 880 }
881
867 if (_lightEntry) 882 if (_lightEntry)
868 { 883 {
869 ExtraParamsNum++; 884 ExtraParamsNum++;
870 TotalBytesLength += 16;// data 885 TotalBytesLength += 16;// data
871 TotalBytesLength += 2 + 4; // type 886 TotalBytesLength += 2 + 4; // type
872 } 887 }
888
873 if (_sculptEntry) 889 if (_sculptEntry)
874 { 890 {
875 ExtraParamsNum++; 891 ExtraParamsNum++;
876 TotalBytesLength += 17;// data 892 TotalBytesLength += 17;// data
877 TotalBytesLength += 2 + 4; // type 893 TotalBytesLength += 2 + 4; // type
878 } 894 }
895
879 if (_projectionEntry) 896 if (_projectionEntry)
880 { 897 {
881 ExtraParamsNum++; 898 ExtraParamsNum++;
@@ -885,7 +902,6 @@ namespace OpenSim.Framework
885 902
886 byte[] returnbytes = new byte[TotalBytesLength]; 903 byte[] returnbytes = new byte[TotalBytesLength];
887 904
888
889 // uint paramlength = ExtraParamsNum; 905 // uint paramlength = ExtraParamsNum;
890 906
891 // Stick in the number of parameters 907 // Stick in the number of parameters
@@ -905,6 +921,7 @@ namespace OpenSim.Framework
905 Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length); 921 Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length);
906 i += FlexiData.Length; 922 i += FlexiData.Length;
907 } 923 }
924
908 if (_lightEntry) 925 if (_lightEntry)
909 { 926 {
910 byte[] LightData = GetLightBytes(); 927 byte[] LightData = GetLightBytes();
@@ -919,6 +936,7 @@ namespace OpenSim.Framework
919 Array.Copy(LightData, 0, returnbytes, i, LightData.Length); 936 Array.Copy(LightData, 0, returnbytes, i, LightData.Length);
920 i += LightData.Length; 937 i += LightData.Length;
921 } 938 }
939
922 if (_sculptEntry) 940 if (_sculptEntry)
923 { 941 {
924 byte[] SculptData = GetSculptBytes(); 942 byte[] SculptData = GetSculptBytes();
@@ -933,6 +951,7 @@ namespace OpenSim.Framework
933 Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length); 951 Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length);
934 i += SculptData.Length; 952 i += SculptData.Length;
935 } 953 }
954
936 if (_projectionEntry) 955 if (_projectionEntry)
937 { 956 {
938 byte[] ProjectionData = GetProjectionBytes(); 957 byte[] ProjectionData = GetProjectionBytes();
@@ -946,6 +965,7 @@ namespace OpenSim.Framework
946 Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length); 965 Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length);
947 i += ProjectionData.Length; 966 i += ProjectionData.Length;
948 } 967 }
968
949 if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry) 969 if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry)
950 { 970 {
951 byte[] returnbyte = new byte[1]; 971 byte[] returnbyte = new byte[1];
@@ -953,10 +973,7 @@ namespace OpenSim.Framework
953 return returnbyte; 973 return returnbyte;
954 } 974 }
955 975
956
957 return returnbytes; 976 return returnbytes;
958 //m_log.Info("[EXTRAPARAMS]: Length = " + m_shape.ExtraParams.Length.ToString());
959
960 } 977 }
961 978
962 public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data) 979 public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data)
@@ -1027,7 +1044,6 @@ namespace OpenSim.Framework
1027 extraParamCount = data[i++]; 1044 extraParamCount = data[i++];
1028 } 1045 }
1029 1046
1030
1031 for (int k = 0; k < extraParamCount; k++) 1047 for (int k = 0; k < extraParamCount; k++)
1032 { 1048 {
1033 ushort epType = Utils.BytesToUInt16(data, i); 1049 ushort epType = Utils.BytesToUInt16(data, i);
@@ -1071,7 +1087,6 @@ namespace OpenSim.Framework
1071 _sculptEntry = false; 1087 _sculptEntry = false;
1072 if (!lGotFilter) 1088 if (!lGotFilter)
1073 _projectionEntry = false; 1089 _projectionEntry = false;
1074
1075 } 1090 }
1076 1091
1077 public void ReadSculptData(byte[] data, int pos) 1092 public void ReadSculptData(byte[] data, int pos)
@@ -1100,6 +1115,7 @@ namespace OpenSim.Framework
1100 if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4) 1115 if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4)
1101 _sculptType = 4; 1116 _sculptType = 4;
1102 } 1117 }
1118
1103 _sculptTexture = SculptUUID; 1119 _sculptTexture = SculptUUID;
1104 _sculptType = SculptTypel; 1120 _sculptType = SculptTypel;
1105 //m_log.Info("[SCULPT]:" + SculptUUID.ToString()); 1121 //m_log.Info("[SCULPT]:" + SculptUUID.ToString());
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 21e1e09..688be3f 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -31,6 +31,7 @@ using System.Diagnostics;
31using System.IO; 31using System.IO;
32using System.Reflection; 32using System.Reflection;
33using System.Text; 33using System.Text;
34using System.Text.RegularExpressions;
34using System.Threading; 35using System.Threading;
35using System.Timers; 36using System.Timers;
36using log4net; 37using log4net;
@@ -124,7 +125,6 @@ namespace OpenSim.Framework.Servers
124 m_logFileAppender = appender; 125 m_logFileAppender = appender;
125 } 126 }
126 } 127 }
127
128 } 128 }
129 129
130 /// <summary> 130 /// <summary>
@@ -443,45 +443,68 @@ namespace OpenSim.Framework.Servers
443 { 443 {
444 string buildVersion = string.Empty; 444 string buildVersion = string.Empty;
445 445
446 // Add commit hash and date information if available
447 // The commit hash and date are stored in a file bin/.version
448 // This file can automatically created by a post
449 // commit script in the opensim git master repository or
450 // by issuing the follwoing command from the top level
451 // directory of the opensim repository
452 // git log -n 1 --pretty="format:%h: %ci" >bin/.version
453 // For the full git commit hash use %H instead of %h
454 //
455 // The subversion information is deprecated and will be removed at a later date 446 // The subversion information is deprecated and will be removed at a later date
456 // Add subversion revision information if available 447 // Add subversion revision information if available
457 // Try file "svn_revision" in the current directory first, then the .svn info. 448 // Try file "svn_revision" in the current directory first, then the .svn info.
458 // This allows to make the revision available in simulators not running from the source tree. 449 // This allows to make the revision available in simulators not running from the source tree.
459 // FIXME: Making an assumption about the directory we're currently in - we do this all over the place 450 // FIXME: Making an assumption about the directory we're currently in - we do this all over the place
460 // elsewhere as well 451 // elsewhere as well
452 string gitDir = "../.git/";
453 string gitRefPointerPath = gitDir + "HEAD";
454
461 string svnRevisionFileName = "svn_revision"; 455 string svnRevisionFileName = "svn_revision";
462 string svnFileName = ".svn/entries"; 456 string svnFileName = ".svn/entries";
463 string gitCommitFileName = ".version"; 457 string manualVersionFileName = ".version";
464 string inputLine; 458 string inputLine;
465 int strcmp; 459 int strcmp;
466 460
467 if (File.Exists(gitCommitFileName)) 461 if (File.Exists(manualVersionFileName))
468 { 462 {
469 StreamReader CommitFile = File.OpenText(gitCommitFileName); 463 using (StreamReader CommitFile = File.OpenText(manualVersionFileName))
470 buildVersion = CommitFile.ReadLine(); 464 buildVersion = CommitFile.ReadLine();
471 CommitFile.Close(); 465
472 m_version += buildVersion ?? ""; 466 m_version += buildVersion ?? "";
473 } 467 }
468 else if (File.Exists(gitRefPointerPath))
469 {
470// m_log.DebugFormat("[OPENSIM]: Found {0}", gitRefPointerPath);
471
472 string rawPointer = "";
473
474 using (StreamReader pointerFile = File.OpenText(gitRefPointerPath))
475 rawPointer = pointerFile.ReadLine();
476
477// m_log.DebugFormat("[OPENSIM]: rawPointer [{0}]", rawPointer);
478
479 Match m = Regex.Match(rawPointer, "^ref: (.+)$");
480
481 if (m.Success)
482 {
483// m_log.DebugFormat("[OPENSIM]: Matched [{0}]", m.Groups[1].Value);
484
485 string gitRef = m.Groups[1].Value;
486 string gitRefPath = gitDir + gitRef;
487 if (File.Exists(gitRefPath))
488 {
489// m_log.DebugFormat("[OPENSIM]: Found gitRefPath [{0}]", gitRefPath);
474 490
475 // Remove the else logic when subversion mirror is no longer used 491 using (StreamReader refFile = File.OpenText(gitRefPath))
492 {
493 string gitHash = refFile.ReadLine();
494 m_version += gitHash.Substring(0, 7);
495 }
496 }
497 }
498 }
476 else 499 else
477 { 500 {
501 // Remove the else logic when subversion mirror is no longer used
478 if (File.Exists(svnRevisionFileName)) 502 if (File.Exists(svnRevisionFileName))
479 { 503 {
480 StreamReader RevisionFile = File.OpenText(svnRevisionFileName); 504 StreamReader RevisionFile = File.OpenText(svnRevisionFileName);
481 buildVersion = RevisionFile.ReadLine(); 505 buildVersion = RevisionFile.ReadLine();
482 buildVersion.Trim(); 506 buildVersion.Trim();
483 RevisionFile.Close(); 507 RevisionFile.Close();
484
485 } 508 }
486 509
487 if (string.IsNullOrEmpty(buildVersion) && File.Exists(svnFileName)) 510 if (string.IsNullOrEmpty(buildVersion) && File.Exists(svnFileName))
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index e5ff27a..fce8999 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -324,10 +324,25 @@ namespace OpenSim.Framework
324 } 324 }
325 325
326 /// <summary> 326 /// <summary>
327 /// Debug utility function to convert OSD into formatted XML for debugging purposes.
328 /// </summary>
329 /// <param name="osd">
330 /// A <see cref="OSD"/>
331 /// </param>
332 /// <returns>
333 /// A <see cref="System.String"/>
334 /// </returns>
335 public static string GetFormattedXml(OSD osd)
336 {
337 return GetFormattedXml(OSDParser.SerializeLLSDXmlString(osd));
338 }
339
340 /// <summary>
327 /// Debug utility function to convert unbroken strings of XML into something human readable for occasional debugging purposes. 341 /// Debug utility function to convert unbroken strings of XML into something human readable for occasional debugging purposes.
328 ///
329 /// Please don't delete me even if I appear currently unused!
330 /// </summary> 342 /// </summary>
343 /// <remarks>
344 /// Please don't delete me even if I appear currently unused!
345 /// </remarks>
331 /// <param name="rawXml"></param> 346 /// <param name="rawXml"></param>
332 /// <returns></returns> 347 /// <returns></returns>
333 public static string GetFormattedXml(string rawXml) 348 public static string GetFormattedXml(string rawXml)
@@ -425,20 +440,30 @@ namespace OpenSim.Framework
425 } 440 }
426 441
427 /// <summary> 442 /// <summary>
428 /// Return an SHA1 hash of the given string 443 /// Return an SHA1 hash
429 /// </summary> 444 /// </summary>
430 /// <param name="data"></param> 445 /// <param name="data"></param>
431 /// <returns></returns> 446 /// <returns></returns>
432 public static string SHA1Hash(string data) 447 public static string SHA1Hash(string data)
433 { 448 {
449 return SHA1Hash(Encoding.Default.GetBytes(data));
450 }
451
452 /// <summary>
453 /// Return an SHA1 hash
454 /// </summary>
455 /// <param name="data"></param>
456 /// <returns></returns>
457 public static string SHA1Hash(byte[] data)
458 {
434 byte[] hash = ComputeSHA1Hash(data); 459 byte[] hash = ComputeSHA1Hash(data);
435 return BitConverter.ToString(hash).Replace("-", String.Empty); 460 return BitConverter.ToString(hash).Replace("-", String.Empty);
436 } 461 }
437 462
438 private static byte[] ComputeSHA1Hash(string src) 463 private static byte[] ComputeSHA1Hash(byte[] src)
439 { 464 {
440 SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider(); 465 SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider();
441 return SHA1.ComputeHash(Encoding.Default.GetBytes(src)); 466 return SHA1.ComputeHash(src);
442 } 467 }
443 468
444 public static int fast_distance2d(int x, int y) 469 public static int fast_distance2d(int x, int y)