From 985e0b765aca8cff5982c30935a2412e4537bb55 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Fri, 13 Jul 2007 19:27:15 +0000
Subject: * Obsoleted ILocalStorage * Added IRegionDataStore * Added OnBackup
event to EventManager
---
.../Framework/General/Interfaces/ILocalStorage.cs | 1 +
.../Environment/Interfaces/IRegionDataStore.cs | 63 ++++++++++++++++++++++
OpenSim/Region/Environment/Scenes/SceneEvents.cs | 11 ++++
3 files changed, 75 insertions(+)
create mode 100644 OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs
index dbdb25d..cd09945 100644
--- a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs
+++ b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs
@@ -34,6 +34,7 @@ namespace OpenSim.Framework.Interfaces
///
/// ILocalStorage. Really hacked together right now needs cleaning up
///
+ [System.Obsolete("Redundant, use IRegionDataStore instead")]
public interface ILocalStorage
{
void Initialise(string datastore);
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
new file mode 100644
index 0000000..ff809b4
--- /dev/null
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) Contributors, http://www.openmetaverse.org/
+* See CONTRIBUTORS.TXT for a full list of copyright holders.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+* * Neither the name of the OpenSim Project nor the
+* names of its contributors may be used to endorse or promote products
+* derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+using libsecondlife;
+
+using OpenSim.Framework.Types;
+using OpenSim.Region;
+using OpenSim.Region.Environment;
+using OpenSim.Region.Environment.Scenes;
+
+using System.Collections.Generic;
+
+namespace OpenSim.Region.Interfaces
+{
+ public interface IRegionDataStore
+ {
+ ///
+ /// Initialises the data storage engine
+ ///
+ /// The file to save the database to (may not be applicable)
+ /// The name of the database to store to (may not be applicable)
+ void Initialise(string filename, string dbname);
+
+ void StoreObject(SceneObject obj);
+ void DeleteObject(LLUUID uuid);
+
+ List LoadObjects();
+
+ void StoreTerrain(double[,] terrain);
+ double[,] LoadTerrain();
+
+ void StoreParcel(OpenSim.Region.Environment.Parcel Parcel);
+ void RemoveParcel(uint ID);
+ List LoadParcels();
+
+ void Shutdown();
+ }
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index cfe3e01..deecfd5 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -10,6 +10,9 @@ namespace OpenSim.Region.Environment.Scenes
public delegate void OnFrameDelegate();
public event OnFrameDelegate OnFrame;
+ public delegate void OnBackupDelegate(Interfaces.IRegionDataStore datastore);
+ public event OnBackupDelegate OnBackup;
+
public delegate void OnNewPresenceDelegate(ScenePresence presence);
public event OnNewPresenceDelegate OnNewPresence;
@@ -37,5 +40,13 @@ namespace OpenSim.Region.Environment.Scenes
OnRemovePresence(uuid);
}
}
+
+ public void TriggerOnBackup(Interfaces.IRegionDataStore dstore)
+ {
+ if (OnBackup != null)
+ {
+ OnBackup(dstore);
+ }
+ }
}
}
--
cgit v1.1