aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLAvatarData.cs
diff options
context:
space:
mode:
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
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Data;
30using System.Reflection; 31using System.Reflection;
31using System.Xml; 32using System.Threading;
32using log4net; 33using log4net;
33using Nini.Config; 34using OpenMetaverse;
34using OpenSim.Framework; 35using OpenSim.Framework;
35using OpenSim.Framework.Communications; 36using System.Data.SqlClient;
36using OpenSim.Framework.Console;
37using OpenSim.Region.Framework;
38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Region.Framework.Scenes.Hypergrid;
40 37
41namespace OpenSim 38namespace 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}