Add last_seen field to regions table

slimupdates
Melanie 2010-01-10 02:13:55 +00:00
parent 21de921b95
commit e189b3056f
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,5 @@
BEGIN;
ALTER TABLE `regions` ADD COLUMN `last_seen` integer NOT NULL DEFAULT 0;
COMMIT;

View File

@ -139,6 +139,7 @@ namespace OpenSim.Services.GridService
try try
{ {
rdata.Data["last_seen"] = Util.UnixTimeSinceEpoch();
m_Database.Store(rdata); m_Database.Store(rdata);
} }
catch (Exception e) catch (Exception e)
@ -164,6 +165,7 @@ namespace OpenSim.Services.GridService
int flags = Convert.ToInt32(region.Data["flags"]); int flags = Convert.ToInt32(region.Data["flags"]);
flags &= ~(int)OpenSim.Data.RegionFlags.RegionOnline; flags &= ~(int)OpenSim.Data.RegionFlags.RegionOnline;
region.Data["flags"] = flags.ToString(); region.Data["flags"] = flags.ToString();
region.Data["last_seen"] = Util.UnixTimeSinceEpoch();
try try
{ {
m_Database.Store(region); m_Database.Store(region);