aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-08 02:40:20 +0000
committerMelanie Thielker2008-09-08 02:40:20 +0000
commit490ac0be005a989c86ebde62aad137fd2da7cbd8 (patch)
tree0bd15a47dea6d2dea470d50779603970a0493fd9 /OpenSim/Data
parentImplement llEjectFromLand. (diff)
downloadopensim-SC_OLD-490ac0be005a989c86ebde62aad137fd2da7cbd8.zip
opensim-SC_OLD-490ac0be005a989c86ebde62aad137fd2da7cbd8.tar.gz
opensim-SC_OLD-490ac0be005a989c86ebde62aad137fd2da7cbd8.tar.bz2
opensim-SC_OLD-490ac0be005a989c86ebde62aad137fd2da7cbd8.tar.xz
Implement proper persistence of the following prim properties:
Floating text, Rotation, Texture animation, Particle System This will make "Eye Candy" scripts work without modification in XEngine. The use of the CHANGED_REGION_RESTART hack is no longer needed. Implemented in MySQL only, hovertext also in SQLite.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs20
-rw-r--r--OpenSim/Data/MySQL/Resources/017_RegionStore.sql9
-rw-r--r--OpenSim/Data/SQLite/Resources/009_RegionStore.sql8
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs9
4 files changed, 43 insertions, 3 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 9552ba1..b7fc70b 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -31,6 +31,7 @@ using System.Data;
31using System.IO; 31using System.IO;
32using System.Reflection; 32using System.Reflection;
33using System.Threading; 33using System.Threading;
34using System.Drawing;
34using OpenMetaverse; 35using OpenMetaverse;
35using log4net; 36using log4net;
36using MySql.Data.MySqlClient; 37using MySql.Data.MySqlClient;
@@ -858,6 +859,10 @@ namespace OpenSim.Data.MySQL
858 createCol(prims, "SceneGroupID", typeof (String)); 859 createCol(prims, "SceneGroupID", typeof (String));
859 // various text fields 860 // various text fields
860 createCol(prims, "Text", typeof (String)); 861 createCol(prims, "Text", typeof (String));
862 createCol(prims, "ColorR", typeof (Int32));
863 createCol(prims, "ColorG", typeof (Int32));
864 createCol(prims, "ColorB", typeof (Int32));
865 createCol(prims, "ColorA", typeof (Int32));
861 createCol(prims, "Description", typeof (String)); 866 createCol(prims, "Description", typeof (String));
862 createCol(prims, "SitName", typeof (String)); 867 createCol(prims, "SitName", typeof (String));
863 createCol(prims, "TouchName", typeof (String)); 868 createCol(prims, "TouchName", typeof (String));
@@ -912,6 +917,7 @@ namespace OpenSim.Data.MySQL
912 createCol(prims, "LoopedSound", typeof(String)); 917 createCol(prims, "LoopedSound", typeof(String));
913 createCol(prims, "LoopedSoundGain", typeof(Double)); 918 createCol(prims, "LoopedSoundGain", typeof(Double));
914 createCol(prims, "TextureAnimation", typeof(Byte[])); 919 createCol(prims, "TextureAnimation", typeof(Byte[]));
920 createCol(prims, "ParticleSystem", typeof(Byte[]));
915 921
916 createCol(prims, "OmegaX", typeof (Double)); 922 createCol(prims, "OmegaX", typeof (Double));
917 createCol(prims, "OmegaY", typeof (Double)); 923 createCol(prims, "OmegaY", typeof (Double));
@@ -1109,6 +1115,10 @@ namespace OpenSim.Data.MySQL
1109 prim.Name = (String) row["Name"]; 1115 prim.Name = (String) row["Name"];
1110 // various text fields 1116 // various text fields
1111 prim.Text = (String) row["Text"]; 1117 prim.Text = (String) row["Text"];
1118 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]),
1119 Convert.ToInt32(row["ColorR"]),
1120 Convert.ToInt32(row["ColorG"]),
1121 Convert.ToInt32(row["ColorB"]));
1112 prim.Description = (String) row["Description"]; 1122 prim.Description = (String) row["Description"];
1113 prim.SitName = (String) row["SitName"]; 1123 prim.SitName = (String) row["SitName"];
1114 prim.TouchName = (String) row["TouchName"]; 1124 prim.TouchName = (String) row["TouchName"];
@@ -1180,6 +1190,8 @@ namespace OpenSim.Data.MySQL
1180 1190
1181 if (!row.IsNull("TextureAnimation")) 1191 if (!row.IsNull("TextureAnimation"))
1182 prim.TextureAnimation = (Byte[])row["TextureAnimation"]; 1192 prim.TextureAnimation = (Byte[])row["TextureAnimation"];
1193 if (!row.IsNull("ParticleSystem"))
1194 prim.ParticleSystem = (Byte[])row["ParticleSystem"];
1183 1195
1184 prim.RotationalVelocity = new Vector3( 1196 prim.RotationalVelocity = new Vector3(
1185 Convert.ToSingle(row["OmegaX"]), 1197 Convert.ToSingle(row["OmegaX"]),
@@ -1187,9 +1199,6 @@ namespace OpenSim.Data.MySQL
1187 Convert.ToSingle(row["OmegaZ"]) 1199 Convert.ToSingle(row["OmegaZ"])
1188 ); 1200 );
1189 1201
1190 // TODO: Rotation
1191 // OmegaX, OmegaY, OmegaZ
1192
1193 prim.SetCameraEyeOffset(new Vector3( 1202 prim.SetCameraEyeOffset(new Vector3(
1194 Convert.ToSingle(row["CameraEyeOffsetX"]), 1203 Convert.ToSingle(row["CameraEyeOffsetX"]),
1195 Convert.ToSingle(row["CameraEyeOffsetY"]), 1204 Convert.ToSingle(row["CameraEyeOffsetY"]),
@@ -1419,6 +1428,10 @@ namespace OpenSim.Data.MySQL
1419 // the UUID of the root part for this SceneObjectGroup 1428 // the UUID of the root part for this SceneObjectGroup
1420 // various text fields 1429 // various text fields
1421 row["Text"] = prim.Text; 1430 row["Text"] = prim.Text;
1431 row["ColorR"] = prim.Color.R;
1432 row["ColorG"] = prim.Color.G;
1433 row["ColorB"] = prim.Color.B;
1434 row["ColorA"] = prim.Color.A;
1422 row["Description"] = prim.Description; 1435 row["Description"] = prim.Description;
1423 row["SitName"] = prim.SitName; 1436 row["SitName"] = prim.SitName;
1424 row["TouchName"] = prim.TouchName; 1437 row["TouchName"] = prim.TouchName;
@@ -1485,6 +1498,7 @@ namespace OpenSim.Data.MySQL
1485 } 1498 }
1486 1499
1487 row["TextureAnimation"] = prim.TextureAnimation; 1500 row["TextureAnimation"] = prim.TextureAnimation;
1501 row["ParticleSystem"] = prim.ParticleSystem;
1488 1502
1489 row["OmegaX"] = prim.RotationalVelocity.X; 1503 row["OmegaX"] = prim.RotationalVelocity.X;
1490 row["OmegaY"] = prim.RotationalVelocity.Y; 1504 row["OmegaY"] = prim.RotationalVelocity.Y;
diff --git a/OpenSim/Data/MySQL/Resources/017_RegionStore.sql b/OpenSim/Data/MySQL/Resources/017_RegionStore.sql
new file mode 100644
index 0000000..0304f30
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/017_RegionStore.sql
@@ -0,0 +1,9 @@
1BEGIN;
2
3ALTER TABLE prims ADD COLUMN ColorR integer not null default 0;
4ALTER TABLE prims ADD COLUMN ColorG integer not null default 0;
5ALTER TABLE prims ADD COLUMN ColorB integer not null default 0;
6ALTER TABLE prims ADD COLUMN ColorA integer not null default 0;
7ALTER TABLE prims ADD COLUMN ParticleSystem blob;
8
9COMMIT;
diff --git a/OpenSim/Data/SQLite/Resources/009_RegionStore.sql b/OpenSim/Data/SQLite/Resources/009_RegionStore.sql
new file mode 100644
index 0000000..1f40548
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/009_RegionStore.sql
@@ -0,0 +1,8 @@
1BEGIN;
2
3ALTER TABLE prims ADD COLUMN ColorR integer not null default 0;
4ALTER TABLE prims ADD COLUMN ColorG integer not null default 0;
5ALTER TABLE prims ADD COLUMN ColorB integer not null default 0;
6ALTER TABLE prims ADD COLUMN ColorA integer not null default 0;
7
8COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index bb441f6..cfb2023 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -31,6 +31,7 @@ using System.Data;
31using System.IO; 31using System.IO;
32using System.Reflection; 32using System.Reflection;
33using System.Threading; 33using System.Threading;
34using System.Drawing;
34using OpenMetaverse; 35using OpenMetaverse;
35using log4net; 36using log4net;
36using Mono.Data.SqliteClient; 37using Mono.Data.SqliteClient;
@@ -666,6 +667,10 @@ namespace OpenSim.Data.SQLite
666 createCol(prims, "SceneGroupID", typeof (String)); 667 createCol(prims, "SceneGroupID", typeof (String));
667 // various text fields 668 // various text fields
668 createCol(prims, "Text", typeof (String)); 669 createCol(prims, "Text", typeof (String));
670 createCol(prims, "ColorR", typeof (Int32));
671 createCol(prims, "ColorG", typeof (Int32));
672 createCol(prims, "ColorB", typeof (Int32));
673 createCol(prims, "ColorA", typeof (Int32));
669 createCol(prims, "Description", typeof (String)); 674 createCol(prims, "Description", typeof (String));
670 createCol(prims, "SitName", typeof (String)); 675 createCol(prims, "SitName", typeof (String));
671 createCol(prims, "TouchName", typeof (String)); 676 createCol(prims, "TouchName", typeof (String));
@@ -890,6 +895,10 @@ namespace OpenSim.Data.SQLite
890 prim.Name = (String) row["Name"]; 895 prim.Name = (String) row["Name"];
891 // various text fields 896 // various text fields
892 prim.Text = (String) row["Text"]; 897 prim.Text = (String) row["Text"];
898 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]),
899 Convert.ToInt32(row["ColorR"]),
900 Convert.ToInt32(row["ColorG"]),
901 Convert.ToInt32(row["ColorB"]));
893 prim.Description = (String) row["Description"]; 902 prim.Description = (String) row["Description"];
894 prim.SitName = (String) row["SitName"]; 903 prim.SitName = (String) row["SitName"];
895 prim.TouchName = (String) row["TouchName"]; 904 prim.TouchName = (String) row["TouchName"];