diff --git a/addon-modules/0Data/PGSQL/PGSQLAssetData.cs b/addon-modules/0Data/PGSQL/PGSQLAssetData.cs
new file mode 100644
index 0000000000..bad5d37b80
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLAssetData.cs
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Reflection;
+using System.Collections.Generic;
+using log4net;
+
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// An asset storage interface for the PGSQL database system
+ ///
+ public class PGSQLAssetData : OpenSim.Data.PGSQL.PGSQLAssetData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLAuthenticationData.cs b/addon-modules/0Data/PGSQL/PGSQLAuthenticationData.cs
new file mode 100644
index 0000000000..d4f2de6229
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLAuthenticationData.cs
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+using OpenMetaverse;
+using Npgsql;
+
+using OpenSim.Framework;
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ public class PGSQLAuthenticationData : OpenSim.Data.PGSQL.PGSQLAuthenticationData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLAuthenticationData(string connectionString, string realm)
+ : base(connectionString, realm)
+ {
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLAvatarData.cs b/addon-modules/0Data/PGSQL/PGSQLAvatarData.cs
new file mode 100644
index 0000000000..d2fddce76c
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLAvatarData.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections.Generic;
+using System.Reflection;
+using log4net;
+using Npgsql;
+
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A SQLite Interface for Avatar Data
+ ///
+ public class PGSQLAvatarData : OpenSim.Data.PGSQL.PGSQLAvatarData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLAvatarData(string connectionString, string realm) :
+ base(connectionString, realm)
+ {
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLEstateData.cs b/addon-modules/0Data/PGSQL/PGSQLEstateData.cs
new file mode 100644
index 0000000000..172b822fe6
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLEstateData.cs
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections.Generic;
+using System.Reflection;
+using Npgsql;
+
+namespace Diva.Data.PGSQL
+{
+ public class PGSQLEstateStore : OpenSim.Data.PGSQL.PGSQLEstateStore
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLEstateStore() : base()
+ {
+ }
+
+ public PGSQLEstateStore(string connectionString) : base(connectionString)
+ {
+ }
+
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLFriendsData.cs b/addon-modules/0Data/PGSQL/PGSQLFriendsData.cs
new file mode 100644
index 0000000000..e83596fa66
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLFriendsData.cs
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ public class PGSQLFriendsData : OpenSim.Data.PGSQL.PGSQLFriendsData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+
+ public PGSQLFriendsData(string connectionString, string realm)
+ : base(connectionString, realm)
+ {
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLGenericTableHandler.cs b/addon-modules/0Data/PGSQL/PGSQLGenericTableHandler.cs
new file mode 100644
index 0000000000..1d27681d5d
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLGenericTableHandler.cs
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) Marcus Kirsch (aka Marck). All rights reserved.
+ *
+ * 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 OpenSimulator 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 System;
+using System.Collections.Generic;
+using System.Reflection;
+
+using Npgsql;
+
+namespace Diva.Data.PGSQL
+{
+ public class PGSQLGenericTableHandler : OpenSim.Data.PGSQL.PGSQLGenericTableHandler where T : class, new()
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLGenericTableHandler(string connectionString, string realm, string storeName)
+ : base(connectionString, realm, storeName) { }
+
+ new public virtual T[] DoQuery(NpgsqlCommand cmd)
+ {
+ return base.DoQuery(cmd);
+ }
+
+ }
+
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLGridUserData.cs b/addon-modules/0Data/PGSQL/PGSQLGridUserData.cs
new file mode 100644
index 0000000000..2a3f8d9e0a
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLGridUserData.cs
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+using Npgsql;
+
+namespace Diva.Data.PGSQL
+{
+ public class PGSQLGridUserData : OpenSim.Data.PGSQL.PGSQLGridUserData, IGridUserData
+ {
+ private PGSQLGenericTableHandler m_DatabaseHandler;
+
+ //protected override Assembly Assembly
+ //{
+ // // WARNING! Moving migrations to this assembly!!!
+ // get { return GetType().Assembly; }
+ //}
+
+ public PGSQLGridUserData(string connectionString, string realm)
+ : base(connectionString, realm)
+ {
+ m_DatabaseHandler = new Diva.Data.PGSQL.PGSQLGenericTableHandler(connectionString, realm, "GridUserStore");
+ }
+
+ public GridUserData[] GetOnlineUsers()
+ {
+ return m_DatabaseHandler.Get("Online", "'true'");
+ }
+
+ public long GetOnlineUserCount()
+ {
+ return m_DatabaseHandler.GetCount("Online", "'true'");
+ }
+
+ public long GetActiveUserCount(int period)
+ {
+ return m_DatabaseHandler.GetCount(string.Format(" \"Online\" = '{0}' OR Date_Part('day', now()-to_timestamp(cast(\"Logout\" as double precision))) <= {1}", "true", period));
+ }
+
+ public GridUserData[] GetUsers(string pattern)
+ {
+ if (string.IsNullOrEmpty(pattern) || pattern.Trim().Length == 0)
+ pattern = " ORDER BY \"UserID\" ";
+ else
+ pattern = string.Format(" \"UserID\" LIKE '%{0}%' ORDER BY \"UserID\" ", pattern);
+
+ return m_DatabaseHandler.Get(pattern);
+ }
+
+ public void ResetTOS()
+ {
+ using (NpgsqlCommand cmd = new NpgsqlCommand())
+ {
+ cmd.CommandText = String.Format("update {0} set \"TOS\"= :tos", m_Realm);
+ cmd.Parameters.AddWithValue("tos", string.Empty);
+ ExecuteNonQuery(cmd);
+ }
+ }
+
+ public void ResetOnline()
+ {
+ using (NpgsqlCommand cmd = new NpgsqlCommand())
+ {
+ cmd.CommandText = String.Format("update {0} set \"Online\"='False' ", m_Realm);
+ ExecuteNonQuery(cmd);
+ }
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLGroupsData.cs b/addon-modules/0Data/PGSQL/PGSQLGroupsData.cs
new file mode 100644
index 0000000000..cb26450c36
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLGroupsData.cs
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Reflection;
+
+using OpenSim.Data;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A PGSQL Interface for Groups
+ ///
+ public class PGSQLGroupsData : OpenSim.Data.PGSQL.PGSQLGroupsData
+ {
+ public PGSQLGroupsData(string conn, string realm)
+ : base(conn, realm)
+ {
+ }
+
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLHGTravelData.cs b/addon-modules/0Data/PGSQL/PGSQLHGTravelData.cs
new file mode 100644
index 0000000000..8aa31179e9
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLHGTravelData.cs
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+using Npgsql;
+
+namespace Diva.Data.PGSQL
+{
+ public class PGSQLHGTravelData : OpenSim.Data.PGSQL.PGSQLHGTravelData, IHGTravelingData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLHGTravelData(string connectionString, string realm)
+ : base(connectionString, realm)
+ {
+ }
+
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLInventoryStore.cs b/addon-modules/0Data/PGSQL/PGSQLInventoryStore.cs
new file mode 100644
index 0000000000..6a91126f19
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLInventoryStore.cs
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections.Generic;
+
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// An Inventory Interface to the PGSQL database
+ ///
+ public class PGSQLInventoryStore : OpenSim.Data.PGSQL.PGSQLInventoryData
+ {
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLOfflineIMData.cs b/addon-modules/0Data/PGSQL/PGSQLOfflineIMData.cs
new file mode 100644
index 0000000000..7350ca2be8
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLOfflineIMData.cs
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Reflection;
+
+using OpenSim.Data;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A PGSQL Interface for the Grid Server
+ ///
+ public class PGSQLOfflineIMData : OpenSim.Data.PGSQL.PGSQLOfflineIMData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLOfflineIMData(string connectionString, string realm) :
+ base(connectionString, realm)
+ {
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLPresenceData.cs b/addon-modules/0Data/PGSQL/PGSQLPresenceData.cs
new file mode 100644
index 0000000000..0b0501b308
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLPresenceData.cs
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections.Generic;
+using System.Reflection;
+using Npgsql;
+
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A PGSQL Interface for the Grid Server
+ ///
+ public class PGSQLPresenceData : OpenSim.Data.PGSQL.PGSQLPresenceData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLPresenceData(string connectionString, string realm) :
+ base(connectionString, realm)
+ {
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLRegionData.cs b/addon-modules/0Data/PGSQL/PGSQLRegionData.cs
new file mode 100644
index 0000000000..8dfd0dd8c5
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLRegionData.cs
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) Crista Lopes (aka Diva) and Marcus Kirsch (aka Marck). All rights reserved.
+ *
+ * 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 OpenSimulator 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 System;
+using System.Collections.Generic;
+using System.Reflection;
+
+using Npgsql;
+using OpenMetaverse;
+
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A RegionData Interface to the PGSQL database
+ ///
+ public class PGSQLRegionData : OpenSim.Data.PGSQL.PGSQLRegionData, IRegionData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ private PGSQLGenericTableHandler m_DatabaseHandler;
+
+ public PGSQLRegionData(string connectionString, string realm)
+ : base(connectionString, realm)
+ {
+ m_DatabaseHandler = new PGSQLGenericTableHandler(connectionString, realm, "GridStore");
+ }
+
+ public RegionData[] Get(UUID scopeID, int regionFlags, int excludeFlags)
+ {
+ return m_DatabaseHandler.Get(CreateWhereClause(scopeID, regionFlags, excludeFlags));
+ }
+
+ public long GetCount(UUID scopeID, int regionFlags, int excludeFlags)
+ {
+ return m_DatabaseHandler.GetCount(CreateWhereClause(scopeID, regionFlags, excludeFlags));
+ }
+
+ private string CreateWhereClause(UUID scopeID, int regionFlags, int excludeFlags)
+ {
+ string where = "(flags & {0}) <> 0 and (flags & {1}) = 0";
+ if (scopeID != UUID.Zero)
+ where += " and \"ScopeID\" = " + scopeID.ToString();
+
+ return string.Format(where, regionFlags.ToString(), excludeFlags.ToString());
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLSimulationData.cs b/addon-modules/0Data/PGSQL/PGSQLSimulationData.cs
new file mode 100644
index 0000000000..7348232f21
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLSimulationData.cs
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections.Generic;
+using System.Reflection;
+
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A PGSQL Interface for the Region Server
+ ///
+ public class PGSQLSimulationData : OpenSim.Data.PGSQL.PGSQLSimulationData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLSimulationData() : base()
+ {
+ }
+
+ public PGSQLSimulationData(string connectionString) : base(connectionString)
+ {
+ }
+
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLUserAccountData.cs b/addon-modules/0Data/PGSQL/PGSQLUserAccountData.cs
new file mode 100644
index 0000000000..5cf5cdb5ac
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLUserAccountData.cs
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Reflection;
+
+using OpenMetaverse;
+using OpenSim.Data;
+using OpenSim.Data.PGSQL;
+using Npgsql;
+
+namespace Diva.Data.PGSQL
+{
+ public class PGSQLUserAccountData : OpenSim.Data.PGSQL.PGSQLUserAccountData, IUserAccountData
+ {
+ private PGSQLGenericTableHandler m_DatabaseHandler;
+
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLUserAccountData(string connectionString, string realm)
+ : base(connectionString, realm)
+ {
+ m_DatabaseHandler = new PGSQLGenericTableHandler(connectionString, realm, "UserAccount");
+ }
+
+ public UserAccountData[] GetActiveAccounts(UUID scopeID, string query, string excludeTerm)
+ {
+ string[] words = query.Split(new char[] { ' ' });
+
+ for (int i = 0; i < words.Length; i++)
+ {
+ if (words[i].Length < 3)
+ {
+ if (i != words.Length - 1)
+ Array.Copy(words, i + 1, words, i, words.Length - i - 1);
+ Array.Resize(ref words, words.Length - 1);
+ }
+ }
+
+ if (words.Length == 0)
+ return new UserAccountData[0];
+
+ if (words.Length > 2)
+ return new UserAccountData[0];
+
+ NpgsqlCommand cmd = new NpgsqlCommand();
+
+ if (words.Length == 1)
+ {
+ cmd.CommandText = String.Format("select * from {0} where (\"ScopeID\"=:ScopeID or \"ScopeID\"='00000000-0000-0000-0000-000000000000') and (lower(\"FirstName\") like lower(:search) or lower(\"LastName\") like lower(:search) )", m_Realm);
+ cmd.Parameters.AddWithValue("search", "%" + words[0] + "%");
+ cmd.Parameters.AddWithValue("ScopeID", scopeID.ToString());
+ }
+ else
+ {
+ cmd.CommandText = String.Format("select * from {0} where (\"ScopeID\"=:ScopeID or \"ScopeID\"='00000000-0000-0000-0000-000000000000') and (lower(\"FirstName\") like lower(:searchFirst) or lower(\"LastName\") like lower(:searchLast) )", m_Realm);
+ cmd.Parameters.AddWithValue("searchFirst", "%" + words[0] + "%");
+ cmd.Parameters.AddWithValue("searchLast", "%" + words[1] + "%");
+ cmd.Parameters.AddWithValue("ScopeID", scopeID.ToString());
+ }
+ cmd.CommandText = cmd.CommandText + " and (lower(\"FirstName\") not like lower(:exclude) )";
+ cmd.Parameters.AddWithValue("exclude", excludeTerm + "%");
+
+ return m_DatabaseHandler.DoQuery(cmd);
+ }
+
+ public long GetActiveAccountsCount(UUID scopeID, string excludeTerm)
+ {
+ string where = string.Format("(\"ScopeID\"='{0}' or \"ScopeID\"='00000000-0000-0000-0000-000000000000') and (lower(\"FirstName\") not like lower('{1}%') )", scopeID, excludeTerm);
+
+ return m_DatabaseHandler.GetCount(where);
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLUserProfilesData.cs b/addon-modules/0Data/PGSQL/PGSQLUserProfilesData.cs
new file mode 100644
index 0000000000..e747c0ac86
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLUserProfilesData.cs
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Reflection;
+
+using OpenSim.Data;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A PGSQL Interface for the Grid Server
+ ///
+ public class PGSQLUserProfilesData : OpenSim.Data.PGSQL.UserProfilesData
+ {
+ protected override Assembly Assembly
+ {
+ get { return GetType().BaseType.Assembly; }
+ }
+
+ public PGSQLUserProfilesData(string connectionString) :
+ base(connectionString)
+ {
+ }
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/PGSQLXInventoryData.cs b/addon-modules/0Data/PGSQL/PGSQLXInventoryData.cs
new file mode 100644
index 0000000000..630b9cefa8
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/PGSQLXInventoryData.cs
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 System;
+using System.Reflection;
+
+using OpenSim.Data.PGSQL;
+
+namespace Diva.Data.PGSQL
+{
+ ///
+ /// A PGSQL Interface for the Inventory
+ ///
+ public class PGSQLXInventoryData : OpenSim.Data.PGSQL.PGSQLXInventoryData
+ {
+ public PGSQLXInventoryData(string conn, string realm)
+ : base(conn, realm)
+ {
+ }
+
+ }
+}
diff --git a/addon-modules/0Data/PGSQL/Properties/AssemblyInfo.cs b/addon-modules/0Data/PGSQL/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..c697cf3b9e
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Diva.Data.PGSQL")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Diva Distribution")]
+[assembly: AssemblyCopyright("Crista Lopes aka Diva Canto, and contributors")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("82bceb97-dbf1-43d9-831c-c4d66937f93e")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.7.6.*")]
+
diff --git a/addon-modules/0Data/PGSQL/Resources/GridUserStore.migrations b/addon-modules/0Data/PGSQL/Resources/GridUserStore.migrations
new file mode 100644
index 0000000000..d5a1bf66e9
--- /dev/null
+++ b/addon-modules/0Data/PGSQL/Resources/GridUserStore.migrations
@@ -0,0 +1,25 @@
+:VERSION 1 # --------------------------
+
+BEGIN;
+
+CREATE TABLE GridUser (
+ "UserID" VARCHAR(255) NOT NULL PRIMARY KEY,
+ "HomeRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
+ "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
+ "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
+ "LastRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
+ "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
+ "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
+ "Online" CHAR(5) NOT NULL DEFAULT 'false',
+ "Login" CHAR(16) NOT NULL DEFAULT '0',
+ "Logout" CHAR(16) NOT NULL DEFAULT '0'
+);
+
+COMMIT;
+
+:VERSION 2 # --------------------------
+BEGIN;
+
+ALTER TABLE GridUser ADD "TOS" char(128);
+
+COMMIT;
diff --git a/addon-modules/0Data/prebuild.PGSQL.xml b/addon-modules/0Data/prebuild.PGSQL.xml
new file mode 100644
index 0000000000..722635253d
--- /dev/null
+++ b/addon-modules/0Data/prebuild.PGSQL.xml
@@ -0,0 +1,43 @@
+
+
+
+
+ ../../../bin/
+
+
+
+
+ ../../../bin/
+
+
+
+ ../../../bin/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/syncdiva.bat b/syncdiva.bat
new file mode 100644
index 0000000000..c4ffefc837
--- /dev/null
+++ b/syncdiva.bat
@@ -0,0 +1,7 @@
+rem git remote add https://github.com/diva/diva-distribution.git
+
+git fetch upstream
+
+git merge upstream/master
+
+pause ok