aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-01-10 02:13:55 +0000
committerMelanie2010-01-10 02:13:55 +0000
commite189b3056fff7223f6474bc26af559ef32891fa6 (patch)
tree3ee93139513fbf26525c8bd9aa3c8cde56f094d4 /OpenSim
parentMake the new API return only the regions that are marked online (diff)
downloadopensim-SC-e189b3056fff7223f6474bc26af559ef32891fa6.zip
opensim-SC-e189b3056fff7223f6474bc26af559ef32891fa6.tar.gz
opensim-SC-e189b3056fff7223f6474bc26af559ef32891fa6.tar.bz2
opensim-SC-e189b3056fff7223f6474bc26af559ef32891fa6.tar.xz
Add last_seen field to regions table
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/MySQL/Resources/006_GridStore.sql5
-rw-r--r--OpenSim/Services/GridService/GridService.cs2
2 files changed, 7 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/Resources/006_GridStore.sql b/OpenSim/Data/MySQL/Resources/006_GridStore.sql
new file mode 100644
index 0000000..91322d6
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/006_GridStore.sql
@@ -0,0 +1,5 @@
1BEGIN;
2
3ALTER TABLE `regions` ADD COLUMN `last_seen` integer NOT NULL DEFAULT 0;
4
5COMMIT;
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 3ae51e4..9bf986e 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -139,6 +139,7 @@ namespace OpenSim.Services.GridService
139 139
140 try 140 try
141 { 141 {
142 rdata.Data["last_seen"] = Util.UnixTimeSinceEpoch();
142 m_Database.Store(rdata); 143 m_Database.Store(rdata);
143 } 144 }
144 catch (Exception e) 145 catch (Exception e)
@@ -164,6 +165,7 @@ namespace OpenSim.Services.GridService
164 int flags = Convert.ToInt32(region.Data["flags"]); 165 int flags = Convert.ToInt32(region.Data["flags"]);
165 flags &= ~(int)OpenSim.Data.RegionFlags.RegionOnline; 166 flags &= ~(int)OpenSim.Data.RegionFlags.RegionOnline;
166 region.Data["flags"] = flags.ToString(); 167 region.Data["flags"] = flags.ToString();
168 region.Data["last_seen"] = Util.UnixTimeSinceEpoch();
167 try 169 try
168 { 170 {
169 m_Database.Store(region); 171 m_Database.Store(region);