diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLOfflineIMData.cs (renamed from OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs) | 67 |
1 files changed, 19 insertions, 48 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Data/MySQL/MySQLOfflineIMData.cs index d7198f0..252f358 100644 --- a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs +++ b/OpenSim/Data/MySQL/MySQLOfflineIMData.cs | |||
@@ -26,66 +26,37 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using System.Collections; |
30 | using log4net; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | |||
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Data.MySQL; | ||
35 | |||
36 | using OpenMetaverse; | ||
37 | using MySql.Data.MySqlClient; | ||
33 | 38 | ||
34 | namespace OpenSim.Region.Framework.Scenes.Scripting | 39 | namespace OpenSim.Data.MySQL |
35 | { | 40 | { |
36 | public class NullScriptHost : IScriptHost | 41 | public class MySQLOfflineIMData : MySQLGenericTableHandler<OfflineIMData>, IOfflineIMData |
37 | { | 42 | { |
38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | public MySQLOfflineIMData(string connectionString, string realm) |
39 | 44 | : base(connectionString, realm, "IM_Store") | |
40 | private Vector3 m_pos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); | ||
41 | |||
42 | public string Name | ||
43 | { | ||
44 | get { return "Object"; } | ||
45 | set { } | ||
46 | } | ||
47 | |||
48 | public string SitName | ||
49 | { | ||
50 | get { return String.Empty; } | ||
51 | set { } | ||
52 | } | ||
53 | |||
54 | public string TouchName | ||
55 | { | 45 | { |
56 | get { return String.Empty; } | ||
57 | set { } | ||
58 | } | 46 | } |
59 | 47 | ||
60 | public string Description | 48 | public void DeleteOld() |
61 | { | 49 | { |
62 | get { return String.Empty; } | 50 | uint now = (uint)Util.UnixTimeSinceEpoch(); |
63 | set { } | ||
64 | } | ||
65 | |||
66 | public UUID UUID | ||
67 | { | ||
68 | get { return UUID.Zero; } | ||
69 | } | ||
70 | |||
71 | public UUID OwnerID | ||
72 | { | ||
73 | get { return UUID.Zero; } | ||
74 | } | ||
75 | 51 | ||
76 | public UUID CreatorID | 52 | using (MySqlCommand cmd = new MySqlCommand()) |
77 | { | 53 | { |
78 | get { return UUID.Zero; } | 54 | cmd.CommandText = String.Format("delete from {0} where TMStamp < ?tstamp", m_Realm); |
79 | } | 55 | cmd.Parameters.AddWithValue("?tstamp", now - 14 * 24 * 60 * 60); // > 2 weeks old |
80 | 56 | ||
81 | public Vector3 AbsolutePosition | 57 | ExecuteNonQuery(cmd); |
82 | { | 58 | } |
83 | get { return m_pos; } | ||
84 | } | ||
85 | 59 | ||
86 | public void SetText(string text, Vector3 color, double alpha) | ||
87 | { | ||
88 | m_log.Warn("Tried to SetText "+text+" on NullScriptHost"); | ||
89 | } | 60 | } |
90 | } | 61 | } |
91 | } | 62 | } |