diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLAvatarData.cs (renamed from OpenSim/Region/Application/HGCommands.cs) | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/OpenSim/Region/Application/HGCommands.cs b/OpenSim/Data/MSSQL/MSSQLAvatarData.cs index 7ae161d..4992183 100644 --- a/OpenSim/Region/Application/HGCommands.cs +++ b/OpenSim/Data/MSSQL/MSSQLAvatarData.cs | |||
@@ -27,34 +27,45 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | ||
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using System.Xml; | 32 | using System.Threading; |
32 | using log4net; | 33 | using log4net; |
33 | using Nini.Config; | 34 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | 36 | using System.Data.SqlClient; |
36 | using OpenSim.Framework.Console; | ||
37 | using OpenSim.Region.Framework; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | using OpenSim.Region.Framework.Scenes.Hypergrid; | ||
40 | 37 | ||
41 | namespace OpenSim | 38 | namespace OpenSim.Data.MSSQL |
42 | { | 39 | { |
43 | public class HGCommands | 40 | /// <summary> |
41 | /// A MSSQL Interface for Avatar Storage | ||
42 | /// </summary> | ||
43 | public class MSSQLAvatarData : MSSQLGenericTableHandler<AvatarBaseData>, | ||
44 | IAvatarData | ||
44 | { | 45 | { |
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | |||
48 | public MSSQLAvatarData(string connectionString, string realm) : | ||
49 | base(connectionString, realm, "Avatar") | ||
50 | { | ||
51 | } | ||
46 | 52 | ||
47 | public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager, | 53 | public bool Delete(UUID principalID, string name) |
48 | StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version) | ||
49 | { | 54 | { |
50 | HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager); | 55 | using (SqlConnection conn = new SqlConnection(m_ConnectionString)) |
56 | using (SqlCommand cmd = new SqlCommand()) | ||
57 | { | ||
51 | 58 | ||
52 | return | 59 | cmd.CommandText = String.Format("DELETE FROM {0} where [PrincipalID] = @PrincipalID and [Name] = @Name", m_Realm); |
53 | new HGScene( | 60 | cmd.Parameters.Add(m_database.CreateParameter("@PrincipalID", principalID.ToString())); |
54 | regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager, | 61 | cmd.Parameters.Add(m_database.CreateParameter("@Name", name)); |
55 | m_moduleLoader, false, m_configSettings.PhysicalPrim, | 62 | cmd.Connection = conn; |
56 | m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); | 63 | conn.Open(); |
57 | } | 64 | if (cmd.ExecuteNonQuery() > 0) |
65 | return true; | ||
58 | 66 | ||
67 | return false; | ||
68 | } | ||
69 | } | ||
59 | } | 70 | } |
60 | } | 71 | } |