aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLAvatarData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLAvatarData.cs (renamed from OpenSim/Region/Communications/Hypergrid/HGUserDataPlugin.cs)47
1 files changed, 21 insertions, 26 deletions
diff --git a/OpenSim/Region/Communications/Hypergrid/HGUserDataPlugin.cs b/OpenSim/Data/MySQL/MySQLAvatarData.cs
index 4b8fc26..5611302 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGUserDataPlugin.cs
+++ b/OpenSim/Data/MySQL/MySQLAvatarData.cs
@@ -26,47 +26,42 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
30using System.Collections.Generic; 29using System.Collections.Generic;
31using System.Net; 30using System.Data;
32using System.Reflection; 31using System.Reflection;
33using System.Text.RegularExpressions; 32using System.Threading;
34using System.Xml.Serialization;
35using log4net; 33using log4net;
36using Nwc.XmlRpc;
37using OpenMetaverse; 34using OpenMetaverse;
38using OpenSim.Data;
39using OpenSim.Framework; 35using OpenSim.Framework;
40using OpenSim.Framework.Communications; 36using MySql.Data.MySqlClient;
41using OpenSim.Framework.Communications.Clients;
42using OpenSim.Region.Communications.OGS1;
43 37
44namespace OpenSim.Region.Communications.Hypergrid 38namespace OpenSim.Data.MySQL
45{ 39{
46 public class HGUserDataPlugin : OGS1UserDataPlugin 40 /// <summary>
41 /// A MySQL Interface for the Grid Server
42 /// </summary>
43 public class MySQLAvatarData : MySQLGenericTableHandler<AvatarBaseData>,
44 IAvatarData
47 { 45 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 47
50 HGUserServices m_UserServices; 48 public MySQLAvatarData(string connectionString, string realm) :
51 49 base(connectionString, realm, "Avatar")
52 public HGUserDataPlugin()
53 { 50 {
54 } 51 }
55 52
56 public HGUserDataPlugin(CommunicationsManager commsManager, HGUserServices userServices) 53 public bool Delete(UUID principalID, string name)
57 { 54 {
58 m_log.DebugFormat("[HG USER SERVICES]: {0} initialized", Name); 55 MySqlCommand cmd = new MySqlCommand();
59 m_commsManager = commsManager;
60 m_UserServices = userServices;
61 }
62 56
63 protected override string GetUserServerURL(UUID userID) 57 cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm);
64 { 58 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
65 string url = string.Empty; 59 cmd.Parameters.AddWithValue("?Name", name);
66 if (m_UserServices.IsForeignUser(userID, out url)) 60
67 return url; 61 if (ExecuteNonQuery(cmd) > 0)
68 return m_commsManager.NetworkServersInfo.UserURL; 62 return true;
69 }
70 63
64 return false;
65 }
71 } 66 }
72} 67}