diff options
author | Adam Frisby | 2008-03-18 14:54:44 +0000 |
---|---|---|
committer | Adam Frisby | 2008-03-18 14:54:44 +0000 |
commit | aad69b90186b1edd259479c776c1b19be78224fb (patch) | |
tree | e3802aafc793493f65a12c68130055c589db6137 /OpenSim/Framework/Data.MySQL | |
parent | Formatting cleanup. Minor refactoring. (diff) | |
download | opensim-SC-aad69b90186b1edd259479c776c1b19be78224fb.zip opensim-SC-aad69b90186b1edd259479c776c1b19be78224fb.tar.gz opensim-SC-aad69b90186b1edd259479c776c1b19be78224fb.tar.bz2 opensim-SC-aad69b90186b1edd259479c776c1b19be78224fb.tar.xz |
* Applying Mantis Patch #518.2 - State not persisted in MySQL DataStore
Diffstat (limited to 'OpenSim/Framework/Data.MySQL')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index 3a20b05..f4c839e 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | |||
@@ -718,6 +718,7 @@ namespace OpenSim.Framework.Data.MySQL | |||
718 | createCol(shapes, "ProfileEnd", typeof (Int32)); | 718 | createCol(shapes, "ProfileEnd", typeof (Int32)); |
719 | createCol(shapes, "ProfileCurve", typeof (Int32)); | 719 | createCol(shapes, "ProfileCurve", typeof (Int32)); |
720 | createCol(shapes, "ProfileHollow", typeof (Int32)); | 720 | createCol(shapes, "ProfileHollow", typeof (Int32)); |
721 | createCol(shapes, "State", typeof(Int32)); | ||
721 | createCol(shapes, "Texture", typeof (Byte[])); | 722 | createCol(shapes, "Texture", typeof (Byte[])); |
722 | createCol(shapes, "ExtraParams", typeof (Byte[])); | 723 | createCol(shapes, "ExtraParams", typeof (Byte[])); |
723 | 724 | ||
@@ -1137,6 +1138,24 @@ namespace OpenSim.Framework.Data.MySQL | |||
1137 | 1138 | ||
1138 | s.ExtraParams = (byte[]) row["ExtraParams"]; | 1139 | s.ExtraParams = (byte[]) row["ExtraParams"]; |
1139 | 1140 | ||
1141 | try | ||
1142 | { | ||
1143 | s.State = Convert.ToByte(row["State"]); | ||
1144 | } | ||
1145 | catch (InvalidCastException) | ||
1146 | { | ||
1147 | // Database table was created before we got here and needs to be created! :P | ||
1148 | |||
1149 | using ( | ||
1150 | MySqlCommand cmd = | ||
1151 | new MySqlCommand( | ||
1152 | "ALTER TABLE `primshapes` ADD COLUMN `State` int NOT NULL default 0;", | ||
1153 | m_connection)) | ||
1154 | { | ||
1155 | cmd.ExecuteNonQuery(); | ||
1156 | } | ||
1157 | } | ||
1158 | |||
1140 | return s; | 1159 | return s; |
1141 | } | 1160 | } |
1142 | 1161 | ||
@@ -1173,6 +1192,22 @@ namespace OpenSim.Framework.Data.MySQL | |||
1173 | row["ProfileHollow"] = s.ProfileHollow; | 1192 | row["ProfileHollow"] = s.ProfileHollow; |
1174 | row["Texture"] = s.TextureEntry; | 1193 | row["Texture"] = s.TextureEntry; |
1175 | row["ExtraParams"] = s.ExtraParams; | 1194 | row["ExtraParams"] = s.ExtraParams; |
1195 | try | ||
1196 | { | ||
1197 | row["State"] = s.State; | ||
1198 | } | ||
1199 | catch (MySqlException) | ||
1200 | { | ||
1201 | // Database table was created before we got here and needs to be created! :P | ||
1202 | using ( | ||
1203 | MySqlCommand cmd = | ||
1204 | new MySqlCommand( | ||
1205 | "ALTER TABLE `primshapes` ADD COLUMN `State` int NOT NULL default 0;", | ||
1206 | m_connection)) | ||
1207 | { | ||
1208 | cmd.ExecuteNonQuery(); | ||
1209 | } | ||
1210 | } | ||
1176 | } | 1211 | } |
1177 | 1212 | ||
1178 | private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID) | 1213 | private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID) |