diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLGridUserData.cs (renamed from OpenSim/Region/Communications/Hypergrid/HGUserDataPlugin.cs) | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/OpenSim/Region/Communications/Hypergrid/HGUserDataPlugin.cs b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs index 4b8fc26..9993720 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGUserDataPlugin.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs | |||
@@ -26,47 +26,43 @@ | |||
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 System.Data.SqlClient; |
41 | using OpenSim.Framework.Communications.Clients; | ||
42 | using OpenSim.Region.Communications.OGS1; | ||
43 | 37 | ||
44 | namespace OpenSim.Region.Communications.Hypergrid | 38 | namespace OpenSim.Data.MSSQL |
45 | { | 39 | { |
46 | public class HGUserDataPlugin : OGS1UserDataPlugin | 40 | /// <summary> |
41 | /// A MSSQL Interface for Avatar Storage | ||
42 | /// </summary> | ||
43 | public class MSSQLGridUserData : MSSQLGenericTableHandler<GridUserData>, | ||
44 | IGridUserData | ||
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 MSSQLGridUserData(string connectionString, string realm) : |
51 | 49 | base(connectionString, realm, "UserGrid") | |
52 | public HGUserDataPlugin() | ||
53 | { | 50 | { |
54 | } | 51 | } |
55 | 52 | ||
56 | public HGUserDataPlugin(CommunicationsManager commsManager, HGUserServices userServices) | 53 | public GridUserData GetGridUserData(string userID) |
57 | { | 54 | { |
58 | m_log.DebugFormat("[HG USER SERVICES]: {0} initialized", Name); | 55 | GridUserData[] ret = Get("UserID", userID); |
59 | m_commsManager = commsManager; | 56 | |
60 | m_UserServices = userServices; | 57 | if (ret.Length == 0) |
58 | return null; | ||
59 | |||
60 | return ret[0]; | ||
61 | } | 61 | } |
62 | 62 | ||
63 | protected override string GetUserServerURL(UUID userID) | 63 | public bool StoreGridUserData(GridUserData data) |
64 | { | 64 | { |
65 | string url = string.Empty; | 65 | return Store(data); |
66 | if (m_UserServices.IsForeignUser(userID, out url)) | ||
67 | return url; | ||
68 | return m_commsManager.NetworkServersInfo.UserURL; | ||
69 | } | 66 | } |
70 | |||
71 | } | 67 | } |
72 | } | 68 | } |