diff options
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
31 | using System.Net; | 30 | using System.Data; |
32 | using System.Reflection; | 31 | using System.Reflection; |
33 | using System.Text.RegularExpressions; | 32 | using System.Threading; |
34 | using System.Xml.Serialization; | ||
35 | using log4net; | 33 | using log4net; |
36 | using Nwc.XmlRpc; | ||
37 | using OpenMetaverse; | 34 | using OpenMetaverse; |
38 | using OpenSim.Data; | ||
39 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | 36 | using MySql.Data.MySqlClient; |
41 | using OpenSim.Framework.Communications.Clients; | ||
42 | using OpenSim.Region.Communications.OGS1; | ||
43 | 37 | ||
44 | namespace OpenSim.Region.Communications.Hypergrid | 38 | namespace 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 | } |