diff options
author | Melanie | 2010-01-10 02:13:55 +0000 |
---|---|---|
committer | Melanie | 2010-01-10 02:13:55 +0000 |
commit | e189b3056fff7223f6474bc26af559ef32891fa6 (patch) | |
tree | 3ee93139513fbf26525c8bd9aa3c8cde56f094d4 | |
parent | Make the new API return only the regions that are marked online (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Data/MySQL/Resources/006_GridStore.sql | 5 | ||||
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 2 |
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 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE `regions` ADD COLUMN `last_seen` integer NOT NULL DEFAULT 0; | ||
4 | |||
5 | COMMIT; | ||
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); |