aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorMelanie2009-10-27 11:32:11 +0000
committerMelanie2009-10-27 11:32:11 +0000
commit31a848e97bd984ab0a85feca397ce419f6ae839a (patch)
tree4743f5eb7c12b3723ed4b986d19714d1b3a0a3ea /OpenSim/Data
parentCommented out instrumentation in ODEPrim.cs (diff)
parentFinally hunted down the Parallel deadlock. Packets were being handled asynchr... (diff)
downloadopensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.zip
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.gz
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.bz2
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/DataPluginFactory.cs15
-rw-r--r--OpenSim/Data/IPresenceData.cs55
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs3
-rw-r--r--OpenSim/Data/MySQL/MySQLLegacyRegionData.cs85
4 files changed, 107 insertions, 51 deletions
diff --git a/OpenSim/Data/DataPluginFactory.cs b/OpenSim/Data/DataPluginFactory.cs
index 718c6b2..841f71e 100644
--- a/OpenSim/Data/DataPluginFactory.cs
+++ b/OpenSim/Data/DataPluginFactory.cs
@@ -119,14 +119,15 @@ namespace OpenSim.Data
119 119
120 PluginLoaderParamFactory<T>(connect, out pluginInitialiser, out extensionPointPath); 120 PluginLoaderParamFactory<T>(connect, out pluginInitialiser, out extensionPointPath);
121 121
122 PluginLoader<T> loader = new PluginLoader<T>(pluginInitialiser); 122 using (PluginLoader<T> loader = new PluginLoader<T>(pluginInitialiser))
123 123 {
124 // loader will try to load all providers (MySQL, MSSQL, etc) 124 // loader will try to load all providers (MySQL, MSSQL, etc)
125 // unless it is constrainted to the correct "Provider" entry in the addin.xml 125 // unless it is constrainted to the correct "Provider" entry in the addin.xml
126 loader.Add(extensionPointPath, new PluginProviderFilter(provider)); 126 loader.Add(extensionPointPath, new PluginProviderFilter(provider));
127 loader.Load(); 127 loader.Load();
128 128
129 return loader.Plugins; 129 return loader.Plugins;
130 }
130 } 131 }
131 132
132 /// <summary> 133 /// <summary>
diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs
new file mode 100644
index 0000000..ca661a2
--- /dev/null
+++ b/OpenSim/Data/IPresenceData.cs
@@ -0,0 +1,55 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using OpenMetaverse;
31using OpenSim.Framework;
32
33namespace OpenSim.Data
34{
35 public class PresenceData
36 {
37 public UUID PrincipalID;
38 public UUID RegionID;
39 public Dictionary<string, object> Data;
40 }
41
42 /// <summary>
43 /// An interface for connecting to the authentication datastore
44 /// </summary>
45 public interface IPresenceData
46 {
47 bool Store(PresenceData data);
48
49 PresenceData Get(UUID principalID);
50
51 bool SetDataItem(UUID principalID, string item, string value);
52
53 bool Delete(UUID regionID);
54 }
55}
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index fc05d1d..4d49733 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -167,9 +167,6 @@ namespace OpenSim.Data.MySQL
167 asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); 167 asset.Temporary = Convert.ToBoolean(dbReader["temporary"]);
168 } 168 }
169 } 169 }
170
171 if (asset != null)
172 UpdateAccessTime(asset);
173 } 170 }
174 catch (Exception e) 171 catch (Exception e)
175 { 172 {
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index 801d6b9..a807948 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -66,22 +66,26 @@ namespace OpenSim.Data.MySQL
66 Migration m = new Migration(m_Connection, assem, "RegionStore"); 66 Migration m = new Migration(m_Connection, assem, "RegionStore");
67 m.Update(); 67 m.Update();
68 68
69 // NOTE: This is a very slow query that times out on regions with a lot of prims.
70 // I'm told that it is no longer relevant so it's commented out now, but if it
71 // is relevant it should be added as a console command instead of part of the
72 // startup phase
69 // Clean dropped attachments 73 // Clean dropped attachments
70 // 74 //
71 try 75 //try
72 { 76 //{
73 using (MySqlCommand cmd = m_Connection.CreateCommand()) 77 // using (MySqlCommand cmd = m_Connection.CreateCommand())
74 { 78 // {
75 cmd.CommandText = "delete from prims, primshapes using prims " + 79 // cmd.CommandText = "delete from prims, primshapes using prims " +
76 "left join primshapes on prims.uuid = primshapes.uuid " + 80 // "left join primshapes on prims.uuid = primshapes.uuid " +
77 "where PCode = 9 and State <> 0"; 81 // "where PCode = 9 and State <> 0";
78 ExecuteNonQuery(cmd); 82 // ExecuteNonQuery(cmd);
79 } 83 // }
80 } 84 //}
81 catch (MySqlException ex) 85 //catch (MySqlException ex)
82 { 86 //{
83 m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message); 87 // m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
84 } 88 //}
85 } 89 }
86 90
87 private IDataReader ExecuteReader(MySqlCommand c) 91 private IDataReader ExecuteReader(MySqlCommand c)
@@ -1430,37 +1434,36 @@ namespace OpenSim.Data.MySQL
1430 { 1434 {
1431 PrimitiveBaseShape s = new PrimitiveBaseShape(); 1435 PrimitiveBaseShape s = new PrimitiveBaseShape();
1432 s.Scale = new Vector3( 1436 s.Scale = new Vector3(
1433 Convert.ToSingle(row["ScaleX"]), 1437 (float)(double)row["ScaleX"],
1434 Convert.ToSingle(row["ScaleY"]), 1438 (float)(double)row["ScaleY"],
1435 Convert.ToSingle(row["ScaleZ"]) 1439 (float)(double)row["ScaleZ"]
1436 ); 1440 );
1437 // paths 1441 // paths
1438 s.PCode = Convert.ToByte(row["PCode"]); 1442 s.PCode = (byte)(int)row["PCode"];
1439 s.PathBegin = Convert.ToUInt16(row["PathBegin"]); 1443 s.PathBegin = (ushort)(int)row["PathBegin"];
1440 s.PathEnd = Convert.ToUInt16(row["PathEnd"]); 1444 s.PathEnd = (ushort)(int)row["PathEnd"];
1441 s.PathScaleX = Convert.ToByte(row["PathScaleX"]); 1445 s.PathScaleX = (byte)(int)row["PathScaleX"];
1442 s.PathScaleY = Convert.ToByte(row["PathScaleY"]); 1446 s.PathScaleY = (byte)(int)row["PathScaleY"];
1443 s.PathShearX = Convert.ToByte(row["PathShearX"]); 1447 s.PathShearX = (byte)(int)row["PathShearX"];
1444 s.PathShearY = Convert.ToByte(row["PathShearY"]); 1448 s.PathShearY = (byte)(int)row["PathShearY"];
1445 s.PathSkew = Convert.ToSByte(row["PathSkew"]); 1449 s.PathSkew = (sbyte)(int)row["PathSkew"];
1446 s.PathCurve = Convert.ToByte(row["PathCurve"]); 1450 s.PathCurve = (byte)(int)row["PathCurve"];
1447 s.PathRadiusOffset = Convert.ToSByte(row["PathRadiusOffset"]); 1451 s.PathRadiusOffset = (sbyte)(int)row["PathRadiusOffset"];
1448 s.PathRevolutions = Convert.ToByte(row["PathRevolutions"]); 1452 s.PathRevolutions = (byte)(int)row["PathRevolutions"];
1449 s.PathTaperX = Convert.ToSByte(row["PathTaperX"]); 1453 s.PathTaperX = (sbyte)(int)row["PathTaperX"];
1450 s.PathTaperY = Convert.ToSByte(row["PathTaperY"]); 1454 s.PathTaperY = (sbyte)(int)row["PathTaperY"];
1451 s.PathTwist = Convert.ToSByte(row["PathTwist"]); 1455 s.PathTwist = (sbyte)(int)row["PathTwist"];
1452 s.PathTwistBegin = Convert.ToSByte(row["PathTwistBegin"]); 1456 s.PathTwistBegin = (sbyte)(int)row["PathTwistBegin"];
1453 // profile 1457 // profile
1454 s.ProfileBegin = Convert.ToUInt16(row["ProfileBegin"]); 1458 s.ProfileBegin = (ushort)(int)row["ProfileBegin"];
1455 s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]); 1459 s.ProfileEnd = (ushort)(int)row["ProfileEnd"];
1456 s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); 1460 s.ProfileCurve = (byte)(int)row["ProfileCurve"];
1457 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); 1461 s.ProfileHollow = (ushort)(int)row["ProfileHollow"];
1458 byte[] textureEntry = (byte[]) row["Texture"]; 1462 s.TextureEntry = (byte[])row["Texture"];
1459 s.TextureEntry = textureEntry;
1460 1463
1461 s.ExtraParams = (byte[]) row["ExtraParams"]; 1464 s.ExtraParams = (byte[])row["ExtraParams"];
1462 1465
1463 s.State = Convert.ToByte(row["State"]); 1466 s.State = (byte)(int)row["State"];
1464 1467
1465 return s; 1468 return s;
1466 } 1469 }