Beispiel #1
0
        public override void FinishedMigration(IDataConnector genericData)
        {
            if (!genericData.TableExists("estates")) return;
            DataReaderConnection dr = genericData.QueryData("WHERE `Key` = 'EstateID'", "estates",
                                                            "`ID`, `Key`, `Value`");

            if (dr != null)
            {
                try
                {
                    while (dr.DataReader.Read())
                    {
                        try
                        {
                            UUID ID = UUID.Parse(dr.DataReader["ID"].ToString());
                            string value = dr.DataReader["Value"].ToString();
                            QueryFilter filter = new QueryFilter();
                            filter.andFilters["`ID`"] = value;
                            filter.andFilters["`Key`"] = "EstateSettings";
                            List<string> results = genericData.Query(new string[1] {"`Value`"}, "estates", filter, null,
                                                                     null, null);
                            if ((results != null) && (results.Count >= 1))
                            {
                                EstateSettings es = new EstateSettings();
                                es.FromOSD((OSDMap) OSDParser.DeserializeLLSDXml(results[0]));
                                genericData.Insert("estateregions", new object[] {ID, value});

                                filter = new QueryFilter();
                                filter.andFilters["`EstateID`"] = value;

                                List<string> exist = genericData.Query(new string[1] {"`EstateID`"}, "estatesettings",
                                                                       filter, null, null, null);
                                if (exist == null || exist.Count == 0)
                                {
                                    genericData.Insert("estatesettings",
                                                       new object[]
                                                           {
                                                               value, es.EstateName, es.EstateOwner, es.ParentEstateID,
                                                               es.ToOSD()
                                                           });
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                }
                catch
                {
                }
                finally
                {
                    dr.DataReader.Close();
                    genericData.CloseDatabase(dr);
                }
            }
        }
Beispiel #2
0
        public override void FinishedMigration(IDataConnector genericData)
        {
            if (!genericData.TableExists("estates"))
            {
                return;
            }
            DataReaderConnection dr = genericData.QueryData("WHERE `Key` = 'EstateID'", "estates", "`ID`, `Key`, `Value`");

            if (dr != null)
            {
                try
                {
                    while (dr.DataReader.Read())
                    {
                        try
                        {
                            UUID        ID     = UUID.Parse(dr.DataReader["ID"].ToString());
                            string      value  = dr.DataReader["Value"].ToString();
                            QueryFilter filter = new QueryFilter();
                            filter.andFilters["`ID`"]  = value;
                            filter.andFilters["`Key`"] = "EstateSettings";
                            List <string> results = genericData.Query(new string[1] {
                                "`Value`"
                            }, "estates", filter, null, null, null);
                            if ((results != null) && (results.Count >= 1))
                            {
                                EstateSettings es = new EstateSettings();
                                es.FromOSD((OSDMap)OSDParser.DeserializeLLSDXml(results[0]));
                                genericData.Insert("estateregions", new object[] { ID, value });

                                filter = new QueryFilter();
                                filter.andFilters["`EstateID`"] = value;

                                List <string> exist = genericData.Query(new string[1] {
                                    "`EstateID`"
                                }, "estatesettings", filter, null, null, null);
                                if (exist == null || exist.Count == 0)
                                {
                                    genericData.Insert("estatesettings", new object[] { value, es.EstateName, es.EstateOwner, es.ParentEstateID, es.ToOSD() });
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                }
                catch
                {
                }
                finally
                {
                    dr.DataReader.Close();
                    genericData.CloseDatabase(dr);
                }
            }
        }