diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLRegionData.cs | 97 |
1 files changed, 51 insertions, 46 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 65f301f..5a53f9b 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using System.Data.SqlClient; | 31 | using System.Data.SqlClient; |
32 | using System.Drawing; | ||
32 | using System.IO; | 33 | using System.IO; |
33 | using System.Reflection; | 34 | using System.Reflection; |
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
@@ -932,6 +933,10 @@ VALUES | |||
932 | prim.Name = (String)row["Name"]; | 933 | prim.Name = (String)row["Name"]; |
933 | // various text fields | 934 | // various text fields |
934 | prim.Text = (String)row["Text"]; | 935 | prim.Text = (String)row["Text"]; |
936 | prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]), | ||
937 | Convert.ToInt32(row["ColorR"]), | ||
938 | Convert.ToInt32(row["ColorG"]), | ||
939 | Convert.ToInt32(row["ColorB"])); | ||
935 | prim.Description = (String)row["Description"]; | 940 | prim.Description = (String)row["Description"]; |
936 | prim.SitName = (String)row["SitName"]; | 941 | prim.SitName = (String)row["SitName"]; |
937 | prim.TouchName = (String)row["TouchName"]; | 942 | prim.TouchName = (String)row["TouchName"]; |
@@ -948,48 +953,47 @@ VALUES | |||
948 | prim.BaseMask = Convert.ToUInt32(row["BaseMask"]); | 953 | prim.BaseMask = Convert.ToUInt32(row["BaseMask"]); |
949 | // vectors | 954 | // vectors |
950 | prim.OffsetPosition = new Vector3( | 955 | prim.OffsetPosition = new Vector3( |
951 | Convert.ToSingle(row["PositionX"]), | 956 | Convert.ToSingle(row["PositionX"]), |
952 | Convert.ToSingle(row["PositionY"]), | 957 | Convert.ToSingle(row["PositionY"]), |
953 | Convert.ToSingle(row["PositionZ"]) | 958 | Convert.ToSingle(row["PositionZ"])); |
954 | ); | 959 | |
955 | prim.GroupPosition = new Vector3( | 960 | prim.GroupPosition = new Vector3( |
956 | Convert.ToSingle(row["GroupPositionX"]), | 961 | Convert.ToSingle(row["GroupPositionX"]), |
957 | Convert.ToSingle(row["GroupPositionY"]), | 962 | Convert.ToSingle(row["GroupPositionY"]), |
958 | Convert.ToSingle(row["GroupPositionZ"]) | 963 | Convert.ToSingle(row["GroupPositionZ"])); |
959 | ); | 964 | |
960 | prim.Velocity = new Vector3( | 965 | prim.Velocity = new Vector3( |
961 | Convert.ToSingle(row["VelocityX"]), | 966 | Convert.ToSingle(row["VelocityX"]), |
962 | Convert.ToSingle(row["VelocityY"]), | 967 | Convert.ToSingle(row["VelocityY"]), |
963 | Convert.ToSingle(row["VelocityZ"]) | 968 | Convert.ToSingle(row["VelocityZ"])); |
964 | ); | 969 | |
965 | prim.AngularVelocity = new Vector3( | 970 | prim.AngularVelocity = new Vector3( |
966 | Convert.ToSingle(row["AngularVelocityX"]), | 971 | Convert.ToSingle(row["AngularVelocityX"]), |
967 | Convert.ToSingle(row["AngularVelocityY"]), | 972 | Convert.ToSingle(row["AngularVelocityY"]), |
968 | Convert.ToSingle(row["AngularVelocityZ"]) | 973 | Convert.ToSingle(row["AngularVelocityZ"])); |
969 | ); | 974 | |
970 | prim.Acceleration = new Vector3( | 975 | prim.Acceleration = new Vector3( |
971 | Convert.ToSingle(row["AccelerationX"]), | 976 | Convert.ToSingle(row["AccelerationX"]), |
972 | Convert.ToSingle(row["AccelerationY"]), | 977 | Convert.ToSingle(row["AccelerationY"]), |
973 | Convert.ToSingle(row["AccelerationZ"]) | 978 | Convert.ToSingle(row["AccelerationZ"])); |
974 | ); | 979 | |
975 | // quaternions | 980 | // quaternions |
976 | prim.RotationOffset = new Quaternion( | 981 | prim.RotationOffset = new Quaternion( |
977 | Convert.ToSingle(row["RotationX"]), | 982 | Convert.ToSingle(row["RotationX"]), |
978 | Convert.ToSingle(row["RotationY"]), | 983 | Convert.ToSingle(row["RotationY"]), |
979 | Convert.ToSingle(row["RotationZ"]), | 984 | Convert.ToSingle(row["RotationZ"]), |
980 | Convert.ToSingle(row["RotationW"]) | 985 | Convert.ToSingle(row["RotationW"])); |
981 | ); | 986 | |
982 | prim.SitTargetPositionLL = new Vector3( | 987 | prim.SitTargetPositionLL = new Vector3( |
983 | Convert.ToSingle(row["SitTargetOffsetX"]), | 988 | Convert.ToSingle(row["SitTargetOffsetX"]), |
984 | Convert.ToSingle(row["SitTargetOffsetY"]), | 989 | Convert.ToSingle(row["SitTargetOffsetY"]), |
985 | Convert.ToSingle(row["SitTargetOffsetZ"]) | 990 | Convert.ToSingle(row["SitTargetOffsetZ"])); |
986 | ); | 991 | |
987 | prim.SitTargetOrientationLL = new Quaternion( | 992 | prim.SitTargetOrientationLL = new Quaternion( |
988 | Convert.ToSingle(row["SitTargetOrientX"]), | 993 | Convert.ToSingle(row["SitTargetOrientX"]), |
989 | Convert.ToSingle(row["SitTargetOrientY"]), | 994 | Convert.ToSingle(row["SitTargetOrientY"]), |
990 | Convert.ToSingle(row["SitTargetOrientZ"]), | 995 | Convert.ToSingle(row["SitTargetOrientZ"]), |
991 | Convert.ToSingle(row["SitTargetOrientW"]) | 996 | Convert.ToSingle(row["SitTargetOrientW"])); |
992 | ); | ||
993 | 997 | ||
994 | prim.PayPrice[0] = Convert.ToInt32(row["PayPrice"]); | 998 | prim.PayPrice[0] = Convert.ToInt32(row["PayPrice"]); |
995 | prim.PayPrice[1] = Convert.ToInt32(row["PayButton1"]); | 999 | prim.PayPrice[1] = Convert.ToInt32(row["PayButton1"]); |
@@ -1001,17 +1005,15 @@ VALUES | |||
1001 | prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); | 1005 | prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); |
1002 | prim.SoundFlags = 1; // If it's persisted at all, it's looped | 1006 | prim.SoundFlags = 1; // If it's persisted at all, it's looped |
1003 | 1007 | ||
1004 | if (row["TextureAnimation"] != null && row["TextureAnimation"] != DBNull.Value) | 1008 | if (!row.IsNull("TextureAnimation") && row["TextureAnimation"] != DBNull.Value) |
1005 | prim.TextureAnimation = (Byte[])row["TextureAnimation"]; | 1009 | prim.TextureAnimation = (Byte[])row["TextureAnimation"]; |
1010 | if (!row.IsNull("ParticleSystem")) | ||
1011 | prim.ParticleSystem = (Byte[])row["ParticleSystem"]; | ||
1006 | 1012 | ||
1007 | prim.RotationalVelocity = new Vector3( | 1013 | prim.RotationalVelocity = new Vector3( |
1008 | Convert.ToSingle(row["OmegaX"]), | 1014 | Convert.ToSingle(row["OmegaX"]), |
1009 | Convert.ToSingle(row["OmegaY"]), | 1015 | Convert.ToSingle(row["OmegaY"]), |
1010 | Convert.ToSingle(row["OmegaZ"]) | 1016 | Convert.ToSingle(row["OmegaZ"])); |
1011 | ); | ||
1012 | |||
1013 | // TODO: Rotation | ||
1014 | // OmegaX, OmegaY, OmegaZ | ||
1015 | 1017 | ||
1016 | prim.SetCameraEyeOffset(new Vector3( | 1018 | prim.SetCameraEyeOffset(new Vector3( |
1017 | Convert.ToSingle(row["CameraEyeOffsetX"]), | 1019 | Convert.ToSingle(row["CameraEyeOffsetX"]), |
@@ -1039,6 +1041,9 @@ VALUES | |||
1039 | prim.SalePrice = Convert.ToInt32(row["SalePrice"]); | 1041 | prim.SalePrice = Convert.ToInt32(row["SalePrice"]); |
1040 | prim.ObjectSaleType = Convert.ToByte(row["SaleType"]); | 1042 | prim.ObjectSaleType = Convert.ToByte(row["SaleType"]); |
1041 | 1043 | ||
1044 | if (!row.IsNull("ClickAction")) | ||
1045 | prim.ClickAction = Convert.ToByte(row["ClickAction"]); | ||
1046 | |||
1042 | return prim; | 1047 | return prim; |
1043 | } | 1048 | } |
1044 | 1049 | ||
@@ -1051,10 +1056,10 @@ VALUES | |||
1051 | { | 1056 | { |
1052 | PrimitiveBaseShape s = new PrimitiveBaseShape(); | 1057 | PrimitiveBaseShape s = new PrimitiveBaseShape(); |
1053 | s.Scale = new Vector3( | 1058 | s.Scale = new Vector3( |
1054 | Convert.ToSingle(row["ScaleX"]), | 1059 | Convert.ToSingle(row["ScaleX"]), |
1055 | Convert.ToSingle(row["ScaleY"]), | 1060 | Convert.ToSingle(row["ScaleY"]), |
1056 | Convert.ToSingle(row["ScaleZ"]) | 1061 | Convert.ToSingle(row["ScaleZ"])); |
1057 | ); | 1062 | |
1058 | // paths | 1063 | // paths |
1059 | s.PCode = Convert.ToByte(row["PCode"]); | 1064 | s.PCode = Convert.ToByte(row["PCode"]); |
1060 | s.PathBegin = Convert.ToUInt16(row["PathBegin"]); | 1065 | s.PathBegin = Convert.ToUInt16(row["PathBegin"]); |